Commit 0fc48c37 authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller

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: default avatarSomnath K <somnathk@serverengines.com>
Signed-off-by: default avatarAjit Khaparde <ajitk@serverengines.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 48e9989e
...@@ -289,6 +289,7 @@ struct be_adapter { ...@@ -289,6 +289,7 @@ struct be_adapter {
u32 rx_fc; /* Rx flow control */ u32 rx_fc; /* Rx flow control */
u32 tx_fc; /* Tx flow control */ u32 tx_fc; /* Tx flow control */
bool ue_detected; bool ue_detected;
bool stats_ioctl_sent;
int link_speed; int link_speed;
u8 port_type; u8 port_type;
u8 transceiver; u8 transceiver;
......
...@@ -75,6 +75,7 @@ static int be_mcc_compl_process(struct be_adapter *adapter, ...@@ -75,6 +75,7 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
be_dws_le_to_cpu(&resp->hw_stats, be_dws_le_to_cpu(&resp->hw_stats,
sizeof(resp->hw_stats)); sizeof(resp->hw_stats));
netdev_stats_update(adapter); netdev_stats_update(adapter);
adapter->stats_ioctl_sent = false;
} }
} else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) && } else if ((compl_status != MCC_STATUS_NOT_SUPPORTED) &&
(compl->tag0 != OPCODE_COMMON_NTWK_MAC_QUERY)) { (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,6 +952,7 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
sge->len = cpu_to_le32(nonemb_cmd->size); sge->len = cpu_to_le32(nonemb_cmd->size);
be_mcc_notify(adapter); be_mcc_notify(adapter);
adapter->stats_ioctl_sent = true;
err: err:
spin_unlock_bh(&adapter->mcc_lock); spin_unlock_bh(&adapter->mcc_lock);
......
...@@ -1801,6 +1801,7 @@ static void be_worker(struct work_struct *work) ...@@ -1801,6 +1801,7 @@ static void be_worker(struct work_struct *work)
struct be_adapter *adapter = struct be_adapter *adapter =
container_of(work, struct be_adapter, work.work); container_of(work, struct be_adapter, work.work);
if (!adapter->stats_ioctl_sent)
be_cmd_get_stats(adapter, &adapter->stats.cmd); be_cmd_get_stats(adapter, &adapter->stats.cmd);
/* Set EQ delay */ /* Set EQ delay */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment