examples/l3fwd: force CRC stripping for i40evf
PATCH 1/1 examples/l3fwd: force CRC stripping for i40evf
Commit 1bbcc5d21129 ("i40evf: report error for unsupported CRC stripping config") broke l3fwd, since it was forcing that CRC was kept. Now, if i40evf is running, CRC stripping will be enabled.
--- examples/l3fwd/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
examples/l3fwd/main.c +8 -1
@@ -906,6 +906,14 @@ main(int argc, char **argv) n_tx_queue =MAX_TX_QUEUE_PER_PORT ;printf ("Creating queues: nb_rxq=%d nb_txq=%u... " , nb_rx_queue, (unsigned )n_tx_queue ); +rte_eth_dev_info_get (portid, &dev_info); +if (dev_info.driver_name && +strcmp (dev_info.driver_name,"net_i40e_vf" ) ==0 ) { +/* i40evf require that CRC stripping is enabled. */ + port_conf.rxmode.hw_strip_crc =1 ; + }else { + port_conf.rxmode.hw_strip_crc =0 ; + } ret =rte_eth_dev_configure (portid, nb_rx_queue, (uint16_t )n_tx_queue, &port_conf);if (ret <0 )
@@ -946,7 +954,6 @@ main(int argc, char **argv)printf ("txq=%u,%d,%d " , lcore_id, queueid, socketid);fflush (stdout); -rte_eth_dev_info_get (portid, &dev_info); txconf = &dev_info.default_txconf;if (port_conf.rxmode.jumbo_frame) txconf->txq_flags =0 ;
Signature · 1 line
2.9.3
- Apply patch to v16.11-rc3
- Compile: Pass
- Host OS: VMware ESXi 6.0
- VM OS: Fedora 20
- GCC: 4.8.3
Tested with this patch, l3fwd sample can work with i40e VF with Fedora VM using VMware as the host.
-----Original Message-----
From: Topel, Bjorn
Sent: Wednesday, November 9, 2016 4:24 PM
To: [email protected]
Cc: Xu, Qian Q <[email protected]>; Yao, Lei A <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]; Topel, Bjorn <[email protected]>
Subject: [PATCH] examples/l3fwd: force CRC stripping for i40evf
Commit 1bbcc5d21129 ("i40evf: report error for unsupported CRC stripping config") broke l3fwd, since it was forcing that CRC was kept. Now, if i40evf is running, CRC stripping will be enabled.
--- examples/l3fwd/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
examples/l3fwd/main.c +8 -1
@@ -906,6 +906,14 @@ main(int argc, char **argv) n_tx_queue =MAX_TX_QUEUE_PER_PORT ;printf ("Creating queues: nb_rxq=%d nb_txq=%u... " , nb_rx_queue, (unsigned )n_tx_queue ); +rte_eth_dev_info_get (portid, &dev_info); +if (dev_info.driver_name && +strcmp (dev_info.driver_name,"net_i40e_vf" ) ==0 ) { +/* i40evf require that CRC stripping is enabled. */ + port_conf.rxmode.hw_strip_crc =1 ; + }else { + port_conf.rxmode.hw_strip_crc =0 ; + } ret =rte_eth_dev_configure (portid, nb_rx_queue, (uint16_t )n_tx_queue, &port_conf);if (ret <0 )
@@ -946,7 +954,6 @@ main(int argc, char **argv)printf ("txq=%u,%d,%d " , lcore_id, queueid, socketid);fflush (stdout); -rte_eth_dev_info_get (portid, &dev_info); txconf = &dev_info.default_txconf;if (port_conf.rxmode.jumbo_frame) txconf->txq_flags =0 ;
--
2.9.3
2016-11-09 09:23, Björn Töpel:
Quoted 3 lines
Commit
1bbcc5d21129("i40evf: report error for unsupported CRC stripping config") broke l3fwd, since it was forcing that CRC was kept. Now, if i40evf is running, CRC stripping will be enabled.
[...]
examples/l3fwd/main.c main(int argc, char **argv) · line 916
Quoted 8 lines
examples/l3fwd/main.c +8
-0+rte_eth_dev_info_get (portid, &dev_info); +if (dev_info.driver_name && +strcmp (dev_info.driver_name,"net_i40e_vf" ) ==0 ) { +/* i40evf require that CRC stripping is enabled. */ + port_conf.rxmode.hw_strip_crc =1 ; + }else { + port_conf.rxmode.hw_strip_crc =0 ; + }
Thanks for raising the issue.
It is completely defeating the generic ethdev API. We must not have different behaviours depending of the driver. Why it cannot be fixed in the driver?
Quoted 3 lines
Thanks for raising the issue. It is completely defeating the generic ethdev API. We must not have different behaviours depending of the driver. Why it cannot be fixed in the driver?
I should probably refer to the thread, where the concern was raised:
http://dpdk.org/ml/archives/dev/2016-July/044555.html
So, the issue is that i40evf *only support* CRC stripping for some setups (i40e Linux driver for PF, i40evf DPDK driver VF).
The l3fwd application disables CRC stripping for all ports, which leads to i40evf_dev_configure() failure -- which from my POV is correct. Mis-configuring a port shouldn't be allowed.
I'm open to suggestions here. What would be a better way to solve this? Maybe just adding a command-line option to the l3fwd application is a better way around?
Björn
Hi,
Quoted 16 lines
Commit
1bbcc5d21129("i40evf: report error for unsupported CRC stripping config") broke l3fwd, since it was forcing that CRC was kept. Now, if i40evf is running, CRC stripping will be enabled.Signed-off-by Björn Töpel <[email protected]>--- examples/l3fwd/main.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)examples/l3fwd/main.c +0
-0@@ -906,6 +906,14 @@ main(int argc, char **argv) n_tx_queue =MAX_TX_QUEUE_PER_PORT ;
examples/l3fwd/main.c main(int argc, char **argv) · line 916
Quoted 10 lines
examples/l3fwd/main.c +8
-0printf ("Creating queues: nb_rxq=%d nb_txq=%u... " , nb_rx_queue, (unsigned )n_tx_queue ); +rte_eth_dev_info_get (portid, &dev_info); +if (dev_info.driver_name && +strcmp (dev_info.driver_name,"net_i40e_vf" ) ==0 ) { +/* i40evf require that CRC stripping is enabled. */ + port_conf.rxmode.hw_strip_crc =1 ; + }else { + port_conf.rxmode.hw_strip_crc =0 ; + }
That's a common problem across Intel VF devices.
Bothe igb and ixgbe overcomes that problem just by forcing ' rxmode.hw_strip_crc = 1;' at PMD itself:
static intixgbevf_dev_configure(struct rte_eth_dev *dev)
{
...
/*
* VF has no ability to enable/disable HW CRC
* Keep the persistent behavior the same as Host PF */
#ifndef RTE_LIBRTE_IXGBE_PF_DISABLE_STRIP_CRC
if (!conf->rxmode.hw_strip_crc) {
PMD_INIT_LOG(NOTICE, "VF can't disable HW CRC Strip");
conf->rxmode.hw_strip_crc = 1;
}
#else
if (conf->rxmode.hw_strip_crc) {
PMD_INIT_LOG(NOTICE, "VF can't enable HW CRC Strip");
conf->rxmode.hw_strip_crc = 0;
}#endif
Wonder, can't i40e VF do the same?
BTW, all other examples would experience same problem too, right? Konstantin
Quoted 13 lines
examples/l3fwd/main.c +0
-2ret =rte_eth_dev_configure (portid, nb_rx_queue, (uint16_t )n_tx_queue, &port_conf);if (ret <0 )@@ -946,7 +954,6 @@ main(int argc, char **argv)printf ("txq=%u,%d,%d " , lcore_id, queueid, socketid);fflush (stdout); -rte_eth_dev_info_get (portid, &dev_info); txconf = &dev_info.default_txconf;if (port_conf.rxmode.jumbo_frame) txconf->txq_flags =0 ; --2.9.3
Adding Helin to the conversation.
Quoted 3 lines
That's a common problem across Intel VF devices. Bothe igb and ixgbe overcomes that problem just by forcing ' rxmode.hw_strip_crc = 1;' at PMD itself:
[...]
Quoted 1 line
Wonder, can't i40e VF do the same?
Right, however, and this (silent failure) approach was rejected by the maintainers. Please, refer to this thread:
http://dpdk.org/ml/archives/dev/2016-April/037523.html
Quoted 1 line
BTW, all other examples would experience same problem too, right?
Correct, so the broader question would be "what is the correct behavior for an example application, when a port configuration isn't supported by the hardware?".
My stand, FWIW, is that igb and ixgbe should have the same semantics as i40e currently has, i.e. return an error to the user if the port is mis-configured, NOT changing the setting behind the users back.
Björn
2016-11-09 11:05, Björn Töpel:
Quoted 9 lines
Quoted 1 line
BTW, all other examples would experience same problem too, right?
Correct, so the broader question would be "what is the correct behavior for an example application, when a port configuration isn't supported by the hardware?".
My stand, FWIW, is that igb and ixgbe should have the same semantics as i40e currently has, i.e. return an error to the user if the port is mis-configured, NOT changing the setting behind the users back.
Yes it sounds sane.
Quoted 19 lines
Adding Helin to the conversation.
Quoted 3 lines
That's a common problem across Intel VF devices. Bothe igb and ixgbe overcomes that problem just by forcing ' rxmode.hw_strip_crc = 1;' at PMD itself:
[...]
Quoted 1 line
Wonder, can't i40e VF do the same?
Right, however, and this (silent failure) approach was rejected by the maintainers. Please, refer to this thread:
http://dpdk.org/ml/archives/dev/2016-April/037523.htmlQuoted 1 line
BTW, all other examples would experience same problem too, right?
Quoted 8 lines
Correct, so the broader question would be "what is the correct behavior for an example application, when a port configuration isn't supported by the hardware?".
My stand, FWIW, is that igb and ixgbe should have the same semantics as i40e currently has, i.e. return an error to the user if the port is mis-configured, NOT changing the setting behind the users back.
Fine by me, but then it means that the fix haw to include changes for all apps plus ixgbe and igb PMDs, correct? :)
Konstantin
Quoted 4 lines
Quoted 4 lines
Correct, so the broader question would be "what is the correct behavior for an example application, when a port configuration isn't supported by the hardware?".
Quoted 8 lines
Quoted 5 lines
My stand, FWIW, is that igb and ixgbe should have the same semantics as i40e currently has, i.e. return an error to the user if the port is mis-configured, NOT changing the setting behind the users back.
Fine by me, but then it means that the fix haw to include changes for all apps plus ixgbe and igb PMDs, correct? :)
Ugh. Correct, I guess. :-)
As for ixgbe and igb - they need a patch changing from silent ignore to explicit error. Regarding the apps, I guess all the apps that rely on that disabling CRC stripping always work, need some work. Or should all the example applications have CRC stripping *enabled* by default? I'd assume that all DPDK supported NICs has support for CRC stripping and I guess this is the rational for having it on by default for Intel VFs.
In general, for the example applications, if an application relies on a property for a port, that the hardware doesn't support -- what would be the desired behavior? Or is it implied that the example applications only use a common, minimal set of features that are know to be supported by all DPDK supported hardware?
Isn't it perfectly valid that some example applications wont run for all hardware?
Finally, why doesn't l3fwd have the CRC stripped?
Björn
Quoted 23 lines
-----Original Message-----
From: Topel, Bjorn
Sent: Wednesday, November 9, 2016 11:28 AM
To: Ananyev, Konstantin <[email protected]>; [email protected]; Zhang, Helin <[email protected]>
Cc: Xu, Qian Q <[email protected]>; Yao, Lei A <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evfQuoted 4 lines
Quoted 4 lines
Correct, so the broader question would be "what is the correct behavior for an example application, when a port configuration isn't supported by the hardware?".
Quoted 8 lines
Quoted 5 lines
My stand, FWIW, is that igb and ixgbe should have the same semantics as i40e currently has, i.e. return an error to the user if the port is mis-configured, NOT changing the setting behind the users back.
Fine by me, but then it means that the fix haw to include changes for all apps plus ixgbe and igb PMDs, correct? :)
Quoted 7 lines
Ugh. Correct, I guess. :-)
As for ixgbe and igb - they need a patch changing from silent ignore to explicit error. Regarding the apps, I guess all the apps that rely on that disabling CRC stripping always work, need some work. Or should all the example applications have CRC stripping *enabled* by default? I'd assume that all DPDK supported NICs has support for CRC stripping
From the sources, it seems that only nfp doesn't support HW CRC stripping. In fact, as I can see some non-Intel PMDs just ignore hw_stip_crc value and assume that CRC strip is always on.
Quoted 9 lines
and I
guess this is the rational for having it on by default for Intel VFs.In general, for the example applications, if an application relies on a property for a port, that the hardware doesn't support -- what would be the desired behavior? Or is it implied that the example applications only use a common, minimal set of features that are know to be supported by all DPDK supported hardware?
Quoted 4 lines
Isn't it perfectly valid that some example applications wont run for all hardware?
Finally, why doesn't l3fwd have the CRC stripped?
I don’t know any good reason for that for l3fwd or any other sample app. I think it is just a 'historical' reason.
Konstantin
Quoted 3 lines
Björn
Quoted 37 lines
-----Original Message-----
From: Topel, Bjorn
Sent: Wednesday, November 9, 2016 7:28 PM
To: Ananyev, Konstantin; [email protected]; Zhang, Helin
Cc: Xu, Qian Q; Yao, Lei A; Wu, Jingjing; [email protected]
Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evfQuoted 11 lines
Quoted 8 lines
Correct, so the broader question would be "what is the correct behavior for an example application, when a port configuration isn't supported by the hardware?".
My stand, FWIW, is that igb and ixgbe should have the same semantics as i40e currently has, i.e. return an error to the user if the port is mis-configured, NOT changing the setting behind the users back.
Fine by me, but then it means that the fix haw to include changes for all apps plus ixgbe and igb PMDs, correct? :)
Ugh. Correct, I guess. :-)
As for ixgbe and igb - they need a patch changing from silent ignore to explicit error. Regarding the apps, I guess all the apps that rely on that disabling CRC stripping always work, need some work. Or should all the example applications have CRC stripping *enabled* by default? I'd assume that all DPDK supported NICs has support for CRC stripping and I guess this is the rational for having it on by default for Intel VFs.
In general, for the example applications, if an application relies on a property for a port, that the hardware doesn't support -- what would be the desired behavior? Or is it implied that the example applications only use a common, minimal set of features that are know to be supported by all DPDK supported hardware?
Quoted 7 lines
Isn't it perfectly valid that some example applications wont run for all hardware?
Finally, why doesn't l3fwd have the CRC stripped?
Björn
Yes, i40e driver changed a little bit on that according to the review comments during implementation, comparing to igb and ixgbe.
I'd suggest to re-invesitgate if we can do the similar thing in igb and ixgbe driver. Any critical issue now? Or just an improvement comments?
Thanks,
Helin
Quoted 4 lines · Björn/Konstantin
Quoted 1 line
Finally, why doesn't l3fwd have the CRC stripped?
I don’t know any good reason for that for l3fwd or any other sample app. I think it is just a 'historical' reason.
Ok! Then I'd suggest changing the l3fwd default to actually *strip* CRC instead of not doing it. Lei, any comments?
Quoted 4 lines · Helin
Yes, i40e driver changed a little bit on that according to the review comments during implementation, comparing to igb and ixgbe. I'd suggest to re-invesitgate if we can do the similar thing in igb and ixgbe driver.
Good. Let's do that!
Quoted 1 line
Any critical issue now? Or just an improvement comments?
Not from my perspective. The issue is that Lei needs some kind of work-around for l3fwd with i40evf, so I'll let Lei comment on how critical it is.
Björn
I'm testing some DPDK sample under VMware. During the testing work, I find l3fwd+ ixgbe vf can work ,but L3fwd + i40evf can't work. So I reported this issue to Bjorn. From my perspective, if can add new parameter in l3fwd sample like what have already don’t in testpmd "----crc-strip enable" is a better way to resolve this issue.
Lei
-----Original Message-----
From: Topel, Bjorn
Sent: Wednesday, November 9, 2016 9:10 PM
To: Zhang, Helin <[email protected]>; Ananyev, Konstantin <[email protected]>; [email protected]
Cc: Xu, Qian Q <[email protected]>; Yao, Lei A <[email protected]>; Wu, Jingjing <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd: force CRC stripping for i40evf
Quoted 4 lines · Björn/Konstantin
Quoted 1 line
Finally, why doesn't l3fwd have the CRC stripped?
I don’t know any good reason for that for l3fwd or any other sample app. I think it is just a 'historical' reason.
Ok! Then I'd suggest changing the l3fwd default to actually *strip* CRC instead of not doing it. Lei, any comments?
Quoted 4 lines · Helin
Yes, i40e driver changed a little bit on that according to the review comments during implementation, comparing to igb and ixgbe. I'd suggest to re-invesitgate if we can do the similar thing in igb and ixgbe driver.
Good. Let's do that!
Quoted 1 line
Any critical issue now? Or just an improvement comments?
Not from my perspective. The issue is that Lei needs some kind of work-around for l3fwd with i40evf, so I'll let Lei comment on how critical it is.
Björn
Quoted 5 lines · Lei
I'm testing some DPDK sample under VMware. During the testing work, I find l3fwd+ ixgbe vf can work ,but L3fwd + i40evf can't work. So I reported this issue to Bjorn. From my perspective, if can add new parameter in l3fwd sample like what have already don’t in testpmd "----crc-strip enable" is a better way to resolve this issue.
(Please don't top-post.)
As discussed in the thread, it might be better to just change the default in l3fwd from .hw_strip_crc = 0 to 1.
I'll be looking into changing igbvf and ixgbevf to match the semantics of i40evf.
Björn
2016-11-10 07:17, Björn Töpel:
Quoted 5 lines
As discussed in the thread, it might be better to just change the default in l3fwd from .hw_strip_crc = 0 to 1.
I'll be looking into changing igbvf and ixgbevf to match the semantics of i40evf.
Just to make it sure, you mean returning an error in the driver when a configuration cannot be applied, right?
Quoted 2 lines · Thomas
Just to make it sure, you mean returning an error in the driver when a configuration cannot be applied, right?
Yes, as in 1bbcc5d21129 ("i40evf: report error for unsupported CRC stripping config"), where -EINVAL is returned.
Björn