From: Florian Fainelli Subject: Re: [PATCH net-next 2/3] net: dsa: bcm_sf2: Propagate ethtool::rxnfc to CPU port Date: Mon, 6 Aug 2018 15:37:24 -0700 Message-ID: References: <20180806212909.21720-1-f.fainelli@gmail.com> <20180806212909.21720-4-f.fainelli@gmail.com> <20180806223225.GE18350@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org, vivien.didelot@savoirfairelinux.com, linville@tuxdriver.com, davem@davemloft.net To: Andrew Lunn Return-path: Received: from mail-pl0-f68.google.com ([209.85.160.68]:34789 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730735AbeHGAsq (ORCPT ); Mon, 6 Aug 2018 20:48:46 -0400 Received: by mail-pl0-f68.google.com with SMTP id f6-v6so6233885plo.1 for ; Mon, 06 Aug 2018 15:37:33 -0700 (PDT) In-Reply-To: <20180806223225.GE18350@lunn.ch> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 08/06/2018 03:32 PM, Andrew Lunn wrote: >> 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. Hu, right, thanks for spotting it, this is done in the set_rxnfc() part, will submit a v2 shortly. > >> + /* 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 > -- Florian