DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] examples: ipv4, udp and tcp checksum offload warning
@ 2021-09-13 12:09 usamanadeem321
  2021-09-13 15:11 ` Stephen Hemminger
  2021-09-14 18:08 ` [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available Usama Nadeem
  0 siblings, 2 replies; 19+ messages in thread
From: usamanadeem321 @ 2021-09-13 12:09 UTC (permalink / raw)
  To: thomas; +Cc: dev, usamanadeem321

Closes gracefully if IPV4 checksum offload is not available.
Gives warning if UDP or TCP checksum offloads are not available.

Signed-off-by: usamanadeem321 <usama.nadeem@emumba.com>
---
 examples/l3fwd/main.c | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 00ac267af1..81e605700e 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -123,7 +123,7 @@ static struct rte_eth_conf port_conf = {
 		.mq_mode = ETH_MQ_RX_RSS,
 		.max_rx_pkt_len = RTE_ETHER_MAX_LEN,
 		.split_hdr_size = 0,
-		.offloads = DEV_RX_OFFLOAD_CHECKSUM,
+
 	},
 	.rx_adv_conf = {
 		.rss_conf = {
@@ -1039,6 +1039,30 @@ l3fwd_poll_resource_setup(void)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM)
+			local_port_conf.rxmode.offloads |=
+			 DEV_RX_OFFLOAD_IPV4_CKSUM;
+		else {
+			rte_exit(EXIT_FAILURE,
+				"IPV4 Checksum offload not available. (port %u) ",
+				portid);
+		}
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM)
+			local_port_conf.rxmode.offloads |=
+			DEV_RX_OFFLOAD_UDP_CKSUM;
+
+		else
+			printf("WARNING: UDP Checksum offload not available.\n");
+
+		if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM)
+			local_port_conf.rxmode.offloads |=
+			DEV_RX_OFFLOAD_TCP_CKSUM;
+
+		else
+			printf("WARNING: TCP Checksum offload not available.\n");
+
+
 		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 			dev_info.flow_type_rss_offloads;
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-06-30 21:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13 12:09 [dpdk-dev] [PATCH] examples: ipv4, udp and tcp checksum offload warning usamanadeem321
2021-09-13 15:11 ` Stephen Hemminger
2021-09-14 18:08 ` [dpdk-dev] [PATCH v2] Warns if IPv4, UDP or TCP checksum offload not available Usama Nadeem
2021-09-14 18:28   ` Stephen Hemminger
2021-09-14 22:22   ` Ananyev, Konstantin
2021-09-14 23:44     ` Stephen Hemminger
2021-09-15  8:43       ` Ananyev, Konstantin
2021-10-08 15:51   ` [dpdk-dev] [PATCH v3] ipv4 and udp/tcp cksum verification through software Usama Nadeem
2021-10-14 18:43     ` [dpdk-dev] [PATCH v4] examples/l3fwd: " Usama Nadeem
2021-11-01  8:33       ` Usama Nadeem
2021-11-04 11:11       ` Walsh, Conor
2021-11-04 16:19         ` Medvedkin, Vladimir
2021-11-16  5:20           ` Usama Nadeem
2021-11-16  5:21         ` Usama Nadeem
2023-06-30 21:50         ` Stephen Hemminger
2021-11-04 13:19       ` Ananyev, Konstantin
2021-11-16  5:18         ` Usama Nadeem
2022-01-14  9:30         ` Usama Nadeem
2022-01-14 12:05           ` Ananyev, Konstantin

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).