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

Commit b56421d0 authored by Rajesh Borundia's avatar Rajesh Borundia Committed by David S. Miller
Browse files

qlcnic: Fix LRO disable



o In dev->open LRO was enabled by default, enable it depending
  upon netdev->features , kernel may have disabled it.
o Configure LRO when interface is up.

Signed-off-by: default avatarRajesh Borundia <Rajesh.Borundia@qlogic.com>
Signed-off-by: default avatarAnirban Chakraborty <Anirban.Chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8d54811
Loading
Loading
Loading
Loading
+16 −10
Original line number Diff line number Diff line
@@ -998,6 +998,11 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
	if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
		return -EINVAL;

	if (data & ETH_FLAG_LRO) {

		if (netdev->features & NETIF_F_LRO)
			return 0;

		if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
			return -EINVAL;

@@ -1007,13 +1012,14 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
			return -EINVAL;
		}

	if ((data & ETH_FLAG_LRO) && (netdev->features & NETIF_F_LRO))
		return 0;

	if (data & ETH_FLAG_LRO) {
		hw_lro = QLCNIC_LRO_ENABLED;
		netdev->features |= NETIF_F_LRO;

	} else {

		if (!(netdev->features & NETIF_F_LRO))
			return 0;

		hw_lro = 0;
		netdev->features &= ~NETIF_F_LRO;
	}
+6 −0
Original line number Diff line number Diff line
@@ -566,6 +566,9 @@ int qlcnic_config_hw_lro(struct qlcnic_adapter *adapter, int enable)
	u64 word;
	int rv;

	if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
		return 0;

	memset(&req, 0, sizeof(struct qlcnic_nic_req));

	req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);
@@ -711,6 +714,9 @@ int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter)
	u64 word;
	int rv;

	if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state))
		return 0;

	memset(&req, 0, sizeof(struct qlcnic_nic_req));
	req.qhdr = cpu_to_le64(QLCNIC_HOST_REQUEST << 23);

+2 −1
Original line number Diff line number Diff line
@@ -773,7 +773,8 @@ qlcnic_set_netdev_features(struct qlcnic_adapter *adapter,
		features |= (NETIF_F_TSO | NETIF_F_TSO6);
		vlan_features |= (NETIF_F_TSO | NETIF_F_TSO6);
	}
	if (adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO)

	if (netdev->features & NETIF_F_LRO)
		features |= NETIF_F_LRO;

	if (esw_cfg->offload_flags & BIT_0) {