On Thu, Mar 6, 2025 at 9:53 AM Kevin Traynor <[email protected]> wrote:
>
> From: Jay Ding <[email protected]>
>
> rte_eth_dev_info_get() could fail due to device reset, etc.
>
> The return value should be checked before the device info
> pointer is dereferenced.
>
> Fixes: 2f196c80e716 ("netdev-dpdk: Use LSC interrupt mode.")
> Signed-off-by: Jay Ding <[email protected]>
> ---
>  lib/netdev-dpdk.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
> index 549887b31..35cd2ae17 100644
> --- a/lib/netdev-dpdk.c
> +++ b/lib/netdev-dpdk.c
> @@ -2424,5 +2424,6 @@ netdev_dpdk_set_config(struct netdev *netdev, const 
> struct smap *args,
>
>      lsc_interrupt_mode = smap_get_bool(args, "dpdk-lsc-interrupt", true);
> -    if (lsc_interrupt_mode && !(*info.dev_flags & RTE_ETH_DEV_INTR_LSC)) {
> +    if (lsc_interrupt_mode && !ret &&
> +            !(*info.dev_flags & RTE_ETH_DEV_INTR_LSC)) {

Hello,

With this, if rte_eth_dev_info_get() returns an error and the card
does not support lsc_interrupt_mode, we will always set
requested_lsc_interrupt_mode.

Maybe it would be preferable to wrap all the lines related to
lsc_interrupt_mode in an "if (!ret)" ?

Cheers,
M

>          if (smap_get(args, "dpdk-lsc-interrupt")) {
>              VLOG_WARN_BUF(errp, "'%s': link status interrupt is not "
> --
> 2.48.1
>
> _______________________________________________
> dev mailing list
> [email protected]
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to