diff options
author | Hariprasad Shenai <hariprasad@chelsio.com> | 2015-10-21 09:09:55 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-22 14:03:57 (GMT) |
commit | 6ac5fe75df57299cfbd89eb35a36d979742a69d8 (patch) | |
tree | 99131b4918c2ebf3073e00a65c440e7a7fbf0e38 | |
parent | 52a5f8463b10e49da93190dd0ee24e7f1c4860fd (diff) | |
download | linux-6ac5fe75df57299cfbd89eb35a36d979742a69d8.tar.xz |
cxgb4: Return error if setup_rss is called before probe
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c index b7b8c46..59374dc 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c @@ -1015,11 +1015,15 @@ static int set_rss_table(struct net_device *dev, const u32 *p, const u8 *key, if (!p) return 0; - for (i = 0; i < pi->rss_size; i++) - pi->rss[i] = p[i]; - if (pi->adapter->flags & FULL_INIT_DONE) + /* Interface must be brought up atleast once */ + if (pi->adapter->flags & FULL_INIT_DONE) { + for (i = 0; i < pi->rss_size; i++) + pi->rss[i] = p[i]; + return cxgb4_write_rss(pi, pi->rss); - return 0; + } + + return -EPERM; } static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, |