diff mbox series

[v3,2/5] linux-gen: dpdk: enable per pktio RX IP/UDP/TCP checksum offload

Message ID 1503388810-6999-3-git-send-email-odpbot@yandex.ru
State Superseded
Headers show
Series [v3,1/5] linux-gen: dpdk: retrieve offload capabilities | expand

Commit Message

Github ODP bot Aug. 22, 2017, 8 a.m. UTC
From: Bogdan Pricope <bogdan.pricope@linaro.org>


Signed-off-by: Bogdan Pricope <bogdan.pricope@linaro.org>

---
/** Email created from pull request 124 (bogdanPricope:dpdk_hw_csum_pr)
 ** https://github.com/Linaro/odp/pull/124
 ** Patch: https://github.com/Linaro/odp/pull/124.patch
 ** Base sha: aecb3c7a442b426761f1e6f43308a1e9ea709ef3
 ** Merge commit sha: 23658e7f5acf9d3621ec7a8f617db98a26ee1bda
 **/
 platform/linux-generic/pktio/dpdk.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c
index a4884b91..693c0c97 100644
--- a/platform/linux-generic/pktio/dpdk.c
+++ b/platform/linux-generic/pktio/dpdk.c
@@ -666,6 +666,7 @@  static int dpdk_setup_port(pktio_entry_t *pktio_entry)
 	int ret;
 	pkt_dpdk_t *pkt_dpdk = &pktio_entry->s.pkt_dpdk;
 	struct rte_eth_rss_conf rss_conf;
+	uint16_t hw_ip_checksum = 0;
 
 	/* Always set some hash functions to enable DPDK RSS hash calculation */
 	if (pkt_dpdk->hash.all_bits == 0) {
@@ -675,12 +676,17 @@  static int dpdk_setup_port(pktio_entry_t *pktio_entry)
 		rss_conf_to_hash_proto(&rss_conf, &pkt_dpdk->hash);
 	}
 
+	if (pktio_entry->s.config.pktin.bit.ipv4_chksum ||
+	    pktio_entry->s.config.pktin.bit.udp_chksum ||
+	    pktio_entry->s.config.pktin.bit.tcp_chksum)
+		hw_ip_checksum = 1;
+
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
 			.mq_mode = ETH_MQ_RX_RSS,
 			.split_hdr_size = 0,
 			.header_split   = 0,
-			.hw_ip_checksum = 0,
+			.hw_ip_checksum = hw_ip_checksum,
 			.hw_vlan_filter = 0,
 			.hw_strip_crc   = 0,
 			.enable_scatter = 0,