summaryrefslogtreecommitdiff
path: root/lib/librte_mbuf
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2018-10-09 14:18:04 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-11 18:53:49 +0200
commitec7f71577febe59323cd29e9a086348ff3c791cb (patch)
tree056beeb510bf113915a82723b614f3a794f75db0 /lib/librte_mbuf
parent86123c2dfb94416b4fb17e07bf31d32172308623 (diff)
downloaddpdk-ec7f71577febe59323cd29e9a086348ff3c791cb.zip
dpdk-ec7f71577febe59323cd29e9a086348ff3c791cb.tar.gz
dpdk-ec7f71577febe59323cd29e9a086348ff3c791cb.tar.xz
ethdev: add Rx offload outer UDP checksum definition
Introduced DEV_RX_OFFLOAD_OUTER_UDP_CKSUM Rx offload flag and PKT_RX_OUTER_L4_CKSUM_* mbuf ol_flags to detect outer UDP checksum status. - To use hardware Rx outer UDP checksum offload, the user needs to configure DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slowpath. - Driver updates checksum status in mbuf ol_flag as PKT_RX_OUTER_L4_CKSUM_* flags. Signed-off-by: Jerin Jacob <jerin.jacob@caviumnetworks.com> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'lib/librte_mbuf')
-rw-r--r--lib/librte_mbuf/rte_mbuf.c12
-rw-r--r--lib/librte_mbuf/rte_mbuf.h19
2 files changed, 31 insertions, 0 deletions
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 05a5a17..e7fdfdf 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -302,6 +302,11 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
+ case PKT_RX_OUTER_L4_CKSUM_BAD: return "PKT_RX_OUTER_L4_CKSUM_BAD";
+ case PKT_RX_OUTER_L4_CKSUM_GOOD: return "PKT_RX_OUTER_L4_CKSUM_GOOD";
+ case PKT_RX_OUTER_L4_CKSUM_INVALID:
+ return "PKT_RX_OUTER_L4_CKSUM_INVALID";
+
default: return NULL;
}
}
@@ -340,6 +345,13 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
+ { PKT_RX_OUTER_L4_CKSUM_BAD, PKT_RX_OUTER_L4_CKSUM_MASK, NULL },
+ { PKT_RX_OUTER_L4_CKSUM_GOOD, PKT_RX_OUTER_L4_CKSUM_MASK,
+ NULL },
+ { PKT_RX_OUTER_L4_CKSUM_INVALID, PKT_RX_OUTER_L4_CKSUM_MASK,
+ NULL },
+ { PKT_RX_OUTER_L4_CKSUM_UNKNOWN, PKT_RX_OUTER_L4_CKSUM_MASK,
+ "PKT_RX_OUTER_L4_CKSUM_UNKNOWN" },
};
const char *name;
unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index 50a7378..f2e657d 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -178,6 +178,25 @@ extern "C" {
*/
#define PKT_RX_QINQ (1ULL << 20)
+/**
+ * Mask of bits used to determine the status of outer RX L4 checksum.
+ * - PKT_RX_OUTER_L4_CKSUM_UNKNOWN: no info about the outer RX L4 checksum
+ * - PKT_RX_OUTER_L4_CKSUM_BAD: the outer L4 checksum in the packet is wrong
+ * - PKT_RX_OUTER_L4_CKSUM_GOOD: the outer L4 checksum in the packet is valid
+ * - PKT_RX_OUTER_L4_CKSUM_INVALID: invalid outer L4 checksum state.
+ *
+ * The detection of PKT_RX_OUTER_L4_CKSUM_GOOD shall be based on the given
+ * HW capability, At minimum, the PMD should support
+ * PKT_RX_OUTER_L4_CKSUM_UNKNOWN and PKT_RX_OUTER_L4_CKSUM_BAD states
+ * if the DEV_RX_OFFLOAD_OUTER_UDP_CKSUM offload is available.
+ */
+#define PKT_RX_OUTER_L4_CKSUM_MASK ((1ULL << 21) | (1ULL << 22))
+
+#define PKT_RX_OUTER_L4_CKSUM_UNKNOWN 0
+#define PKT_RX_OUTER_L4_CKSUM_BAD (1ULL << 21)
+#define PKT_RX_OUTER_L4_CKSUM_GOOD (1ULL << 22)
+#define PKT_RX_OUTER_L4_CKSUM_INVALID ((1ULL << 21) | (1ULL << 22))
+
/* add new RX flags here */
/* add new TX flags here */