DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros
@ 2017-12-31  7:34 Shachar Beiser
  2017-12-31  7:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields Shachar Beiser
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Shachar Beiser @ 2017-12-31  7:34 UTC (permalink / raw)
  To: dev; +Cc: Shachar Beiser, Adrien Mazarguil, Nelio Laranjeiro

Support IPv6 header vtc_flow fields : tc , flow_label

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
---
 lib/librte_net/rte_ip.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 73ec398..75b9cc3 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -406,6 +406,12 @@ struct ipv6_hdr {
 	uint8_t  dst_addr[16]; /**< IP address of destination host(s). */
 } __attribute__((__packed__));
 
+/* IPv6 vtc_flow: IPv / TC / flow_label */
+#define IPV6_HDR_FL_SHIFT (0)
+#define IPV6_HDR_TC_SHIFT (20)
+#define IPV6_HDR_FL_MASK ((1 << IPV6_HDR_TC_SHIFT) - 1)
+#define IPV6_HDR_TC_MASK (0xf << IPV6_HDR_TC_SHIFT)
+
 /**
  * Process the pseudo-header checksum of an IPv6 header.
  *
-- 
1.8.3.1

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

* [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields
  2017-12-31  7:34 [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Shachar Beiser
@ 2017-12-31  7:34 ` Shachar Beiser
  2018-01-02 19:56   ` Yongseok Koh
  2017-12-31 17:37 ` [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Stephen Hemminger
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 9+ messages in thread
From: Shachar Beiser @ 2017-12-31  7:34 UTC (permalink / raw)
  To: dev; +Cc: Shachar Beiser, Adrien Mazarguil, Nelio Laranjeiro, stable

There are parameters that are not copy from
spec to verbs structure in the vtc_label

Fixes: 43e9d97 ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
---
 drivers/net/mlx5/mlx5_flow.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 6605cfd..3209be8 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -48,6 +48,7 @@
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
 #include <rte_malloc.h>
+#include <rte_ip.h>
 
 #include "mlx5.h"
 #include "mlx5_prm.h"
@@ -1399,6 +1400,8 @@ struct ibv_spec_header {
 		parser->layer = HASH_RXQ_IPV6;
 	if (spec) {
 		unsigned int i;
+		uint32_t vtc_flow_val;
+		uint32_t vtc_flow_mask;
 
 		if (!mask)
 			mask = default_mask;
@@ -1410,7 +1413,20 @@ struct ibv_spec_header {
 		       RTE_DIM(ipv6.mask.src_ip));
 		memcpy(&ipv6.mask.dst_ip, mask->hdr.dst_addr,
 		       RTE_DIM(ipv6.mask.dst_ip));
-		ipv6.mask.flow_label = mask->hdr.vtc_flow;
+		vtc_flow_val = rte_be_to_cpu_32(spec->hdr.vtc_flow);
+		vtc_flow_mask = rte_be_to_cpu_32(mask->hdr.vtc_flow);
+		ipv6.val.flow_label =
+			rte_cpu_to_be_32((vtc_flow_val & IPV6_HDR_FL_MASK) >>
+					 IPV6_HDR_FL_SHIFT);
+		ipv6.val.traffic_class = (vtc_flow_val & IPV6_HDR_TC_MASK) >>
+					 IPV6_HDR_TC_SHIFT;
+		ipv6.val.next_hdr = spec->hdr.proto;
+		ipv6.val.hop_limit = spec->hdr.hop_limits;
+		ipv6.mask.flow_label =
+			rte_cpu_to_be_32((vtc_flow_mask & IPV6_HDR_FL_MASK) >>
+					 IPV6_HDR_FL_SHIFT);
+		ipv6.mask.traffic_class = (vtc_flow_mask & IPV6_HDR_TC_MASK) >>
+					  IPV6_HDR_TC_SHIFT;
 		ipv6.mask.next_hdr = mask->hdr.proto;
 		ipv6.mask.hop_limit = mask->hdr.hop_limits;
 		/* Remove unwanted bits from values. */
@@ -1419,6 +1435,7 @@ struct ibv_spec_header {
 			ipv6.val.dst_ip[i] &= ipv6.mask.dst_ip[i];
 		}
 		ipv6.val.flow_label &= ipv6.mask.flow_label;
+		ipv6.val.traffic_class &= ipv6.mask.traffic_class;
 		ipv6.val.next_hdr &= ipv6.mask.next_hdr;
 		ipv6.val.hop_limit &= ipv6.mask.hop_limit;
 	}
-- 
1.8.3.1

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

