patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/ena: TX L4 offloads should not be set in RX path
@ 2018-01-25 15:10 Rafal Kozik
  0 siblings, 0 replies; 5+ messages in thread
From: Rafal Kozik @ 2018-01-25 15:10 UTC (permalink / raw)
  To: mk; +Cc: Rafal Kozik, stable

Information about received packet type detected by NIC should be
stored in packet_type field of rte_mbuf. TX L4 offload flags should
not be set in RX path. Only fields that could be set in of_flags
during packet receiving are information if L4 and L3 checksum is
correct.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Reported-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Rafal Kozik <rk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 83e0ae2..1e2af80 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -275,16 +275,17 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
 				       struct ena_com_rx_ctx *ena_rx_ctx)
 {
 	uint64_t ol_flags = 0;
+	uint32_t packet_type = 0;
 
 	if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP)
-		ol_flags |= PKT_TX_TCP_CKSUM;
+		packet_type |= RTE_PTYPE_L4_TCP;
 	else if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)
-		ol_flags |= PKT_TX_UDP_CKSUM;
+		packet_type |= RTE_PTYPE_L4_UDP;
 
 	if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4)
-		ol_flags |= PKT_TX_IPV4;
+		packet_type |= RTE_PTYPE_L3_IPV4;
 	else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
-		ol_flags |= PKT_TX_IPV6;
+		packet_type |= RTE_PTYPE_L3_IPV6;
 
 	if (unlikely(ena_rx_ctx->l4_csum_err))
 		ol_flags |= PKT_RX_L4_CKSUM_BAD;
@@ -292,6 +293,7 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
 		ol_flags |= PKT_RX_IP_CKSUM_BAD;
 
 	mbuf->ol_flags = ol_flags;
+	mbuf->packet_type = packet_type;
 }
 
 static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,
-- 
2.7.4

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

* Re: [dpdk-stable] [PATCH] net/ena: TX L4 offloads should not be set in RX path
  2018-01-26 13:51   ` Rafał Kozik
@ 2018-01-26 14:14     ` Luca Boccassi
  0 siblings, 0 replies; 5+ messages in thread
From: Luca Boccassi @ 2018-01-26 14:14 UTC (permalink / raw)
  To: Rafał Kozik; +Cc: stable

On Fri, 2018-01-26 at 14:51 +0100, Rafał Kozik wrote:
> Hello,
> 
> I send this patch to stable list by mistake. I misunderstood git-send
> configuration.
> Currently this patch is under review on dpdk-dev list
> http://dpdk.org/ml/archives/dev/2018-January/089053.html.
> 
> I am very sorry about the trouble I caused, I assure you that it will
> never happen again.
> 
> Kind regards,
> Rafal Kozik

Don't worry, it's no trouble at all.
Given it applies to older releases as well, keep stable in the CC list
so that when it gets merged we can backport it.

