nfp: enable TSO by default
Subsystems (3)
cover nfp: enable TSO by default
Hi,
this short series enables TSO by default on all NICs supported by the NFP driver.
Simon Horman (1):
nfp: enable TSO by default for nfp netdev
Yinjun Zhang (1):
nfp: allow TSO packets with metadata prepended in NFDK path
drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 17 ----------------- .../net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++---- .../net/ethernet/netronome/nfp/nfp_net_repr.c | 5 ++--- 3 files changed, 5 insertions(+), 24 deletions(-)
Signature · 1 line
2.30.2
PATCH 1/2 nfp: allow TSO packets with metadata prepended in NFDK path
From: Yinjun Zhang <[email protected]>
Packets with metadata prepended can be correctly handled in firmware when TSO is enabled, now remove the error path and related comments. Since there's no existing firmware that uses prepended metadata, no need to add compatibility check here.
--- drivers/net/ethernet/netronome/nfp/nfdk/dp.c | 17 ----------------- 1 file changed, 17 deletions(-)
drivers/net/ethernet/netronome/nfp/nfdk/dp.c +0 -17
@@ -56,17 +56,6 @@ nfp_nfdk_tx_tso(struct nfp_net_r_vector *r_vec, struct nfp_nfdk_tx_buf *txbuf, segs =skb_shinfo (skb)->gso_segs; mss =skb_shinfo (skb)->gso_size &NFDK_DESC_TX_MSS_MASK ; -/* Note: TSO of the packet with metadata prepended to skb is not -* supported yet, in which case l3/l4_offset and lso_hdrlen need -* be correctly handled here. -* Concern: -* The driver doesn't have md_bytes easily available at this point. -* The PCI.IN PD ME won't have md_bytes bytes to add to lso_hdrlen, -* so it needs the full length there. The app MEs might prefer -* l3_offset and l4_offset relative to the start of packet data, -* but could probably cope with it being relative to the CTM buf -* data offset. -*/ txd.l3_offset = l3_offset; txd.l4_offset = l4_offset; txd.lso_meta_res =0 ;
@@ -190,12 +179,6 @@ static int nfp_nfdk_prep_port_id(struct sk_buff *skb)if (unlikely (md_dst->type !=METADATA_HW_PORT_MUX ))return 0 ; -/* Note: Unsupported case when TSO a skb with metedata prepended. -* See the comments in `nfp_nfdk_tx_tso` for details. -*/ -if (unlikely (md_dst &&skb_is_gso (skb))) -return -EOPNOTSUPP ; -if (unlikely (skb_cow_head (skb,sizeof (md_dst->u.port_info.port_id))))return -ENOMEM ;
Signature · 1 line
2.30.2
PATCH 2/2 nfp: enable TSO by default for nfp netdev
In reply to Simon HormanWe can benefit from TSO when the host CPU is not powerful enough, so enable it by default now.
--- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 7 +++---- drivers/net/ethernet/netronome/nfp/nfp_net_repr.c | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +3 -4
@@ -2420,12 +2420,11 @@ static void nfp_net_netdev_init(struct nfp_net *nn)if (nfp_app_has_tc (nn->app) && nn->port) netdev->hw_features |=NETIF_F_HW_TC ; -/* Advertise but disable TSO by default. -* C-Tag strip and S-Tag strip can't be supported simultaneously, +/* C-Tag strip and S-Tag strip can't be supported simultaneously, * so enable C-Tag strip and disable S-Tag strip by default. */ - netdev->features &= ~(NETIF_F_TSO |NETIF_F_TSO6 |NETIF_F_HW_VLAN_STAG_RX ); - nn->dp.ctrl &= ~(NFP_NET_CFG_CTRL_LSO_ANY |NFP_NET_CFG_CTRL_RXQINQ ); + netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX ; + nn->dp.ctrl &= ~NFP_NET_CFG_CTRL_RXQINQ ;/* Finalise the netdev setup */ switch (nn->dp.ops->version) {
drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +2 -3
@@ -380,11 +380,10 @@ int nfp_repr_init(struct nfp_app *app, struct net_device *netdev, netdev->features = netdev->hw_features; -/* Advertise but disable TSO by default. -* C-Tag strip and S-Tag strip can't be supported simultaneously, +/* C-Tag strip and S-Tag strip can't be supported simultaneously, * so enable C-Tag strip and disable S-Tag strip by default. */ - netdev->features &= ~(NETIF_F_TSO |NETIF_F_TSO6 |NETIF_F_HW_VLAN_STAG_RX ); + netdev->features &= ~NETIF_F_HW_VLAN_STAG_RX ;netif_set_tso_max_segs (netdev,NFP_NET_LSO_MAX_SEGS ); netdev->priv_flags |=IFF_NO_QUEUE |IFF_DISABLE_NETPOLL ;
Signature · 1 line
2.30.2
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:
Quoted 9 lines · On Tue, 5 Jul 2022 08:36:02 +0100 you wrote:
Hi,
this short series enables TSO by default on all NICs supported by the NFP driver.
Simon Horman (1):
nfp: enable TSO by default for nfp netdev[...]
Here is the summary with links:
- [net-next,1/2] nfp: allow TSO packets with metadata prepended in NFDK path
https://git.kernel.org/netdev/net-next/c/ccccb4932977 - [net-next,2/2] nfp: enable TSO by default for nfp netdev https://git.kernel.org/netdev/net-next/c/7de8b691615f
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html