[ovs-dev] [PATCH v1] netdev-dpdk: Fix flow control configuration.

Ilya Maximets i.maximets at samsung.com
Tue Sep 10 09:29:48 UTC 2019


On 09.09.2019 14:39, Tomasz Konieczny wrote:
> Currently OVS is unable to change flow control configuration in DPDK
> because new settings are being overwritten by current settings
> with rte_eth_dev_flow_ctrl_get(). The fix restores correct order
> of operations and at the same time does not trigger error on devices
> without flow control support when flow control not requested.
> 
> Fixes: d95a8d2b0bd6 ("netdev-dpdk: Fix flow control configuration.")
> Signed-off-by: Tomasz Konieczny <tomaszx.konieczny at intel.com>
> ---

Hi Tomasz,
Thanks for the fix!

I agree that current code in master doesn't make any sense. :)
It seems that no-one uses this functionality since it's broken
for more than a year already.

Fixes tag should point to the commit from master branch, so it
should be:
Fixes: 7e1de65e8dfb ("netdev-dpdk: Fix failure to configure flow control at netdev-init.")

Regarding the fix itself:
Can we just move following two lines:

        dev->fc_conf.mode = fc_mode;
        dev->fc_conf.autoneg = autoneg;

below the rte_eth_dev_flow_ctrl_get() ?
Current version of the patch will re-setup flow control on each call
if it is not in initial state.

Best regards, Ilya Maximets.

>  lib/netdev-dpdk.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index bc20d68..c02dea1 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -1856,17 +1856,19 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args,
>      rx_fc_en = smap_get_bool(args, "rx-flow-ctrl", false);
>      tx_fc_en = smap_get_bool(args, "tx-flow-ctrl", false);
>      autoneg = smap_get_bool(args, "flow-ctrl-autoneg", false);
> -
>      fc_mode = fc_mode_set[tx_fc_en][rx_fc_en];
> -    if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) {
> -        dev->fc_conf.mode = fc_mode;
> -        dev->fc_conf.autoneg = autoneg;
> +
> +    if (fc_mode != RTE_FC_NONE || autoneg != false) {
>          /* Get the Flow control configuration for DPDK-ETH */
>          err = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf);
>          if (err) {
>              VLOG_WARN("Cannot get flow control parameters on port "
>                  DPDK_PORT_ID_FMT", err=%d", dev->port_id, err);
>          }
> +    }
> +    if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) {
> +        dev->fc_conf.mode = fc_mode;
> +        dev->fc_conf.autoneg = autoneg;
>          dpdk_eth_flow_ctrl_setup(dev);
>      }
>  
> 


More information about the dev mailing list