Commit ac8d0c4f authored by Anirban Chakraborty's avatar Anirban Chakraborty Committed by David S. Miller

qlcnic: Check FW capability for TSO

Driver checks TSO capability from FW before enabling it.
Signed-off-by: default avatarAnirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d7753516
...@@ -821,9 +821,10 @@ struct qlcnic_nic_intr_coalesce { ...@@ -821,9 +821,10 @@ struct qlcnic_nic_intr_coalesce {
#define QLCNIC_LRO_REQUEST_CLEANUP 4 #define QLCNIC_LRO_REQUEST_CLEANUP 4
/* Capabilites received */ /* Capabilites received */
#define QLCNIC_FW_CAPABILITY_BDG (1 << 8) #define QLCNIC_FW_CAPABILITY_TSO BIT_1
#define QLCNIC_FW_CAPABILITY_FVLANTX (1 << 9) #define QLCNIC_FW_CAPABILITY_BDG BIT_8
#define QLCNIC_FW_CAPABILITY_HW_LRO (1 << 10) #define QLCNIC_FW_CAPABILITY_FVLANTX BIT_9
#define QLCNIC_FW_CAPABILITY_HW_LRO BIT_10
/* module types */ /* module types */
#define LINKEVENT_MODULE_NOT_PRESENT 1 #define LINKEVENT_MODULE_NOT_PRESENT 1
......
...@@ -820,6 +820,9 @@ static u32 qlcnic_get_tso(struct net_device *dev) ...@@ -820,6 +820,9 @@ static u32 qlcnic_get_tso(struct net_device *dev)
static int qlcnic_set_tso(struct net_device *dev, u32 data) static int qlcnic_set_tso(struct net_device *dev, u32 data)
{ {
struct qlcnic_adapter *adapter = netdev_priv(dev);
if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO))
return -EOPNOTSUPP;
if (data) if (data)
dev->features |= (NETIF_F_TSO | NETIF_F_TSO6); dev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
else else
......
...@@ -1226,10 +1226,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter, ...@@ -1226,10 +1226,14 @@ qlcnic_setup_netdev(struct qlcnic_adapter *adapter,
SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_ops); SET_ETHTOOL_OPS(netdev, &qlcnic_ethtool_ops);
netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM | netdev->features |= (NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM | NETIF_F_GRO | NETIF_F_TSO | NETIF_F_TSO6); NETIF_F_IPV6_CSUM | NETIF_F_GRO);
netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM | netdev->vlan_features |= (NETIF_F_SG | NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM | NETIF_F_TSO | NETIF_F_TSO6); NETIF_F_IPV6_CSUM);
if (adapter->capabilities & QLCNIC_FW_CAPABILITY_TSO) {
netdev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
netdev->vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6);
}
if (pci_using_dac) { if (pci_using_dac) {
netdev->features |= NETIF_F_HIGHDMA; netdev->features |= NETIF_F_HIGHDMA;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment