DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode
@ 2018-11-09  5:50 Nithin Dabilpuram
  2018-11-09  8:20 ` Jerin Jacob
  2018-11-12  7:21 ` [dpdk-dev] " Verma, Shally
  0 siblings, 2 replies; 4+ messages in thread
From: Nithin Dabilpuram @ 2018-11-09  5:50 UTC (permalink / raw)
  To: dev, Jacob,  Jerin, Czekaj, Maciej
  Cc: Nilla, Subrahmanyam, stable, Dabilpuram, Nithin

From: Subrahmanyam Nilla <snilla@caviumnetworks.com>

For performance reasons, word1 of send_hdr_s
sub descriptor was not cleared assuming it is always
having default value of zero since it comes from fixed
offsets of SQ buffer.
This is causing issues in case of SG mode because,
the size of send command might change and hence the word1
of send_hdr_s is not always at fixed offsets of the SQ buffer
and hence not having default value of zero.

This fixes the issue by clearing the word1 in case of SG mode
for every packet.

Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
Cc: stable@dpdk.org

Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
Signed-off-by: Nithin Dabilpuram <ndabilpuram@caviumnetworks.com>
---
 drivers/net/thunderx/nicvf_rxtx.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
index 247c356..1c42874 100644
--- a/drivers/net/thunderx/nicvf_rxtx.c
+++ b/drivers/net/thunderx/nicvf_rxtx.c
@@ -61,6 +61,14 @@
 	entry->buff[0] = sqe.buff[0];
 }
 
