netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: "Paweł Jabłoński" <pawel.jablonski@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	jogreene@redhat.com, "Jeff Kirsher" <jeffrey.t.kirsher@intel.com>
Subject: [net-next 5/9] i40evf: Fix turning TSO, GSO and GRO on after
Date: Mon, 30 Apr 2018 10:00:55 -0700	[thread overview]
Message-ID: <20180430170059.13186-6-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180430170059.13186-1-jeffrey.t.kirsher@intel.com>

From: Paweł Jabłoński <pawel.jablonski@intel.com>

This patch fixes the problem where each MTU change turns TSO,
GSO and GRO on from off state.

Now when TSO, GSO or GRO is turned off, MTU change does not
turn them on.

Signed-off-by: Paweł Jabłoński <pawel.jablonski@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40evf/i40evf_main.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 28a8cc4a14cb..3f04a182903d 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -3357,6 +3357,24 @@ int i40evf_process_config(struct i40evf_adapter *adapter)
 	if (vfres->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN)
 		netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
 
+	/* Do not turn on offloads when they are requested to be turned off.
+	 * TSO needs minimum 576 bytes to work correctly.
+	 */
+	if (netdev->wanted_features) {
+		if (!(netdev->wanted_features & NETIF_F_TSO) ||
+		    netdev->mtu < 576)
+			netdev->features &= ~NETIF_F_TSO;
+		if (!(netdev->wanted_features & NETIF_F_TSO6) ||
+		    netdev->mtu < 576)
+			netdev->features &= ~NETIF_F_TSO6;
+		if (!(netdev->wanted_features & NETIF_F_TSO_ECN))
+			netdev->features &= ~NETIF_F_TSO_ECN;
+		if (!(netdev->wanted_features & NETIF_F_GRO))
+			netdev->features &= ~NETIF_F_GRO;
+		if (!(netdev->wanted_features & NETIF_F_GSO))
+			netdev->features &= ~NETIF_F_GSO;
+	}
+
 	adapter->vsi.id = adapter->vsi_res->vsi_id;
 
 	adapter->vsi.back = adapter;
-- 
2.14.3

  parent reply	other threads:[~2018-04-30 17:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-30 17:00 [net-next 0/9][pull request] 40GbE Intel Wired LAN Driver Updates 2018-04-30 Jeff Kirsher
2018-04-30 17:00 ` [net-next 1/9] i40evf: Replace GFP_ATOMIC with GFP_KERNEL in i40evf_add_vlan Jeff Kirsher
2018-04-30 17:00 ` [net-next 2/9] i40e/i40evf: cleanup incorrect function doxygen comments Jeff Kirsher
2018-04-30 17:00 ` [net-next 3/9] i40e: fix reading LLDP configuration Jeff Kirsher
2018-04-30 17:00 ` [net-next 4/9] i40e: Add advertising 10G LR mode Jeff Kirsher
2018-04-30 17:00 ` Jeff Kirsher [this message]
2018-04-30 17:00 ` [net-next 6/9] i40e: Fix multiple issues with UDP tunnel offload filter configuration Jeff Kirsher
2018-04-30 17:00 ` [net-next 7/9] i40e: avoid overflow in i40e_ptp_adjfreq() Jeff Kirsher
2018-04-30 17:00 ` [net-next 8/9] i40e/i40evf: take into account queue map from vf when handling queues Jeff Kirsher
2018-04-30 17:00 ` [net-next 9/9] i40e: use %pI4b instead of byte swapping before dev_err Jeff Kirsher
2018-05-01 13:38 ` [net-next 0/9][pull request] 40GbE Intel Wired LAN Driver Updates 2018-04-30 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180430170059.13186-6-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=davem@davemloft.net \
    --cc=jogreene@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=pawel.jablonski@intel.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).