netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes
@ 2024-03-08 11:57 Geetha sowjanya
  2024-03-08 13:58 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Geetha sowjanya @ 2024-03-08 11:57 UTC (permalink / raw)
  To: netdev, linux-kernel
  Cc: kuba, davem, pabeni, edumazet, sgoutham, gakula, sbhatta, hkelam

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;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [net PATCH] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes
  2024-03-08 11:57 [net PATCH] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes Geetha sowjanya
@ 2024-03-08 13:58 ` Eric Dumazet
  2024-03-11  6:41   ` [EXTERNAL] " Geethasowjanya Akula
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2024-03-08 13:58 UTC (permalink / raw)
  To: Geetha sowjanya
  Cc: netdev, linux-kernel, kuba, davem, pabeni, sgoutham, sbhatta, hkelam

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [EXTERNAL] Re: [net PATCH] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes
  2024-03-08 13:58 ` Eric Dumazet
@ 2024-03-11  6:41   ` Geethasowjanya Akula
  0 siblings, 0 replies; 3+ messages in thread
From: Geethasowjanya Akula @ 2024-03-11  6:41 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: netdev, linux-kernel, kuba, davem, pabeni, Sunil Kovvuri Goutham,
	Subbaraya Sundeep Bhatta, Hariprasad Kelam



> -----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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-11  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-08 11:57 [net PATCH] octeontx2-pf: Do not use HW TSO when gso_size < 16bytes Geetha sowjanya
2024-03-08 13:58 ` Eric Dumazet
2024-03-11  6:41   ` [EXTERNAL] " Geethasowjanya Akula

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).