Re: [PATCH net] be2net: propagate bridge config query errors

Simon Horman <[email protected]>
Newsgroups org.kernel.vger.netdev,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
Full review at: https://sashiko.dev/#/patchset/[email protected]?part=1
---
--- Patch [1]: [PATCH net] be2net: propagate bridge config query errors ---
commit 7ca874943675f3c258ffbdac77a92f7564cc5f1a
Author: Avi Weiss <[email protected]>

be2net: propagate bridge config query errors

This patch modifies be_ndo_bridge_getlink to return a normalized error code
when be_cmd_get_hsw_config fails. The goal is to propagate the hardware or
firmware error to rtnetlink users instead of silently masking it with a
success return code.

> diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
> --- a/drivers/net/ethernet/emulex/benet/be_main.c
> +++ b/drivers/net/ethernet/emulex/benet/be_main.c
> @@ -5028,7 +5028,7 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq,
>  					       adapter->if_handle, &hsw_mode,
>  					       NULL);
>  		if (status)
> -			return 0;
> +			return be_cmd_status(status);

[Severity: High]
Will returning a hard error here abort the system-wide rtnetlink bridge dump?

Looking at how the netlink core handles the return value from
ndo_bridge_getlink:

net/core/rtnetlink.c:rtnl_bridge_getlink() {
...
                err = ops->ndo_bridge_getlink(skb, portid,
                                              seq, dev,
                                              filter_mask,
                                              NLM_F_MULTI);
                if (err < 0 && err != -EOPNOTSUPP) {
                        if (likely(skb->len))
                                break;
                        goto out_err;
                }
...
}

If a localized firmware failure causes the be2net driver to return an error
like -EIO, it appears this will terminate the global netlink dump. Could this
cause system management tools like 'bridge link' to fail to list all the
other unrelated network interfaces on the system?

>  
>  		if (hsw_mode == PORT_FWD_TYPE_PASSTHRU)
>  			return 0;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.