examples/ip_reassembly: enable scatter mode for Mellanox PMDs
PATCH 1/1 examples/ip_reassembly: enable scatter mode for Mellanox PMDs
Simple change to enable scatter for Mellanox CX4/CX5 PMDs to run this example
--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)
examples/ip_reassembly/main.c +3 -0
@@ -1109,6 +1109,9 @@ main(int argc, char **argv) port_conf.rx_adv_conf.rss_conf.rss_hf, local_port_conf.rx_adv_conf.rss_conf.rss_hf); } +/* Mellanox PMDs needs scatter mode to be explicitly enabled */ +if (!strcmp (dev_info.driver_name,"net_mlx5" )) + local_port_conf.rxmode.offloads |=DEV_RX_OFFLOAD_SCATTER ; ret =rte_eth_dev_configure (portid,1 , (uint16_t )n_tx_queue, &local_port_conf);
Signature · 1 line
2.17.1
Quoted 18 lines · Thinh Tran,
Simple change to enable scatter for Mellanox CX4/CX5 PMDs to run this example
Signed-off-by Thinh Tran <[email protected]>--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)examples/ip_reassembly/main.c +1
-0@@ -1109,6 +1109,9 @@ main(int argc, char **argv) port_conf.rx_adv_conf.rss_conf.rss_hf, local_port_conf.rx_adv_conf.rss_conf.rss_hf); } +/* Mellanox PMDs needs scatter mode to be explicitly
Quoted 3 lines
enabled */
+ if (!strcmp(dev_info.driver_name, "net_mlx5"))
No driver specific code in generic application. Please fix the driver instead.
+ local_port_conf.rxmode.offloads |=
Quoted 9 lines
DEV_RX_OFFLOAD_SCATTER;ret = rte_eth_dev_configure(portid, 1,
(uint16_t)n_tx_queue,&local_port_conf);--
2.17.1
Hi Jerin,
would it be possible to add a command option such as '--enable-scatter' like testpmd does? Thanks,
Thinh Tran
Quoted 39 lines · Jerin Jacob
On Mon, 18 Nov, 2019, 11:49 pm Thinh Tran, <[email protected] <mailto:[email protected]>> wrote:
Simple change to enable scatter for Mellanox CX4/CX5 PMDs to run this example
Signed-off-by Thinh Tran <[email protected]<mailto:[email protected]>>
---
examples/ip_reassembly/main.c | 3 +++
1 file changed, 3 insertions(+)diff --git
a/examples/ip_reassembly/main.cb/examples/ip_reassembly/main.c
indexd59e6d02f..f881b89d1100644
---a/examples/ip_reassembly/main.c
+++b/examples/ip_reassembly/main.c
@@ -1109,6 +1109,9 @@main(int argc, char **argv)
port_conf.rx_adv_conf.rss_conf.rss_hf,local_port_conf.rx_adv_conf.rss_conf.rss_hf);
}
+ /* Mellanox PMDs needs scatter mode to be explicitly enabled */
+ if (!strcmp(dev_info.driver_name, "net_mlx5"))No driver specific code in generic application. Please fix the driver instead.
+ local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SCATTER; ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue, &local_port_conf); -- 2.17.1
Quoted 13 lines · On Mon, 18 Nov 2019 12:18:33 -0600 Thinh Tran <[email protected]>…
Simple change to enable scatter for Mellanox CX4/CX5 PMDs to run this example
Signed-off-by Thinh Tran <[email protected]>--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)examples/ip_reassembly/main.c +0
-0
examples/ip_reassembly/main.c main(int argc, char **argv) · line 1114
Quoted 6 lines
examples/ip_reassembly/main.c +3
-0@@ -1109,6 +1109,9 @@ main(int argc, char **argv) port_conf.rx_adv_conf.rss_conf.rss_hf, local_port_conf.rx_adv_conf.rss_conf.rss_hf); } +/* Mellanox PMDs needs scatter mode to be explicitly enabled */ +if (!strcmp (dev_info.driver_name,"net_mlx5" )) + local_port_conf.rxmode.offloads |=DEV_RX_OFFLOAD_SCATTER ;
This is a bad, bad precedent.
Either fix MLX driver or enable it for all PMD's.
Forcing applications to do workarounds indicates a poor design abstraction.
Quoted 29 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Stephen Hemminger
Sent: Tuesday, November 19, 2019 3:15
To: Thinh Tran <[email protected]>
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH] examples/ip_reassembly: enable scatter mode for Mellanox PMDsQuoted 13 lines · On Mon, 18 Nov 2019 12:18:33 -0600 Thinh Tran <[email protected]>…
Simple change to enable scatter for Mellanox CX4/CX5 PMDs to run this example
Signed-off-by Thinh Tran <[email protected]>--- examples/ip_reassembly/main.c | 3 +++ 1 file changed, 3 insertions(+)(quoted diff) +0
-0
b/examples/ip_reassembly/main.cindexd59e6d02f..f881b89d1100644examples/ip_reassembly/main.c main(int argc, char **argv) · line 1112
Quoted 4 lines
examples/ip_reassembly/main.c +1
-0@@ -1109,6 +1109,9 @@ main(int argc, char **argv) port_conf.rx_adv_conf.rss_conf.rss_hf, local_port_conf.rx_adv_conf.rss_conf.rss_hf); } +/* Mellanox PMDs needs scatter mode to be explicitly enabled */
Quoted 7 lines
examples/ip_reassembly/main.c main(int argc, char **argv) · line 1114
Quoted 2 lines
examples/ip_reassembly/main.c +2
-0+if (!strcmp (dev_info.driver_name,"net_mlx5" )) + local_port_conf.rxmode.offloads |=
DEV_RX_OFFLOAD_SCATTER;This is a bad, bad precedent.
Either fix MLX driver or enable it for all PMD's.
Forcing applications to do workarounds indicates a poor design abstraction.
+1
What about checking whether PMD supports scattering offload and enable these one?