Thread (9 messages) 9 messages, 6 authors, 2018-01-18

Re: [PATCH v2 1/2] lib/net: add IPv6 header fields macros

From: Ferruh Yigit <hidden>
Date: 2018-01-17 16:53:29

On 1/16/2018 9:17 AM, Shahaf Shuler wrote:
From: Shachar Beiser <redacted>

Support IPv6 header vtc_flow fields : tc , flow_label

Signed-off-by: Shachar Beiser <redacted>
---
Sending on behalf of Shachar.

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

Any objection to the patch?

Thanks,
ferruh
quoted hunk ↗ jump to hunk
---
 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.
  *
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help