Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213817
b: refs/heads/master
c: 24763d8
h: refs/heads/master
i:
  213815: fded766
v: v3
  • Loading branch information
Sucheta Chakraborty authored and David S. Miller committed Aug 17, 2010
1 parent cd3a015 commit e32800d
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8dec32cc421864702912c4341934fe0c737a9798
refs/heads/master: 24763d80fbb45aaf477d53c2203c929f6c41b5fc
1 change: 1 addition & 0 deletions trunk/drivers/net/qlcnic/qlcnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,7 @@ struct qlcnic_mac_req {
#define QLCNIC_MSI_ENABLED 0x02
#define QLCNIC_MSIX_ENABLED 0x04
#define QLCNIC_LRO_ENABLED 0x08
#define QLCNIC_LRO_DISABLED 0x00
#define QLCNIC_BRIDGE_ENABLED 0X10
#define QLCNIC_DIAG_ENABLED 0x20
#define QLCNIC_ESWITCH_ENABLED 0x40
Expand Down
23 changes: 23 additions & 0 deletions trunk/drivers/net/qlcnic/qlcnic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,21 @@ static u32 qlcnic_get_rx_csum(struct net_device *dev)
static int qlcnic_set_rx_csum(struct net_device *dev, u32 data)
{
struct qlcnic_adapter *adapter = netdev_priv(dev);

if (!!data) {
adapter->rx_csum = !!data;
return 0;
}

if (adapter->flags & QLCNIC_LRO_ENABLED) {
if (qlcnic_config_hw_lro(adapter, QLCNIC_LRO_DISABLED))
return -EIO;

dev->features &= ~NETIF_F_LRO;
qlcnic_send_lro_cleanup(adapter);
}
adapter->rx_csum = !!data;
dev_info(&adapter->pdev->dev, "disabling LRO as rx_csum is off\n");
return 0;
}

Expand Down Expand Up @@ -1001,6 +1015,15 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
return -EINVAL;

if (!adapter->rx_csum) {
dev_info(&adapter->pdev->dev, "rx csum is off, "
"cannot toggle lro\n");
return -EINVAL;
}

if ((data & ETH_FLAG_LRO) && (adapter->flags & QLCNIC_LRO_ENABLED))
return 0;

if (data & ETH_FLAG_LRO) {
hw_lro = QLCNIC_LRO_ENABLED;
netdev->features |= NETIF_F_LRO;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/net/qlcnic/qlcnic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev)

qlcnic_config_intr_coalesce(adapter);

if (adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO)
if (netdev->features & NETIF_F_LRO)
qlcnic_config_hw_lro(adapter, QLCNIC_LRO_ENABLED);

qlcnic_napi_enable(adapter);
Expand Down

0 comments on commit e32800d

Please sign in to comment.