diff options
author | Ajit Khaparde <ajitk@serverengines.com> | 2010-07-29 02:18:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-31 02:59:06 -0400 |
commit | 0fc48c37ff3969dde71a43fa7c8f176d4bd90a3e (patch) | |
tree | 5d2d400a09be92fde256ba2501fcd5ea426d0179 /drivers/net/benet | |
parent | 48e9989e033966fd738d062ea9730fe10085fdd1 (diff) |
be2net: fix to avoid sending get_stats request if one is already being processed.
GET_STATS request uses the same memory region as the response.
If a new request for get stats is fired before the response for
the previous get_stats request is received, the response will
corrupt the new request, causing the f/w to misbehave.
Signed-off-by: Somnath K <somnathk@serverengines.com>
Signed-off-by: Ajit Khaparde <ajitk@serverengines.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r-- | drivers/net/benet/be.h | 1 | ||||
-rw-r--r-- | drivers/net/benet/be_cmds.c | 2 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h index 5e6f581c49d4..99197bd54da5 100644 --- a/drivers/net/benet/be.h +++ b/drivers/net/benet/be.h | |||
@@ -289,6 +289,7 @@ struct be_adapter { | |||
289 | u32 rx_fc; /* Rx flow control */ | 289 | u32 rx_fc; /* Rx flow control */ |
290 | u32 tx_fc; /* Tx flow control */ | 290 | u32 tx_fc; /* Tx flow control */ |
291 | bool ue_detected; | 291 | bool ue_detected; |
292 | bool stats_ioctl_sent; | ||
292 | int link_speed; | 293 | int link_speed; |
293 | u8 port_type; | 294 | u8 port_type; |
294 | u8 transceiver; | 295 | u8 transceiver; |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 7fd860dcbc80..3d305494a606 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -75,6 +75,7 @@ static int be_mcc_compl_process(struct be_adapter *adapter, | |||
75 | be_dws_le_to_cpu(&resp->hw_stats, | 75 | be_dws_le_to_cpu(&resp->hw_stats, |
76 | sizeof(resp->hw_stats)); | 76 | sizeof(resp->hw_stats)); |
77 | netdev_stats_update(adapter); | 77 | netdev_stats_update(adapter); |
78 | adapter->stats_ioctl_sent = false; | ||
78 | } | 79 | } |
79 | } else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) && | 80 | } else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) && |
80 | (compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) { | 81 | (compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) { |
@@ -951,6 +952,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) | |||
951 | sge->len = cpu_to_le32(nonemb_cmd->size); | 952 | sge->len = cpu_to_le32(nonemb_cmd->size); |
952 | 953 | ||
953 | be_mcc_notify(adapter); | 954 | be_mcc_notify(adapter); |
955 | adapter->stats_ioctl_sent = true; | ||
954 | 956 | ||
955 | err: | 957 | err: |
956 | spin_unlock_bh(&adapter->mcc_lock); | 958 | spin_unlock_bh(&adapter->mcc_lock); |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index e4a8ae3a1c8d..74e146f470c6 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -1801,7 +1801,8 @@ static void be_worker(struct work_struct *work) | |||
1801 | struct be_adapter *adapter = | 1801 | struct be_adapter *adapter = |
1802 | container_of(work, struct be_adapter, work.work); | 1802 | container_of(work, struct be_adapter, work.work); |
1803 | 1803 | ||
1804 | be_cmd_get_stats(adapter, &adapter->stats.cmd); | 1804 | if (!adapter->stats_ioctl_sent) |
1805 | be_cmd_get_stats(adapter, &adapter->stats.cmd); | ||
1805 | 1806 | ||
1806 | /* Set EQ delay */ | 1807 | /* Set EQ delay */ |
1807 | be_rx_eqd_update(adapter); | 1808 | be_rx_eqd_update(adapter); |