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

Reply via email to