summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/cisco/enic/vnic_dev.c
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <gvaradar@cisco.com>2018-06-05 20:14:57 +0300
committerDavid S. Miller <davem@davemloft.net>2018-06-06 16:09:09 +0300
commit4016a7f15efc9189f0ce18025fb3306a8b5f9195 (patch)
tree9a1056dd055233791d1d2f96cea3205ec57be403 /drivers/net/ethernet/cisco/enic/vnic_dev.c
parent75d4e704fa8d2cf33ff295e5b441317603d7f9fd (diff)
downloadlinux-4016a7f15efc9189f0ce18025fb3306a8b5f9195.tar.xz
enic: fix UDP rss bits
In commit 48398b6e7065 ("enic: set UDP rss flag") driver needed to set a single bit to enable UDP rss. This is changed to two bit. One for UDP IPv4 and other bit for UDP IPv6. The hardware which supports this is not released yet. When released, driver should set 2 bit to enable UDP rss for both IPv4 and IPv6. Also add spinlock around vnic_dev_capable_rss_hash_type(). Signed-off-by: Govindarajulu Varadarajan <gvaradar@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cisco/enic/vnic_dev.c')
-rw-r--r--drivers/net/ethernet/cisco/enic/vnic_dev.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/drivers/net/ethernet/cisco/enic/vnic_dev.c b/drivers/net/ethernet/cisco/enic/vnic_dev.c
index 76cdd4c9d11f..e9db811df59c 100644
--- a/drivers/net/ethernet/cisco/enic/vnic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/vnic_dev.c
@@ -1282,19 +1282,23 @@ int vnic_dev_get_supported_feature_ver(struct vnic_dev *vdev, u8 feature,
return ret;
}
-bool vnic_dev_capable_udp_rss(struct vnic_dev *vdev)
+int vnic_dev_capable_rss_hash_type(struct vnic_dev *vdev, u8 *rss_hash_type)
{
u64 a0 = CMD_NIC_CFG, a1 = 0;
- u64 rss_hash_type;
int wait = 1000;
int err;
err = vnic_dev_cmd(vdev, CMD_CAPABILITY, &a0, &a1, wait);
- if (err || !a0)
- return false;
+ /* rss_hash_type is valid only when a0 is 1. Adapter which does not
+ * support CMD_CAPABILITY for rss_hash_type has a0 = 0
+ */
+ if (err || (a0 != 1))
+ return -EOPNOTSUPP;
+
+ a1 = (a1 >> NIC_CFG_RSS_HASH_TYPE_SHIFT) &
+ NIC_CFG_RSS_HASH_TYPE_MASK_FIELD;
- rss_hash_type = (a1 >> NIC_CFG_RSS_HASH_TYPE_SHIFT) &
- NIC_CFG_RSS_HASH_TYPE_MASK_FIELD;
+ *rss_hash_type = (u8)a1;
- return (rss_hash_type & NIC_CFG_RSS_HASH_TYPE_UDP);
+ return 0;
}