> 2018-01-26 14:39 GMT+01:00 Luca Boccassi <bluca@debian.org>:
> > On Thu, 2018-01-25 at 16:12 +0100, Rafal Kozik wrote:
> > > Information about received packet type detected by NIC should be
> > > stored in packet_type field of rte_mbuf. TX L4 offload flags
> > > should
> > > not be set in RX path. Only fields that could be set in of_flags
> > > during packet receiving are information if L4 and L3 checksum is
> > > correct.
> > > 
> > > Fixes: 1173fca25af9 ("ena: add polling-mode driver")
> > > Cc: stable@dpdk.org
> > > 
> > > Reported-by: Matthew Smith <mgsmith@netgate.com>
> > > Signed-off-by: Rafal Kozik <rk@semihalf.com>
> > > ---
> > >  drivers/net/ena/ena_ethdev.c | 10 ++++++----
> > >  1 file changed, 6 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/net/ena/ena_ethdev.c
> > > b/drivers/net/ena/ena_ethdev.c
> > > index 83e0ae2..1e2af80 100644
> > > --- a/drivers/net/ena/ena_ethdev.c
> > > +++ b/drivers/net/ena/ena_ethdev.c
> > > @@ -275,16 +275,17 @@ static inline void
> > > ena_rx_mbuf_prepare(struct
> > > rte_mbuf *mbuf,
> > >                                      struct ena_com_rx_ctx
> > > *ena_rx_ctx)
> > >  {
> > >       uint64_t ol_flags = 0;
> > > +     uint32_t packet_type = 0;
> > > 
> > >       if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP)
> > > -             ol_flags |= PKT_TX_TCP_CKSUM;
> > > +             packet_type |= RTE_PTYPE_L4_TCP;
> > >       else if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)
> > > -             ol_flags |= PKT_TX_UDP_CKSUM;
> > > +             packet_type |= RTE_PTYPE_L4_UDP;
> > > 
> > >       if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4)
> > > -             ol_flags |= PKT_TX_IPV4;
> > > +             packet_type |= RTE_PTYPE_L3_IPV4;
> > >       else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
> > > -             ol_flags |= PKT_TX_IPV6;
> > > +             packet_type |= RTE_PTYPE_L3_IPV6;
> > > 
> > >       if (unlikely(ena_rx_ctx->l4_csum_err))
> > >               ol_flags |= PKT_RX_L4_CKSUM_BAD;
> > > @@ -292,6 +293,7 @@ static inline void ena_rx_mbuf_prepare(struct
> > > rte_mbuf *mbuf,
> > >               ol_flags |= PKT_RX_IP_CKSUM_BAD;
> > > 
> > >       mbuf->ol_flags = ol_flags;
> > > +     mbuf->packet_type = packet_type;
> > >  }
> > > 
> > >  static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,
> > 
> > Hi,
> > 
> > has a similar/related fix been applied to dpdk/master?
> > 
> > --
> > Kind regards,
> > Luca Boccassi

-- 
Kind regards,
Luca Boccassi

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

