diff mbox series

[net] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes

Message ID 20240308115722.14671-1-gakula@marvell.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [net] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag present in non-next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 972 this patch: 972
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 975 this patch: 975
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 13 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest warning net-next-2024-03-08--15-00 (tests: 800)

Commit Message

Geetha sowjanya March 8, 2024, 11:57 a.m. UTC
Hardware doesn't support packet segmentation when segment size
is < 16 bytes. Hence add an additional check and use SW 
segmentation in such case.

Fixes: 86d7476078b8 ("octeontx2-pf: TCP segmentation offload support").
Signed-off-by: Geetha sowjanya <gakula@marvell.com>
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Eric Dumazet March 8, 2024, 1:58 p.m. UTC | #1
On Fri, Mar 8, 2024 at 12:57 PM Geetha sowjanya <gakula@marvell.com> wrote:
>
> Hardware doesn't support packet segmentation when segment size
> is < 16 bytes. Hence add an additional check and use SW
> segmentation in such case.
>
> Fixes: 86d7476078b8 ("octeontx2-pf: TCP segmentation offload support").
> Signed-off-by: Geetha sowjanya <gakula@marvell.com>
> ---
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> index f828d32737af..2ac56abb3a0e 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> @@ -967,6 +967,13 @@ static bool is_hw_tso_supported(struct otx2_nic *pfvf,
>  {
>         int payload_len, last_seg_size;
>
> +       /* Due to hw issue segment size less than 16 bytes
> +        * are not supported. Hence do not offload such TSO
> +        * segments.
> +        */
> +       if (skb_shinfo(skb)->gso_size < 16)
> +               return false;
> +
>         if (test_bit(HW_TSO, &pfvf->hw.cap_flag))
>                 return true;

How is this driver doing SW segmentation at this stage ?

You might perform this check in ndo_features_check() instead ?

otx2_sq_append_skb() is also forcing a linearization if
skb_shinfo(skb)->nr_frags >= OTX2_MAX_FRAGS_IN_SQE

This is quite bad, this one definitely should use ndo_features_check()
to mask NETIF_F_GSO_MASK for GSO packets.

Look at typhoon_features_check() for an example.
Geetha sowjanya March 11, 2024, 6:41 a.m. UTC | #2
> -----Original Message-----
> From: Eric Dumazet <edumazet@google.com>
> Sent: Friday, March 8, 2024 7:29 PM
> To: Geethasowjanya Akula <gakula@marvell.com>
> Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; kuba@kernel.org;
> davem@davemloft.net; pabeni@redhat.com; Sunil Kovvuri Goutham
> <sgoutham@marvell.com>; Subbaraya Sundeep Bhatta
> <sbhatta@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>
> Subject: [EXTERNAL] Re: [net PATCH] octeontx2-pf: Do not use HW TSO when
> gso_size < 16bytes
> On Fri, Mar 8, 2024 at 12:57 PM Geetha sowjanya <gakula@marvell.com>
> wrote:
> >
> > Hardware doesn't support packet segmentation when segment size is < 16
> > bytes. Hence add an additional check and use SW segmentation in such
> > case.
> >
> > Fixes: 86d7476078b8 ("octeontx2-pf: TCP segmentation offload support").
> > Signed-off-by: Geetha sowjanya <gakula@marvell.com>
> > ---
> >  drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 7 +++++++
> >  1 file changed, 7 insertions(+)
> >
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > index f828d32737af..2ac56abb3a0e 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
> > @@ -967,6 +967,13 @@ static bool is_hw_tso_supported(struct otx2_nic
> > *pfvf,  {
> >         int payload_len, last_seg_size;
> >
> > +       /* Due to hw issue segment size less than 16 bytes
> > +        * are not supported. Hence do not offload such TSO
> > +        * segments.
> > +        */
> > +       if (skb_shinfo(skb)->gso_size < 16)
> > +               return false;
> > +
> >         if (test_bit(HW_TSO, &pfvf->hw.cap_flag))
> >                 return true;
> 
> How is this driver doing SW segmentation at this stage ?
> 
> You might perform this check in ndo_features_check() instead ?
> 
> otx2_sq_append_skb() is also forcing a linearization if skb_shinfo(skb)-
> >nr_frags >= OTX2_MAX_FRAGS_IN_SQE
> 
> This is quite bad, this one definitely should use ndo_features_check() to mask
> NETIF_F_GSO_MASK for GSO packets.
> 
> Look at typhoon_features_check() for an example.

Thanks for the suggestions. Will submit v2 with suggested changes.
diff mbox series

Patch

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
index f828d32737af..2ac56abb3a0e 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c
@@ -967,6 +967,13 @@  static bool is_hw_tso_supported(struct otx2_nic *pfvf,
 {
 	int payload_len, last_seg_size;
 
+	/* Due to hw issue segment size less than 16 bytes
+	 * are not supported. Hence do not offload such TSO
+	 * segments.
+	 */
+	if (skb_shinfo(skb)->gso_size < 16)
+		return false;
+
 	if (test_bit(HW_TSO, &pfvf->hw.cap_flag))
 		return true;