diff options
author | Kalesh AP <kalesh.purayil@emulex.com> | 2014-05-09 03:59:19 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-09 13:13:39 -0400 |
commit | b51aa36725909369c7c0c8e4dcb697efb2d31265 (patch) | |
tree | e44775afd0fd1f06c7c6ff8bd14250227eac4e17 /drivers/net/ethernet/emulex/benet/be_cmds.c | |
parent | 5c29c09be73755fe99749c99a42c11121d6a8c12 (diff) |
be2net: use MCCQ instead of MBOX in be_cmd_rss_config()
be_cmd_rss_config() is called after the MCCQ is created; so this cmd is
now modified to use the MCCQ instead of MBOX. Also fixed some indentation
problem in this routine.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com>
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_cmds.c')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index 5b236640ccea..476752d0a6a4 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -2042,10 +2042,13 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, | |||
2042 | if (!(be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) | 2042 | if (!(be_if_cap_flags(adapter) & BE_IF_FLAGS_RSS)) |
2043 | return 0; | 2043 | return 0; |
2044 | 2044 | ||
2045 | if (mutex_lock_interruptible(&adapter->mbox_lock)) | 2045 | spin_lock_bh(&adapter->mcc_lock); |
2046 | return -1; | ||
2047 | 2046 | ||
2048 | wrb = wrb_from_mbox(adapter); | 2047 | wrb = wrb_from_mccq(adapter); |
2048 | if (!wrb) { | ||
2049 | status = -EBUSY; | ||
2050 | goto err; | ||
2051 | } | ||
2049 | req = embedded_payload(wrb); | 2052 | req = embedded_payload(wrb); |
2050 | 2053 | ||
2051 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, | 2054 | be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH, |
@@ -2055,16 +2058,16 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, | |||
2055 | req->enable_rss = cpu_to_le16(rss_hash_opts); | 2058 | req->enable_rss = cpu_to_le16(rss_hash_opts); |
2056 | req->cpu_table_size_log2 = cpu_to_le16(fls(table_size) - 1); | 2059 | req->cpu_table_size_log2 = cpu_to_le16(fls(table_size) - 1); |
2057 | 2060 | ||
2058 | if (lancer_chip(adapter) || skyhawk_chip(adapter)) | 2061 | if (!BEx_chip(adapter)) |
2059 | req->hdr.version = 1; | 2062 | req->hdr.version = 1; |
2060 | 2063 | ||
2061 | memcpy(req->cpu_table, rsstable, table_size); | 2064 | memcpy(req->cpu_table, rsstable, table_size); |
2062 | memcpy(req->hash, rss_hkey, RSS_HASH_KEY_LEN); | 2065 | memcpy(req->hash, rss_hkey, RSS_HASH_KEY_LEN); |
2063 | be_dws_cpu_to_le(req->hash, sizeof(req->hash)); | 2066 | be_dws_cpu_to_le(req->hash, sizeof(req->hash)); |
2064 | 2067 | ||
2065 | status = be_mbox_notify_wait(adapter); | 2068 | status = be_mcc_notify_wait(adapter); |
2066 | 2069 | err: | |
2067 | mutex_unlock(&adapter->mbox_lock); | 2070 | spin_unlock_bh(&adapter->mcc_lock); |
2068 | return status; | 2071 | return status; |
2069 | } | 2072 | } |
2070 | 2073 | ||