Thread (39 messages) 39 messages, 4 authors, 2017-02-09
STALE3407d

[PATCH v2 1/5] mbuf: fix bitmask of Tx offload flags

From: Jingjing Wu <hidden>
Date: 2017-02-04 03:38:17
Subsystem: library code, the rest · Maintainers: Andrew Morton, Linus Torvalds

Some Tx offload flags are missed in bitmask of all supported packet
Tx offload features flags.
This patch fixes it by redefining PKT_TX_OFFLOAD_MASK.
PKT_RX_OFFLOAD_MASK is also defined in this patch.

CC: olivier.matz@6wind.com
Fixes: 4fb7e803eb1a ("ethdev: add Tx preparation")
Signed-off-by: Jingjing Wu <redacted>
---
 lib/librte_mbuf/rte_mbuf.h | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 0d01167..018a604 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -177,10 +177,11 @@ extern "C" {
  */
 #define PKT_RX_LRO           (1ULL << 16)
 
-/* add new RX flags here */
-
-/* add new TX flags here */
+/* add new RX flags here, and update __PKT_RX_NEXT */
+#define __PKT_RX_NEXT        (1ULL << 17)
 
+/* add new TX flags here, and update __PKT_TX_NEXT */
+#define __PKT_TX_NEXT        (1ULL << 43)
 /**
  * Offload the MACsec. This flag must be set by the application to enable
  * this offload feature for a packet to be transmitted.
@@ -283,6 +284,12 @@ extern "C" {
 #define PKT_TX_OUTER_IPV4   (1ULL << 59)
 
 /**
+ * Bitmask of all supported packet Rx offload features flags,
+ * which can be set for packet.
+ **/
+#define PKT_RX_OFFLOAD_MASK (__PKT_RX_NEXT - 1)
+
+/**
  * Packet outer header is IPv6. This flag must be set when using any
  * outer offload feature (L4 checksum) to tell the NIC that the outer
  * header of the tunneled packet is an IPv6 packet.
@@ -293,14 +300,7 @@ extern "C" {
  * Bitmask of all supported packet Tx offload features flags,
  * which can be set for packet.
  */
-#define PKT_TX_OFFLOAD_MASK (    \
-		PKT_TX_IP_CKSUM |        \
-		PKT_TX_L4_MASK |         \
-		PKT_TX_OUTER_IP_CKSUM |  \
-		PKT_TX_TCP_SEG |         \
-		PKT_TX_QINQ_PKT |        \
-		PKT_TX_VLAN_PKT |        \
-		PKT_TX_TUNNEL_MASK)
+#define PKT_TX_OFFLOAD_MASK ((~(__PKT_TX_NEXT - 1)) & 0x1fffffffffffffff)
 
 #define __RESERVED           (1ULL << 61) /**< reserved for future mbuf use */
 
-- 
2.4.11
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help