* [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions @ 2019-10-16 15:46 Ciara Power 2019-10-16 18:07 ` Ferruh Yigit 0 siblings, 1 reply; 16+ messages in thread From: Ciara Power @ 2019-10-16 15:46 UTC (permalink / raw) To: mtetsuyah; +Cc: dev, Ciara Power Adding promiscuous functions prevents sample applications failing when run on this virtual PMD. The sample applications call promiscuous functions, and fail if this function call returns an error, which occurs when the virtual PMD does not support the promiscuous function being called. This change will be implemented for all virtual PMDs that currently do not have existing promiscuous functions. Multicast functions will also be added for virtual PMDs to prevent sample application breakages here also. Signed-off-by: Ciara Power <ciara.power@intel.com> --- drivers/net/null/rte_eth_null.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index e2ff41a22..b8472a0cf 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -441,11 +441,25 @@ eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, return 0; } +static int +eth_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) +{ + return 0; +} + +static int +eth_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) +{ + return 0; +} + static const struct eth_dev_ops ops = { .dev_start = eth_dev_start, .dev_stop = eth_dev_stop, .dev_configure = eth_dev_configure, .dev_infos_get = eth_dev_info, + .promiscuous_enable = eth_dev_promiscuous_enable, + .promiscuous_disable = eth_dev_promiscuous_disable, .rx_queue_setup = eth_rx_queue_setup, .tx_queue_setup = eth_tx_queue_setup, .rx_queue_release = eth_queue_release, -- 2.17.1 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-16 15:46 [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions Ciara Power @ 2019-10-16 18:07 ` Ferruh Yigit 2019-10-17 10:37 ` Andrew Rybchenko 0 siblings, 1 reply; 16+ messages in thread From: Ferruh Yigit @ 2019-10-16 18:07 UTC (permalink / raw) To: Ciara Power, mtetsuyah; +Cc: dev, Andrew Rybchenko, Thomas Monjalon On 10/16/2019 4:46 PM, Ciara Power wrote: > Adding promiscuous functions prevents sample applications failing when run > on this virtual PMD. The sample applications call promiscuous functions, > and fail if this function call returns an error, which occurs when the > virtual PMD does not support the promiscuous function being called. > > This change will be implemented for all virtual PMDs that currently do not > have existing promiscuous functions. Multicast functions will also be > added for virtual PMDs to prevent sample application breakages here also. +Andrew With the some ethdev APIs returning error code, some sample applications stop working with virtual interfaces, We can, 1- update sample applications to ignore the errors 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) (1) puts us back to before the ethdev APIs updated status, and this may be wrong for the physical devices case, so I am for this RFC. Only perhaps we can have some common empty function and keep assigning that one to reduce the dummy code, what do you think? > > Signed-off-by: Ciara Power <ciara.power@intel.com> > --- > drivers/net/null/rte_eth_null.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c > index e2ff41a22..b8472a0cf 100644 > --- a/drivers/net/null/rte_eth_null.c > +++ b/drivers/net/null/rte_eth_null.c > @@ -441,11 +441,25 @@ eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, > return 0; > } > > +static int > +eth_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) > +{ > + return 0; > +} > + > +static int > +eth_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) > +{ > + return 0; > +} > + > static const struct eth_dev_ops ops = { > .dev_start = eth_dev_start, > .dev_stop = eth_dev_stop, > .dev_configure = eth_dev_configure, > .dev_infos_get = eth_dev_info, > + .promiscuous_enable = eth_dev_promiscuous_enable, > + .promiscuous_disable = eth_dev_promiscuous_disable, > .rx_queue_setup = eth_rx_queue_setup, > .tx_queue_setup = eth_tx_queue_setup, > .rx_queue_release = eth_queue_release, > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-16 18:07 ` Ferruh Yigit @ 2019-10-17 10:37 ` Andrew Rybchenko 2019-10-17 10:47 ` Ferruh Yigit 0 siblings, 1 reply; 16+ messages in thread From: Andrew Rybchenko @ 2019-10-17 10:37 UTC (permalink / raw) To: Ferruh Yigit, Ciara Power, mtetsuyah; +Cc: dev, Thomas Monjalon On 10/16/19 9:07 PM, Ferruh Yigit wrote: > On 10/16/2019 4:46 PM, Ciara Power wrote: >> Adding promiscuous functions prevents sample applications failing when run >> on this virtual PMD. The sample applications call promiscuous functions, >> and fail if this function call returns an error, which occurs when the >> virtual PMD does not support the promiscuous function being called. >> >> This change will be implemented for all virtual PMDs that currently do not >> have existing promiscuous functions. Multicast functions will also be >> added for virtual PMDs to prevent sample application breakages here also. > +Andrew > > With the some ethdev APIs returning error code, some sample applications stop > working with virtual interfaces, > > We can, > 1- update sample applications to ignore the errors > 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) > > (1) puts us back to before the ethdev APIs updated status, and this may be wrong > for the physical devices case, so I am for this RFC. > > Only perhaps we can have some common empty function and keep assigning that one > to reduce the dummy code, what do you think? I don't like the idea to have common empty/dummy functions. If virtual PMD behaves in accordance with enabled promiscuous mode, it should initialize it properly on init: eth_dev->data->promiscuous = 1; If so, if application requires promiscuous mode, attempt to enable will do nothing. If application requires non-promiscuous mode, disable will fail and it is good. >> Signed-off-by: Ciara Power <ciara.power@intel.com> >> --- >> drivers/net/null/rte_eth_null.c | 14 ++++++++++++++ >> 1 file changed, 14 insertions(+) >> >> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c >> index e2ff41a22..b8472a0cf 100644 >> --- a/drivers/net/null/rte_eth_null.c >> +++ b/drivers/net/null/rte_eth_null.c >> @@ -441,11 +441,25 @@ eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, >> return 0; >> } >> >> +static int >> +eth_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) >> +{ >> + return 0; >> +} >> + >> +static int >> +eth_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) >> +{ >> + return 0; >> +} >> + >> static const struct eth_dev_ops ops = { >> .dev_start = eth_dev_start, >> .dev_stop = eth_dev_stop, >> .dev_configure = eth_dev_configure, >> .dev_infos_get = eth_dev_info, >> + .promiscuous_enable = eth_dev_promiscuous_enable, >> + .promiscuous_disable = eth_dev_promiscuous_disable, >> .rx_queue_setup = eth_rx_queue_setup, >> .tx_queue_setup = eth_tx_queue_setup, >> .rx_queue_release = eth_queue_release, >> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 10:37 ` Andrew Rybchenko @ 2019-10-17 10:47 ` Ferruh Yigit 2019-10-17 10:51 ` Andrew Rybchenko 0 siblings, 1 reply; 16+ messages in thread From: Ferruh Yigit @ 2019-10-17 10:47 UTC (permalink / raw) To: Andrew Rybchenko, Ciara Power, mtetsuyah; +Cc: dev, Thomas Monjalon On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: > On 10/16/19 9:07 PM, Ferruh Yigit wrote: >> On 10/16/2019 4:46 PM, Ciara Power wrote: >>> Adding promiscuous functions prevents sample applications failing when run >>> on this virtual PMD. The sample applications call promiscuous functions, >>> and fail if this function call returns an error, which occurs when the >>> virtual PMD does not support the promiscuous function being called. >>> >>> This change will be implemented for all virtual PMDs that currently do not >>> have existing promiscuous functions. Multicast functions will also be >>> added for virtual PMDs to prevent sample application breakages here also. >> +Andrew >> >> With the some ethdev APIs returning error code, some sample applications stop >> working with virtual interfaces, >> >> We can, >> 1- update sample applications to ignore the errors >> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >> >> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >> for the physical devices case, so I am for this RFC. >> >> Only perhaps we can have some common empty function and keep assigning that one >> to reduce the dummy code, what do you think? > > I don't like the idea to have common empty/dummy functions. > If virtual PMD behaves in accordance with enabled promiscuous mode, > it should initialize it properly on init: > eth_dev->data->promiscuous = 1; > If so, if application requires promiscuous mode, attempt to enable will > do nothing. If application requires non-promiscuous mode, disable will > fail and it is good. It is technically correct that we can't disable promiscuous mode in virtual PMDs but I think mainly we don't really care so it returning error may make the applications fail/exit unnecessarily with virtual PMDs. > >>> Signed-off-by: Ciara Power <ciara.power@intel.com> >>> --- >>> drivers/net/null/rte_eth_null.c | 14 ++++++++++++++ >>> 1 file changed, 14 insertions(+) >>> >>> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c >>> index e2ff41a22..b8472a0cf 100644 >>> --- a/drivers/net/null/rte_eth_null.c >>> +++ b/drivers/net/null/rte_eth_null.c >>> @@ -441,11 +441,25 @@ eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, >>> return 0; >>> } >>> >>> +static int >>> +eth_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) >>> +{ >>> + return 0; >>> +} >>> + >>> +static int >>> +eth_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) >>> +{ >>> + return 0; >>> +} >>> + >>> static const struct eth_dev_ops ops = { >>> .dev_start = eth_dev_start, >>> .dev_stop = eth_dev_stop, >>> .dev_configure = eth_dev_configure, >>> .dev_infos_get = eth_dev_info, >>> + .promiscuous_enable = eth_dev_promiscuous_enable, >>> + .promiscuous_disable = eth_dev_promiscuous_disable, >>> .rx_queue_setup = eth_rx_queue_setup, >>> .tx_queue_setup = eth_tx_queue_setup, >>> .rx_queue_release = eth_queue_release, >>> > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 10:47 ` Ferruh Yigit @ 2019-10-17 10:51 ` Andrew Rybchenko 2019-10-17 11:05 ` Ferruh Yigit 0 siblings, 1 reply; 16+ messages in thread From: Andrew Rybchenko @ 2019-10-17 10:51 UTC (permalink / raw) To: Ferruh Yigit, Ciara Power, mtetsuyah; +Cc: dev, Thomas Monjalon On 10/17/19 1:47 PM, Ferruh Yigit wrote: > On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>> Adding promiscuous functions prevents sample applications failing when run >>>> on this virtual PMD. The sample applications call promiscuous functions, >>>> and fail if this function call returns an error, which occurs when the >>>> virtual PMD does not support the promiscuous function being called. >>>> >>>> This change will be implemented for all virtual PMDs that currently do not >>>> have existing promiscuous functions. Multicast functions will also be >>>> added for virtual PMDs to prevent sample application breakages here also. >>> +Andrew >>> >>> With the some ethdev APIs returning error code, some sample applications stop >>> working with virtual interfaces, >>> >>> We can, >>> 1- update sample applications to ignore the errors >>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>> >>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>> for the physical devices case, so I am for this RFC. >>> >>> Only perhaps we can have some common empty function and keep assigning that one >>> to reduce the dummy code, what do you think? >> I don't like the idea to have common empty/dummy functions. >> If virtual PMD behaves in accordance with enabled promiscuous mode, >> it should initialize it properly on init: >> eth_dev->data->promiscuous = 1; >> If so, if application requires promiscuous mode, attempt to enable will >> do nothing. If application requires non-promiscuous mode, disable will >> fail and it is good. > It is technically correct that we can't disable promiscuous mode in virtual PMDs > but I think mainly we don't really care so it returning error may make the > applications fail/exit unnecessarily with virtual PMDs. If I test virtual PMD promiscuous mode, I would prefer enable/disable callback to say me truth. If application really does not care, it should be in the application code. >>>> Signed-off-by: Ciara Power <ciara.power@intel.com> >>>> --- >>>> drivers/net/null/rte_eth_null.c | 14 ++++++++++++++ >>>> 1 file changed, 14 insertions(+) >>>> >>>> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c >>>> index e2ff41a22..b8472a0cf 100644 >>>> --- a/drivers/net/null/rte_eth_null.c >>>> +++ b/drivers/net/null/rte_eth_null.c >>>> @@ -441,11 +441,25 @@ eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, >>>> return 0; >>>> } >>>> >>>> +static int >>>> +eth_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) >>>> +{ >>>> + return 0; >>>> +} >>>> + >>>> +static int >>>> +eth_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) >>>> +{ >>>> + return 0; >>>> +} >>>> + >>>> static const struct eth_dev_ops ops = { >>>> .dev_start = eth_dev_start, >>>> .dev_stop = eth_dev_stop, >>>> .dev_configure = eth_dev_configure, >>>> .dev_infos_get = eth_dev_info, >>>> + .promiscuous_enable = eth_dev_promiscuous_enable, >>>> + .promiscuous_disable = eth_dev_promiscuous_disable, >>>> .rx_queue_setup = eth_rx_queue_setup, >>>> .tx_queue_setup = eth_tx_queue_setup, >>>> .rx_queue_release = eth_queue_release, >>>> ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 10:51 ` Andrew Rybchenko @ 2019-10-17 11:05 ` Ferruh Yigit 2019-10-17 13:43 ` Bruce Richardson 0 siblings, 1 reply; 16+ messages in thread From: Ferruh Yigit @ 2019-10-17 11:05 UTC (permalink / raw) To: Andrew Rybchenko, Ciara Power, mtetsuyah; +Cc: dev, Thomas Monjalon On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: > On 10/17/19 1:47 PM, Ferruh Yigit wrote: >> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>> Adding promiscuous functions prevents sample applications failing when run >>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>> and fail if this function call returns an error, which occurs when the >>>>> virtual PMD does not support the promiscuous function being called. >>>>> >>>>> This change will be implemented for all virtual PMDs that currently do not >>>>> have existing promiscuous functions. Multicast functions will also be >>>>> added for virtual PMDs to prevent sample application breakages here also. >>>> +Andrew >>>> >>>> With the some ethdev APIs returning error code, some sample applications stop >>>> working with virtual interfaces, >>>> >>>> We can, >>>> 1- update sample applications to ignore the errors >>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>> >>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>> for the physical devices case, so I am for this RFC. >>>> >>>> Only perhaps we can have some common empty function and keep assigning that one >>>> to reduce the dummy code, what do you think? >>> I don't like the idea to have common empty/dummy functions. >>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>> it should initialize it properly on init: >>> eth_dev->data->promiscuous = 1; >>> If so, if application requires promiscuous mode, attempt to enable will >>> do nothing. If application requires non-promiscuous mode, disable will >>> fail and it is good. >> It is technically correct that we can't disable promiscuous mode in virtual PMDs >> but I think mainly we don't really care so it returning error may make the >> applications fail/exit unnecessarily with virtual PMDs. > > If I test virtual PMD promiscuous mode, I would prefer enable/disable > callback to say me truth. > > If application really does not care, it should be in the application code. Application can't change this because they may be caring return result for the physical devices. Up until this release these missing dev_ops in virtual PMDs were silently ignored, now APIs are more strict on this (which is good) but to get close the previous behavior for virtual PMDs we need to relax on these features (like saying success on promiscuous disable although it didn't). > >>>>> Signed-off-by: Ciara Power <ciara.power@intel.com> >>>>> --- >>>>> drivers/net/null/rte_eth_null.c | 14 ++++++++++++++ >>>>> 1 file changed, 14 insertions(+) >>>>> >>>>> diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c >>>>> index e2ff41a22..b8472a0cf 100644 >>>>> --- a/drivers/net/null/rte_eth_null.c >>>>> +++ b/drivers/net/null/rte_eth_null.c >>>>> @@ -441,11 +441,25 @@ eth_mac_address_set(__rte_unused struct rte_eth_dev *dev, >>>>> return 0; >>>>> } >>>>> >>>>> +static int >>>>> +eth_dev_promiscuous_enable(__rte_unused struct rte_eth_dev *dev) >>>>> +{ >>>>> + return 0; >>>>> +} >>>>> + >>>>> +static int >>>>> +eth_dev_promiscuous_disable(__rte_unused struct rte_eth_dev *dev) >>>>> +{ >>>>> + return 0; >>>>> +} >>>>> + >>>>> static const struct eth_dev_ops ops = { >>>>> .dev_start = eth_dev_start, >>>>> .dev_stop = eth_dev_stop, >>>>> .dev_configure = eth_dev_configure, >>>>> .dev_infos_get = eth_dev_info, >>>>> + .promiscuous_enable = eth_dev_promiscuous_enable, >>>>> + .promiscuous_disable = eth_dev_promiscuous_disable, >>>>> .rx_queue_setup = eth_rx_queue_setup, >>>>> .tx_queue_setup = eth_tx_queue_setup, >>>>> .rx_queue_release = eth_queue_release, >>>>> > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 11:05 ` Ferruh Yigit @ 2019-10-17 13:43 ` Bruce Richardson 2019-10-17 15:33 ` Ferruh Yigit 0 siblings, 1 reply; 16+ messages in thread From: Bruce Richardson @ 2019-10-17 13:43 UTC (permalink / raw) To: Ferruh Yigit Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: > On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: > > On 10/17/19 1:47 PM, Ferruh Yigit wrote: > >> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: > >>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: > >>>> On 10/16/2019 4:46 PM, Ciara Power wrote: > >>>>> Adding promiscuous functions prevents sample applications failing when run > >>>>> on this virtual PMD. The sample applications call promiscuous functions, > >>>>> and fail if this function call returns an error, which occurs when the > >>>>> virtual PMD does not support the promiscuous function being called. > >>>>> > >>>>> This change will be implemented for all virtual PMDs that currently do not > >>>>> have existing promiscuous functions. Multicast functions will also be > >>>>> added for virtual PMDs to prevent sample application breakages here also. > >>>> +Andrew > >>>> > >>>> With the some ethdev APIs returning error code, some sample applications stop > >>>> working with virtual interfaces, > >>>> > >>>> We can, > >>>> 1- update sample applications to ignore the errors > >>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) > >>>> > >>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong > >>>> for the physical devices case, so I am for this RFC. > >>>> > >>>> Only perhaps we can have some common empty function and keep assigning that one > >>>> to reduce the dummy code, what do you think? > >>> I don't like the idea to have common empty/dummy functions. > >>> If virtual PMD behaves in accordance with enabled promiscuous mode, > >>> it should initialize it properly on init: > >>> eth_dev->data->promiscuous = 1; > >>> If so, if application requires promiscuous mode, attempt to enable will > >>> do nothing. If application requires non-promiscuous mode, disable will > >>> fail and it is good. > >> It is technically correct that we can't disable promiscuous mode in virtual PMDs > >> but I think mainly we don't really care so it returning error may make the > >> applications fail/exit unnecessarily with virtual PMDs. > > > > If I test virtual PMD promiscuous mode, I would prefer enable/disable > > callback to say me truth. > > > > If application really does not care, it should be in the application code. > > Application can't change this because they may be caring return result for the > physical devices. > > Up until this release these missing dev_ops in virtual PMDs were silently > ignored, now APIs are more strict on this (which is good) but to get close the > previous behavior for virtual PMDs we need to relax on these features (like > saying success on promiscuous disable although it didn't). > The other variable here is how often an app is going to request promiscuous disabling? Given that most ports generally come up in that state anyway, and one needs to request enabling it, surely the disable case is relatively rare? In that case I'd tend to agree with having disabling it returning error for vpmds. /Bruce ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 13:43 ` Bruce Richardson @ 2019-10-17 15:33 ` Ferruh Yigit 2019-10-18 8:18 ` Ferruh Yigit 2019-10-18 10:13 ` Bruce Richardson 0 siblings, 2 replies; 16+ messages in thread From: Ferruh Yigit @ 2019-10-17 15:33 UTC (permalink / raw) To: Bruce Richardson Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/17/2019 2:43 PM, Bruce Richardson wrote: > On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>> >>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>> +Andrew >>>>>> >>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>> working with virtual interfaces, >>>>>> >>>>>> We can, >>>>>> 1- update sample applications to ignore the errors >>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>> >>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>> for the physical devices case, so I am for this RFC. >>>>>> >>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>> to reduce the dummy code, what do you think? >>>>> I don't like the idea to have common empty/dummy functions. >>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>> it should initialize it properly on init: >>>>> eth_dev->data->promiscuous = 1; >>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>> fail and it is good. >>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>> but I think mainly we don't really care so it returning error may make the >>>> applications fail/exit unnecessarily with virtual PMDs. >>> >>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>> callback to say me truth. >>> >>> If application really does not care, it should be in the application code. >> >> Application can't change this because they may be caring return result for the >> physical devices. >> >> Up until this release these missing dev_ops in virtual PMDs were silently >> ignored, now APIs are more strict on this (which is good) but to get close the >> previous behavior for virtual PMDs we need to relax on these features (like >> saying success on promiscuous disable although it didn't). >> > The other variable here is how often an app is going to request promiscuous > disabling? Given that most ports generally come up in that state anyway, > and one needs to request enabling it, surely the disable case is relatively > rare? In that case I'd tend to agree with having disabling it returning > error for vpmds. > Yes disabling most probably rare, but still it will generate an error and application is failing because of ring PMD promiscuous disable doesn't look right to me. Perhaps application should differentiate between -ENOTSUP error and operation fail error, but that looks to me adding unnecessary complexity to the app. With a common function shared by all PMDs for both promisc and allmuticast will add a little code and an easier solution. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 15:33 ` Ferruh Yigit @ 2019-10-18 8:18 ` Ferruh Yigit 2019-10-18 8:30 ` Andrew Rybchenko 2019-10-18 10:13 ` Bruce Richardson 1 sibling, 1 reply; 16+ messages in thread From: Ferruh Yigit @ 2019-10-18 8:18 UTC (permalink / raw) To: Bruce Richardson Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/17/2019 4:33 PM, Ferruh Yigit wrote: > On 10/17/2019 2:43 PM, Bruce Richardson wrote: >> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>>> >>>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>>> +Andrew >>>>>>> >>>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>>> working with virtual interfaces, >>>>>>> >>>>>>> We can, >>>>>>> 1- update sample applications to ignore the errors >>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>>> >>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>>> for the physical devices case, so I am for this RFC. >>>>>>> >>>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>>> to reduce the dummy code, what do you think? >>>>>> I don't like the idea to have common empty/dummy functions. >>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>>> it should initialize it properly on init: >>>>>> eth_dev->data->promiscuous = 1; >>>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>>> fail and it is good. >>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>>> but I think mainly we don't really care so it returning error may make the >>>>> applications fail/exit unnecessarily with virtual PMDs. >>>> >>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>>> callback to say me truth. >>>> >>>> If application really does not care, it should be in the application code. >>> >>> Application can't change this because they may be caring return result for the >>> physical devices. >>> >>> Up until this release these missing dev_ops in virtual PMDs were silently >>> ignored, now APIs are more strict on this (which is good) but to get close the >>> previous behavior for virtual PMDs we need to relax on these features (like >>> saying success on promiscuous disable although it didn't). >>> >> The other variable here is how often an app is going to request promiscuous >> disabling? Given that most ports generally come up in that state anyway, >> and one needs to request enabling it, surely the disable case is relatively >> rare? In that case I'd tend to agree with having disabling it returning >> error for vpmds. >> > > Yes disabling most probably rare, but still it will generate an error and > application is failing because of ring PMD promiscuous disable doesn't look > right to me. > > Perhaps application should differentiate between -ENOTSUP error and operation > fail error, but that looks to me adding unnecessary complexity to the app. > > With a common function shared by all PMDs for both promisc and allmuticast will > add a little code and an easier solution. > btw, initialize promiscuous as enabled at PMD init won't help with current APIs because in API dev_ops check is earlier and will still cause -ENOTSUP. rte_eth_promiscuous_enable RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->promiscuous_enable, -ENOTSUP); if (dev->data->promiscuous == 0) diag = (*dev->dev_ops->promiscuous_enable)(dev); dev->data->promiscuous = (diag == 0) ? 1 : 0; return ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-18 8:18 ` Ferruh Yigit @ 2019-10-18 8:30 ` Andrew Rybchenko 0 siblings, 0 replies; 16+ messages in thread From: Andrew Rybchenko @ 2019-10-18 8:30 UTC (permalink / raw) To: Ferruh Yigit, Bruce Richardson Cc: Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/18/19 11:18 AM, Ferruh Yigit wrote: > On 10/17/2019 4:33 PM, Ferruh Yigit wrote: >> On 10/17/2019 2:43 PM, Bruce Richardson wrote: >>> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >>>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>>>> >>>>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>>>> +Andrew >>>>>>>> >>>>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>>>> working with virtual interfaces, >>>>>>>> >>>>>>>> We can, >>>>>>>> 1- update sample applications to ignore the errors >>>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>>>> >>>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>>>> for the physical devices case, so I am for this RFC. >>>>>>>> >>>>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>>>> to reduce the dummy code, what do you think? >>>>>>> I don't like the idea to have common empty/dummy functions. >>>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>>>> it should initialize it properly on init: >>>>>>> eth_dev->data->promiscuous = 1; >>>>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>>>> fail and it is good. >>>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>>>> but I think mainly we don't really care so it returning error may make the >>>>>> applications fail/exit unnecessarily with virtual PMDs. >>>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>>>> callback to say me truth. >>>>> >>>>> If application really does not care, it should be in the application code. >>>> Application can't change this because they may be caring return result for the >>>> physical devices. >>>> >>>> Up until this release these missing dev_ops in virtual PMDs were silently >>>> ignored, now APIs are more strict on this (which is good) but to get close the >>>> previous behavior for virtual PMDs we need to relax on these features (like >>>> saying success on promiscuous disable although it didn't). >>>> >>> The other variable here is how often an app is going to request promiscuous >>> disabling? Given that most ports generally come up in that state anyway, >>> and one needs to request enabling it, surely the disable case is relatively >>> rare? In that case I'd tend to agree with having disabling it returning >>> error for vpmds. >>> >> Yes disabling most probably rare, but still it will generate an error and >> application is failing because of ring PMD promiscuous disable doesn't look >> right to me. >> >> Perhaps application should differentiate between -ENOTSUP error and operation >> fail error, but that looks to me adding unnecessary complexity to the app. >> >> With a common function shared by all PMDs for both promisc and allmuticast will >> add a little code and an easier solution. >> > btw, initialize promiscuous as enabled at PMD init won't help with current APIs > because in API dev_ops check is earlier and will still cause -ENOTSUP. My bad, I think it should be fixed. > rte_eth_promiscuous_enable > RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->promiscuous_enable, -ENOTSUP); > if (dev->data->promiscuous == 0) > diag = (*dev->dev_ops->promiscuous_enable)(dev); > dev->data->promiscuous = (diag == 0) ? 1 : 0; > return ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-17 15:33 ` Ferruh Yigit 2019-10-18 8:18 ` Ferruh Yigit @ 2019-10-18 10:13 ` Bruce Richardson 2019-10-18 11:38 ` Ferruh Yigit 1 sibling, 1 reply; 16+ messages in thread From: Bruce Richardson @ 2019-10-18 10:13 UTC (permalink / raw) To: Ferruh Yigit Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On Thu, Oct 17, 2019 at 04:33:59PM +0100, Ferruh Yigit wrote: > On 10/17/2019 2:43 PM, Bruce Richardson wrote: > > On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: > >> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: > >>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: > >>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: > >>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: > >>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: > >>>>>>> Adding promiscuous functions prevents sample applications failing when run > >>>>>>> on this virtual PMD. The sample applications call promiscuous functions, > >>>>>>> and fail if this function call returns an error, which occurs when the > >>>>>>> virtual PMD does not support the promiscuous function being called. > >>>>>>> > >>>>>>> This change will be implemented for all virtual PMDs that currently do not > >>>>>>> have existing promiscuous functions. Multicast functions will also be > >>>>>>> added for virtual PMDs to prevent sample application breakages here also. > >>>>>> +Andrew > >>>>>> > >>>>>> With the some ethdev APIs returning error code, some sample applications stop > >>>>>> working with virtual interfaces, > >>>>>> > >>>>>> We can, > >>>>>> 1- update sample applications to ignore the errors > >>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) > >>>>>> > >>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong > >>>>>> for the physical devices case, so I am for this RFC. > >>>>>> > >>>>>> Only perhaps we can have some common empty function and keep assigning that one > >>>>>> to reduce the dummy code, what do you think? > >>>>> I don't like the idea to have common empty/dummy functions. > >>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, > >>>>> it should initialize it properly on init: > >>>>> eth_dev->data->promiscuous = 1; > >>>>> If so, if application requires promiscuous mode, attempt to enable will > >>>>> do nothing. If application requires non-promiscuous mode, disable will > >>>>> fail and it is good. > >>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs > >>>> but I think mainly we don't really care so it returning error may make the > >>>> applications fail/exit unnecessarily with virtual PMDs. > >>> > >>> If I test virtual PMD promiscuous mode, I would prefer enable/disable > >>> callback to say me truth. > >>> > >>> If application really does not care, it should be in the application code. > >> > >> Application can't change this because they may be caring return result for the > >> physical devices. > >> > >> Up until this release these missing dev_ops in virtual PMDs were silently > >> ignored, now APIs are more strict on this (which is good) but to get close the > >> previous behavior for virtual PMDs we need to relax on these features (like > >> saying success on promiscuous disable although it didn't). > >> > > The other variable here is how often an app is going to request promiscuous > > disabling? Given that most ports generally come up in that state anyway, > > and one needs to request enabling it, surely the disable case is relatively > > rare? In that case I'd tend to agree with having disabling it returning > > error for vpmds. > > > > Yes disabling most probably rare, but still it will generate an error and > application is failing because of ring PMD promiscuous disable doesn't look > right to me. Well, if an app needs promiscuous mode disabled then having it fail is the right thing to do. If the app doesn't care about promiscuous mode failing, why is it checking the return value at all? > > Perhaps application should differentiate between -ENOTSUP error and operation > fail error, but that looks to me adding unnecessary complexity to the app. > Again, does the app care or not? It's probably still better to return correct info to the app in all cases, and then let the app decide how best to handle it. > With a common function shared by all PMDs for both promisc and allmuticast will > add a little code and an easier solution. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-18 10:13 ` Bruce Richardson @ 2019-10-18 11:38 ` Ferruh Yigit 2019-10-18 11:57 ` Andrew Rybchenko 2019-10-18 13:12 ` Bruce Richardson 0 siblings, 2 replies; 16+ messages in thread From: Ferruh Yigit @ 2019-10-18 11:38 UTC (permalink / raw) To: Bruce Richardson Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/18/2019 11:13 AM, Bruce Richardson wrote: > On Thu, Oct 17, 2019 at 04:33:59PM +0100, Ferruh Yigit wrote: >> On 10/17/2019 2:43 PM, Bruce Richardson wrote: >>> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >>>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>>>> >>>>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>>>> +Andrew >>>>>>>> >>>>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>>>> working with virtual interfaces, >>>>>>>> >>>>>>>> We can, >>>>>>>> 1- update sample applications to ignore the errors >>>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>>>> >>>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>>>> for the physical devices case, so I am for this RFC. >>>>>>>> >>>>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>>>> to reduce the dummy code, what do you think? >>>>>>> I don't like the idea to have common empty/dummy functions. >>>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>>>> it should initialize it properly on init: >>>>>>> eth_dev->data->promiscuous = 1; >>>>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>>>> fail and it is good. >>>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>>>> but I think mainly we don't really care so it returning error may make the >>>>>> applications fail/exit unnecessarily with virtual PMDs. >>>>> >>>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>>>> callback to say me truth. >>>>> >>>>> If application really does not care, it should be in the application code. >>>> >>>> Application can't change this because they may be caring return result for the >>>> physical devices. >>>> >>>> Up until this release these missing dev_ops in virtual PMDs were silently >>>> ignored, now APIs are more strict on this (which is good) but to get close the >>>> previous behavior for virtual PMDs we need to relax on these features (like >>>> saying success on promiscuous disable although it didn't). >>>> >>> The other variable here is how often an app is going to request promiscuous >>> disabling? Given that most ports generally come up in that state anyway, >>> and one needs to request enabling it, surely the disable case is relatively >>> rare? In that case I'd tend to agree with having disabling it returning >>> error for vpmds. >>> >> >> Yes disabling most probably rare, but still it will generate an error and >> application is failing because of ring PMD promiscuous disable doesn't look >> right to me. > > Well, if an app needs promiscuous mode disabled then having it fail is the > right thing to do. If the app doesn't care about promiscuous mode failing, > why is it checking the return value at all? > >> >> Perhaps application should differentiate between -ENOTSUP error and operation >> fail error, but that looks to me adding unnecessary complexity to the app. >> > Again, does the app care or not? It's probably still better to return > correct info to the app in all cases, and then let the app decide how best > to handle it. My thinking is, application "cares" about the ethdev API return values, but to check/test quickly with null/ring PMD perhaps not really care that much abut promisc/allmuticast support of these PMDs and let's relax these support of virtual PMDs to make life easy. But eventually the main target is to fix sample applications to run with virtual PMDs which has been broken in this release. Both approach works, a) Implement dummy dev_ops to virtual PMDs to report success b) Update ethdev APIs to not call dev_ops if the requested configuration is already satisfied and change virtual PMDs to report promisc & allmulticast enabled by default. (disable still will have same issue) Is the consensus option (b)? btw, the problem exists in high level for the offload support, if the application is requesting a specific offload support it fails to run with the virtual PMDs since virtual PMDs doesn't support any offloads. Indeed I have same suggestion for this case too, relax the virtual PMD by claiming it supports all offloads. Because at least for me when I use those virtual PMDs I don't really would like to test offloads or the procmisc/allmulticast features ... > >> With a common function shared by all PMDs for both promisc and allmuticast will >> add a little code and an easier solution. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-18 11:38 ` Ferruh Yigit @ 2019-10-18 11:57 ` Andrew Rybchenko 2019-10-18 13:02 ` Ferruh Yigit 2019-10-18 13:12 ` Bruce Richardson 1 sibling, 1 reply; 16+ messages in thread From: Andrew Rybchenko @ 2019-10-18 11:57 UTC (permalink / raw) To: Ferruh Yigit, Bruce Richardson Cc: Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/18/19 2:38 PM, Ferruh Yigit wrote: > On 10/18/2019 11:13 AM, Bruce Richardson wrote: >> On Thu, Oct 17, 2019 at 04:33:59PM +0100, Ferruh Yigit wrote: >>> On 10/17/2019 2:43 PM, Bruce Richardson wrote: >>>> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >>>>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>>>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>>>>> >>>>>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>>>>> +Andrew >>>>>>>>> >>>>>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>>>>> working with virtual interfaces, >>>>>>>>> >>>>>>>>> We can, >>>>>>>>> 1- update sample applications to ignore the errors >>>>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>>>>> >>>>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>>>>> for the physical devices case, so I am for this RFC. >>>>>>>>> >>>>>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>>>>> to reduce the dummy code, what do you think? >>>>>>>> I don't like the idea to have common empty/dummy functions. >>>>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>>>>> it should initialize it properly on init: >>>>>>>> eth_dev->data->promiscuous = 1; >>>>>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>>>>> fail and it is good. >>>>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>>>>> but I think mainly we don't really care so it returning error may make the >>>>>>> applications fail/exit unnecessarily with virtual PMDs. >>>>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>>>>> callback to say me truth. >>>>>> >>>>>> If application really does not care, it should be in the application code. >>>>> Application can't change this because they may be caring return result for the >>>>> physical devices. >>>>> >>>>> Up until this release these missing dev_ops in virtual PMDs were silently >>>>> ignored, now APIs are more strict on this (which is good) but to get close the >>>>> previous behavior for virtual PMDs we need to relax on these features (like >>>>> saying success on promiscuous disable although it didn't). >>>>> >>>> The other variable here is how often an app is going to request promiscuous >>>> disabling? Given that most ports generally come up in that state anyway, >>>> and one needs to request enabling it, surely the disable case is relatively >>>> rare? In that case I'd tend to agree with having disabling it returning >>>> error for vpmds. >>>> >>> Yes disabling most probably rare, but still it will generate an error and >>> application is failing because of ring PMD promiscuous disable doesn't look >>> right to me. >> Well, if an app needs promiscuous mode disabled then having it fail is the >> right thing to do. If the app doesn't care about promiscuous mode failing, >> why is it checking the return value at all? >> >>> Perhaps application should differentiate between -ENOTSUP error and operation >>> fail error, but that looks to me adding unnecessary complexity to the app. >>> >> Again, does the app care or not? It's probably still better to return >> correct info to the app in all cases, and then let the app decide how best >> to handle it. > My thinking is, application "cares" about the ethdev API return values, but to > check/test quickly with null/ring PMD perhaps not really care that much abut > promisc/allmuticast support of these PMDs and let's relax these support of > virtual PMDs to make life easy. > > But eventually the main target is to fix sample applications to run with virtual > PMDs which has been broken in this release. > Both approach works, > a) Implement dummy dev_ops to virtual PMDs to report success > b) Update ethdev APIs to not call dev_ops if the requested configuration is > already satisfied and change virtual PMDs to report promisc & allmulticast > enabled by default. (disable still will have same issue) > > Is the consensus option (b)? Yes. > btw, the problem exists in high level for the offload support, if the > application is requesting a specific offload support it fails to run with the > virtual PMDs since virtual PMDs doesn't support any offloads. Indeed I have same > suggestion for this case too, relax the virtual PMD by claiming it supports all > offloads. Because at least for me when I use those virtual PMDs I don't really > would like to test offloads or the procmisc/allmulticast features ... It looks like I simply don't understand virtual PMDs usacase. >>> With a common function shared by all PMDs for both promisc and allmuticast will >>> add a little code and an easier solution. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-18 11:57 ` Andrew Rybchenko @ 2019-10-18 13:02 ` Ferruh Yigit 0 siblings, 0 replies; 16+ messages in thread From: Ferruh Yigit @ 2019-10-18 13:02 UTC (permalink / raw) To: Andrew Rybchenko, Bruce Richardson Cc: Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/18/2019 12:57 PM, Andrew Rybchenko wrote: > On 10/18/19 2:38 PM, Ferruh Yigit wrote: >> On 10/18/2019 11:13 AM, Bruce Richardson wrote: >>> On Thu, Oct 17, 2019 at 04:33:59PM +0100, Ferruh Yigit wrote: >>>> On 10/17/2019 2:43 PM, Bruce Richardson wrote: >>>>> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >>>>>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>>>>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>>>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>>>>>> >>>>>>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>>>>>> +Andrew >>>>>>>>>> >>>>>>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>>>>>> working with virtual interfaces, >>>>>>>>>> >>>>>>>>>> We can, >>>>>>>>>> 1- update sample applications to ignore the errors >>>>>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>>>>>> >>>>>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>>>>>> for the physical devices case, so I am for this RFC. >>>>>>>>>> >>>>>>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>>>>>> to reduce the dummy code, what do you think? >>>>>>>>> I don't like the idea to have common empty/dummy functions. >>>>>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>>>>>> it should initialize it properly on init: >>>>>>>>> eth_dev->data->promiscuous = 1; >>>>>>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>>>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>>>>>> fail and it is good. >>>>>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>>>>>> but I think mainly we don't really care so it returning error may make the >>>>>>>> applications fail/exit unnecessarily with virtual PMDs. >>>>>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>>>>>> callback to say me truth. >>>>>>> >>>>>>> If application really does not care, it should be in the application code. >>>>>> Application can't change this because they may be caring return result for the >>>>>> physical devices. >>>>>> >>>>>> Up until this release these missing dev_ops in virtual PMDs were silently >>>>>> ignored, now APIs are more strict on this (which is good) but to get close the >>>>>> previous behavior for virtual PMDs we need to relax on these features (like >>>>>> saying success on promiscuous disable although it didn't). >>>>>> >>>>> The other variable here is how often an app is going to request promiscuous >>>>> disabling? Given that most ports generally come up in that state anyway, >>>>> and one needs to request enabling it, surely the disable case is relatively >>>>> rare? In that case I'd tend to agree with having disabling it returning >>>>> error for vpmds. >>>>> >>>> Yes disabling most probably rare, but still it will generate an error and >>>> application is failing because of ring PMD promiscuous disable doesn't look >>>> right to me. >>> Well, if an app needs promiscuous mode disabled then having it fail is the >>> right thing to do. If the app doesn't care about promiscuous mode failing, >>> why is it checking the return value at all? >>> >>>> Perhaps application should differentiate between -ENOTSUP error and operation >>>> fail error, but that looks to me adding unnecessary complexity to the app. >>>> >>> Again, does the app care or not? It's probably still better to return >>> correct info to the app in all cases, and then let the app decide how best >>> to handle it. >> My thinking is, application "cares" about the ethdev API return values, but to >> check/test quickly with null/ring PMD perhaps not really care that much abut >> promisc/allmuticast support of these PMDs and let's relax these support of >> virtual PMDs to make life easy. >> >> But eventually the main target is to fix sample applications to run with virtual >> PMDs which has been broken in this release. >> Both approach works, >> a) Implement dummy dev_ops to virtual PMDs to report success >> b) Update ethdev APIs to not call dev_ops if the requested configuration is >> already satisfied and change virtual PMDs to report promisc & allmulticast >> enabled by default. (disable still will have same issue) >> >> Is the consensus option (b)? > > Yes. > >> btw, the problem exists in high level for the offload support, if the >> application is requesting a specific offload support it fails to run with the >> virtual PMDs since virtual PMDs doesn't support any offloads. Indeed I have same >> suggestion for this case too, relax the virtual PMD by claiming it supports all >> offloads. Because at least for me when I use those virtual PMDs I don't really >> would like to test offloads or the procmisc/allmulticast features ... > > It looks like I simply don't understand virtual PMDs usacase. I guess it changes for virtual PMD, bonding, failsafe, vhost, etc has more production use cases, null I would assume mostly used for debugging. > >>>> With a common function shared by all PMDs for both promisc and allmuticast will >>>> add a little code and an easier solution. > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-18 11:38 ` Ferruh Yigit 2019-10-18 11:57 ` Andrew Rybchenko @ 2019-10-18 13:12 ` Bruce Richardson 2019-10-18 13:38 ` Ferruh Yigit 1 sibling, 1 reply; 16+ messages in thread From: Bruce Richardson @ 2019-10-18 13:12 UTC (permalink / raw) To: Ferruh Yigit Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On Fri, Oct 18, 2019 at 12:38:53PM +0100, Ferruh Yigit wrote: > On 10/18/2019 11:13 AM, Bruce Richardson wrote: > > On Thu, Oct 17, 2019 at 04:33:59PM +0100, Ferruh Yigit wrote: > >> On 10/17/2019 2:43 PM, Bruce Richardson wrote: > >>> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: > >>>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: > >>>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: > >>>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: > >>>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: > >>>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: > >>>>>>>>> Adding promiscuous functions prevents sample applications failing when run > >>>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, > >>>>>>>>> and fail if this function call returns an error, which occurs when the > >>>>>>>>> virtual PMD does not support the promiscuous function being called. > >>>>>>>>> > >>>>>>>>> This change will be implemented for all virtual PMDs that currently do not > >>>>>>>>> have existing promiscuous functions. Multicast functions will also be > >>>>>>>>> added for virtual PMDs to prevent sample application breakages here also. > >>>>>>>> +Andrew > >>>>>>>> > >>>>>>>> With the some ethdev APIs returning error code, some sample applications stop > >>>>>>>> working with virtual interfaces, > >>>>>>>> > >>>>>>>> We can, > >>>>>>>> 1- update sample applications to ignore the errors > >>>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) > >>>>>>>> > >>>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong > >>>>>>>> for the physical devices case, so I am for this RFC. > >>>>>>>> > >>>>>>>> Only perhaps we can have some common empty function and keep assigning that one > >>>>>>>> to reduce the dummy code, what do you think? > >>>>>>> I don't like the idea to have common empty/dummy functions. > >>>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, > >>>>>>> it should initialize it properly on init: > >>>>>>> eth_dev->data->promiscuous = 1; > >>>>>>> If so, if application requires promiscuous mode, attempt to enable will > >>>>>>> do nothing. If application requires non-promiscuous mode, disable will > >>>>>>> fail and it is good. > >>>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs > >>>>>> but I think mainly we don't really care so it returning error may make the > >>>>>> applications fail/exit unnecessarily with virtual PMDs. > >>>>> > >>>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable > >>>>> callback to say me truth. > >>>>> > >>>>> If application really does not care, it should be in the application code. > >>>> > >>>> Application can't change this because they may be caring return result for the > >>>> physical devices. > >>>> > >>>> Up until this release these missing dev_ops in virtual PMDs were silently > >>>> ignored, now APIs are more strict on this (which is good) but to get close the > >>>> previous behavior for virtual PMDs we need to relax on these features (like > >>>> saying success on promiscuous disable although it didn't). > >>>> > >>> The other variable here is how often an app is going to request promiscuous > >>> disabling? Given that most ports generally come up in that state anyway, > >>> and one needs to request enabling it, surely the disable case is relatively > >>> rare? In that case I'd tend to agree with having disabling it returning > >>> error for vpmds. > >>> > >> > >> Yes disabling most probably rare, but still it will generate an error and > >> application is failing because of ring PMD promiscuous disable doesn't look > >> right to me. > > > > Well, if an app needs promiscuous mode disabled then having it fail is the > > right thing to do. If the app doesn't care about promiscuous mode failing, > > why is it checking the return value at all? > > > >> > >> Perhaps application should differentiate between -ENOTSUP error and operation > >> fail error, but that looks to me adding unnecessary complexity to the app. > >> > > Again, does the app care or not? It's probably still better to return > > correct info to the app in all cases, and then let the app decide how best > > to handle it. > > My thinking is, application "cares" about the ethdev API return values, but to > check/test quickly with null/ring PMD perhaps not really care that much abut > promisc/allmuticast support of these PMDs and let's relax these support of > virtual PMDs to make life easy. > > But eventually the main target is to fix sample applications to run with virtual > PMDs which has been broken in this release. > Both approach works, > a) Implement dummy dev_ops to virtual PMDs to report success > b) Update ethdev APIs to not call dev_ops if the requested configuration is > already satisfied and change virtual PMDs to report promisc & allmulticast > enabled by default. (disable still will have same issue) > > Is the consensus option (b)? > > > > btw, the problem exists in high level for the offload support, if the > application is requesting a specific offload support it fails to run with the > virtual PMDs since virtual PMDs doesn't support any offloads. Indeed I have same > suggestion for this case too, relax the virtual PMD by claiming it supports all > offloads. Because at least for me when I use those virtual PMDs I don't really > would like to test offloads or the procmisc/allmulticast features ... > I really dislike having the drivers lying. It may work in some cases, but eventually you will hit a problem where an app really does need a feature and then breaks for the user in mysterious ways when run with a virtual PMD. Much better to have the vPMD always report the truth to the app, and let the app worry about whether the app can continue on error or not. Final option I'd throw out there, is to allow a vdev parameter to tell the vpmd it's allowed to lie. That gives an override in case of an app that can't handle a non-fatal failure. /Bruce ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions 2019-10-18 13:12 ` Bruce Richardson @ 2019-10-18 13:38 ` Ferruh Yigit 0 siblings, 0 replies; 16+ messages in thread From: Ferruh Yigit @ 2019-10-18 13:38 UTC (permalink / raw) To: Bruce Richardson Cc: Andrew Rybchenko, Ciara Power, mtetsuyah, dev, Thomas Monjalon On 10/18/2019 2:12 PM, Bruce Richardson wrote: > On Fri, Oct 18, 2019 at 12:38:53PM +0100, Ferruh Yigit wrote: >> On 10/18/2019 11:13 AM, Bruce Richardson wrote: >>> On Thu, Oct 17, 2019 at 04:33:59PM +0100, Ferruh Yigit wrote: >>>> On 10/17/2019 2:43 PM, Bruce Richardson wrote: >>>>> On Thu, Oct 17, 2019 at 12:05:56PM +0100, Ferruh Yigit wrote: >>>>>> On 10/17/2019 11:51 AM, Andrew Rybchenko wrote: >>>>>>> On 10/17/19 1:47 PM, Ferruh Yigit wrote: >>>>>>>> On 10/17/2019 11:37 AM, Andrew Rybchenko wrote: >>>>>>>>> On 10/16/19 9:07 PM, Ferruh Yigit wrote: >>>>>>>>>> On 10/16/2019 4:46 PM, Ciara Power wrote: >>>>>>>>>>> Adding promiscuous functions prevents sample applications failing when run >>>>>>>>>>> on this virtual PMD. The sample applications call promiscuous functions, >>>>>>>>>>> and fail if this function call returns an error, which occurs when the >>>>>>>>>>> virtual PMD does not support the promiscuous function being called. >>>>>>>>>>> >>>>>>>>>>> This change will be implemented for all virtual PMDs that currently do not >>>>>>>>>>> have existing promiscuous functions. Multicast functions will also be >>>>>>>>>>> added for virtual PMDs to prevent sample application breakages here also. >>>>>>>>>> +Andrew >>>>>>>>>> >>>>>>>>>> With the some ethdev APIs returning error code, some sample applications stop >>>>>>>>>> working with virtual interfaces, >>>>>>>>>> >>>>>>>>>> We can, >>>>>>>>>> 1- update sample applications to ignore the errors >>>>>>>>>> 2- Add dummy dev_ops support to (almost all) virtual PMDs (what this RFC suggests) >>>>>>>>>> >>>>>>>>>> (1) puts us back to before the ethdev APIs updated status, and this may be wrong >>>>>>>>>> for the physical devices case, so I am for this RFC. >>>>>>>>>> >>>>>>>>>> Only perhaps we can have some common empty function and keep assigning that one >>>>>>>>>> to reduce the dummy code, what do you think? >>>>>>>>> I don't like the idea to have common empty/dummy functions. >>>>>>>>> If virtual PMD behaves in accordance with enabled promiscuous mode, >>>>>>>>> it should initialize it properly on init: >>>>>>>>> eth_dev->data->promiscuous = 1; >>>>>>>>> If so, if application requires promiscuous mode, attempt to enable will >>>>>>>>> do nothing. If application requires non-promiscuous mode, disable will >>>>>>>>> fail and it is good. >>>>>>>> It is technically correct that we can't disable promiscuous mode in virtual PMDs >>>>>>>> but I think mainly we don't really care so it returning error may make the >>>>>>>> applications fail/exit unnecessarily with virtual PMDs. >>>>>>> >>>>>>> If I test virtual PMD promiscuous mode, I would prefer enable/disable >>>>>>> callback to say me truth. >>>>>>> >>>>>>> If application really does not care, it should be in the application code. >>>>>> >>>>>> Application can't change this because they may be caring return result for the >>>>>> physical devices. >>>>>> >>>>>> Up until this release these missing dev_ops in virtual PMDs were silently >>>>>> ignored, now APIs are more strict on this (which is good) but to get close the >>>>>> previous behavior for virtual PMDs we need to relax on these features (like >>>>>> saying success on promiscuous disable although it didn't). >>>>>> >>>>> The other variable here is how often an app is going to request promiscuous >>>>> disabling? Given that most ports generally come up in that state anyway, >>>>> and one needs to request enabling it, surely the disable case is relatively >>>>> rare? In that case I'd tend to agree with having disabling it returning >>>>> error for vpmds. >>>>> >>>> >>>> Yes disabling most probably rare, but still it will generate an error and >>>> application is failing because of ring PMD promiscuous disable doesn't look >>>> right to me. >>> >>> Well, if an app needs promiscuous mode disabled then having it fail is the >>> right thing to do. If the app doesn't care about promiscuous mode failing, >>> why is it checking the return value at all? >>> >>>> >>>> Perhaps application should differentiate between -ENOTSUP error and operation >>>> fail error, but that looks to me adding unnecessary complexity to the app. >>>> >>> Again, does the app care or not? It's probably still better to return >>> correct info to the app in all cases, and then let the app decide how best >>> to handle it. >> >> My thinking is, application "cares" about the ethdev API return values, but to >> check/test quickly with null/ring PMD perhaps not really care that much abut >> promisc/allmuticast support of these PMDs and let's relax these support of >> virtual PMDs to make life easy. >> >> But eventually the main target is to fix sample applications to run with virtual >> PMDs which has been broken in this release. >> Both approach works, >> a) Implement dummy dev_ops to virtual PMDs to report success >> b) Update ethdev APIs to not call dev_ops if the requested configuration is >> already satisfied and change virtual PMDs to report promisc & allmulticast >> enabled by default. (disable still will have same issue) >> >> Is the consensus option (b)? >> >> >> >> btw, the problem exists in high level for the offload support, if the >> application is requesting a specific offload support it fails to run with the >> virtual PMDs since virtual PMDs doesn't support any offloads. Indeed I have same >> suggestion for this case too, relax the virtual PMD by claiming it supports all >> offloads. Because at least for me when I use those virtual PMDs I don't really >> would like to test offloads or the procmisc/allmulticast features ... >> > I really dislike having the drivers lying. It may work in some cases, but > eventually you will hit a problem where an app really does need a feature > and then breaks for the user in mysterious ways when run with a virtual > PMD. Much better to have the vPMD always report the truth to the app, and > let the app worry about whether the app can continue on error or not. > > Final option I'd throw out there, is to allow a vdev parameter to tell the > vpmd it's allowed to lie. That gives an override in case of an app that > can't handle a non-fatal failure. vdev devarg can work for the offload case, only issue I can see at first glance is code duplication among the PMDs but perhaps that can be solved when issue checked in-dept. ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2019-10-18 13:38 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2019-10-16 15:46 [dpdk-dev] [RFC] net/null: add empty promiscuous mode functions Ciara Power 2019-10-16 18:07 ` Ferruh Yigit 2019-10-17 10:37 ` Andrew Rybchenko 2019-10-17 10:47 ` Ferruh Yigit 2019-10-17 10:51 ` Andrew Rybchenko 2019-10-17 11:05 ` Ferruh Yigit 2019-10-17 13:43 ` Bruce Richardson 2019-10-17 15:33 ` Ferruh Yigit 2019-10-18 8:18 ` Ferruh Yigit 2019-10-18 8:30 ` Andrew Rybchenko 2019-10-18 10:13 ` Bruce Richardson 2019-10-18 11:38 ` Ferruh Yigit 2019-10-18 11:57 ` Andrew Rybchenko 2019-10-18 13:02 ` Ferruh Yigit 2019-10-18 13:12 ` Bruce Richardson 2019-10-18 13:38 ` Ferruh Yigit
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).