* Re: [dpdk-stable] [PATCH] net/ena: TX L4 offloads should not be set in RX path
  2018-01-26 13:39 ` Luca Boccassi
@ 2018-01-26 13:51   ` Rafał Kozik
  2018-01-26 14:14     ` Luca Boccassi
  0 siblings, 1 reply; 5+ messages in thread
From: Rafał Kozik @ 2018-01-26 13:51 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: stable

Hello,

I send this patch to stable list by mistake. I misunderstood git-send
configuration.
Currently this patch is under review on dpdk-dev list
http://dpdk.org/ml/archives/dev/2018-January/089053.html.

I am very sorry about the trouble I caused, I assure you that it will
never happen again.

Kind regards,
Rafal Kozik

2018-01-26 14:39 GMT+01:00 Luca Boccassi <bluca@debian.org>:
> On Thu, 2018-01-25 at 16:12 +0100, Rafal Kozik wrote:
>> Information about received packet type detected by NIC should be
>> stored in packet_type field of rte_mbuf. TX L4 offload flags should
>> not be set in RX path. Only fields that could be set in of_flags
>> during packet receiving are information if L4 and L3 checksum is
>> correct.
>>
>> Fixes: 1173fca25af9 ("ena: add polling-mode driver")
>> Cc: stable@dpdk.org
>>
>> Reported-by: Matthew Smith <mgsmith@netgate.com>
>> Signed-off-by: Rafal Kozik <rk@semihalf.com>
>> ---
>>  drivers/net/ena/ena_ethdev.c | 10 ++++++----
>>  1 file changed, 6 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ena/ena_ethdev.c
>> b/drivers/net/ena/ena_ethdev.c
>> index 83e0ae2..1e2af80 100644
>> --- a/drivers/net/ena/ena_ethdev.c
>> +++ b/drivers/net/ena/ena_ethdev.c
>> @@ -275,16 +275,17 @@ static inline void ena_rx_mbuf_prepare(struct
>> rte_mbuf *mbuf,
>>                                      struct ena_com_rx_ctx
>> *ena_rx_ctx)
>>  {
>>       uint64_t ol_flags = 0;
>> +     uint32_t packet_type = 0;
>>
>>       if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP)
>> -             ol_flags |= PKT_TX_TCP_CKSUM;
>> +             packet_type |= RTE_PTYPE_L4_TCP;
>>       else if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)
>> -             ol_flags |= PKT_TX_UDP_CKSUM;
>> +             packet_type |= RTE_PTYPE_L4_UDP;
>>
>>       if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4)
>> -             ol_flags |= PKT_TX_IPV4;
>> +             packet_type |= RTE_PTYPE_L3_IPV4;
>>       else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
>> -             ol_flags |= PKT_TX_IPV6;
>> +             packet_type |= RTE_PTYPE_L3_IPV6;
>>
>>       if (unlikely(ena_rx_ctx->l4_csum_err))
>>               ol_flags |= PKT_RX_L4_CKSUM_BAD;
>> @@ -292,6 +293,7 @@ static inline void ena_rx_mbuf_prepare(struct
>> rte_mbuf *mbuf,
>>               ol_flags |= PKT_RX_IP_CKSUM_BAD;
>>
>>       mbuf->ol_flags = ol_flags;
>> +     mbuf->packet_type = packet_type;
>>  }
>>
>>  static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,
>
> Hi,
>
> has a similar/related fix been applied to dpdk/master?
>
> --
> Kind regards,
> Luca Boccassi

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

* Re: [dpdk-stable] [PATCH] net/ena: TX L4 offloads should not be set in RX path
  2018-01-25 15:12 Rafal Kozik
@ 2018-01-26 13:39 ` Luca Boccassi
  2018-01-26 13:51   ` Rafał Kozik
  0 siblings, 1 reply; 5+ messages in thread
From: Luca Boccassi @ 2018-01-26 13:39 UTC (permalink / raw)
  To: Rafal Kozik; +Cc: stable

On Thu, 2018-01-25 at 16:12 +0100, Rafal Kozik wrote:
> Information about received packet type detected by NIC should be
> stored in packet_type field of rte_mbuf. TX L4 offload flags should
> not be set in RX path. Only fields that could be set in of_flags
> during packet receiving are information if L4 and L3 checksum is
> correct.
> 
> Fixes: 1173fca25af9 ("ena: add polling-mode driver")
> Cc: stable@dpdk.org
> 
> Reported-by: Matthew Smith <mgsmith@netgate.com>
> Signed-off-by: Rafal Kozik <rk@semihalf.com>
> ---
>  drivers/net/ena/ena_ethdev.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ena/ena_ethdev.c
> b/drivers/net/ena/ena_ethdev.c
> index 83e0ae2..1e2af80 100644
> --- a/drivers/net/ena/ena_ethdev.c
> +++ b/drivers/net/ena/ena_ethdev.c
> @@ -275,16 +275,17 @@ static inline void ena_rx_mbuf_prepare(struct
> rte_mbuf *mbuf,
>  				       struct ena_com_rx_ctx
> *ena_rx_ctx)
>  {
>  	uint64_t ol_flags = 0;
> +	uint32_t packet_type = 0;
>  
>  	if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP)
> -		ol_flags |= PKT_TX_TCP_CKSUM;
> +		packet_type |= RTE_PTYPE_L4_TCP;
>  	else if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)
> -		ol_flags |= PKT_TX_UDP_CKSUM;
> +		packet_type |= RTE_PTYPE_L4_UDP;
>  
>  	if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4)
> -		ol_flags |= PKT_TX_IPV4;
> +		packet_type |= RTE_PTYPE_L3_IPV4;
>  	else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
> -		ol_flags |= PKT_TX_IPV6;
> +		packet_type |= RTE_PTYPE_L3_IPV6;
>  
>  	if (unlikely(ena_rx_ctx->l4_csum_err))
>  		ol_flags |= PKT_RX_L4_CKSUM_BAD;
> @@ -292,6 +293,7 @@ static inline void ena_rx_mbuf_prepare(struct
> rte_mbuf *mbuf,
>  		ol_flags |= PKT_RX_IP_CKSUM_BAD;
>  
>  	mbuf->ol_flags = ol_flags;
> +	mbuf->packet_type = packet_type;
>  }
>  
>  static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,

Hi,

has a similar/related fix been applied to dpdk/master?

-- 
Kind regards,
Luca Boccassi

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

* [dpdk-stable] [PATCH] net/ena: TX L4 offloads should not be set in RX path
@ 2018-01-25 15:12 Rafal Kozik
  2018-01-26 13:39 ` Luca Boccassi
  0 siblings, 1 reply; 5+ messages in thread
