|
@@ -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)
|
|
static int qlcnic_set_rx_csum(struct net_device *dev, u32 data)
|
|
{
|
|
{
|
|
struct qlcnic_adapter *adapter = netdev_priv(dev);
|
|
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;
|
|
adapter->rx_csum = !!data;
|
|
|
|
+ dev_info(&adapter->pdev->dev, "disabling LRO as rx_csum is off\n");
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1001,6 +1015,15 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
|
|
if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
|
|
if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
|
|
return -EINVAL;
|
|
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) {
|
|
if (data & ETH_FLAG_LRO) {
|
|
hw_lro = QLCNIC_LRO_ENABLED;
|
|
hw_lro = QLCNIC_LRO_ENABLED;
|
|
netdev->features |= NETIF_F_LRO;
|
|
netdev->features |= NETIF_F_LRO;
|