提交 7aeb2156 编写于 作者: P Padmanabh Ratnakar 提交者: David S. Miller

be2net : Fix die temperature stat for Lancer

Query die temperature stat for Lancer to report it correctly
in ethtool.
Signed-off-by: NPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c871c5f2
...@@ -435,6 +435,7 @@ struct be_adapter { ...@@ -435,6 +435,7 @@ struct be_adapter {
u32 max_pmac_cnt; /* Max secondary UC MACs programmable */ u32 max_pmac_cnt; /* Max secondary UC MACs programmable */
u32 uc_macs; /* Count of secondary UC MAC programmed */ u32 uc_macs; /* Count of secondary UC MAC programmed */
u32 msg_enable; u32 msg_enable;
int be_get_temp_freq;
}; };
#define be_physfn(adapter) (!adapter->virtfn) #define be_physfn(adapter) (!adapter->virtfn)
......
...@@ -19,9 +19,6 @@ ...@@ -19,9 +19,6 @@
#include "be.h" #include "be.h"
#include "be_cmds.h" #include "be_cmds.h"
/* Must be a power of 2 or else MODULO will BUG_ON */
static int be_get_temp_freq = 64;
static inline void *embedded_payload(struct be_mcc_wrb *wrb) static inline void *embedded_payload(struct be_mcc_wrb *wrb)
{ {
return wrb->payload.embedded_payload; return wrb->payload.embedded_payload;
...@@ -115,7 +112,7 @@ static int be_mcc_compl_process(struct be_adapter *adapter, ...@@ -115,7 +112,7 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
} }
} else { } else {
if (opcode == OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES) if (opcode == OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES)
be_get_temp_freq = 0; adapter->be_get_temp_freq = 0;
if (compl_status == MCC_STATUS_NOT_SUPPORTED || if (compl_status == MCC_STATUS_NOT_SUPPORTED ||
compl_status == MCC_STATUS_ILLEGAL_REQUEST) compl_status == MCC_STATUS_ILLEGAL_REQUEST)
...@@ -1206,9 +1203,6 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) ...@@ -1206,9 +1203,6 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
struct be_cmd_req_hdr *hdr; struct be_cmd_req_hdr *hdr;
int status = 0; int status = 0;
if (MODULO(adapter->work_counter, be_get_temp_freq) == 0)
be_cmd_get_die_temperature(adapter);
spin_lock_bh(&adapter->mcc_lock); spin_lock_bh(&adapter->mcc_lock);
wrb = wrb_from_mccq(adapter); wrb = wrb_from_mccq(adapter);
......
...@@ -3567,6 +3567,9 @@ static int be_get_initial_config(struct be_adapter *adapter) ...@@ -3567,6 +3567,9 @@ static int be_get_initial_config(struct be_adapter *adapter)
if (be_is_wol_supported(adapter)) if (be_is_wol_supported(adapter))
adapter->wol = true; adapter->wol = true;
/* Must be a power of 2 or else MODULO will BUG_ON */
adapter->be_get_temp_freq = 64;
level = be_get_fw_log_level(adapter); level = be_get_fw_log_level(adapter);
adapter->msg_enable = level <= FW_LOG_LEVEL_DEFAULT ? NETIF_MSG_HW : 0; adapter->msg_enable = level <= FW_LOG_LEVEL_DEFAULT ? NETIF_MSG_HW : 0;
...@@ -3747,6 +3750,9 @@ static void be_worker(struct work_struct *work) ...@@ -3747,6 +3750,9 @@ static void be_worker(struct work_struct *work)
be_cmd_get_stats(adapter, &adapter->stats_cmd); be_cmd_get_stats(adapter, &adapter->stats_cmd);
} }
if (MODULO(adapter->work_counter, adapter->be_get_temp_freq) == 0)
be_cmd_get_die_temperature(adapter);
for_all_rx_queues(adapter, rxo, i) { for_all_rx_queues(adapter, rxo, i) {
if (rxo->rx_post_starved) { if (rxo->rx_post_starved) {
rxo->rx_post_starved = false; rxo->rx_post_starved = false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册