From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2022-02-10 17:05:33
This series contains updates to ice driver only.
Dan Carpenter propagates an error in FEC configuration.
Jesse fixes TSO offloads of IPIP and SIT frames.
Dave adds a dedicated LAG unregister function to resolve a KASAN error
and moves auxiliary device re-creation after LAG removal to the service
task to avoid issues with RTNL lock.
The following are changes since commit c4416f5c2eb3ed48dfba265e628a6e52da962f03:
net: mpls: Fix GCC 12 warning
and are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue 100GbE
Dan Carpenter (1):
ice: fix an error code in ice_cfg_phy_fec()
Dave Ertman (2):
ice: Fix KASAN error in LAG NETDEV_UNREGISTER handler
ice: Avoid RTNL lock when re-creating auxiliary device
Jesse Brandeburg (1):
ice: fix IPIP and SIT TSO offload
drivers/net/ethernet/intel/ice/ice.h | 3 +-
drivers/net/ethernet/intel/ice/ice_common.c | 3 +-
drivers/net/ethernet/intel/ice/ice_lag.c | 34 +++++++++++++++----
.../net/ethernet/intel/ice/ice_lan_tx_rx.h | 1 +
drivers/net/ethernet/intel/ice/ice_main.c | 28 ++++++++++-----
5 files changed, 53 insertions(+), 16 deletions(-)
--
2.31.1
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2022-02-10 17:05:34
From: Jesse Brandeburg <redacted>
The driver was avoiding offload for IPIP (at least) frames due to
parsing the inner header offsets incorrectly when trying to check
lengths.
This length check works for VXLAN frames but fails on IPIP frames
because skb_transport_offset points to the inner header in IPIP
frames, which meant the subtraction of transport_header from
inner_network_header returns a negative value (-20).
With the code before this patch, everything continued to work, but GSO
was being used to segment, causing throughputs of 1.5Gb/s per thread.
After this patch, throughput is more like 10Gb/s per thread for IPIP
traffic.
Fixes: e94d44786693 ("ice: Implement filter sync, NDO operations and bump version")
Signed-off-by: Jesse Brandeburg <redacted>
Reviewed-by: Paul Menzel <redacted>
Tested-by: Gurucharan G <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
Testing Hints: test IPIP tunnel and VXLAN tunnel, both should use TSO.
.../net/ethernet/intel/ice/ice_lan_tx_rx.h | 1 +
drivers/net/ethernet/intel/ice/ice_main.c | 25 +++++++++++++------
2 files changed, 18 insertions(+), 8 deletions(-)
@@ -8525,6 +8525,7 @@ ice_features_check(struct sk_buff *skb,structnet_device__always_unused*netdev,netdev_features_tfeatures){+boolgso=skb_is_gso(skb);size_tlen;/* No point in doing any of this if neither checksum nor GSO are
@@ -8537,24 +8538,32 @@ ice_features_check(struct sk_buff *skb,/* We cannot support GSO if the MSS is going to be less than*64bytes.IfitisthenweneedtodropsupportforGSO.*/-if(skb_is_gso(skb)&&(skb_shinfo(skb)->gso_size<64))+if(gso&&(skb_shinfo(skb)->gso_size<ICE_TXD_CTX_MIN_MSS))features&=~NETIF_F_GSO_MASK;-len=skb_network_header(skb)-skb->data;+len=skb_network_offset(skb);if(len>ICE_TXD_MACLEN_MAX||len&0x1)gotoout_rm_features;-len=skb_transport_header(skb)-skb_network_header(skb);+len=skb_network_header_len(skb);if(len>ICE_TXD_IPLEN_MAX||len&0x1)gotoout_rm_features;if(skb->encapsulation){-len=skb_inner_network_header(skb)-skb_transport_header(skb);-if(len>ICE_TXD_L4LEN_MAX||len&0x1)-gotoout_rm_features;+/* this must work for VXLAN frames AND IPIP/SIT frames, and in+*thecaseofIPIPframes,thetransportheaderpointeris+*aftertheinnerheader!Sochecktomakesurethatthis+*isaGREorUDP_TUNNELframebeforedoingthatmath.+*/+if(gso&&(skb_shinfo(skb)->gso_type&+(SKB_GSO_GRE|SKB_GSO_UDP_TUNNEL))){+len=skb_inner_network_header(skb)-+skb_transport_header(skb);+if(len>ICE_TXD_L4LEN_MAX||len&0x1)+gotoout_rm_features;+}-len=skb_inner_transport_header(skb)--skb_inner_network_header(skb);+len=skb_inner_network_header_len(skb);if(len>ICE_TXD_IPLEN_MAX||len&0x1)gotoout_rm_features;}
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2022-02-10 17:05:42
From: Dave Ertman <david.m.ertman@intel.com>
Currently, the same handler is called for both a NETDEV_BONDING_INFO
LAG unlink notification as for a NETDEV_UNREGISTER call. This is
causing a problem though, since the netdev_notifier_info passed has
a different structure depending on which event is passed. The problem
manifests as a call trace from a BUG: KASAN stack-out-of-bounds error.
Fix this by creating a handler specific to NETDEV_UNREGISTER that only
is passed valid elements in the netdev_notifier_info struct for the
NETDEV_UNREGISTER event.
Also included is the removal of an unbalanced dev_put on the peer_netdev
and related braces.
Fixes: 6a8b357278f5 ("ice: Respond to a NETDEV_UNREGISTER event for LAG")
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Acked-by: Jonathan Toppins <redacted>
Tested-by: Sunitha Mekala <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice_lag.c | 34 +++++++++++++++++++-----
1 file changed, 28 insertions(+), 6 deletions(-)
@@ -204,17 +204,39 @@ ice_lag_unlink(struct ice_lag *lag,lag->upper_netdev=NULL;}-if(lag->peer_netdev){-dev_put(lag->peer_netdev);-lag->peer_netdev=NULL;-}-+lag->peer_netdev=NULL;ice_set_sriov_cap(pf);ice_set_rdma_cap(pf);lag->bonded=false;lag->role=ICE_LAG_NONE;}+/**+*ice_lag_unregister-handlenetdevunregisterevents+*@lag:LAGinfostruct+*@netdev:netdevreportingtheevent+*/+staticvoidice_lag_unregister(structice_lag*lag,structnet_device*netdev)+{+structice_pf*pf=lag->pf;++/* check to see if this event is for this netdev+*checkthatweareinanaggregate+*/+if(netdev!=lag->netdev||!lag->bonded)+return;++if(lag->upper_netdev){+dev_put(lag->upper_netdev);+lag->upper_netdev=NULL;+ice_set_sriov_cap(pf);+ice_set_rdma_cap(pf);+}+/* perform some cleanup in case we come back */+lag->bonded=false;+lag->role=ICE_LAG_NONE;+}+/***ice_lag_changeupper_event-handleLAGchangeupperevent*@lag:LAGinfostruct
@@ -307,7 +329,7 @@ ice_lag_event_handler(struct notifier_block *notif_blk, unsigned long event,ice_lag_info_event(lag,ptr);break;caseNETDEV_UNREGISTER:-ice_lag_unlink(lag,ptr);+ice_lag_unregister(lag,netdev);break;default:break;
From: Tony Nguyen <anthony.l.nguyen@intel.com> Date: 2022-02-10 17:05:43
From: Dave Ertman <david.m.ertman@intel.com>
If a call to re-create the auxiliary device happens in a context that has
already taken the RTNL lock, then the call flow that recreates auxiliary
device can hang if there is another attempt to claim the RTNL lock by the
auxiliary driver.
To avoid this, any call to re-create auxiliary devices that comes from
an source that is holding the RTNL lock (e.g. netdev notifier when
interface exits a bond) should execute in a separate thread. To
accomplish this, add a flag to the PF that will be evaluated in the
service task and dealt with there.
Fixes: f9f5301e7e2d ("ice: Register auxiliary device to provide RDMA")
Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Reviewed-by: Jonathan Toppins <redacted>
Tested-by: Gurucharan G <redacted>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/ice/ice.h | 3 ++-
drivers/net/ethernet/intel/ice/ice_main.c | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
@@ -483,6 +483,7 @@ enum ice_pf_flags {ICE_FLAG_VF_TRUE_PROMISC_ENA,ICE_FLAG_MDD_AUTO_RESET_VF,ICE_FLAG_LINK_LENIENT_MODE_ENA,+ICE_FLAG_PLUG_AUX_DEV,ICE_PF_FLAGS_NBITS/* must be last */};
Hello:
This series was applied to netdev/net.git (master)
by Tony Nguyen [off-list ref]:
On Thu, 10 Feb 2022 09:05:11 -0800 you wrote:
This series contains updates to ice driver only.
Dan Carpenter propagates an error in FEC configuration.
Jesse fixes TSO offloads of IPIP and SIT frames.
Dave adds a dedicated LAG unregister function to resolve a KASAN error
and moves auxiliary device re-creation after LAG removal to the service
task to avoid issues with RTNL lock.
[...]