octeontx2-pf: Do not use HW TSO when gso_size < 16bytes
Geetha sowjanya
maintainerPATCH 1/1 octeontx2-pf: Do not use HW TSO when gso_size < 16bytes
Hardware doesn't support packet segmentation when segment size is < 16 bytes. Hence add an additional check and use SW segmentation in such case.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +7 -0
@@ -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;
Signature · 1 line
2.25.1
Quoted 18 lines · Geetha sowjanya
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 <[email protected]>--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +0
-0@@ -967,6 +967,13 @@ static bool is_hw_tso_supported(struct otx2_nic *pfvf, {int payload_len, last_seg_size;
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c static bool is_hw_tso_supported(struct otx2_nic *pfvf, · line 978
Quoted 10 lines
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +7
-0+/* 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.
Geethasowjanya Akula
maintainerQuoted 48 lines
-----Original Message-----
From: Eric Dumazet <[email protected]>
Sent: Friday, March 8, 2024 7:29 PM
To: Geethasowjanya Akula <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sunil Kovvuri Goutham <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>; Hariprasad Kelam <[email protected]>
Subject: [EXTERNAL] Re: [net PATCH] octeontx2-pf: Do not use HW TSO whengso_size< 16bytesQuoted 19 lines · Geetha sowjanya
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 <[email protected]>--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +0
-0@@ -967,6 +967,13 @@ static bool is_hw_tso_supported(struct otx2_nic *pfvf, {int payload_len, last_seg_size;drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c static bool is_hw_tso_supported(struct otx2_nic · line 978
Quoted 10 lines
drivers/net/ethernet/marvell/octeontx2/nic/otx2_txrx.c +7
-0+/* 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 ?
Quoted 7 lines
otx2_sq_append_skb()is also forcing a linearization if skb_shinfo(skb)-Quoted 1 line
nr_frags>=OTX2_MAX_FRAGS_IN_SQEThis is quite bad, this one definitely should use
ndo_features_check()to maskNETIF_F_GSO_MASKfor GSO packets.Look at
typhoon_features_check()for an example.
Thanks for the suggestions. Will submit v2 with suggested changes.