On Thu, Feb 9, 2023 at 5:29 PM Kevin Traynor <ktray...@redhat.com> wrote:
>
> By default OVS configures 2048 descriptors for tx and rx queues
> on DPDK devices. It also allows the user to configure those values.
>
> If the values used are not acceptable to the device than queue setup
> will fail.
>
> The device exposes it's max/min/alignment requirements, so use those
> to ensure that an acceptable value is used during queue setup.
>
> If the default or user value is not acceptable, adjust to a suitable
> value.
>
> Reported-at: https://bugzilla.redhat.com/2119876
> Signed-off-by: Kevin Traynor <ktray...@redhat.com>
> ---
>  lib/netdev-dpdk.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index fb0dd43f7..e901f857e 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -1008,4 +1008,13 @@ dpdk_watchdog(void *dummy OVS_UNUSED)
>  }
>
> +static int
> +dpdk_limit_desc_size(int desc_size, struct rte_eth_desc_lim *lim)
> +{
> +    desc_size = ROUND_UP(desc_size, lim->nb_align);

Based on a quick grep, it seems possible a driver exposes nb_align == 0.
Like for example:
https://git.dpdk.org/dpdk/tree/drivers/net/bnxt/bnxt_ethdev.c#n1020

> +    desc_size = MIN(desc_size, lim->nb_max);
> +    desc_size = MAX(desc_size, lim->nb_min);
> +    return desc_size;

Automatically adjusting a default value seems normal to me.
But in the case of user input, I think it would help if there was some
log indicating that OVS adjusted the config.


> +}
> +
>  static int
>  dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int n_rxq, int n_txq)
> @@ -1056,4 +1065,7 @@ dpdk_eth_dev_port_config(struct netdev_dpdk *dev, int 
> n_rxq, int n_txq)
>      }
>
> +    dev->rxq_size = dpdk_limit_desc_size(dev->rxq_size, &info.rx_desc_lim);
> +    dev->txq_size = dpdk_limit_desc_size(dev->txq_size, &info.tx_desc_lim);
> +
>      /* A device may report more queues than it makes available (this has
>       * been observed for Intel xl710, which reserves some of them for
> --
> 2.39.1
>
> _______________________________________________
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>


-- 
David Marchand

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to