Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24763d80 authored by Sucheta Chakraborty's avatar Sucheta Chakraborty Committed by David S. Miller
Browse files

qlcnic: turn off lro when rxcsum is disabled.



o Also dont allow lro to be turn on, if rx csum is disabled

Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarAmit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dec32cc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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
+23 −0
Original line number Diff line number Diff line
@@ -818,10 +818,24 @@ 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;
}

static u32 qlcnic_get_tso(struct net_device *dev)
{
	return (dev->features & (NETIF_F_TSO | NETIF_F_TSO6)) != 0;
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);