[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180806223225.GE18350@lunn.ch>
Date: Tue, 7 Aug 2018 00:32:25 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Florian Fainelli <f.fainelli@...il.com>
Cc: netdev@...r.kernel.org, vivien.didelot@...oirfairelinux.com,
linville@...driver.com, davem@...emloft.net
Subject: Re: [PATCH net-next 2/3] net: dsa: bcm_sf2: Propagate ethtool::rxnfc
to CPU port
> int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port,
> struct ethtool_rxnfc *nfc, u32 *rule_locs)
> {
> + struct net_device *p = ds->ports[port].cpu_dp->master;
> struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
> int ret = 0;
>
> @@ -1214,12 +1223,20 @@ int bcm_sf2_get_rxnfc(struct dsa_switch *ds, int port,
>
> mutex_unlock(&priv->cfp.lock);
Hi Florian
I think you should be testing ret here. If you have had a real error,
you probably should be returning it, rather than overwriting it with
what ethtool returns below.
> + /* Pass up the commands to the attached master network device */
> + if (p->ethtool_ops->get_rxnfc) {
> + ret = p->ethtool_ops->get_rxnfc(p, nfc, rule_locs);
> + if (ret == -EOPNOTSUPP)
> + ret = 0;
> + }
> +
> return ret;
> }
Andrew
Powered by blists - more mailing lists