summaryrefslogtreecommitdiff
path: root/lib/librte_mbuf
diff options
context:
space:
mode:
authorJerin Jacob <jerin.jacob@caviumnetworks.com>2018-10-09 14:18:09 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-11 18:53:49 +0200
commitdf694a05bffffc1eb1a96112af5cd24da61daeff (patch)
tree7e064f295551f36f46773b1d1f65a6917cfc728b /lib/librte_mbuf
parentec7f71577febe59323cd29e9a086348ff3c791cb (diff)
downloaddpdk-df694a05bffffc1eb1a96112af5cd24da61daeff.zip
dpdk-df694a05bffffc1eb1a96112af5cd24da61daeff.tar.gz
dpdk-df694a05bffffc1eb1a96112af5cd24da61daeff.tar.xz
ethdev: add Tx offload outer UDP checksum definition
Introduced DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags and PKT_TX_OUTER_UDP_CKSUM mbuf ol_flags to enable Tx outer UDP checksum offload. To use hardware Tx outer UDP checksum offload, the user needs to, - enable following in mbuf: a) fill outer_l2_len and outer_l3_len in mbuf b) set the PKT_TX_OUTER_UDP_CKSUM flag c) set the flag PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 - configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flags in slow path 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.c1
-rw-r--r--lib/librte_mbuf/rte_mbuf.h14
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index e7fdfdf..5297beb 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -448,6 +448,7 @@ rte_get_tx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
"PKT_TX_TUNNEL_NONE" },
{ PKT_TX_MACSEC, PKT_TX_MACSEC, NULL },
{ PKT_TX_SEC_OFFLOAD, PKT_TX_SEC_OFFLOAD, NULL },
+ { PKT_TX_OUTER_UDP_CKSUM, PKT_TX_OUTER_UDP_CKSUM, NULL },
};
const char *name;
unsigned int i;
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index f2e657d..61f0f1c 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -202,6 +202,17 @@ extern "C" {
/* add new TX flags here */
/**
+ * Outer UDP checksum offload flag. This flag is used for enabling
+ * outer UDP checksum in PMD. To use outer UDP checksum, the user needs to
+ * 1) Enable the following in mbuff,
+ * a) Fill outer_l2_len and outer_l3_len in mbuf.
+ * b) Set the PKT_TX_OUTER_UDP_CKSUM flag.
+ * c) Set the PKT_TX_OUTER_IPV4 or PKT_TX_OUTER_IPV6 flag.
+ * 2) Configure DEV_TX_OFFLOAD_OUTER_UDP_CKSUM offload flag.
+ */
+#define PKT_TX_OUTER_UDP_CKSUM (1ULL << 41)
+
+/**
* UDP Fragmentation Offload flag. This flag is used for enabling UDP
* fragmentation in SW or in HW. When use UFO, mbuf->tso_segsz is used
* to store the MSS of UDP fragments.
@@ -368,7 +379,8 @@ extern "C" {
PKT_TX_TUNNEL_MASK | \
PKT_TX_MACSEC | \
PKT_TX_SEC_OFFLOAD | \
- PKT_TX_UDP_SEG)
+ PKT_TX_UDP_SEG | \
+ PKT_TX_OUTER_UDP_CKSUM)
/**
* Mbuf having an external buffer attached. shinfo in mbuf must be filled.