[dpdk-dev,v2,1/2] lib/net: add IPv6 header fields macros

Message ID f2e8a0362a0b96380183e2c6638f92f5d44b597d.1516093981.git.shahafs@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues

Commit Message

Shahaf Shuler Jan. 16, 2018, 9:17 a.m. UTC
  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(+)
  

Comments

Ferruh Yigit Jan. 17, 2018, 4:53 p.m. UTC | #1
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.
>   *
>
  
Olivier Matz Jan. 18, 2018, 1:57 p.m. UTC | #2
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.
> >   *
> > 
>
  
Ferruh Yigit Jan. 18, 2018, 3:07 p.m. UTC | #3
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.
  

Patch

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