From: Rafal Kozik @ 2018-01-25 15:12 UTC (permalink / raw)
  To: rk; +Cc: stable

Information about received packet type detected by NIC should be
stored in packet_type field of rte_mbuf. TX L4 offload flags should
not be set in RX path. Only fields that could be set in of_flags
during packet receiving are information if L4 and L3 checksum is
correct.

Fixes: 1173fca25af9 ("ena: add polling-mode driver")
Cc: stable@dpdk.org

Reported-by: Matthew Smith <mgsmith@netgate.com>
Signed-off-by: Rafal Kozik <rk@semihalf.com>
---
 drivers/net/ena/ena_ethdev.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ena/ena_ethdev.c b/drivers/net/ena/ena_ethdev.c
index 83e0ae2..1e2af80 100644
--- a/drivers/net/ena/ena_ethdev.c
+++ b/drivers/net/ena/ena_ethdev.c
@@ -275,16 +275,17 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
 				       struct ena_com_rx_ctx *ena_rx_ctx)
 {
 	uint64_t ol_flags = 0;
+	uint32_t packet_type = 0;
 
 	if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_TCP)
-		ol_flags |= PKT_TX_TCP_CKSUM;
+		packet_type |= RTE_PTYPE_L4_TCP;
 	else if (ena_rx_ctx->l4_proto == ENA_ETH_IO_L4_PROTO_UDP)
-		ol_flags |= PKT_TX_UDP_CKSUM;
+		packet_type |= RTE_PTYPE_L4_UDP;
 
 	if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV4)
-		ol_flags |= PKT_TX_IPV4;
+		packet_type |= RTE_PTYPE_L3_IPV4;
 	else if (ena_rx_ctx->l3_proto == ENA_ETH_IO_L3_PROTO_IPV6)
-		ol_flags |= PKT_TX_IPV6;
+		packet_type |= RTE_PTYPE_L3_IPV6;
 
 	if (unlikely(ena_rx_ctx->l4_csum_err))
 		ol_flags |= PKT_RX_L4_CKSUM_BAD;
@@ -292,6 +293,7 @@ static inline void ena_rx_mbuf_prepare(struct rte_mbuf *mbuf,
 		ol_flags |= PKT_RX_IP_CKSUM_BAD;
 
 	mbuf->ol_flags = ol_flags;
+	mbuf->packet_type = packet_type;
 }
 
 static inline void ena_tx_mbuf_prepare(struct rte_mbuf *mbuf,
-- 
2.7.4

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

end of thread, other threads:[~2018-01-26 14:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-25 15:10 [dpdk-stable] [PATCH] net/ena: TX L4 offloads should not be set in RX path Rafal Kozik
2018-01-25 15:12 Rafal Kozik
2018-01-26 13:39 ` Luca Boccassi
2018-01-26 13:51   ` Rafał Kozik
2018-01-26 14:14     ` Luca Boccassi

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