From: Andrew Lunn Subject: Re: [PATCH net-next 2/3] net: dsa: bcm_sf2: Propagate ethtool::rxnfc to CPU port Date: Tue, 7 Aug 2018 00:32:25 +0200 Message-ID: <20180806223225.GE18350@lunn.ch> References: <20180806212909.21720-1-f.fainelli@gmail.com> <20180806212909.21720-4-f.fainelli@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@vger.kernel.org, vivien.didelot@savoirfairelinux.com, linville@tuxdriver.com, davem@davemloft.net To: Florian Fainelli Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:56772 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728198AbeHGAnm (ORCPT ); Mon, 6 Aug 2018 20:43:42 -0400 Content-Disposition: inline In-Reply-To: <20180806212909.21720-4-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: > 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