* Re: [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros
  2017-12-31  7:34 [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Shachar Beiser
  2017-12-31  7:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields Shachar Beiser
@ 2017-12-31 17:37 ` Stephen Hemminger
  2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 " Shahaf Shuler
  2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix IPv6 header fields Shahaf Shuler
  3 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2017-12-31 17:37 UTC (permalink / raw)
  To: Shachar Beiser; +Cc: dev, Adrien Mazarguil, Nelio Laranjeiro

On Sun, 31 Dec 2017 07:34:29 +0000
Shachar Beiser <shacharbe@mellanox.com> wrote:

> +/* IPv6 vtc_flow: IPv / TC / flow_label */
> +#define IPV6_HDR_FL_SHIFT (0)
> +#define IPV6_HDR_TC_SHIFT (20)

No parenthesis needed around simple numeric values.

> +#define IPV6_HDR_FL_MASK ((1 << IPV6_HDR_TC_SHIFT) - 1)

If you use ((1u << IPV6_HDR_TC_SHFIT - 1)
then the mask will be unsigned which probably what you want.

> +#define IPV6_HDR_TC_MASK (0xf << IPV6_HDR_TC_SHIFT)

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

* Re: [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields
  2017-12-31  7:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields Shachar Beiser
@ 2018-01-02 19:56   ` Yongseok Koh
  0 siblings, 0 replies; 9+ messages in thread
From: Yongseok Koh @ 2018-01-02 19:56 UTC (permalink / raw)
  To: Shachar Beiser; +Cc: dev, Adrien Mazarguil, Nélio Laranjeiro, stable


> On Dec 30, 2017, at 11:34 PM, Shachar Beiser <shacharbe@mellanox.com> wrote:
> 
> There are parameters that are not copy from
> spec to verbs structure in the vtc_label
> 
> Fixes: 43e9d97 ("net/mlx5: support upstream rdma-core")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

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

* [dpdk-dev] [PATCH v2 1/2] lib/net: add IPv6 header fields macros
  2017-12-31  7:34 [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Shachar Beiser
  2017-12-31  7:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields Shachar Beiser
  2017-12-31 17:37 ` [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Stephen Hemminger
@ 2018-01-16  9:17 ` Shahaf Shuler
  2018-01-17 16:53   ` Ferruh Yigit
  2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix IPv6 header fields Shahaf Shuler
  3 siblings, 1 reply; 9+ messages in thread
From: Shahaf Shuler @ 2018-01-16  9:17 UTC (permalink / raw)
  To: olivier.matz, stephen, yskoh, nelio.laranjeiro, adrien.mazarguil
  Cc: dev, Shachar Beiser

From: Shachar Beiser <shacharbe@mellanox.com>

Support IPv6 header vtc_flow fields : tc , flow_label

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
---
Sending on behalf of Shachar.

On v2:
 - Addressed Stephen comments on the coding style.

---
 lib/librte_net/rte_ip.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
index 9a62ff667..f32684c66 100644
--- a/lib/librte_net/rte_ip.h
+++ b/lib/librte_net/rte_ip.h
@@ -344,6 +344,12 @@ struct ipv6_hdr {
 	uint8_t  dst_addr[16]; /**< IP address of destination host(s). */
 } __attribute__((__packed__));
 
+/* IPv6 vtc_flow: IPv / TC / flow_label */
+#define IPV6_HDR_FL_SHIFT 0
+#define IPV6_HDR_TC_SHIFT 20
+#define IPV6_HDR_FL_MASK ((1u << IPV6_HDR_TC_SHIFT) - 1)
+#define IPV6_HDR_TC_MASK (0xf << IPV6_HDR_TC_SHIFT)
+
 /**
  * Process the pseudo-header checksum of an IPv6 header.
  *
-- 
2.12.0

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

* [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix IPv6 header fields
  2017-12-31  7:34 [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Shachar Beiser
                   ` (2 preceding siblings ...)
  2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 " Shahaf Shuler
@ 2018-01-16  9:17 ` Shahaf Shuler
  3 siblings, 0 replies; 9+ messages in thread
From: Shahaf Shuler @ 2018-01-16  9:17 UTC (permalink / raw)
  To: olivier.matz, stephen, yskoh, nelio.laranjeiro, adrien.mazarguil
  Cc: dev, Shachar Beiser, stable

From: Shachar Beiser <shacharbe@mellanox.com>

There are parameters that are not copy from
spec to verbs structure in the vtc_label

Fixes: 43e9d97 ("net/mlx5: support upstream rdma-core")
Cc: stable@dpdk.org

Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
---
Sending on behalf of Shachar.

On v2:
 - No changes.

---
 drivers/net/mlx5/mlx5_flow.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index ff9fd78d5..4396ea852 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -48,6 +48,7 @@
 #include <rte_flow.h>
 #include <rte_flow_driver.h>
 #include <rte_malloc.h>
+#include <rte_ip.h>
 
 #include "mlx5.h"
 #include "mlx5_defs.h"
@@ -1410,6 +1411,8 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 		parser->layer = HASH_RXQ_IPV6;
 	if (spec) {
 		unsigned int i;
+		uint32_t vtc_flow_val;
+		uint32_t vtc_flow_mask;
 
 		if (!mask)
 			mask = default_mask;
@@ -1421,7 +1424,20 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 		       RTE_DIM(ipv6.mask.src_ip));
 		memcpy(&ipv6.mask.dst_ip, mask->hdr.dst_addr,
 		       RTE_DIM(ipv6.mask.dst_ip));
-		ipv6.mask.flow_label = mask->hdr.vtc_flow;
+		vtc_flow_val = rte_be_to_cpu_32(spec->hdr.vtc_flow);
+		vtc_flow_mask = rte_be_to_cpu_32(mask->hdr.vtc_flow);
+		ipv6.val.flow_label =
+			rte_cpu_to_be_32((vtc_flow_val & IPV6_HDR_FL_MASK) >>
+					 IPV6_HDR_FL_SHIFT);
+		ipv6.val.traffic_class = (vtc_flow_val & IPV6_HDR_TC_MASK) >>
+					 IPV6_HDR_TC_SHIFT;
+		ipv6.val.next_hdr = spec->hdr.proto;
+		ipv6.val.hop_limit = spec->hdr.hop_limits;
+		ipv6.mask.flow_label =
+			rte_cpu_to_be_32((vtc_flow_mask & IPV6_HDR_FL_MASK) >>
+					 IPV6_HDR_FL_SHIFT);
+		ipv6.mask.traffic_class = (vtc_flow_mask & IPV6_HDR_TC_MASK) >>
+					  IPV6_HDR_TC_SHIFT;
 		ipv6.mask.next_hdr = mask->hdr.proto;
 		ipv6.mask.hop_limit = mask->hdr.hop_limits;
 		/* Remove unwanted bits from values. */
@@ -1430,6 +1446,7 @@ mlx5_flow_create_ipv6(const struct rte_flow_item *item,
 			ipv6.val.dst_ip[i] &= ipv6.mask.dst_ip[i];
 		}
 		ipv6.val.flow_label &= ipv6.mask.flow_label;
+		ipv6.val.traffic_class &= ipv6.mask.traffic_class;
 		ipv6.val.next_hdr &= ipv6.mask.next_hdr;
 		ipv6.val.hop_limit &= ipv6.mask.hop_limit;
 	}
-- 
2.12.0

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

* Re: [dpdk-dev] [PATCH v2 1/2] lib/net: add IPv6 header fields macros
  2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 " Shahaf Shuler
@ 2018-01-17 16:53   ` Ferruh Yigit
  2018-01-18 13:57     ` Olivier Matz
  0 siblings, 1 reply; 9+ messages in thread
From: Ferruh Yigit @ 2018-01-17 16:53 UTC (permalink / raw)
  To: olivier.matz, yskoh, nelio.laranjeiro, adrien.mazarguil
  Cc: Shahaf Shuler, stephen, dev, Shachar Beiser

On 1/16/2018 9:17 AM, Shahaf Shuler wrote:
> From: Shachar Beiser <shacharbe@mellanox.com>
> 
> Support IPv6 header vtc_flow fields : tc , flow_label
> 
> Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
> ---
> Sending on behalf of Shachar.
> 
> On v2:
>  - Addressed Stephen comments on the coding style.

Hi Olivier,

Any objection to the patch?

Thanks,
ferruh

> 
> ---
>  lib/librte_net/rte_ip.h | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
> index 9a62ff667..f32684c66 100644
> --- a/lib/librte_net/rte_ip.h
> +++ b/lib/librte_net/rte_ip.h
> @@ -344,6 +344,12 @@ struct ipv6_hdr {
>  	uint8_t  dst_addr[16]; /**< IP address of destination host(s). */
>  } __attribute__((__packed__));
>  
> +/* IPv6 vtc_flow: IPv / TC / flow_label */
> +#define IPV6_HDR_FL_SHIFT 0
> +#define IPV6_HDR_TC_SHIFT 20
> +#define IPV6_HDR_FL_MASK ((1u << IPV6_HDR_TC_SHIFT) - 1)
> +#define IPV6_HDR_TC_MASK (0xf << IPV6_HDR_TC_SHIFT)
> +
>  /**
>   * Process the pseudo-header checksum of an IPv6 header.
>   *
> 

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

* Re: [dpdk-dev] [PATCH v2 1/2] lib/net: add IPv6 header fields macros
  2018-01-17 16:53   ` Ferruh Yigit
@ 2018-01-18 13:57     ` Olivier Matz
  2018-01-18 15:07       ` Ferruh Yigit
  0 siblings, 1 reply; 9+ messages in thread
From: Olivier Matz @ 2018-01-18 13:57 UTC (permalink / raw)
  To: Ferruh Yigit
  Cc: yskoh, nelio.laranjeiro, adrien.mazarguil, Shahaf Shuler,
	stephen, dev, Shachar Beiser

On Wed, Jan 17, 2018 at 04:53:25PM +0000, Ferruh Yigit wrote:
> On 1/16/2018 9:17 AM, Shahaf Shuler wrote:
> > From: Shachar Beiser <shacharbe@mellanox.com>
> > 
> > Support IPv6 header vtc_flow fields : tc , flow_label
> > 
> > Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>
> > ---
> > Sending on behalf of Shachar.
> > 
> > On v2:
> >  - Addressed Stephen comments on the coding style.
> 
> Hi Olivier,
> 
> Any objection to the patch?

Sorry, I missed it.

Acked-by: Olivier Matz <olivier.matz@6wind.com>


> 
> Thanks,
> ferruh
> 
> > 
> > ---
> >  lib/librte_net/rte_ip.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/lib/librte_net/rte_ip.h b/lib/librte_net/rte_ip.h
> > index 9a62ff667..f32684c66 100644
> > --- a/lib/librte_net/rte_ip.h
> > +++ b/lib/librte_net/rte_ip.h
> > @@ -344,6 +344,12 @@ struct ipv6_hdr {
> >  	uint8_t  dst_addr[16]; /**< IP address of destination host(s). */
> >  } __attribute__((__packed__));
> >  
> > +/* IPv6 vtc_flow: IPv / TC / flow_label */
> > +#define IPV6_HDR_FL_SHIFT 0
> > +#define IPV6_HDR_TC_SHIFT 20
> > +#define IPV6_HDR_FL_MASK ((1u << IPV6_HDR_TC_SHIFT) - 1)
> > +#define IPV6_HDR_TC_MASK (0xf << IPV6_HDR_TC_SHIFT)
> > +
> >  /**
> >   * Process the pseudo-header checksum of an IPv6 header.
> >   *
> > 
> 

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

* Re: [dpdk-dev] [PATCH v2 1/2] lib/net: add IPv6 header fields macros
  2018-01-18 13:57     ` Olivier Matz
@ 2018-01-18 15:07       ` Ferruh Yigit
  0 siblings, 0 replies; 9+ messages in thread
From: Ferruh Yigit @ 2018-01-18 15:07 UTC (permalink / raw)
  To: Olivier Matz
  Cc: yskoh, nelio.laranjeiro, adrien.mazarguil, Shahaf Shuler,
	stephen, dev, Shachar Beiser

On 1/18/2018 1:57 PM, Olivier Matz wrote:
> On Wed, Jan 17, 2018 at 04:53:25PM +0000, Ferruh Yigit wrote:
>> On 1/16/2018 9:17 AM, Shahaf Shuler wrote:
>>> From: Shachar Beiser <shacharbe@mellanox.com>
>>>
>>> Support IPv6 header vtc_flow fields : tc , flow_label
>>>
>>> Signed-off-by: Shachar Beiser <shacharbe@mellanox.com>

> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Series applied to dpdk-next-net/master, thanks.

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

end of thread, other threads:[~2018-01-18 15:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-31  7:34 [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Shachar Beiser
2017-12-31  7:34 ` [dpdk-dev] [PATCH 2/2] net/mlx5: fix IPv6 header fields Shachar Beiser
2018-01-02 19:56   ` Yongseok Koh
2017-12-31 17:37 ` [dpdk-dev] [PATCH 1/2] lib/net: add IPv6 header fields macros Stephen Hemminger
2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 " Shahaf Shuler
2018-01-17 16:53   ` Ferruh Yigit
2018-01-18 13:57     ` Olivier Matz
2018-01-18 15:07       ` Ferruh Yigit
2018-01-16  9:17 ` [dpdk-dev] [PATCH v2 2/2] net/mlx5: fix IPv6 header fields Shahaf Shuler

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