DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shahaf Shuler <shahafs@mellanox.com>
To: olivier.matz@6wind.com, stephen@networkplumber.org,
	yskoh@mellanox.com, nelio.laranjeiro@6wind.com,
	adrien.mazarguil@6wind.com
Cc: dev@dpdk.org, Shachar Beiser <shacharbe@mellanox.com>
Subject: [dpdk-dev] [PATCH v2 1/2] lib/net: add IPv6 header fields macros
Date: Tue, 16 Jan 2018 11:17:51 +0200	[thread overview]
Message-ID: <f2e8a0362a0b96380183e2c6638f92f5d44b597d.1516093981.git.shahafs@mellanox.com> (raw)
In-Reply-To: <07cfe9a606927b551c3530a2b910ef88547d9118.1514705637.git.shacharbe@mellanox.com>

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

  parent reply	other threads:[~2018-01-16  9:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-31  7:34 [dpdk-dev] [PATCH " 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 ` Shahaf Shuler [this message]
2018-01-17 16:53   ` [dpdk-dev] [PATCH v2 " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f2e8a0362a0b96380183e2c6638f92f5d44b597d.1516093981.git.shahafs@mellanox.com \
    --to=shahafs@mellanox.com \
    --cc=adrien.mazarguil@6wind.com \
    --cc=dev@dpdk.org \
    --cc=nelio.laranjeiro@6wind.com \
    --cc=olivier.matz@6wind.com \
    --cc=shacharbe@mellanox.com \
    --cc=stephen@networkplumber.org \
    --cc=yskoh@mellanox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).