* [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
@ 2018-01-23 8:11 Moti Haimovsky
2018-01-25 1:11 ` Lu, Wenzhuo
2018-01-29 11:33 ` [dpdk-dev] [PATCH v2] " Moti Haimovsky
0 siblings, 2 replies; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-23 8:11 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx offload configuration from
testpmd.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
app/test-pmd/testpmd.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..a082352 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = 0,
.ignore_offload_bitfield = 1,
};
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-23 8:11 [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default Moti Haimovsky
@ 2018-01-25 1:11 ` Lu, Wenzhuo
2018-01-25 9:04 ` Thomas Monjalon
2018-01-29 11:33 ` [dpdk-dev] [PATCH v2] " Moti Haimovsky
1 sibling, 1 reply; 21+ messages in thread
From: Lu, Wenzhuo @ 2018-01-25 1:11 UTC (permalink / raw)
To: Moti Haimovsky, thomas; +Cc: dev
Hi Moti,
> -----Original Message-----
> From: Moti Haimovsky [mailto:motih@mellanox.com]
> Sent: Tuesday, January 23, 2018 4:11 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; thomas@monjalon.net
> Cc: dev@dpdk.org; Moti Haimovsky <motih@mellanox.com>
> Subject: [PATCH] app/testpmd: do not enable Rx offloads by default
>
> Removed the hardcoded preconfigured Rx offload configuration from
> testpmd.
> Testers who wish to use these offloads will now have to explicitly write them
> in the command-line when running testpmd.
>
> Motivation:
> Some PMDs such at the mlx4 may not implement all the offloads.
> After the offload API rework assuming no offload is enabled by default,
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying to
> enable a not supported offload is clearly an error which will cause
> configuration failing.
>
> Considering that testpmd is an application to test the PMD, it should not fail
> on a configuration which was not explicitly requested.
> The behavior of this test application is then turned to an opt-in model.
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
> app/test-pmd/testpmd.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> 5dc8cca..a082352 100644
> --- a/app/test-pmd/testpmd.c
> +++ b/app/test-pmd/testpmd.c
> @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> */
> struct rte_eth_rxmode rx_mode = {
> .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> length. */
> - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> - DEV_RX_OFFLOAD_VLAN_STRIP |
> - DEV_RX_OFFLOAD_CRC_STRIP),
> + .offloads = 0,
Change the default behavior may trigger other problems. I think TX offload could be a good reference. Get the capability and check what's supported first, then ignore the not supported functions with printing a warning but not block anything...
> .ignore_offload_bitfield = 1,
> };
>
> --
> 1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-25 1:11 ` Lu, Wenzhuo
@ 2018-01-25 9:04 ` Thomas Monjalon
2018-01-25 16:01 ` Stephen Hemminger
2018-01-26 7:30 ` Lu, Wenzhuo
0 siblings, 2 replies; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-25 9:04 UTC (permalink / raw)
To: Lu, Wenzhuo; +Cc: Moti Haimovsky, dev, shahafs, ferruh.yigit
25/01/2018 02:11, Lu, Wenzhuo:
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > */
> > struct rte_eth_rxmode rx_mode = {
> > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> > length. */
> > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > - DEV_RX_OFFLOAD_CRC_STRIP),
> > + .offloads = 0,
>
> Change the default behavior may trigger other problems. I think TX offload could be a good reference. Get the capability and check what's supported first, then ignore the not supported functions with printing a warning but not block anything...
I agree that we should check the capabilities before requesting an offload.
But I disagree on another point: we should not enable an offload if the
user did not request it explicitly. It makes things unclear.
This is a testing tool, it should be close to the ethdev API behavior.
Why these offload flags are silently enabled?
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-25 9:04 ` Thomas Monjalon
@ 2018-01-25 16:01 ` Stephen Hemminger
2018-01-26 7:31 ` Lu, Wenzhuo
2018-01-26 7:30 ` Lu, Wenzhuo
1 sibling, 1 reply; 21+ messages in thread
From: Stephen Hemminger @ 2018-01-25 16:01 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Lu, Wenzhuo, Moti Haimovsky, dev, shahafs, ferruh.yigit
On Thu, 25 Jan 2018 10:04:11 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:
> 25/01/2018 02:11, Lu, Wenzhuo:
> > > --- a/app/test-pmd/testpmd.c
> > > +++ b/app/test-pmd/testpmd.c
> > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > */
> > > struct rte_eth_rxmode rx_mode = {
> > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> > > length. */
> > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > + .offloads = 0,
> >
> > Change the default behavior may trigger other problems. I think TX offload could be a good reference. Get the capability and check what's supported first, then ignore the not supported functions with printing a warning but not block anything...
>
> I agree that we should check the capabilities before requesting an offload.
> But I disagree on another point: we should not enable an offload if the
> user did not request it explicitly. It makes things unclear.
> This is a testing tool, it should be close to the ethdev API behavior.
>
> Why these offload flags are silently enabled?
Also all virtual devices ignore CRC strip.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-25 9:04 ` Thomas Monjalon
2018-01-25 16:01 ` Stephen Hemminger
@ 2018-01-26 7:30 ` Lu, Wenzhuo
2018-01-26 7:48 ` Thomas Monjalon
1 sibling, 1 reply; 21+ messages in thread
From: Lu, Wenzhuo @ 2018-01-26 7:30 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Moti Haimovsky, dev, shahafs, Yigit, Ferruh
Hi Thomas,
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Thursday, January 25, 2018 5:04 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: Moti Haimovsky <motih@mellanox.com>; dev@dpdk.org;
> shahafs@mellanox.com; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [PATCH] app/testpmd: do not enable Rx offloads by default
>
> 25/01/2018 02:11, Lu, Wenzhuo:
> > > --- a/app/test-pmd/testpmd.c
> > > +++ b/app/test-pmd/testpmd.c
> > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > */
> > > struct rte_eth_rxmode rx_mode = {
> > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> > > length. */
> > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > + .offloads = 0,
> >
> > Change the default behavior may trigger other problems. I think TX offload
> could be a good reference. Get the capability and check what's supported
> first, then ignore the not supported functions with printing a warning but
> not block anything...
>
> I agree that we should check the capabilities before requesting an offload.
> But I disagree on another point: we should not enable an offload if the user
> did not request it explicitly. It makes things unclear.
> This is a testing tool, it should be close to the ethdev API behavior.
>
> Why these offload flags are silently enabled?
I don't think it's silently. It's a global configuration. In this case, testpmd is the user, it does request it explicitly. If it's not so explicit, maybe we can consider moving all the configuration to a specific configure file.
Talking about why it's enabled by default. Hard to figure out the history. To my opinion, the original designer wants to simulate the common case.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-25 16:01 ` Stephen Hemminger
@ 2018-01-26 7:31 ` Lu, Wenzhuo
2018-01-26 7:49 ` Thomas Monjalon
0 siblings, 1 reply; 21+ messages in thread
From: Lu, Wenzhuo @ 2018-01-26 7:31 UTC (permalink / raw)
To: Stephen Hemminger, Thomas Monjalon
Cc: Moti Haimovsky, dev, shahafs, Yigit, Ferruh
Hi Stephen,
> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, January 26, 2018 12:02 AM
> To: Thomas Monjalon <thomas@monjalon.net>
> Cc: Lu, Wenzhuo <wenzhuo.lu@intel.com>; Moti Haimovsky
> <motih@mellanox.com>; dev@dpdk.org; shahafs@mellanox.com; Yigit,
> Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by
> default
>
> On Thu, 25 Jan 2018 10:04:11 +0100
> Thomas Monjalon <thomas@monjalon.net> wrote:
>
> > 25/01/2018 02:11, Lu, Wenzhuo:
> > > > --- a/app/test-pmd/testpmd.c
> > > > +++ b/app/test-pmd/testpmd.c
> > > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > > */
> > > > struct rte_eth_rxmode rx_mode = {
> > > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> > > > length. */
> > > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > > + .offloads = 0,
> > >
> > > Change the default behavior may trigger other problems. I think TX
> offload could be a good reference. Get the capability and check what's
> supported first, then ignore the not supported functions with printing a
> warning but not block anything...
> >
> > I agree that we should check the capabilities before requesting an offload.
> > But I disagree on another point: we should not enable an offload if
> > the user did not request it explicitly. It makes things unclear.
> > This is a testing tool, it should be close to the ethdev API behavior.
> >
> > Why these offload flags are silently enabled?
>
> Also all virtual devices ignore CRC strip.
Look like it's the case the device ignores the flag if it doesn't have the capability.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-26 7:30 ` Lu, Wenzhuo
@ 2018-01-26 7:48 ` Thomas Monjalon
2018-01-26 8:06 ` Lu, Wenzhuo
0 siblings, 1 reply; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-26 7:48 UTC (permalink / raw)
To: Lu, Wenzhuo; +Cc: Moti Haimovsky, dev, shahafs, Yigit, Ferruh
26/01/2018 08:30, Lu, Wenzhuo:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 25/01/2018 02:11, Lu, Wenzhuo:
> > > > --- a/app/test-pmd/testpmd.c
> > > > +++ b/app/test-pmd/testpmd.c
> > > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > > */
> > > > struct rte_eth_rxmode rx_mode = {
> > > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> > > > length. */
> > > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > > + .offloads = 0,
> > >
> > > Change the default behavior may trigger other problems. I think TX offload
> > could be a good reference. Get the capability and check what's supported
> > first, then ignore the not supported functions with printing a warning but
> > not block anything...
> >
> > I agree that we should check the capabilities before requesting an offload.
> > But I disagree on another point: we should not enable an offload if the user
> > did not request it explicitly. It makes things unclear.
> > This is a testing tool, it should be close to the ethdev API behavior.
> >
> > Why these offload flags are silently enabled?
>
> I don't think it's silently. It's a global configuration. In this case, testpmd is the user, it does request it explicitly. If it's not so explicit, maybe we can consider moving all the configuration to a specific configure file.
> Talking about why it's enabled by default. Hard to figure out the history. To my opinion, the original designer wants to simulate the common case.
Please do not justify a design mistake by history.
This is a test tool, so we don't care about the common case.
A test tool should not try to guess the best configuration.
Only the user should decide the configuration to apply,
and the default should be empty, as the API is.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-26 7:31 ` Lu, Wenzhuo
@ 2018-01-26 7:49 ` Thomas Monjalon
0 siblings, 0 replies; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-26 7:49 UTC (permalink / raw)
To: Lu, Wenzhuo
Cc: Stephen Hemminger, Moti Haimovsky, dev, shahafs, Yigit, Ferruh
26/01/2018 08:31, Lu, Wenzhuo:
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > On Thu, 25 Jan 2018 10:04:11 +0100
> > Thomas Monjalon <thomas@monjalon.net> wrote:
> > > 25/01/2018 02:11, Lu, Wenzhuo:
> > > > > --- a/app/test-pmd/testpmd.c
> > > > > +++ b/app/test-pmd/testpmd.c
> > > > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > > > */
> > > > > struct rte_eth_rxmode rx_mode = {
> > > > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame
> > > > > length. */
> > > > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > > > + .offloads = 0,
> > > >
> > > > Change the default behavior may trigger other problems. I think TX
> > offload could be a good reference. Get the capability and check what's
> > supported first, then ignore the not supported functions with printing a
> > warning but not block anything...
> > >
> > > I agree that we should check the capabilities before requesting an offload.
> > > But I disagree on another point: we should not enable an offload if
> > > the user did not request it explicitly. It makes things unclear.
> > > This is a testing tool, it should be close to the ethdev API behavior.
> > >
> > > Why these offload flags are silently enabled?
> >
> > Also all virtual devices ignore CRC strip.
> Look like it's the case the device ignores the flag if it doesn't have the capability.
It is a wrong behaviour!
If a configuration cannot be applied, it must be an error.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-26 7:48 ` Thomas Monjalon
@ 2018-01-26 8:06 ` Lu, Wenzhuo
2018-01-26 8:35 ` Thomas Monjalon
0 siblings, 1 reply; 21+ messages in thread
From: Lu, Wenzhuo @ 2018-01-26 8:06 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: Moti Haimovsky, dev, shahafs, Yigit, Ferruh
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Friday, January 26, 2018 3:48 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>
> Cc: Moti Haimovsky <motih@mellanox.com>; dev@dpdk.org;
> shahafs@mellanox.com; Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: Re: [PATCH] app/testpmd: do not enable Rx offloads by default
>
> 26/01/2018 08:30, Lu, Wenzhuo:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > 25/01/2018 02:11, Lu, Wenzhuo:
> > > > > --- a/app/test-pmd/testpmd.c
> > > > > +++ b/app/test-pmd/testpmd.c
> > > > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > > > */
> > > > > struct rte_eth_rxmode rx_mode = {
> > > > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum
> frame
> > > > > length. */
> > > > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > > > + .offloads = 0,
> > > >
> > > > Change the default behavior may trigger other problems. I think TX
> > > > offload
> > > could be a good reference. Get the capability and check what's
> > > supported first, then ignore the not supported functions with
> > > printing a warning but not block anything...
> > >
> > > I agree that we should check the capabilities before requesting an offload.
> > > But I disagree on another point: we should not enable an offload if
> > > the user did not request it explicitly. It makes things unclear.
> > > This is a testing tool, it should be close to the ethdev API behavior.
> > >
> > > Why these offload flags are silently enabled?
> >
> > I don't think it's silently. It's a global configuration. In this case, testpmd is
> the user, it does request it explicitly. If it's not so explicit, maybe we can
> consider moving all the configuration to a specific configure file.
> > Talking about why it's enabled by default. Hard to figure out the history.
> To my opinion, the original designer wants to simulate the common case.
>
> Please do not justify a design mistake by history.
>
> This is a test tool, so we don't care about the common case.
> A test tool should not try to guess the best configuration.
> Only the user should decide the configuration to apply, and the default
> should be empty, as the API is.
I see the divergence. You think testpmd is a tool, so it should be white paper as the tool users may suppose it is.
I think testpmd is an example to let the APP developers know how to use DPDK. So any pre-configuration is acceptable.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-26 8:06 ` Lu, Wenzhuo
@ 2018-01-26 8:35 ` Thomas Monjalon
2018-01-27 18:14 ` Shahaf Shuler
0 siblings, 1 reply; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-26 8:35 UTC (permalink / raw)
To: Lu, Wenzhuo; +Cc: Moti Haimovsky, dev, shahafs, Yigit, Ferruh
26/01/2018 09:06, Lu, Wenzhuo:
> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > 26/01/2018 08:30, Lu, Wenzhuo:
> > > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > > 25/01/2018 02:11, Lu, Wenzhuo:
> > > > > > --- a/app/test-pmd/testpmd.c
> > > > > > +++ b/app/test-pmd/testpmd.c
> > > > > > @@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
> > > > > > */
> > > > > > struct rte_eth_rxmode rx_mode = {
> > > > > > .max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum
> > frame
> > > > > > length. */
> > > > > > - .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
> > > > > > - DEV_RX_OFFLOAD_VLAN_STRIP |
> > > > > > - DEV_RX_OFFLOAD_CRC_STRIP),
> > > > > > + .offloads = 0,
> > > > >
> > > > > Change the default behavior may trigger other problems. I think TX
> > > > > offload
> > > > could be a good reference. Get the capability and check what's
> > > > supported first, then ignore the not supported functions with
> > > > printing a warning but not block anything...
> > > >
> > > > I agree that we should check the capabilities before requesting an offload.
> > > > But I disagree on another point: we should not enable an offload if
> > > > the user did not request it explicitly. It makes things unclear.
> > > > This is a testing tool, it should be close to the ethdev API behavior.
> > > >
> > > > Why these offload flags are silently enabled?
> > >
> > > I don't think it's silently. It's a global configuration. In this case, testpmd is
> > the user, it does request it explicitly. If it's not so explicit, maybe we can
> > consider moving all the configuration to a specific configure file.
> > > Talking about why it's enabled by default. Hard to figure out the history.
> > To my opinion, the original designer wants to simulate the common case.
> >
> > Please do not justify a design mistake by history.
> >
> > This is a test tool, so we don't care about the common case.
> > A test tool should not try to guess the best configuration.
> > Only the user should decide the configuration to apply, and the default
> > should be empty, as the API is.
>
> I see the divergence. You think testpmd is a tool, so it should be white paper as the tool users may suppose it is.
> I think testpmd is an example to let the APP developers know how to use DPDK. So any pre-configuration is acceptable.
Ah ah ah :)
No
Examples are in examples/ directory.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default
2018-01-26 8:35 ` Thomas Monjalon
@ 2018-01-27 18:14 ` Shahaf Shuler
0 siblings, 0 replies; 21+ messages in thread
From: Shahaf Shuler @ 2018-01-27 18:14 UTC (permalink / raw)
To: Thomas Monjalon, Lu, Wenzhuo; +Cc: Mordechay Haimovsky, dev, Yigit, Ferruh
Friday, January 26, 2018 10:36 AM, Thomas Monjalon:
> 26/01/2018 09:06, Lu, Wenzhuo:
> > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > 26/01/2018 08:30, Lu, Wenzhuo:
> > > > From: Thomas Monjalon [mailto:thomas@monjalon.net]
> > > > > 25/01/2018 02:11, Lu, Wenzhuo:
> > > > > Why these offload flags are silently enabled?
> > > >
> > > > I don't think it's silently. It's a global configuration. In this
> > > > case, testpmd is
> > > the user, it does request it explicitly. If it's not so explicit,
> > > maybe we can consider moving all the configuration to a specific
> configure file.
> > > > Talking about why it's enabled by default. Hard to figure out the history.
> > > To my opinion, the original designer wants to simulate the common case.
> > >
> > > Please do not justify a design mistake by history.
> > >
> > > This is a test tool, so we don't care about the common case.
> > > A test tool should not try to guess the best configuration.
> > > Only the user should decide the configuration to apply, and the
> > > default should be empty, as the API is.
> >
> > I see the divergence. You think testpmd is a tool, so it should be white
> paper as the tool users may suppose it is.
> > I think testpmd is an example to let the APP developers know how to use
> DPDK. So any pre-configuration is acceptable.
If so, then what this patch shows that it is not such a good example to application writers.
Application should not set offloads that are not supported by the PMD. Pre-configuration is OK, but adjustment is a must according to the PMD caps.
I think that many PMD have a wrong behavior due to it. They are forced to silently drop un-supported offload configuration (to enable testpmd to run on top of them).
This will end up, for example, in application which expects to have the VLAN tag in the mbuf (because the configuration passed successfully), while in fact it will be always in the packet headers.
I didn't change it on my series because I wanted to convert the application "as is" from the old to the new offloads API, however I do think a change is needed here.
>
> Ah ah ah :)
> No
> Examples are in examples/ directory.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [dpdk-dev] [PATCH v2] app/testpmd: do not enable Rx offloads by default
2018-01-23 8:11 [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default Moti Haimovsky
2018-01-25 1:11 ` Lu, Wenzhuo
@ 2018-01-29 11:33 ` Moti Haimovsky
2018-01-29 11:52 ` Thomas Monjalon
2018-01-30 8:44 ` [dpdk-dev] [PATCH v3] " Moti Haimovsky
1 sibling, 2 replies; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-29 11:33 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx offload configuration from
testpmd and changed the Rx offload command line parameters from
disable to enable.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
app/test-pmd/parameters.c | 30 +++++++++++++++---------------
app/test-pmd/testpmd.c | 4 +---
doc/guides/nics/thunderx.rst | 2 +-
doc/guides/testpmd_app_ug/run_app.rst | 20 ++++++++++----------
4 files changed, 27 insertions(+), 29 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..134fd99 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -580,15 +580,15 @@
#ifdef RTE_LIBRTE_BITRATE
{ "bitrate-stats", 1, 0, 0 },
#endif
- { "disable-crc-strip", 0, 0, 0 },
+ { "enable-crc-strip", 0, 0, 0 },
{ "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
- { "disable-hw-vlan", 0, 0, 0 },
- { "disable-hw-vlan-filter", 0, 0, 0 },
- { "disable-hw-vlan-strip", 0, 0, 0 },
- { "disable-hw-vlan-extend", 0, 0, 0 },
+ { "enable-hw-vlan", 0, 0, 0 },
+ { "enable-hw-vlan-filter", 0, 0, 0 },
+ { "enable-hw-vlan-strip", 0, 0, 0 },
+ { "enable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -875,8 +875,8 @@
" must be >= 0\n", n);
}
#endif
- if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
+ if (!strcmp(lgopts[opt_idx].name, "enable-crc-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
rx_offloads |= DEV_RX_OFFLOAD_TCP_LRO;
if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
@@ -886,20 +886,20 @@
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+ if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-filter"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ "enable-hw-vlan-filter"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ "enable-hw-vlan-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-extend"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ "enable-hw-vlan-extend"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..a082352 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = 0,
.ignore_offload_bitfield = 1,
};
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
.. code-block:: console
./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
- -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+ -- -i --no-flush-rx \
--port-topology=loop
...
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..076c121 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -299,9 +299,9 @@ The commandline options are:
In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
If the drop-queue does not exist, the packet is dropped. The default value is N=127.
-* ``--disable-crc-strip``
+* ``--enable-crc-strip``
- Disable hardware CRC stripping.
+ Enable hardware CRC stripping.
* ``--enable-lro``
@@ -315,21 +315,21 @@ The commandline options are:
Enable scatter (multi-segment) RX.
-* ``--disable-hw-vlan``
+* ``--enable-hw-vlan``
- Disable hardware VLAN.
+ Enable hardware VLAN.
-* ``--disable-hw-vlan-filter``
+* ``--enable-hw-vlan-filter``
- Disable hardware VLAN filter.
+ Enable hardware VLAN filter.
-* ``--disable-hw-vlan-strip``
+* ``--enable-hw-vlan-strip``
- Disable hardware VLAN strip.
+ Enable hardware VLAN strip.
-* ``--disable-hw-vlan-extend``
+* ``--enable-hw-vlan-extend``
- Disable hardware VLAN extend.
+ Enable hardware VLAN extend.
* ``--enable-drop-en``
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH v2] app/testpmd: do not enable Rx offloads by default
2018-01-29 11:33 ` [dpdk-dev] [PATCH v2] " Moti Haimovsky
@ 2018-01-29 11:52 ` Thomas Monjalon
2018-01-30 8:44 ` [dpdk-dev] [PATCH v3] " Moti Haimovsky
1 sibling, 0 replies; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-29 11:52 UTC (permalink / raw)
To: wenzhuo.lu, ferruh.yigit; +Cc: Moti Haimovsky, dev
29/01/2018 12:33, Moti Haimovsky:
> Removed the hardcoded preconfigured Rx offload configuration from
> testpmd and changed the Rx offload command line parameters from
> disable to enable.
> Testers who wish to use these offloads will now have to explicitly
> write them in the command-line when running testpmd.
>
> Motivation:
> Some PMDs such at the mlx4 may not implement all the offloads.
> After the offload API rework assuming no offload is enabled by default,
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
> to enable a not supported offload is clearly an error which will cause
> configuration failing.
>
> Considering that testpmd is an application to test the PMD, it should
> not fail on a configuration which was not explicitly requested.
> The behavior of this test application is then turned to an opt-in
> model.
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
This is a very good step in the right direction
because testpmd is a tool app.
So testpmd must not enable anything without explicit user request.
The next step will be to check the offload capabilities
before enabling them.
If a requested capability is not available, it should return
either an error, or a warning.
I want to merge this first patch in 18.02-rc2,
because some drivers (lacking some capabilities) cannot be tested
without explicitly disabling the forced offloads.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [dpdk-dev] [PATCH v3] app/testpmd: do not enable Rx offloads by default
2018-01-29 11:33 ` [dpdk-dev] [PATCH v2] " Moti Haimovsky
2018-01-29 11:52 ` Thomas Monjalon
@ 2018-01-30 8:44 ` Moti Haimovsky
2018-01-30 9:00 ` [dpdk-dev] [PATCH v4] " Moti Haimovsky
1 sibling, 1 reply; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-30 8:44 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx offload configuration from
testpmd and changed the Rx offload command line parameters from
disable to enable.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
V3:
Updated documentation to reflect the change in the command-line parameters.
Updated testpmd help to also reflect the change in the command-line parameters.
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
app/test-pmd/parameters.c | 40 +++++++++++-----------
app/test-pmd/testpmd.c | 4 +--
doc/guides/contributing/documentation.rst | 2 +-
doc/guides/howto/lm_virtio_vhost_user.rst | 2 +-
doc/guides/howto/pvp_reference_benchmark.rst | 4 +--
.../howto/virtio_user_as_exceptional_path.rst | 4 +--
doc/guides/nics/mrvl.rst | 4 +--
doc/guides/nics/octeontx.rst | 4 +--
doc/guides/nics/thunderx.rst | 2 +-
doc/guides/nics/virtio.rst | 5 +--
doc/guides/testpmd_app_ug/run_app.rst | 20 +++++------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 18 +++++-----
12 files changed, 54 insertions(+), 55 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..a93e1f0 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -129,14 +129,14 @@
printf(" --latencystats=N: enable latency and jitter statistcs "
"monitoring on forwarding lcore id N.\n");
#endif
- printf(" --disable-crc-strip: disable CRC stripping by hardware.\n");
+ printf(" --enable-crc-strip: enable CRC stripping by hardware.\n");
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
- printf(" --disable-hw-vlan: disable hardware vlan.\n");
- printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
- printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
- printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");
+ printf(" --enable-hw-vlan: enable hardware vlan.\n");
+ printf(" --enable-hw-vlan-filter: enable hardware vlan filter.\n");
+ printf(" --enable-hw-vlan-strip: enable hardware vlan strip.\n");
+ printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
printf(" --port-topology=N: set port topology (N: paired (default) or "
@@ -580,15 +580,15 @@
#ifdef RTE_LIBRTE_BITRATE
{ "bitrate-stats", 1, 0, 0 },
#endif
- { "disable-crc-strip", 0, 0, 0 },
+ { "enable-crc-strip", 0, 0, 0 },
{ "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
- { "disable-hw-vlan", 0, 0, 0 },
- { "disable-hw-vlan-filter", 0, 0, 0 },
- { "disable-hw-vlan-strip", 0, 0, 0 },
- { "disable-hw-vlan-extend", 0, 0, 0 },
+ { "enable-hw-vlan", 0, 0, 0 },
+ { "enable-hw-vlan-filter", 0, 0, 0 },
+ { "enable-hw-vlan-strip", 0, 0, 0 },
+ { "enable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -875,8 +875,8 @@
" must be >= 0\n", n);
}
#endif
- if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
+ if (!strcmp(lgopts[opt_idx].name, "enable-crc-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
rx_offloads |= DEV_RX_OFFLOAD_TCP_LRO;
if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
@@ -886,20 +886,20 @@
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+ if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-filter"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ "enable-hw-vlan-filter"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ "enable-hw-vlan-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-extend"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ "enable-hw-vlan-extend"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..a082352 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = 0,
.ignore_offload_bitfield = 1,
};
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 170dacd..82f2e1b 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -294,7 +294,7 @@ Line Length
testpmd -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 --txd=1024
diff --git a/doc/guides/howto/lm_virtio_vhost_user.rst b/doc/guides/howto/lm_virtio_vhost_user.rst
index 9402ed8..b4aa1c9 100644
--- a/doc/guides/howto/lm_virtio_vhost_user.rst
+++ b/doc/guides/howto/lm_virtio_vhost_user.rst
@@ -466,4 +466,4 @@ run_testpmd_in_vm.sh
# test system has 8 cpus (0-7), use cpus 2-7 for VM
/root/dpdk/x86_64-default-linuxapp-gcc/app/testpmd \
- -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i --disable-hw-vlan-filter
+ -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i
diff --git a/doc/guides/howto/pvp_reference_benchmark.rst b/doc/guides/howto/pvp_reference_benchmark.rst
index 228b4a2..67fa232 100644
--- a/doc/guides/howto/pvp_reference_benchmark.rst
+++ b/doc/guides/howto/pvp_reference_benchmark.rst
@@ -158,7 +158,7 @@ Testpmd launch
$RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
--vdev 'net_vhost0,iface=/tmp/vhost-user1' \
--vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
- --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1 \
+ --portmask=f -i --rxq=1 --txq=1 \
--nb-cores=4 --forward-mode=io
With this command, isolated CPUs 2 to 5 will be used as lcores for PMD threads.
@@ -375,7 +375,7 @@ Start testpmd:
$RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
--proc-type auto --file-prefix pg -- \
--portmask=3 --forward-mode=macswap --port-topology=chained \
- --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
+ --disable-rss -i --rxq=1 --txq=1 \
--rxd=256 --txd=256 --nb-cores=2 --auto-start
Results template
diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst b/doc/guides/howto/virtio_user_as_exceptional_path.rst
index 3f99fe8..393f002 100644
--- a/doc/guides/howto/virtio_user_as_exceptional_path.rst
+++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst
@@ -84,7 +84,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --rxd=1024 --txd=1024
This command runs testpmd with two ports, one physical NIC to communicate
@@ -113,7 +113,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
--txd=1024
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index 77b2d66..b7f3292 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -215,7 +215,7 @@ Usage example
.. code-block:: console
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
- -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
+ -c 7 -- -i -a --rxq=2
Building DPDK
@@ -272,4 +272,4 @@ In order to run testpmd example application following command can be used:
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
--burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2 --nb-cores=2 \
- -i -a --disable-hw-vlan-strip --rss-udp
+ -i -a --rss-udp
diff --git a/doc/guides/nics/octeontx.rst b/doc/guides/nics/octeontx.rst
index 212fe34..8e2a2b7 100644
--- a/doc/guides/nics/octeontx.rst
+++ b/doc/guides/nics/octeontx.rst
@@ -88,8 +88,8 @@ following ``make`` command:
--mbuf-pool-ops-name="octeontx_fpavf" \
--vdev='event_octeontx' \
--vdev='eth_octeontx,nr_port=2' \
- -- --rxq=1 --txq=1 --nb-core=2 --total-num-mbufs=16384 \
- --disable-hw-vlan-filter -i
+ -- --rxq=1 --txq=1 --nb-core=2 \
+ --total-num-mbufs=16384 -i
.....
EAL: Detected 24 lcore(s)
EAL: Probing VFIO support...
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
.. code-block:: console
./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
- -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+ -- -i --no-flush-rx \
--port-topology=loop
...
diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index af82f86..e686d46 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -78,8 +78,9 @@ In this release, the virtio PMD driver provides the basic functionality of packe
by default. Tx queue size is still hard-coded to be 256.
* Features of mac/vlan filter are supported, negotiation with vhost/backend are needed to support them.
- When backend can't support vlan filter, virtio app on guest should disable vlan filter to make sure
- the virtio port is configured correctly. E.g. specify '--disable-hw-vlan' in testpmd command line.
+ When backend can't support vlan filter, virtio app on guest should not enable vlan filter in order
+ to make sure the virtio port is configured correctly. E.g. do not specify '--enable-hw-vlan' in testpmd
+ command line.
* "RTE_PKTMBUF_HEADROOM" should be defined
no less than "sizeof(struct virtio_net_hdr_mrg_rxbuf)", which is 12 bytes when mergeable or
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..076c121 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -299,9 +299,9 @@ The commandline options are:
In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
If the drop-queue does not exist, the packet is dropped. The default value is N=127.
-* ``--disable-crc-strip``
+* ``--enable-crc-strip``
- Disable hardware CRC stripping.
+ Enable hardware CRC stripping.
* ``--enable-lro``
@@ -315,21 +315,21 @@ The commandline options are:
Enable scatter (multi-segment) RX.
-* ``--disable-hw-vlan``
+* ``--enable-hw-vlan``
- Disable hardware VLAN.
+ Enable hardware VLAN.
-* ``--disable-hw-vlan-filter``
+* ``--enable-hw-vlan-filter``
- Disable hardware VLAN filter.
+ Enable hardware VLAN filter.
-* ``--disable-hw-vlan-strip``
+* ``--enable-hw-vlan-strip``
- Disable hardware VLAN strip.
+ Enable hardware VLAN strip.
-* ``--disable-hw-vlan-extend``
+* ``--enable-hw-vlan-extend``
- Disable hardware VLAN extend.
+ Enable hardware VLAN extend.
* ``--enable-drop-en``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index d8c9ef0..4c11ec5 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1673,9 +1673,9 @@ Set hardware CRC stripping on or off for all ports::
testpmd> port config all crc-strip (on|off)
-CRC stripping is on by default.
+CRC stripping is off by default.
-The ``off`` option is equivalent to the ``--disable-crc-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-crc-strip`` command-line option.
port config - scatter
~~~~~~~~~~~~~~~~~~~~~~~
@@ -1706,9 +1706,9 @@ Set hardware VLAN on or off for all ports::
testpmd> port config all hw-vlan (on|off)
-Hardware VLAN is on by default.
+Hardware VLAN is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option.
port config - VLAN filter
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1717,9 +1717,9 @@ Set hardware VLAN filter on or off for all ports::
testpmd> port config all hw-vlan-filter (on|off)
-Hardware VLAN filter is on by default.
+Hardware VLAN filter is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-filter`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option.
port config - VLAN strip
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1728,9 +1728,9 @@ Set hardware VLAN strip on or off for all ports::
testpmd> port config all hw-vlan-strip (on|off)
-Hardware VLAN strip is on by default.
+Hardware VLAN strip is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option.
port config - VLAN extend
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1741,7 +1741,7 @@ Set hardware VLAN extend on or off for all ports::
Hardware VLAN extend is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-extend`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option.
port config - Drop Packets
~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* [dpdk-dev] [PATCH v4] app/testpmd: do not enable Rx offloads by default
2018-01-30 8:44 ` [dpdk-dev] [PATCH v3] " Moti Haimovsky
@ 2018-01-30 9:00 ` Moti Haimovsky
2018-01-31 3:16 ` Lu, Wenzhuo
2018-01-31 11:55 ` [dpdk-dev] [PATCH v5] " Moti Haimovsky
0 siblings, 2 replies; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-30 9:00 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx offload configuration from
testpmd and changed the Rx offload command line parameters from
disable to enable.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
V4:
Fixed checkpatches warnings.
V3:
Updated documentation to reflect the change in the command-line parameters.
Updated testpmd help to also reflect the change in the command-line parameters.
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
app/test-pmd/parameters.c | 40 +++++++++++-----------
app/test-pmd/testpmd.c | 4 +--
doc/guides/contributing/documentation.rst | 2 +-
doc/guides/howto/lm_virtio_vhost_user.rst | 2 +-
doc/guides/howto/pvp_reference_benchmark.rst | 4 +--
.../howto/virtio_user_as_exceptional_path.rst | 4 +--
doc/guides/nics/mrvl.rst | 4 +--
doc/guides/nics/octeontx.rst | 4 +--
doc/guides/nics/thunderx.rst | 2 +-
doc/guides/nics/virtio.rst | 5 +--
doc/guides/testpmd_app_ug/run_app.rst | 20 +++++------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 18 +++++-----
12 files changed, 54 insertions(+), 55 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..a93e1f0 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -129,14 +129,14 @@
printf(" --latencystats=N: enable latency and jitter statistcs "
"monitoring on forwarding lcore id N.\n");
#endif
- printf(" --disable-crc-strip: disable CRC stripping by hardware.\n");
+ printf(" --enable-crc-strip: enable CRC stripping by hardware.\n");
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
- printf(" --disable-hw-vlan: disable hardware vlan.\n");
- printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
- printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
- printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");
+ printf(" --enable-hw-vlan: enable hardware vlan.\n");
+ printf(" --enable-hw-vlan-filter: enable hardware vlan filter.\n");
+ printf(" --enable-hw-vlan-strip: enable hardware vlan strip.\n");
+ printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
printf(" --port-topology=N: set port topology (N: paired (default) or "
@@ -580,15 +580,15 @@
#ifdef RTE_LIBRTE_BITRATE
{ "bitrate-stats", 1, 0, 0 },
#endif
- { "disable-crc-strip", 0, 0, 0 },
+ { "enable-crc-strip", 0, 0, 0 },
{ "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
- { "disable-hw-vlan", 0, 0, 0 },
- { "disable-hw-vlan-filter", 0, 0, 0 },
- { "disable-hw-vlan-strip", 0, 0, 0 },
- { "disable-hw-vlan-extend", 0, 0, 0 },
+ { "enable-hw-vlan", 0, 0, 0 },
+ { "enable-hw-vlan-filter", 0, 0, 0 },
+ { "enable-hw-vlan-strip", 0, 0, 0 },
+ { "enable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -875,8 +875,8 @@
" must be >= 0\n", n);
}
#endif
- if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
+ if (!strcmp(lgopts[opt_idx].name, "enable-crc-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
rx_offloads |= DEV_RX_OFFLOAD_TCP_LRO;
if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
@@ -886,20 +886,20 @@
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+ if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-filter"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ "enable-hw-vlan-filter"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ "enable-hw-vlan-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-extend"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ "enable-hw-vlan-extend"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..a082352 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = 0,
.ignore_offload_bitfield = 1,
};
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 170dacd..82f2e1b 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -294,7 +294,7 @@ Line Length
testpmd -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 --txd=1024
diff --git a/doc/guides/howto/lm_virtio_vhost_user.rst b/doc/guides/howto/lm_virtio_vhost_user.rst
index 9402ed8..0661e88 100644
--- a/doc/guides/howto/lm_virtio_vhost_user.rst
+++ b/doc/guides/howto/lm_virtio_vhost_user.rst
@@ -466,4 +466,4 @@ run_testpmd_in_vm.sh
# test system has 8 cpus (0-7), use cpus 2-7 for VM
/root/dpdk/x86_64-default-linuxapp-gcc/app/testpmd \
- -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i --disable-hw-vlan-filter
+ -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i
diff --git a/doc/guides/howto/pvp_reference_benchmark.rst b/doc/guides/howto/pvp_reference_benchmark.rst
index 228b4a2..67fa232 100644
--- a/doc/guides/howto/pvp_reference_benchmark.rst
+++ b/doc/guides/howto/pvp_reference_benchmark.rst
@@ -158,7 +158,7 @@ Testpmd launch
$RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
--vdev 'net_vhost0,iface=/tmp/vhost-user1' \
--vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
- --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1 \
+ --portmask=f -i --rxq=1 --txq=1 \
--nb-cores=4 --forward-mode=io
With this command, isolated CPUs 2 to 5 will be used as lcores for PMD threads.
@@ -375,7 +375,7 @@ Start testpmd:
$RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
--proc-type auto --file-prefix pg -- \
--portmask=3 --forward-mode=macswap --port-topology=chained \
- --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
+ --disable-rss -i --rxq=1 --txq=1 \
--rxd=256 --txd=256 --nb-cores=2 --auto-start
Results template
diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst b/doc/guides/howto/virtio_user_as_exceptional_path.rst
index 3f99fe8..393f002 100644
--- a/doc/guides/howto/virtio_user_as_exceptional_path.rst
+++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst
@@ -84,7 +84,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --rxd=1024 --txd=1024
This command runs testpmd with two ports, one physical NIC to communicate
@@ -113,7 +113,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
--txd=1024
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index 77b2d66..b7f3292 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -215,7 +215,7 @@ Usage example
.. code-block:: console
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
- -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
+ -c 7 -- -i -a --rxq=2
Building DPDK
@@ -272,4 +272,4 @@ In order to run testpmd example application following command can be used:
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
--burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2 --nb-cores=2 \
- -i -a --disable-hw-vlan-strip --rss-udp
+ -i -a --rss-udp
diff --git a/doc/guides/nics/octeontx.rst b/doc/guides/nics/octeontx.rst
index 212fe34..8e2a2b7 100644
--- a/doc/guides/nics/octeontx.rst
+++ b/doc/guides/nics/octeontx.rst
@@ -88,8 +88,8 @@ following ``make`` command:
--mbuf-pool-ops-name="octeontx_fpavf" \
--vdev='event_octeontx' \
--vdev='eth_octeontx,nr_port=2' \
- -- --rxq=1 --txq=1 --nb-core=2 --total-num-mbufs=16384 \
- --disable-hw-vlan-filter -i
+ -- --rxq=1 --txq=1 --nb-core=2 \
+ --total-num-mbufs=16384 -i
.....
EAL: Detected 24 lcore(s)
EAL: Probing VFIO support...
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
.. code-block:: console
./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
- -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+ -- -i --no-flush-rx \
--port-topology=loop
...
diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index af82f86..90751e9 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -78,8 +78,9 @@ In this release, the virtio PMD driver provides the basic functionality of packe
by default. Tx queue size is still hard-coded to be 256.
* Features of mac/vlan filter are supported, negotiation with vhost/backend are needed to support them.
- When backend can't support vlan filter, virtio app on guest should disable vlan filter to make sure
- the virtio port is configured correctly. E.g. specify '--disable-hw-vlan' in testpmd command line.
+ When backend can't support vlan filter, virtio app on guest should not enable vlan filter in order
+ to make sure the virtio port is configured correctly. E.g. do not specify '--enable-hw-vlan' in testpmd
+ command line.
* "RTE_PKTMBUF_HEADROOM" should be defined
no less than "sizeof(struct virtio_net_hdr_mrg_rxbuf)", which is 12 bytes when mergeable or
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..076c121 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -299,9 +299,9 @@ The commandline options are:
In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
If the drop-queue does not exist, the packet is dropped. The default value is N=127.
-* ``--disable-crc-strip``
+* ``--enable-crc-strip``
- Disable hardware CRC stripping.
+ Enable hardware CRC stripping.
* ``--enable-lro``
@@ -315,21 +315,21 @@ The commandline options are:
Enable scatter (multi-segment) RX.
-* ``--disable-hw-vlan``
+* ``--enable-hw-vlan``
- Disable hardware VLAN.
+ Enable hardware VLAN.
-* ``--disable-hw-vlan-filter``
+* ``--enable-hw-vlan-filter``
- Disable hardware VLAN filter.
+ Enable hardware VLAN filter.
-* ``--disable-hw-vlan-strip``
+* ``--enable-hw-vlan-strip``
- Disable hardware VLAN strip.
+ Enable hardware VLAN strip.
-* ``--disable-hw-vlan-extend``
+* ``--enable-hw-vlan-extend``
- Disable hardware VLAN extend.
+ Enable hardware VLAN extend.
* ``--enable-drop-en``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index d8c9ef0..4c11ec5 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1673,9 +1673,9 @@ Set hardware CRC stripping on or off for all ports::
testpmd> port config all crc-strip (on|off)
-CRC stripping is on by default.
+CRC stripping is off by default.
-The ``off`` option is equivalent to the ``--disable-crc-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-crc-strip`` command-line option.
port config - scatter
~~~~~~~~~~~~~~~~~~~~~~~
@@ -1706,9 +1706,9 @@ Set hardware VLAN on or off for all ports::
testpmd> port config all hw-vlan (on|off)
-Hardware VLAN is on by default.
+Hardware VLAN is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option.
port config - VLAN filter
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1717,9 +1717,9 @@ Set hardware VLAN filter on or off for all ports::
testpmd> port config all hw-vlan-filter (on|off)
-Hardware VLAN filter is on by default.
+Hardware VLAN filter is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-filter`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option.
port config - VLAN strip
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1728,9 +1728,9 @@ Set hardware VLAN strip on or off for all ports::
testpmd> port config all hw-vlan-strip (on|off)
-Hardware VLAN strip is on by default.
+Hardware VLAN strip is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option.
port config - VLAN extend
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1741,7 +1741,7 @@ Set hardware VLAN extend on or off for all ports::
Hardware VLAN extend is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-extend`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option.
port config - Drop Packets
~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH v4] app/testpmd: do not enable Rx offloads by default
2018-01-30 9:00 ` [dpdk-dev] [PATCH v4] " Moti Haimovsky
@ 2018-01-31 3:16 ` Lu, Wenzhuo
2018-01-31 11:55 ` [dpdk-dev] [PATCH v5] " Moti Haimovsky
1 sibling, 0 replies; 21+ messages in thread
From: Lu, Wenzhuo @ 2018-01-31 3:16 UTC (permalink / raw)
To: Moti Haimovsky, thomas; +Cc: dev
Hi Moti,
> -----Original Message-----
> From: Moti Haimovsky [mailto:motih@mellanox.com]
> Sent: Tuesday, January 30, 2018 5:01 PM
> To: Lu, Wenzhuo <wenzhuo.lu@intel.com>; thomas@monjalon.net
> Cc: dev@dpdk.org; Moti Haimovsky <motih@mellanox.com>
> Subject: [PATCH v4] app/testpmd: do not enable Rx offloads by default
>
> Removed the hardcoded preconfigured Rx offload configuration from
> testpmd and changed the Rx offload command line parameters from disable
> to enable.
> Testers who wish to use these offloads will now have to explicitly write them
> in the command-line when running testpmd.
>
> Motivation:
> Some PMDs such at the mlx4 may not implement all the offloads.
> After the offload API rework assuming no offload is enabled by default,
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API")
As TX mentioned here and I see TX offload also have a default configuration. Is it better to handle TX too in one patch? It may help to track the motivation later.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [dpdk-dev] [PATCH v5] app/testpmd: do not enable Rx offloads by default
2018-01-30 9:00 ` [dpdk-dev] [PATCH v4] " Moti Haimovsky
2018-01-31 3:16 ` Lu, Wenzhuo
@ 2018-01-31 11:55 ` Moti Haimovsky
2018-01-31 16:59 ` [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx " Moti Haimovsky
1 sibling, 1 reply; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-31 11:55 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx and Tx offload configuration
from testpmd and changed the Rx offload command line parameters from
disable to enable.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
V5:
Removed Tx hardcoded defaults in order to be consistent with Rx offloads.
V4:
Fixed checkpatches warnings.
V3:
Updated documentation to reflect the change in the command-line parameters.
Updated testpmd help to also reflect the change in the command-line parameters.
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
app/test-pmd/parameters.c | 40 +++++++++++-----------
app/test-pmd/testpmd.c | 11 ++----
doc/guides/contributing/documentation.rst | 2 +-
doc/guides/howto/lm_virtio_vhost_user.rst | 2 +-
doc/guides/howto/pvp_reference_benchmark.rst | 4 +--
.../howto/virtio_user_as_exceptional_path.rst | 4 +--
doc/guides/nics/mrvl.rst | 4 +--
doc/guides/nics/octeontx.rst | 4 +--
doc/guides/nics/thunderx.rst | 2 +-
doc/guides/nics/virtio.rst | 5 +--
doc/guides/testpmd_app_ug/run_app.rst | 20 +++++------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 18 +++++-----
12 files changed, 55 insertions(+), 61 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..a93e1f0 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -129,14 +129,14 @@
printf(" --latencystats=N: enable latency and jitter statistcs "
"monitoring on forwarding lcore id N.\n");
#endif
- printf(" --disable-crc-strip: disable CRC stripping by hardware.\n");
+ printf(" --enable-crc-strip: enable CRC stripping by hardware.\n");
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
- printf(" --disable-hw-vlan: disable hardware vlan.\n");
- printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
- printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
- printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");
+ printf(" --enable-hw-vlan: enable hardware vlan.\n");
+ printf(" --enable-hw-vlan-filter: enable hardware vlan filter.\n");
+ printf(" --enable-hw-vlan-strip: enable hardware vlan strip.\n");
+ printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
printf(" --port-topology=N: set port topology (N: paired (default) or "
@@ -580,15 +580,15 @@
#ifdef RTE_LIBRTE_BITRATE
{ "bitrate-stats", 1, 0, 0 },
#endif
- { "disable-crc-strip", 0, 0, 0 },
+ { "enable-crc-strip", 0, 0, 0 },
{ "enable-lro", 0, 0, 0 },
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
- { "disable-hw-vlan", 0, 0, 0 },
- { "disable-hw-vlan-filter", 0, 0, 0 },
- { "disable-hw-vlan-strip", 0, 0, 0 },
- { "disable-hw-vlan-extend", 0, 0, 0 },
+ { "enable-hw-vlan", 0, 0, 0 },
+ { "enable-hw-vlan-filter", 0, 0, 0 },
+ { "enable-hw-vlan-strip", 0, 0, 0 },
+ { "enable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -875,8 +875,8 @@
" must be >= 0\n", n);
}
#endif
- if (!strcmp(lgopts[opt_idx].name, "disable-crc-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_CRC_STRIP;
+ if (!strcmp(lgopts[opt_idx].name, "enable-crc-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
if (!strcmp(lgopts[opt_idx].name, "enable-lro"))
rx_offloads |= DEV_RX_OFFLOAD_TCP_LRO;
if (!strcmp(lgopts[opt_idx].name, "enable-scatter"))
@@ -886,20 +886,20 @@
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+ if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-filter"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ "enable-hw-vlan-filter"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ "enable-hw-vlan-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-extend"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ "enable-hw-vlan-extend"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..ebf7c2d 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,14 +305,12 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = 0,
.ignore_offload_bitfield = 1,
};
struct rte_eth_txmode tx_mode = {
- .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE,
+ .offloads = 0,
};
struct rte_fdir_conf fdir_conf = {
@@ -671,11 +669,6 @@ static int eth_event_callback(portid_t port_id,
port->dev_conf.txmode = tx_mode;
port->dev_conf.rxmode = rx_mode;
rte_eth_dev_info_get(pid, &port->dev_info);
- if (!(port->dev_info.tx_offload_capa &
- DEV_TX_OFFLOAD_MBUF_FAST_FREE))
- port->dev_conf.txmode.offloads &=
- ~DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-
if (numa_support) {
if (port_numa[pid] != NUMA_NO_CONFIG)
port_per_socket[port_numa[pid]]++;
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 170dacd..82f2e1b 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -294,7 +294,7 @@ Line Length
testpmd -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 --txd=1024
diff --git a/doc/guides/howto/lm_virtio_vhost_user.rst b/doc/guides/howto/lm_virtio_vhost_user.rst
index 9402ed8..0661e88 100644
--- a/doc/guides/howto/lm_virtio_vhost_user.rst
+++ b/doc/guides/howto/lm_virtio_vhost_user.rst
@@ -466,4 +466,4 @@ run_testpmd_in_vm.sh
# test system has 8 cpus (0-7), use cpus 2-7 for VM
/root/dpdk/x86_64-default-linuxapp-gcc/app/testpmd \
- -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i --disable-hw-vlan-filter
+ -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i
diff --git a/doc/guides/howto/pvp_reference_benchmark.rst b/doc/guides/howto/pvp_reference_benchmark.rst
index 228b4a2..67fa232 100644
--- a/doc/guides/howto/pvp_reference_benchmark.rst
+++ b/doc/guides/howto/pvp_reference_benchmark.rst
@@ -158,7 +158,7 @@ Testpmd launch
$RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
--vdev 'net_vhost0,iface=/tmp/vhost-user1' \
--vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
- --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1 \
+ --portmask=f -i --rxq=1 --txq=1 \
--nb-cores=4 --forward-mode=io
With this command, isolated CPUs 2 to 5 will be used as lcores for PMD threads.
@@ -375,7 +375,7 @@ Start testpmd:
$RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
--proc-type auto --file-prefix pg -- \
--portmask=3 --forward-mode=macswap --port-topology=chained \
- --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
+ --disable-rss -i --rxq=1 --txq=1 \
--rxd=256 --txd=256 --nb-cores=2 --auto-start
Results template
diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst b/doc/guides/howto/virtio_user_as_exceptional_path.rst
index 3f99fe8..393f002 100644
--- a/doc/guides/howto/virtio_user_as_exceptional_path.rst
+++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst
@@ -84,7 +84,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --rxd=1024 --txd=1024
This command runs testpmd with two ports, one physical NIC to communicate
@@ -113,7 +113,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
--txd=1024
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index 77b2d66..b7f3292 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -215,7 +215,7 @@ Usage example
.. code-block:: console
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
- -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
+ -c 7 -- -i -a --rxq=2
Building DPDK
@@ -272,4 +272,4 @@ In order to run testpmd example application following command can be used:
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
--burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2 --nb-cores=2 \
- -i -a --disable-hw-vlan-strip --rss-udp
+ -i -a --rss-udp
diff --git a/doc/guides/nics/octeontx.rst b/doc/guides/nics/octeontx.rst
index 212fe34..8e2a2b7 100644
--- a/doc/guides/nics/octeontx.rst
+++ b/doc/guides/nics/octeontx.rst
@@ -88,8 +88,8 @@ following ``make`` command:
--mbuf-pool-ops-name="octeontx_fpavf" \
--vdev='event_octeontx' \
--vdev='eth_octeontx,nr_port=2' \
- -- --rxq=1 --txq=1 --nb-core=2 --total-num-mbufs=16384 \
- --disable-hw-vlan-filter -i
+ -- --rxq=1 --txq=1 --nb-core=2 \
+ --total-num-mbufs=16384 -i
.....
EAL: Detected 24 lcore(s)
EAL: Probing VFIO support...
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
.. code-block:: console
./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
- -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+ -- -i --no-flush-rx \
--port-topology=loop
...
diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index af82f86..90751e9 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -78,8 +78,9 @@ In this release, the virtio PMD driver provides the basic functionality of packe
by default. Tx queue size is still hard-coded to be 256.
* Features of mac/vlan filter are supported, negotiation with vhost/backend are needed to support them.
- When backend can't support vlan filter, virtio app on guest should disable vlan filter to make sure
- the virtio port is configured correctly. E.g. specify '--disable-hw-vlan' in testpmd command line.
+ When backend can't support vlan filter, virtio app on guest should not enable vlan filter in order
+ to make sure the virtio port is configured correctly. E.g. do not specify '--enable-hw-vlan' in testpmd
+ command line.
* "RTE_PKTMBUF_HEADROOM" should be defined
no less than "sizeof(struct virtio_net_hdr_mrg_rxbuf)", which is 12 bytes when mergeable or
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..076c121 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -299,9 +299,9 @@ The commandline options are:
In perfect filter mode, when a rule is added with queue = -1, the packet will be enqueued into the RX drop-queue.
If the drop-queue does not exist, the packet is dropped. The default value is N=127.
-* ``--disable-crc-strip``
+* ``--enable-crc-strip``
- Disable hardware CRC stripping.
+ Enable hardware CRC stripping.
* ``--enable-lro``
@@ -315,21 +315,21 @@ The commandline options are:
Enable scatter (multi-segment) RX.
-* ``--disable-hw-vlan``
+* ``--enable-hw-vlan``
- Disable hardware VLAN.
+ Enable hardware VLAN.
-* ``--disable-hw-vlan-filter``
+* ``--enable-hw-vlan-filter``
- Disable hardware VLAN filter.
+ Enable hardware VLAN filter.
-* ``--disable-hw-vlan-strip``
+* ``--enable-hw-vlan-strip``
- Disable hardware VLAN strip.
+ Enable hardware VLAN strip.
-* ``--disable-hw-vlan-extend``
+* ``--enable-hw-vlan-extend``
- Disable hardware VLAN extend.
+ Enable hardware VLAN extend.
* ``--enable-drop-en``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index d8c9ef0..4c11ec5 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1673,9 +1673,9 @@ Set hardware CRC stripping on or off for all ports::
testpmd> port config all crc-strip (on|off)
-CRC stripping is on by default.
+CRC stripping is off by default.
-The ``off`` option is equivalent to the ``--disable-crc-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-crc-strip`` command-line option.
port config - scatter
~~~~~~~~~~~~~~~~~~~~~~~
@@ -1706,9 +1706,9 @@ Set hardware VLAN on or off for all ports::
testpmd> port config all hw-vlan (on|off)
-Hardware VLAN is on by default.
+Hardware VLAN is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option.
port config - VLAN filter
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1717,9 +1717,9 @@ Set hardware VLAN filter on or off for all ports::
testpmd> port config all hw-vlan-filter (on|off)
-Hardware VLAN filter is on by default.
+Hardware VLAN filter is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-filter`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option.
port config - VLAN strip
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1728,9 +1728,9 @@ Set hardware VLAN strip on or off for all ports::
testpmd> port config all hw-vlan-strip (on|off)
-Hardware VLAN strip is on by default.
+Hardware VLAN strip is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option.
port config - VLAN extend
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1741,7 +1741,7 @@ Set hardware VLAN extend on or off for all ports::
Hardware VLAN extend is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-extend`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option.
port config - Drop Packets
~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx offloads by default
2018-01-31 11:55 ` [dpdk-dev] [PATCH v5] " Moti Haimovsky
@ 2018-01-31 16:59 ` Moti Haimovsky
2018-01-31 17:19 ` Thomas Monjalon
2018-01-31 17:32 ` [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads Moti Haimovsky
0 siblings, 2 replies; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-31 16:59 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx and Tx offload configuration
from testpmd and changed the Rx offload command line parameters from
disable to enable.
Testers who wish to use these offloads will now have to explicitly
write them in the command-line when running testpmd.
The above does not apply to Rx crc-strip and Tx MBUF_FAST_FREE which
were not removed and are silently dropped in ports that do not
support them.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
V6:
Returned DEV_RX_OFFLOAD_CRC_STRIP and DEV_TX_OFFLOAD_MBUF_FAST_FREE
as default config values.
V5:
Removed Tx hardcoded defaults in order to be consistent with Rx offloads.
V4:
Fixed checkpatches warnings.
V3:
Updated documentation to reflect the change in the command-line parameters.
Updated testpmd help to also reflect the change in the command-line parameters.
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
app/test-pmd/parameters.c | 32 +++++++++++-----------
app/test-pmd/testpmd.c | 11 ++++----
doc/guides/contributing/documentation.rst | 2 +-
doc/guides/howto/lm_virtio_vhost_user.rst | 2 +-
doc/guides/howto/pvp_reference_benchmark.rst | 4 +--
.../howto/virtio_user_as_exceptional_path.rst | 4 +--
doc/guides/nics/mrvl.rst | 4 +--
doc/guides/nics/octeontx.rst | 4 +--
doc/guides/nics/thunderx.rst | 2 +-
doc/guides/nics/virtio.rst | 5 ++--
doc/guides/testpmd_app_ug/run_app.rst | 16 +++++------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 14 +++++-----
12 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..97d22b8 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -133,10 +133,10 @@
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
- printf(" --disable-hw-vlan: disable hardware vlan.\n");
- printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
- printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
- printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");
+ printf(" --enable-hw-vlan: enable hardware vlan.\n");
+ printf(" --enable-hw-vlan-filter: enable hardware vlan filter.\n");
+ printf(" --enable-hw-vlan-strip: enable hardware vlan strip.\n");
+ printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
printf(" --port-topology=N: set port topology (N: paired (default) or "
@@ -585,10 +585,10 @@
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
- { "disable-hw-vlan", 0, 0, 0 },
- { "disable-hw-vlan-filter", 0, 0, 0 },
- { "disable-hw-vlan-strip", 0, 0, 0 },
- { "disable-hw-vlan-extend", 0, 0, 0 },
+ { "enable-hw-vlan", 0, 0, 0 },
+ { "enable-hw-vlan-filter", 0, 0, 0 },
+ { "enable-hw-vlan-strip", 0, 0, 0 },
+ { "enable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -886,20 +886,20 @@
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+ if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-filter"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ "enable-hw-vlan-filter"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ "enable-hw-vlan-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-extend"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ "enable-hw-vlan-extend"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..14d40ac 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
.ignore_offload_bitfield = 1,
};
@@ -667,7 +665,7 @@ static int eth_event_callback(portid_t port_id,
RTE_ETH_FOREACH_DEV(pid) {
port = &ports[pid];
- /* Apply default Tx configuration for all ports */
+ /* Apply default TxRx configuration for all ports */
port->dev_conf.txmode = tx_mode;
port->dev_conf.rxmode = rx_mode;
rte_eth_dev_info_get(pid, &port->dev_info);
@@ -675,7 +673,10 @@ static int eth_event_callback(portid_t port_id,
DEV_TX_OFFLOAD_MBUF_FAST_FREE))
port->dev_conf.txmode.offloads &=
~DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-
+ if (!(port->dev_info.rx_offload_capa &
+ DEV_RX_OFFLOAD_CRC_STRIP))
+ port->dev_conf.rxmode.offloads &=
+ ~DEV_RX_OFFLOAD_CRC_STRIP;
if (numa_support) {
if (port_numa[pid] != NUMA_NO_CONFIG)
port_per_socket[port_numa[pid]]++;
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 170dacd..82f2e1b 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -294,7 +294,7 @@ Line Length
testpmd -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 --txd=1024
diff --git a/doc/guides/howto/lm_virtio_vhost_user.rst b/doc/guides/howto/lm_virtio_vhost_user.rst
index 9402ed8..0661e88 100644
--- a/doc/guides/howto/lm_virtio_vhost_user.rst
+++ b/doc/guides/howto/lm_virtio_vhost_user.rst
@@ -466,4 +466,4 @@ run_testpmd_in_vm.sh
# test system has 8 cpus (0-7), use cpus 2-7 for VM
/root/dpdk/x86_64-default-linuxapp-gcc/app/testpmd \
- -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i --disable-hw-vlan-filter
+ -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i
diff --git a/doc/guides/howto/pvp_reference_benchmark.rst b/doc/guides/howto/pvp_reference_benchmark.rst
index 228b4a2..67fa232 100644
--- a/doc/guides/howto/pvp_reference_benchmark.rst
+++ b/doc/guides/howto/pvp_reference_benchmark.rst
@@ -158,7 +158,7 @@ Testpmd launch
$RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
--vdev 'net_vhost0,iface=/tmp/vhost-user1' \
--vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
- --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1 \
+ --portmask=f -i --rxq=1 --txq=1 \
--nb-cores=4 --forward-mode=io
With this command, isolated CPUs 2 to 5 will be used as lcores for PMD threads.
@@ -375,7 +375,7 @@ Start testpmd:
$RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
--proc-type auto --file-prefix pg -- \
--portmask=3 --forward-mode=macswap --port-topology=chained \
- --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
+ --disable-rss -i --rxq=1 --txq=1 \
--rxd=256 --txd=256 --nb-cores=2 --auto-start
Results template
diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst b/doc/guides/howto/virtio_user_as_exceptional_path.rst
index 3f99fe8..393f002 100644
--- a/doc/guides/howto/virtio_user_as_exceptional_path.rst
+++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst
@@ -84,7 +84,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --rxd=1024 --txd=1024
This command runs testpmd with two ports, one physical NIC to communicate
@@ -113,7 +113,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
--txd=1024
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index 77b2d66..b7f3292 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -215,7 +215,7 @@ Usage example
.. code-block:: console
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
- -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
+ -c 7 -- -i -a --rxq=2
Building DPDK
@@ -272,4 +272,4 @@ In order to run testpmd example application following command can be used:
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
--burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2 --nb-cores=2 \
- -i -a --disable-hw-vlan-strip --rss-udp
+ -i -a --rss-udp
diff --git a/doc/guides/nics/octeontx.rst b/doc/guides/nics/octeontx.rst
index 212fe34..8e2a2b7 100644
--- a/doc/guides/nics/octeontx.rst
+++ b/doc/guides/nics/octeontx.rst
@@ -88,8 +88,8 @@ following ``make`` command:
--mbuf-pool-ops-name="octeontx_fpavf" \
--vdev='event_octeontx' \
--vdev='eth_octeontx,nr_port=2' \
- -- --rxq=1 --txq=1 --nb-core=2 --total-num-mbufs=16384 \
- --disable-hw-vlan-filter -i
+ -- --rxq=1 --txq=1 --nb-core=2 \
+ --total-num-mbufs=16384 -i
.....
EAL: Detected 24 lcore(s)
EAL: Probing VFIO support...
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
.. code-block:: console
./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
- -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+ -- -i --no-flush-rx \
--port-topology=loop
...
diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index af82f86..90751e9 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -78,8 +78,9 @@ In this release, the virtio PMD driver provides the basic functionality of packe
by default. Tx queue size is still hard-coded to be 256.
* Features of mac/vlan filter are supported, negotiation with vhost/backend are needed to support them.
- When backend can't support vlan filter, virtio app on guest should disable vlan filter to make sure
- the virtio port is configured correctly. E.g. specify '--disable-hw-vlan' in testpmd command line.
+ When backend can't support vlan filter, virtio app on guest should not enable vlan filter in order
+ to make sure the virtio port is configured correctly. E.g. do not specify '--enable-hw-vlan' in testpmd
+ command line.
* "RTE_PKTMBUF_HEADROOM" should be defined
no less than "sizeof(struct virtio_net_hdr_mrg_rxbuf)", which is 12 bytes when mergeable or
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..782be3e 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -315,21 +315,21 @@ The commandline options are:
Enable scatter (multi-segment) RX.
-* ``--disable-hw-vlan``
+* ``--enable-hw-vlan``
- Disable hardware VLAN.
+ Enable hardware VLAN.
-* ``--disable-hw-vlan-filter``
+* ``--enable-hw-vlan-filter``
- Disable hardware VLAN filter.
+ Enable hardware VLAN filter.
-* ``--disable-hw-vlan-strip``
+* ``--enable-hw-vlan-strip``
- Disable hardware VLAN strip.
+ Enable hardware VLAN strip.
-* ``--disable-hw-vlan-extend``
+* ``--enable-hw-vlan-extend``
- Disable hardware VLAN extend.
+ Enable hardware VLAN extend.
* ``--enable-drop-en``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index d8c9ef0..a63b236 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1706,9 +1706,9 @@ Set hardware VLAN on or off for all ports::
testpmd> port config all hw-vlan (on|off)
-Hardware VLAN is on by default.
+Hardware VLAN is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option.
port config - VLAN filter
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1717,9 +1717,9 @@ Set hardware VLAN filter on or off for all ports::
testpmd> port config all hw-vlan-filter (on|off)
-Hardware VLAN filter is on by default.
+Hardware VLAN filter is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-filter`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option.
port config - VLAN strip
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1728,9 +1728,9 @@ Set hardware VLAN strip on or off for all ports::
testpmd> port config all hw-vlan-strip (on|off)
-Hardware VLAN strip is on by default.
+Hardware VLAN strip is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option.
port config - VLAN extend
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1741,7 +1741,7 @@ Set hardware VLAN extend on or off for all ports::
Hardware VLAN extend is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-extend`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option.
port config - Drop Packets
~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx offloads by default
2018-01-31 16:59 ` [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx " Moti Haimovsky
@ 2018-01-31 17:19 ` Thomas Monjalon
2018-01-31 17:32 ` [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads Moti Haimovsky
1 sibling, 0 replies; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-31 17:19 UTC (permalink / raw)
To: Moti Haimovsky; +Cc: wenzhuo.lu, dev, techboard
31/01/2018 17:59, Moti Haimovsky:
> Removed the hardcoded preconfigured Rx and Tx offload configuration
> from testpmd and changed the Rx offload command line parameters from
> disable to enable.
The description must be updated because v6 does not remove the last
default Tx offload.
> Testers who wish to use these offloads will now have to explicitly
> write them in the command-line when running testpmd.
> The above does not apply to Rx crc-strip and Tx MBUF_FAST_FREE which
> were not removed and are silently dropped in ports that do not
> support them.
Can be added here: It has been decided by the Technical Board.
> Motivation:
> Some PMDs such at the mlx4 may not implement all the offloads.
> After the offload API rework assuming no offload is enabled by default,
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
> to enable a not supported offload is clearly an error which will cause
> configuration failing.
>
> Considering that testpmd is an application to test the PMD, it should
> not fail on a configuration which was not explicitly requested.
> The behavior of this test application is then turned to an opt-in
> model.
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
> ---
> V6:
> Returned DEV_RX_OFFLOAD_CRC_STRIP and DEV_TX_OFFLOAD_MBUF_FAST_FREE
> as default config values.
Thank you, it reflects what has been decided today in the
Technical Board meeting.
We discussed the need of not having offloads by default in testpmd.
There are only two exceptions for 18.02:
- Rx CRC strip is often required, and the flag could be completely removed
or reversed in 18.05.
- Tx fast free could be discussed more.
^ permalink raw reply [flat|nested] 21+ messages in thread
* [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads
2018-01-31 16:59 ` [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx " Moti Haimovsky
2018-01-31 17:19 ` Thomas Monjalon
@ 2018-01-31 17:32 ` Moti Haimovsky
2018-01-31 21:09 ` Thomas Monjalon
1 sibling, 1 reply; 21+ messages in thread
From: Moti Haimovsky @ 2018-01-31 17:32 UTC (permalink / raw)
To: wenzhuo.lu, thomas; +Cc: dev, Moti Haimovsky
Removed the hardcoded preconfigured Rx VLAN offload configuration
from testpmd and changed the Rx offload command line parameters from
disable to enable.
It has been decided by the Technical Board that testers who wish to
use these offloads will now have to explicitly write them in the
command-line when running testpmd.
Motivation:
Some PMDs such at the mlx4 may not implement all the offloads.
After the offload API rework assuming no offload is enabled by default,
commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
to enable a not supported offload is clearly an error which will cause
configuration failing.
Considering that testpmd is an application to test the PMD, it should
not fail on a configuration which was not explicitly requested.
The behavior of this test application is then turned to an opt-in
model.
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
---
V7:
Modified the commit message to reflect that only Rx VLAN offloads
were removed.
V6:
Returned DEV_RX_OFFLOAD_CRC_STRIP and DEV_TX_OFFLOAD_MBUF_FAST_FREE
as default config values.
V5:
Removed Tx hardcoded defaults in order to be consistent with Rx offloads.
V4:
Fixed checkpatches warnings.
V3:
Updated documentation to reflect the change in the command-line parameters.
Updated testpmd help to also reflect the change in the command-line parameters.
V2:
Modified Rx offload command line parameters from disable to enable.
This way the user can choose the offload parameters to configure the
device with in a consistent manner.
---
app/test-pmd/parameters.c | 32 +++++++++++-----------
app/test-pmd/testpmd.c | 11 ++++----
doc/guides/contributing/documentation.rst | 2 +-
doc/guides/howto/lm_virtio_vhost_user.rst | 2 +-
doc/guides/howto/pvp_reference_benchmark.rst | 4 +--
.../howto/virtio_user_as_exceptional_path.rst | 4 +--
doc/guides/nics/mrvl.rst | 4 +--
doc/guides/nics/octeontx.rst | 4 +--
doc/guides/nics/thunderx.rst | 2 +-
doc/guides/nics/virtio.rst | 5 ++--
doc/guides/testpmd_app_ug/run_app.rst | 16 +++++------
doc/guides/testpmd_app_ug/testpmd_funcs.rst | 14 +++++-----
12 files changed, 51 insertions(+), 49 deletions(-)
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index fd59071..97d22b8 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -133,10 +133,10 @@
printf(" --enable-lro: enable large receive offload.\n");
printf(" --enable-rx-cksum: enable rx hardware checksum offload.\n");
printf(" --enable-rx-timestamp: enable rx hardware timestamp offload.\n");
- printf(" --disable-hw-vlan: disable hardware vlan.\n");
- printf(" --disable-hw-vlan-filter: disable hardware vlan filter.\n");
- printf(" --disable-hw-vlan-strip: disable hardware vlan strip.\n");
- printf(" --disable-hw-vlan-extend: disable hardware vlan extend.\n");
+ printf(" --enable-hw-vlan: enable hardware vlan.\n");
+ printf(" --enable-hw-vlan-filter: enable hardware vlan filter.\n");
+ printf(" --enable-hw-vlan-strip: enable hardware vlan strip.\n");
+ printf(" --enable-hw-vlan-extend: enable hardware vlan extend.\n");
printf(" --enable-drop-en: enable per queue packet drop.\n");
printf(" --disable-rss: disable rss.\n");
printf(" --port-topology=N: set port topology (N: paired (default) or "
@@ -585,10 +585,10 @@
{ "enable-rx-cksum", 0, 0, 0 },
{ "enable-rx-timestamp", 0, 0, 0 },
{ "enable-scatter", 0, 0, 0 },
- { "disable-hw-vlan", 0, 0, 0 },
- { "disable-hw-vlan-filter", 0, 0, 0 },
- { "disable-hw-vlan-strip", 0, 0, 0 },
- { "disable-hw-vlan-extend", 0, 0, 0 },
+ { "enable-hw-vlan", 0, 0, 0 },
+ { "enable-hw-vlan-filter", 0, 0, 0 },
+ { "enable-hw-vlan-strip", 0, 0, 0 },
+ { "enable-hw-vlan-extend", 0, 0, 0 },
{ "enable-drop-en", 0, 0, 0 },
{ "disable-rss", 0, 0, 0 },
{ "port-topology", 1, 0, 0 },
@@ -886,20 +886,20 @@
if (!strcmp(lgopts[opt_idx].name,
"enable-rx-timestamp"))
rx_offloads |= DEV_RX_OFFLOAD_TIMESTAMP;
- if (!strcmp(lgopts[opt_idx].name, "disable-hw-vlan"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN;
+ if (!strcmp(lgopts[opt_idx].name, "enable-hw-vlan"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-filter"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_FILTER;
+ "enable-hw-vlan-filter"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-strip"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_STRIP;
+ "enable-hw-vlan-strip"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_STRIP;
if (!strcmp(lgopts[opt_idx].name,
- "disable-hw-vlan-extend"))
- rx_offloads &= ~DEV_RX_OFFLOAD_VLAN_EXTEND;
+ "enable-hw-vlan-extend"))
+ rx_offloads |= DEV_RX_OFFLOAD_VLAN_EXTEND;
if (!strcmp(lgopts[opt_idx].name, "enable-drop-en"))
rx_drop_en = 1;
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index 5dc8cca..14d40ac 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -305,9 +305,7 @@ struct fwd_engine * fwd_engines[] = {
*/
struct rte_eth_rxmode rx_mode = {
.max_rx_pkt_len = ETHER_MAX_LEN, /**< Default maximum frame length. */
- .offloads = (DEV_RX_OFFLOAD_VLAN_FILTER |
- DEV_RX_OFFLOAD_VLAN_STRIP |
- DEV_RX_OFFLOAD_CRC_STRIP),
+ .offloads = DEV_RX_OFFLOAD_CRC_STRIP,
.ignore_offload_bitfield = 1,
};
@@ -667,7 +665,7 @@ static int eth_event_callback(portid_t port_id,
RTE_ETH_FOREACH_DEV(pid) {
port = &ports[pid];
- /* Apply default Tx configuration for all ports */
+ /* Apply default TxRx configuration for all ports */
port->dev_conf.txmode = tx_mode;
port->dev_conf.rxmode = rx_mode;
rte_eth_dev_info_get(pid, &port->dev_info);
@@ -675,7 +673,10 @@ static int eth_event_callback(portid_t port_id,
DEV_TX_OFFLOAD_MBUF_FAST_FREE))
port->dev_conf.txmode.offloads &=
~DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-
+ if (!(port->dev_info.rx_offload_capa &
+ DEV_RX_OFFLOAD_CRC_STRIP))
+ port->dev_conf.rxmode.offloads &=
+ ~DEV_RX_OFFLOAD_CRC_STRIP;
if (numa_support) {
if (port_numa[pid] != NUMA_NO_CONFIG)
port_per_socket[port_numa[pid]]++;
diff --git a/doc/guides/contributing/documentation.rst b/doc/guides/contributing/documentation.rst
index 170dacd..82f2e1b 100644
--- a/doc/guides/contributing/documentation.rst
+++ b/doc/guides/contributing/documentation.rst
@@ -294,7 +294,7 @@ Line Length
testpmd -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-hw-vlan --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 --txd=1024
diff --git a/doc/guides/howto/lm_virtio_vhost_user.rst b/doc/guides/howto/lm_virtio_vhost_user.rst
index 9402ed8..0661e88 100644
--- a/doc/guides/howto/lm_virtio_vhost_user.rst
+++ b/doc/guides/howto/lm_virtio_vhost_user.rst
@@ -466,4 +466,4 @@ run_testpmd_in_vm.sh
# test system has 8 cpus (0-7), use cpus 2-7 for VM
/root/dpdk/x86_64-default-linuxapp-gcc/app/testpmd \
- -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i --disable-hw-vlan-filter
+ -l 0-5 -n 4 --socket-mem 350 -- --burst=64 --i
diff --git a/doc/guides/howto/pvp_reference_benchmark.rst b/doc/guides/howto/pvp_reference_benchmark.rst
index 228b4a2..67fa232 100644
--- a/doc/guides/howto/pvp_reference_benchmark.rst
+++ b/doc/guides/howto/pvp_reference_benchmark.rst
@@ -158,7 +158,7 @@ Testpmd launch
$RTE_SDK/install/bin/testpmd -l 0,2,3,4,5 --socket-mem=1024 -n 4 \
--vdev 'net_vhost0,iface=/tmp/vhost-user1' \
--vdev 'net_vhost1,iface=/tmp/vhost-user2' -- \
- --portmask=f --disable-hw-vlan -i --rxq=1 --txq=1 \
+ --portmask=f -i --rxq=1 --txq=1 \
--nb-cores=4 --forward-mode=io
With this command, isolated CPUs 2 to 5 will be used as lcores for PMD threads.
@@ -375,7 +375,7 @@ Start testpmd:
$RTE_SDK/install/bin/testpmd -l 0,1,2 --socket-mem 1024 -n 4 \
--proc-type auto --file-prefix pg -- \
--portmask=3 --forward-mode=macswap --port-topology=chained \
- --disable-hw-vlan --disable-rss -i --rxq=1 --txq=1 \
+ --disable-rss -i --rxq=1 --txq=1 \
--rxd=256 --txd=256 --nb-cores=2 --auto-start
Results template
diff --git a/doc/guides/howto/virtio_user_as_exceptional_path.rst b/doc/guides/howto/virtio_user_as_exceptional_path.rst
index 3f99fe8..393f002 100644
--- a/doc/guides/howto/virtio_user_as_exceptional_path.rst
+++ b/doc/guides/howto/virtio_user_as_exceptional_path.rst
@@ -84,7 +84,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --rxd=1024 --txd=1024
This command runs testpmd with two ports, one physical NIC to communicate
@@ -113,7 +113,7 @@ compiling the kernel and those kernel modules should be inserted.
$(testpmd) -l 2-3 -n 4 \
--vdev=virtio_user0,path=/dev/vhost-net,queues=2,queue_size=1024 \
- -- -i --txqflags=0x0 --disable-hw-vlan --enable-lro \
+ -- -i --txqflags=0x0 --enable-lro \
--enable-rx-cksum --txq=2 --rxq=2 --rxd=1024 \
--txd=1024
diff --git a/doc/guides/nics/mrvl.rst b/doc/guides/nics/mrvl.rst
index 77b2d66..b7f3292 100644
--- a/doc/guides/nics/mrvl.rst
+++ b/doc/guides/nics/mrvl.rst
@@ -215,7 +215,7 @@ Usage example
.. code-block:: console
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2,cfg=/home/user/mrvl.conf \
- -c 7 -- -i -a --disable-hw-vlan-strip --rxq=2
+ -c 7 -- -i -a --rxq=2
Building DPDK
@@ -272,4 +272,4 @@ In order to run testpmd example application following command can be used:
./testpmd --vdev=eth_mrvl,iface=eth0,iface=eth2 -c 7 -- \
--burst=128 --txd=2048 --rxd=1024 --rxq=2 --txq=2 --nb-cores=2 \
- -i -a --disable-hw-vlan-strip --rss-udp
+ -i -a --rss-udp
diff --git a/doc/guides/nics/octeontx.rst b/doc/guides/nics/octeontx.rst
index 212fe34..8e2a2b7 100644
--- a/doc/guides/nics/octeontx.rst
+++ b/doc/guides/nics/octeontx.rst
@@ -88,8 +88,8 @@ following ``make`` command:
--mbuf-pool-ops-name="octeontx_fpavf" \
--vdev='event_octeontx' \
--vdev='eth_octeontx,nr_port=2' \
- -- --rxq=1 --txq=1 --nb-core=2 --total-num-mbufs=16384 \
- --disable-hw-vlan-filter -i
+ -- --rxq=1 --txq=1 --nb-core=2 \
+ --total-num-mbufs=16384 -i
.....
EAL: Detected 24 lcore(s)
EAL: Probing VFIO support...
diff --git a/doc/guides/nics/thunderx.rst b/doc/guides/nics/thunderx.rst
index 1c800e7..5270ef2 100644
--- a/doc/guides/nics/thunderx.rst
+++ b/doc/guides/nics/thunderx.rst
@@ -177,7 +177,7 @@ This section provides instructions to configure SR-IOV with Linux OS.
.. code-block:: console
./arm64-thunderx-linuxapp-gcc/app/testpmd -l 0-3 -n 4 -w 0002:01:00.2 \
- -- -i --disable-hw-vlan-filter --disable-crc-strip --no-flush-rx \
+ -- -i --no-flush-rx \
--port-topology=loop
...
diff --git a/doc/guides/nics/virtio.rst b/doc/guides/nics/virtio.rst
index af82f86..90751e9 100644
--- a/doc/guides/nics/virtio.rst
+++ b/doc/guides/nics/virtio.rst
@@ -78,8 +78,9 @@ In this release, the virtio PMD driver provides the basic functionality of packe
by default. Tx queue size is still hard-coded to be 256.
* Features of mac/vlan filter are supported, negotiation with vhost/backend are needed to support them.
- When backend can't support vlan filter, virtio app on guest should disable vlan filter to make sure
- the virtio port is configured correctly. E.g. specify '--disable-hw-vlan' in testpmd command line.
+ When backend can't support vlan filter, virtio app on guest should not enable vlan filter in order
+ to make sure the virtio port is configured correctly. E.g. do not specify '--enable-hw-vlan' in testpmd
+ command line.
* "RTE_PKTMBUF_HEADROOM" should be defined
no less than "sizeof(struct virtio_net_hdr_mrg_rxbuf)", which is 12 bytes when mergeable or
diff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst
index 46da1df..782be3e 100644
--- a/doc/guides/testpmd_app_ug/run_app.rst
+++ b/doc/guides/testpmd_app_ug/run_app.rst
@@ -315,21 +315,21 @@ The commandline options are:
Enable scatter (multi-segment) RX.
-* ``--disable-hw-vlan``
+* ``--enable-hw-vlan``
- Disable hardware VLAN.
+ Enable hardware VLAN.
-* ``--disable-hw-vlan-filter``
+* ``--enable-hw-vlan-filter``
- Disable hardware VLAN filter.
+ Enable hardware VLAN filter.
-* ``--disable-hw-vlan-strip``
+* ``--enable-hw-vlan-strip``
- Disable hardware VLAN strip.
+ Enable hardware VLAN strip.
-* ``--disable-hw-vlan-extend``
+* ``--enable-hw-vlan-extend``
- Disable hardware VLAN extend.
+ Enable hardware VLAN extend.
* ``--enable-drop-en``
diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
index d8c9ef0..a63b236 100644
--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst
+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst
@@ -1706,9 +1706,9 @@ Set hardware VLAN on or off for all ports::
testpmd> port config all hw-vlan (on|off)
-Hardware VLAN is on by default.
+Hardware VLAN is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan`` command-line option.
port config - VLAN filter
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1717,9 +1717,9 @@ Set hardware VLAN filter on or off for all ports::
testpmd> port config all hw-vlan-filter (on|off)
-Hardware VLAN filter is on by default.
+Hardware VLAN filter is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-filter`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-filter`` command-line option.
port config - VLAN strip
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1728,9 +1728,9 @@ Set hardware VLAN strip on or off for all ports::
testpmd> port config all hw-vlan-strip (on|off)
-Hardware VLAN strip is on by default.
+Hardware VLAN strip is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-strip`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-strip`` command-line option.
port config - VLAN extend
~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1741,7 +1741,7 @@ Set hardware VLAN extend on or off for all ports::
Hardware VLAN extend is off by default.
-The ``off`` option is equivalent to the ``--disable-hw-vlan-extend`` command-line option.
+The ``on`` option is equivalent to the ``--enable-hw-vlan-extend`` command-line option.
port config - Drop Packets
~~~~~~~~~~~~~~~~~~~~~~~~~~
--
1.8.3.1
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads
2018-01-31 17:32 ` [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads Moti Haimovsky
@ 2018-01-31 21:09 ` Thomas Monjalon
0 siblings, 0 replies; 21+ messages in thread
From: Thomas Monjalon @ 2018-01-31 21:09 UTC (permalink / raw)
To: Moti Haimovsky; +Cc: dev, wenzhuo.lu, techboard
31/01/2018 18:32, Moti Haimovsky:
> Removed the hardcoded preconfigured Rx VLAN offload configuration
> from testpmd and changed the Rx offload command line parameters from
> disable to enable.
> It has been decided by the Technical Board that testers who wish to
> use these offloads will now have to explicitly write them in the
> command-line when running testpmd.
> Motivation:
> Some PMDs such at the mlx4 may not implement all the offloads.
> After the offload API rework assuming no offload is enabled by default,
> commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API")
> commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") trying
> to enable a not supported offload is clearly an error which will cause
> configuration failing.
>
> Considering that testpmd is an application to test the PMD, it should
> not fail on a configuration which was not explicitly requested.
> The behavior of this test application is then turned to an opt-in
> model.
>
> Signed-off-by: Moti Haimovsky <motih@mellanox.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
Applied with added explanations about the Technical Board agreement. Thanks
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2018-01-31 21:10 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 8:11 [dpdk-dev] [PATCH] app/testpmd: do not enable Rx offloads by default Moti Haimovsky
2018-01-25 1:11 ` Lu, Wenzhuo
2018-01-25 9:04 ` Thomas Monjalon
2018-01-25 16:01 ` Stephen Hemminger
2018-01-26 7:31 ` Lu, Wenzhuo
2018-01-26 7:49 ` Thomas Monjalon
2018-01-26 7:30 ` Lu, Wenzhuo
2018-01-26 7:48 ` Thomas Monjalon
2018-01-26 8:06 ` Lu, Wenzhuo
2018-01-26 8:35 ` Thomas Monjalon
2018-01-27 18:14 ` Shahaf Shuler
2018-01-29 11:33 ` [dpdk-dev] [PATCH v2] " Moti Haimovsky
2018-01-29 11:52 ` Thomas Monjalon
2018-01-30 8:44 ` [dpdk-dev] [PATCH v3] " Moti Haimovsky
2018-01-30 9:00 ` [dpdk-dev] [PATCH v4] " Moti Haimovsky
2018-01-31 3:16 ` Lu, Wenzhuo
2018-01-31 11:55 ` [dpdk-dev] [PATCH v5] " Moti Haimovsky
2018-01-31 16:59 ` [dpdk-dev] [PATCH v6] app/testpmd: no Rx or Tx " Moti Haimovsky
2018-01-31 17:19 ` Thomas Monjalon
2018-01-31 17:32 ` [dpdk-dev] [PATCH v7] app/testpmd: removed preconf Rx VLAN offloads Moti Haimovsky
2018-01-31 21:09 ` Thomas Monjalon
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).