sfc: Fix return value from efx_ethtool_set_rx_ntuple()
authorBen Hutchings <bhutchings@solarflare.com>
Sat, 14 May 2011 01:35:25 +0000 (02:35 +0100)
committerBen Hutchings <bhutchings@solarflare.com>
Sat, 14 May 2011 01:35:25 +0000 (02:35 +0100)
ethtool_ops::set_rx_ntuple is supposed to return 0 on success, but it
currently returns the filter ID when it inserts or modifies a filter.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
drivers/net/sfc/ethtool.c

index 8c5e0052c44aef836391aada06b4bc22829365d9..348437a8117eb9596a452b3534c0ba8fc9f10cb0 100644 (file)
@@ -955,8 +955,9 @@ static int efx_ethtool_set_rx_ntuple(struct net_device *net_dev,
 
        if (ntuple->fs.action == ETHTOOL_RXNTUPLE_ACTION_CLEAR)
                return efx_filter_remove_filter(efx, &filter);
-       else
-               return efx_filter_insert_filter(efx, &filter, true);
+
+       rc = efx_filter_insert_filter(efx, &filter, true);
+       return rc < 0 ? rc : 0;
 }
 
 static int efx_ethtool_get_rxfh_indir(struct net_device *net_dev,