DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] examples/l3fwd: fix jumbo packet drop issue
@ 2021-07-27  9:25 rohit.raj
  2021-08-11 10:19 ` Singh, Aman Deep
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: rohit.raj @ 2021-07-27  9:25 UTC (permalink / raw)
  Cc: dev, nipun.gupta, hemant.agrawal, Rohit Raj, Sachin Saxena,
	Vanshika Shukla

From: Rohit Raj <rohit.raj@nxp.com>

l3fwd uses mbufs with 2KB data size. If we enable jumbo packets, it is
not able to store packets with size greater than 2KB, hence these
packets are dropped.

This patch fixes this issue by enabling scatter for jumbo packet, if
it is supported by NIC.

If scatter is not supported by NIC and max jumbo packet length is
greater than default mbuf data size, then application exits with
proper error message.

Fixes: f68aad7904f ("examples/l3fwd: update")

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Sachin Saxena <sachin.saxena@nxp.com>
Signed-off-by: Vanshika Shukla <vanshika.shukla@nxp.com>
---
 examples/l3fwd/main.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 4cb800aa15..6aaaa8ecb5 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -1035,6 +1035,20 @@ l3fwd_poll_resource_setup(void)
 				"Error during getting device (port %u) info: %s\n",
 				portid, strerror(-ret));
 
+		/* Enable Receive side SCATTER, if supported by NIC,
+		 * when jumbo packet is enabled.
+		 */
+		if (local_port_conf.rxmode.offloads &
+				DEV_RX_OFFLOAD_JUMBO_FRAME){
+			if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SCATTER)
+				local_port_conf.rxmode.offloads |=
+						DEV_RX_OFFLOAD_SCATTER;
+			else if (local_port_conf.rxmode.max_rx_pkt_len >
+					RTE_MBUF_DEFAULT_DATAROOM)
+				rte_exit(EXIT_FAILURE,
+					"Max packet length greater than default MBUF size\n");
+		}
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
2.17.1


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

end of thread, other threads:[~2021-11-16  6:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-27  9:25 [dpdk-dev] [PATCH v1] examples/l3fwd: fix jumbo packet drop issue rohit.raj
2021-08-11 10:19 ` Singh, Aman Deep
2021-08-11 11:30 ` Ferruh Yigit
2021-11-12  3:16 ` [PATCH v2] " rohit.raj
2021-11-12  9:40   ` Ananyev, Konstantin
2021-11-16  6:08     ` [EXT] " Rohit Raj

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