+static inline void __hot
+fill_sq_desc_header_zero_w1(union sq_entry_t *entry,
+				struct rte_mbuf *pkt)
+{
+	fill_sq_desc_header(entry, pkt);
+	entry->buff[1] = 0ULL;
+}
+
 void __hot
 nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq)
 {
@@ -204,7 +212,7 @@
 		used_bufs += nb_segs;
 
 		txbuffs[tail] = NULL;
-		fill_sq_desc_header(desc_ptr + tail, pkt);
+		fill_sq_desc_header_zero_w1(desc_ptr + tail, pkt);
 		tail = (tail + 1) & qlen_mask;
 
 		txbuffs[tail] = pkt;
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode
  2018-11-09  5:50 [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode Nithin Dabilpuram
@ 2018-11-09  8:20 ` Jerin Jacob
  2018-11-09 20:25   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
  2018-11-12  7:21 ` [dpdk-dev] " Verma, Shally
  1 sibling, 1 reply; 4+ messages in thread
From: Jerin Jacob @ 2018-11-09  8:20 UTC (permalink / raw)
  To: Dabilpuram, Nithin
  Cc: dev, Jacob,  Jerin, Czekaj, Maciej, Nilla, Subrahmanyam, stable

-----Original Message-----
> Date: Fri, 9 Nov 2018 11:20:55 +0530
> From: "Dabilpuram, Nithin" <Nithin.Dabilpuram@cavium.com>
> To: "dev@dpdk.org" <dev@dpdk.org>, "Jacob,  Jerin"
>  <Jerin.JacobKollanukkaran@cavium.com>, "Czekaj, Maciej"
>  <Maciej.Czekaj@cavium.com>
> CC: "Nilla, Subrahmanyam" <Subrahmanyam.Nilla@cavium.com>,
>  "stable@dpdk.org" <stable@dpdk.org>, "Dabilpuram, Nithin"
>  <Nithin.Dabilpuram@cavium.com>
> Subject: [PATCH] net/thunderx:  fix Tx desc corruption in scatter-gather
>  mode
> 
> From: Subrahmanyam Nilla <snilla@caviumnetworks.com>
> 
> For performance reasons, word1 of send_hdr_s
> sub descriptor was not cleared assuming it is always
> having default value of zero since it comes from fixed
> offsets of SQ buffer.
> This is causing issues in case of SG mode because,
> the size of send command might change and hence the word1
> of send_hdr_s is not always at fixed offsets of the SQ buffer
> and hence not having default value of zero.
> 
> This fixes the issue by clearing the word1 in case of SG mode
> for every packet.
> 
> Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
> Signed-off-by: Nithin Dabilpuram <ndabilpuram@caviumnetworks.com>
> ---

Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

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

* Re: [dpdk-dev] [dpdk-stable] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode
  2018-11-09  8:20 ` Jerin Jacob
@ 2018-11-09 20:25   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-11-09 20:25 UTC (permalink / raw)
  To: Jerin Jacob, Dabilpuram, Nithin
  Cc: dev, Jacob, Jerin, Czekaj, Maciej, Nilla, Subrahmanyam, stable

On 11/9/2018 8:20 AM, Jerin Jacob wrote:
<...>
>> From: Subrahmanyam Nilla <snilla@caviumnetworks.com>
>>
>> For performance reasons, word1 of send_hdr_s
>> sub descriptor was not cleared assuming it is always
>> having default value of zero since it comes from fixed
>> offsets of SQ buffer.
>> This is causing issues in case of SG mode because,
>> the size of send command might change and hence the word1
>> of send_hdr_s is not always at fixed offsets of the SQ buffer
>> and hence not having default value of zero.
>>
>> This fixes the issue by clearing the word1 in case of SG mode
>> for every packet.
>>
>> Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
>> Signed-off-by: Nithin Dabilpuram <ndabilpuram@caviumnetworks.com>
>> ---
> 
> Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>

Applied to dpdk-next-net/master, thanks.

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

* Re: [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode
  2018-11-09  5:50 [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode Nithin Dabilpuram
  2018-11-09  8:20 ` Jerin Jacob
@ 2018-11-12  7:21 ` Verma, Shally
  1 sibling, 0 replies; 4+ messages in thread
From: Verma, Shally @ 2018-11-12  7:21 UTC (permalink / raw)
  To: Dabilpuram, Nithin, dev, Jacob,  Jerin, Czekaj, Maciej
  Cc: Nilla, Subrahmanyam, stable, Dabilpuram, Nithin



>-----Original Message-----
>From: dev <dev-bounces@dpdk.org> On Behalf Of Nithin Dabilpuram
>Sent: 09 November 2018 11:21
>To: dev@dpdk.org; Jacob, Jerin <Jerin.JacobKollanukkaran@cavium.com>; Czekaj, Maciej <Maciej.Czekaj@cavium.com>
>Cc: Nilla, Subrahmanyam <Subrahmanyam.Nilla@cavium.com>; stable@dpdk.org; Dabilpuram, Nithin
><Nithin.Dabilpuram@cavium.com>
>Subject: [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode
>
>External Email
>
>From: Subrahmanyam Nilla <snilla@caviumnetworks.com>
>
>For performance reasons, word1 of send_hdr_s
>sub descriptor was not cleared assuming it is always
>having default value of zero since it comes from fixed
>offsets of SQ buffer.
>This is causing issues in case of SG mode because,
>the size of send command might change and hence the word1
>of send_hdr_s is not always at fixed offsets of the SQ buffer
>and hence not having default value of zero.
>
>This fixes the issue by clearing the word1 in case of SG mode
>for every packet.
>
>Fixes: 1c421f18e0 ("net/thunderx: add single and multi-segment Tx")
>Cc: stable@dpdk.org
>
>Signed-off-by: Subrahmanyam Nilla <snilla@caviumnetworks.com>
>Signed-off-by: Nithin Dabilpuram <ndabilpuram@caviumnetworks.com>
>---
> drivers/net/thunderx/nicvf_rxtx.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c
>index 247c356..1c42874 100644
>--- a/drivers/net/thunderx/nicvf_rxtx.c
>+++ b/drivers/net/thunderx/nicvf_rxtx.c
>@@ -61,6 +61,14 @@
>        entry->buff[0] = sqe.buff[0];
> }
>
>+static inline void __hot
>+fill_sq_desc_header_zero_w1(union sq_entry_t *entry,
>+                               struct rte_mbuf *pkt)
>+{
>+       fill_sq_desc_header(entry, pkt);
>+       entry->buff[1] = 0ULL;
>+}
>+
> void __hot
> nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq)
> {
>@@ -204,7 +212,7 @@
>                used_bufs += nb_segs;
>
>                txbuffs[tail] = NULL;
>-               fill_sq_desc_header(desc_ptr + tail, pkt);
>+               fill_sq_desc_header_zero_w1(desc_ptr + tail, pkt);
>                tail = (tail + 1) & qlen_mask;
>
>                txbuffs[tail] = pkt;
>--
Acked-by: Shally Verma <shally.verma@caviumnetworks.com>

Thanks
Shally
>1.8.3.1

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

end of thread, other threads:[~2018-11-12  7:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-09  5:50 [dpdk-dev] [PATCH] net/thunderx: fix Tx desc corruption in scatter-gather mode Nithin Dabilpuram
2018-11-09  8:20 ` Jerin Jacob
2018-11-09 20:25   ` [dpdk-dev] [dpdk-stable] " Ferruh Yigit
2018-11-12  7:21 ` [dpdk-dev] " Verma, Shally

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