Commit 5624e80f authored by David S. Miller's avatar David S. Miller

Merge branch 'be2net-next'

Sathya Perla says:

====================
be2net: patch set

Patches 1 and 2 fix sparse warnings (static declaration needed and endian
declaration needed) introduced by the earlier patch set.

Patches 3 and 4 add 20G/40G speed reporting via ethtool for the Skyhawk-R
chip.

Patches 5 to 12 fix various style issues and checkpatch warnings in the
driver such as:
	- removing unnecessary return statements in void routines
	- adding needed blank lines after a declaration block
	- deleting multiple blank lines
	- inserting a blank line after a function/struct definition
	- removing space after typecast
	- fixing multiple assignments on a single line
	- fixing alignment on a line wrap
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents cecda693 cd3307aa
...@@ -209,7 +209,6 @@ static int be_mcc_compl_process(struct be_adapter *adapter, ...@@ -209,7 +209,6 @@ static int be_mcc_compl_process(struct be_adapter *adapter,
if (base_status != MCC_STATUS_SUCCESS && if (base_status != MCC_STATUS_SUCCESS &&
!be_skip_err_log(opcode, base_status, addl_status)) { !be_skip_err_log(opcode, base_status, addl_status)) {
if (base_status == MCC_STATUS_UNAUTHORIZED_REQUEST) { if (base_status == MCC_STATUS_UNAUTHORIZED_REQUEST) {
dev_warn(&adapter->pdev->dev, dev_warn(&adapter->pdev->dev,
"VF is not privileged to issue opcode %d-%d\n", "VF is not privileged to issue opcode %d-%d\n",
...@@ -317,7 +316,7 @@ static void be_async_dbg_evt_process(struct be_adapter *adapter, ...@@ -317,7 +316,7 @@ static void be_async_dbg_evt_process(struct be_adapter *adapter,
struct be_mcc_compl *cmp) struct be_mcc_compl *cmp)
{ {
u8 event_type = 0; u8 event_type = 0;
struct be_async_event_qnq *evt = (struct be_async_event_qnq *) cmp; struct be_async_event_qnq *evt = (struct be_async_event_qnq *)cmp;
event_type = (cmp->flags >> ASYNC_EVENT_TYPE_SHIFT) & event_type = (cmp->flags >> ASYNC_EVENT_TYPE_SHIFT) &
ASYNC_EVENT_TYPE_MASK; ASYNC_EVENT_TYPE_MASK;
...@@ -593,6 +592,7 @@ static int lancer_wait_ready(struct be_adapter *adapter) ...@@ -593,6 +592,7 @@ static int lancer_wait_ready(struct be_adapter *adapter)
static bool lancer_provisioning_error(struct be_adapter *adapter) static bool lancer_provisioning_error(struct be_adapter *adapter)
{ {
u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0; u32 sliport_status = 0, sliport_err1 = 0, sliport_err2 = 0;
sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET); sliport_status = ioread32(adapter->db + SLIPORT_STATUS_OFFSET);
if (sliport_status & SLIPORT_STATUS_ERR_MASK) { if (sliport_status & SLIPORT_STATUS_ERR_MASK) {
sliport_err1 = ioread32(adapter->db + SLIPORT_ERROR1_OFFSET); sliport_err1 = ioread32(adapter->db + SLIPORT_ERROR1_OFFSET);
...@@ -675,7 +675,6 @@ int be_fw_wait_ready(struct be_adapter *adapter) ...@@ -675,7 +675,6 @@ int be_fw_wait_ready(struct be_adapter *adapter)
return -1; return -1;
} }
static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb) static inline struct be_sge *nonembedded_sgl(struct be_mcc_wrb *wrb)
{ {
return &wrb->payload.sgl[0]; return &wrb->payload.sgl[0];
...@@ -922,6 +921,7 @@ int be_cmd_eq_create(struct be_adapter *adapter, struct be_eq_obj *eqo) ...@@ -922,6 +921,7 @@ int be_cmd_eq_create(struct be_adapter *adapter, struct be_eq_obj *eqo)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_eq_create *resp = embedded_payload(wrb); struct be_cmd_resp_eq_create *resp = embedded_payload(wrb);
eqo->q.id = le16_to_cpu(resp->eq_id); eqo->q.id = le16_to_cpu(resp->eq_id);
eqo->msix_idx = eqo->msix_idx =
(ver == 2) ? le16_to_cpu(resp->msix_idx) : eqo->idx; (ver == 2) ? le16_to_cpu(resp->msix_idx) : eqo->idx;
...@@ -956,7 +956,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, ...@@ -956,7 +956,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
if (permanent) { if (permanent) {
req->permanent = 1; req->permanent = 1;
} else { } else {
req->if_id = cpu_to_le16((u16) if_handle); req->if_id = cpu_to_le16((u16)if_handle);
req->pmac_id = cpu_to_le32(pmac_id); req->pmac_id = cpu_to_le32(pmac_id);
req->permanent = 0; req->permanent = 0;
} }
...@@ -964,6 +964,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, ...@@ -964,6 +964,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_mac_query *resp = embedded_payload(wrb); struct be_cmd_resp_mac_query *resp = embedded_payload(wrb);
memcpy(mac_addr, resp->mac.addr, ETH_ALEN); memcpy(mac_addr, resp->mac.addr, ETH_ALEN);
} }
...@@ -1000,6 +1001,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, ...@@ -1000,6 +1001,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_pmac_add *resp = embedded_payload(wrb); struct be_cmd_resp_pmac_add *resp = embedded_payload(wrb);
*pmac_id = le32_to_cpu(resp->pmac_id); *pmac_id = le32_to_cpu(resp->pmac_id);
} }
...@@ -1032,7 +1034,8 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id, u32 dom) ...@@ -1032,7 +1034,8 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, int pmac_id, u32 dom)
req = embedded_payload(wrb); req = embedded_payload(wrb);
be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req), wrb, NULL); OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req),
wrb, NULL);
req->hdr.domain = dom; req->hdr.domain = dom;
req->if_id = cpu_to_le32(if_id); req->if_id = cpu_to_le32(if_id);
...@@ -1104,6 +1107,7 @@ int be_cmd_cq_create(struct be_adapter *adapter, struct be_queue_info *cq, ...@@ -1104,6 +1107,7 @@ int be_cmd_cq_create(struct be_adapter *adapter, struct be_queue_info *cq,
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_cq_create *resp = embedded_payload(wrb); struct be_cmd_resp_cq_create *resp = embedded_payload(wrb);
cq->id = le16_to_cpu(resp->cq_id); cq->id = le16_to_cpu(resp->cq_id);
cq->created = true; cq->created = true;
} }
...@@ -1116,6 +1120,7 @@ int be_cmd_cq_create(struct be_adapter *adapter, struct be_queue_info *cq, ...@@ -1116,6 +1120,7 @@ int be_cmd_cq_create(struct be_adapter *adapter, struct be_queue_info *cq,
static u32 be_encoded_q_len(int q_len) static u32 be_encoded_q_len(int q_len)
{ {
u32 len_encoded = fls(q_len); /* log2(len) + 1 */ u32 len_encoded = fls(q_len); /* log2(len) + 1 */
if (len_encoded == 16) if (len_encoded == 16)
len_encoded = 0; len_encoded = 0;
return len_encoded; return len_encoded;
...@@ -1171,6 +1176,7 @@ static int be_cmd_mccq_ext_create(struct be_adapter *adapter, ...@@ -1171,6 +1176,7 @@ static int be_cmd_mccq_ext_create(struct be_adapter *adapter,
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb); struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb);
mccq->id = le16_to_cpu(resp->id); mccq->id = le16_to_cpu(resp->id);
mccq->created = true; mccq->created = true;
} }
...@@ -1214,6 +1220,7 @@ static int be_cmd_mccq_org_create(struct be_adapter *adapter, ...@@ -1214,6 +1220,7 @@ static int be_cmd_mccq_org_create(struct be_adapter *adapter,
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb); struct be_cmd_resp_mcc_create *resp = embedded_payload(wrb);
mccq->id = le16_to_cpu(resp->id); mccq->id = le16_to_cpu(resp->id);
mccq->created = true; mccq->created = true;
} }
...@@ -1272,6 +1279,7 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo) ...@@ -1272,6 +1279,7 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo)
status = be_cmd_notify_wait(adapter, &wrb); status = be_cmd_notify_wait(adapter, &wrb);
if (!status) { if (!status) {
struct be_cmd_resp_eth_tx_create *resp = embedded_payload(&wrb); struct be_cmd_resp_eth_tx_create *resp = embedded_payload(&wrb);
txq->id = le16_to_cpu(resp->cid); txq->id = le16_to_cpu(resp->cid);
if (ver == 2) if (ver == 2)
txo->db_offset = le32_to_cpu(resp->db_offset); txo->db_offset = le32_to_cpu(resp->db_offset);
...@@ -1316,6 +1324,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter, ...@@ -1316,6 +1324,7 @@ int be_cmd_rxq_create(struct be_adapter *adapter,
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb); struct be_cmd_resp_eth_rx_create *resp = embedded_payload(wrb);
rxq->id = le16_to_cpu(resp->id); rxq->id = le16_to_cpu(resp->id);
rxq->created = true; rxq->created = true;
*rss_id = resp->rss_id; *rss_id = resp->rss_id;
...@@ -1429,6 +1438,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags, ...@@ -1429,6 +1438,7 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
status = be_cmd_notify_wait(adapter, &wrb); status = be_cmd_notify_wait(adapter, &wrb);
if (!status) { if (!status) {
struct be_cmd_resp_if_create *resp = embedded_payload(&wrb); struct be_cmd_resp_if_create *resp = embedded_payload(&wrb);
*if_handle = le32_to_cpu(resp->interface_id); *if_handle = le32_to_cpu(resp->interface_id);
/* Hack to retrieve VF's pmac-id on BE3 */ /* Hack to retrieve VF's pmac-id on BE3 */
...@@ -1512,7 +1522,6 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd) ...@@ -1512,7 +1522,6 @@ int be_cmd_get_stats(struct be_adapter *adapter, struct be_dma_mem *nonemb_cmd)
int lancer_cmd_get_pport_stats(struct be_adapter *adapter, int lancer_cmd_get_pport_stats(struct be_adapter *adapter,
struct be_dma_mem *nonemb_cmd) struct be_dma_mem *nonemb_cmd)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct lancer_cmd_req_pport_stats *req; struct lancer_cmd_req_pport_stats *req;
int status = 0; int status = 0;
...@@ -1603,6 +1612,7 @@ int be_cmd_link_status_query(struct be_adapter *adapter, u16 *link_speed, ...@@ -1603,6 +1612,7 @@ int be_cmd_link_status_query(struct be_adapter *adapter, u16 *link_speed,
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_link_status *resp = embedded_payload(wrb); struct be_cmd_resp_link_status *resp = embedded_payload(wrb);
if (link_speed) { if (link_speed) {
*link_speed = resp->link_speed ? *link_speed = resp->link_speed ?
le16_to_cpu(resp->link_speed) * 10 : le16_to_cpu(resp->link_speed) * 10 :
...@@ -1670,6 +1680,7 @@ int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size) ...@@ -1670,6 +1680,7 @@ int be_cmd_get_reg_len(struct be_adapter *adapter, u32 *log_size)
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_get_fat *resp = embedded_payload(wrb); struct be_cmd_resp_get_fat *resp = embedded_payload(wrb);
if (log_size && resp->log_size) if (log_size && resp->log_size)
*log_size = le32_to_cpu(resp->log_size) - *log_size = le32_to_cpu(resp->log_size) -
sizeof(u32); sizeof(u32);
...@@ -1699,7 +1710,7 @@ int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf) ...@@ -1699,7 +1710,7 @@ int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
&get_fat_cmd.dma); &get_fat_cmd.dma);
if (!get_fat_cmd.va) { if (!get_fat_cmd.va) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"Memory allocation failure while retrieving FAT data\n"); "Memory allocation failure while reading FAT data\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -1729,6 +1740,7 @@ int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf) ...@@ -1729,6 +1740,7 @@ int be_cmd_get_regs(struct be_adapter *adapter, u32 buf_len, void *buf)
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_get_fat *resp = get_fat_cmd.va; struct be_cmd_resp_get_fat *resp = get_fat_cmd.va;
memcpy(buf + offset, memcpy(buf + offset,
resp->data_buffer, resp->data_buffer,
le32_to_cpu(resp->read_log_length)); le32_to_cpu(resp->read_log_length));
...@@ -1783,8 +1795,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter) ...@@ -1783,8 +1795,8 @@ int be_cmd_get_fw_ver(struct be_adapter *adapter)
/* set the EQ delay interval of an EQ to specified value /* set the EQ delay interval of an EQ to specified value
* Uses async mcc * Uses async mcc
*/ */
int __be_cmd_modify_eqd(struct be_adapter *adapter, struct be_set_eqd *set_eqd, static int __be_cmd_modify_eqd(struct be_adapter *adapter,
int num) struct be_set_eqd *set_eqd, int num)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_modify_eq_delay *req; struct be_cmd_req_modify_eq_delay *req;
...@@ -1899,8 +1911,8 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value) ...@@ -1899,8 +1911,8 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
BE_IF_FLAGS_VLAN_PROMISCUOUS | BE_IF_FLAGS_VLAN_PROMISCUOUS |
BE_IF_FLAGS_MCAST_PROMISCUOUS); BE_IF_FLAGS_MCAST_PROMISCUOUS);
} else if (flags & IFF_ALLMULTI) { } else if (flags & IFF_ALLMULTI) {
req->if_flags_mask = req->if_flags = req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS);
cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS); req->if_flags = cpu_to_le32(BE_IF_FLAGS_MCAST_PROMISCUOUS);
} else if (flags & BE_FLAGS_VLAN_PROMISC) { } else if (flags & BE_FLAGS_VLAN_PROMISC) {
req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_VLAN_PROMISCUOUS); req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_VLAN_PROMISCUOUS);
...@@ -1911,8 +1923,8 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value) ...@@ -1911,8 +1923,8 @@ int be_cmd_rx_filter(struct be_adapter *adapter, u32 flags, u32 value)
struct netdev_hw_addr *ha; struct netdev_hw_addr *ha;
int i = 0; int i = 0;
req->if_flags_mask = req->if_flags = req->if_flags_mask = cpu_to_le32(BE_IF_FLAGS_MULTICAST);
cpu_to_le32(BE_IF_FLAGS_MULTICAST); req->if_flags = cpu_to_le32(BE_IF_FLAGS_MULTICAST);
/* Reset mcast promisc mode if already set by setting mask /* Reset mcast promisc mode if already set by setting mask
* and not setting flags field * and not setting flags field
...@@ -2010,6 +2022,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc) ...@@ -2010,6 +2022,7 @@ int be_cmd_get_flow_control(struct be_adapter *adapter, u32 *tx_fc, u32 *rx_fc)
if (!status) { if (!status) {
struct be_cmd_resp_get_flow_control *resp = struct be_cmd_resp_get_flow_control *resp =
embedded_payload(wrb); embedded_payload(wrb);
*tx_fc = le16_to_cpu(resp->tx_flow_control); *tx_fc = le16_to_cpu(resp->tx_flow_control);
*rx_fc = le16_to_cpu(resp->rx_flow_control); *rx_fc = le16_to_cpu(resp->rx_flow_control);
} }
...@@ -2039,6 +2052,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter) ...@@ -2039,6 +2052,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb); struct be_cmd_resp_query_fw_cfg *resp = embedded_payload(wrb);
adapter->port_num = le32_to_cpu(resp->phys_port); adapter->port_num = le32_to_cpu(resp->phys_port);
adapter->function_mode = le32_to_cpu(resp->function_mode); adapter->function_mode = le32_to_cpu(resp->function_mode);
adapter->function_caps = le32_to_cpu(resp->function_caps); adapter->function_caps = le32_to_cpu(resp->function_caps);
...@@ -2187,6 +2201,7 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state) ...@@ -2187,6 +2201,7 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state)
if (!status) { if (!status) {
struct be_cmd_resp_get_beacon_state *resp = struct be_cmd_resp_get_beacon_state *resp =
embedded_payload(wrb); embedded_payload(wrb);
*state = resp->beacon_state; *state = resp->beacon_state;
} }
...@@ -2628,6 +2643,7 @@ int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern, ...@@ -2628,6 +2643,7 @@ int be_cmd_ddr_dma_test(struct be_adapter *adapter, u64 pattern,
if (!status) { if (!status) {
struct be_cmd_resp_ddrdma_test *resp; struct be_cmd_resp_ddrdma_test *resp;
resp = cmd->va; resp = cmd->va;
if ((memcmp(resp->rcv_buff, req->snd_buff, byte_cnt) != 0) || if ((memcmp(resp->rcv_buff, req->snd_buff, byte_cnt) != 0) ||
resp->snd_err) { resp->snd_err) {
...@@ -2703,6 +2719,7 @@ int be_cmd_get_phy_info(struct be_adapter *adapter) ...@@ -2703,6 +2719,7 @@ int be_cmd_get_phy_info(struct be_adapter *adapter)
if (!status) { if (!status) {
struct be_phy_info *resp_phy_info = struct be_phy_info *resp_phy_info =
cmd.va + sizeof(struct be_cmd_req_hdr); cmd.va + sizeof(struct be_cmd_req_hdr);
adapter->phy.phy_type = le16_to_cpu(resp_phy_info->phy_type); adapter->phy.phy_type = le16_to_cpu(resp_phy_info->phy_type);
adapter->phy.interface_type = adapter->phy.interface_type =
le16_to_cpu(resp_phy_info->interface_type); le16_to_cpu(resp_phy_info->interface_type);
...@@ -2832,6 +2849,7 @@ int be_cmd_req_native_mode(struct be_adapter *adapter) ...@@ -2832,6 +2849,7 @@ int be_cmd_req_native_mode(struct be_adapter *adapter)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_set_func_cap *resp = embedded_payload(wrb); struct be_cmd_resp_set_func_cap *resp = embedded_payload(wrb);
adapter->be3_native = le32_to_cpu(resp->cap_flags) & adapter->be3_native = le32_to_cpu(resp->cap_flags) &
CAPABILITY_BE3_NATIVE_ERX_API; CAPABILITY_BE3_NATIVE_ERX_API;
if (!adapter->be3_native) if (!adapter->be3_native)
...@@ -2871,6 +2889,7 @@ int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege, ...@@ -2871,6 +2889,7 @@ int be_cmd_get_fn_privileges(struct be_adapter *adapter, u32 *privilege,
if (!status) { if (!status) {
struct be_cmd_resp_get_fn_privileges *resp = struct be_cmd_resp_get_fn_privileges *resp =
embedded_payload(wrb); embedded_payload(wrb);
*privilege = le32_to_cpu(resp->privilege_mask); *privilege = le32_to_cpu(resp->privilege_mask);
/* In UMC mode FW does not return right privileges. /* In UMC mode FW does not return right privileges.
...@@ -3018,7 +3037,6 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac, ...@@ -3018,7 +3037,6 @@ int be_cmd_get_mac_from_list(struct be_adapter *adapter, u8 *mac,
int be_cmd_get_active_mac(struct be_adapter *adapter, u32 curr_pmac_id, int be_cmd_get_active_mac(struct be_adapter *adapter, u32 curr_pmac_id,
u8 *mac, u32 if_handle, bool active, u32 domain) u8 *mac, u32 if_handle, bool active, u32 domain)
{ {
if (!active) if (!active)
be_cmd_get_mac_from_list(adapter, mac, &active, &curr_pmac_id, be_cmd_get_mac_from_list(adapter, mac, &active, &curr_pmac_id,
if_handle, domain); if_handle, domain);
...@@ -3202,6 +3220,7 @@ int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid, ...@@ -3202,6 +3220,7 @@ int be_cmd_get_hsw_config(struct be_adapter *adapter, u16 *pvid,
if (!status) { if (!status) {
struct be_cmd_resp_get_hsw_config *resp = struct be_cmd_resp_get_hsw_config *resp =
embedded_payload(wrb); embedded_payload(wrb);
be_dws_le_to_cpu(&resp->context, sizeof(resp->context)); be_dws_le_to_cpu(&resp->context, sizeof(resp->context));
vid = AMAP_GET_BITS(struct amap_get_hsw_resp_context, vid = AMAP_GET_BITS(struct amap_get_hsw_resp_context,
pvid, &resp->context); pvid, &resp->context);
...@@ -3261,7 +3280,8 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter) ...@@ -3261,7 +3280,8 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter)
status = be_mbox_notify_wait(adapter); status = be_mbox_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_acpi_wol_magic_config_v1 *resp; struct be_cmd_resp_acpi_wol_magic_config_v1 *resp;
resp = (struct be_cmd_resp_acpi_wol_magic_config_v1 *) cmd.va;
resp = (struct be_cmd_resp_acpi_wol_magic_config_v1 *)cmd.va;
adapter->wol_cap = resp->wol_settings; adapter->wol_cap = resp->wol_settings;
if (adapter->wol_cap & BE_WOL_CAP) if (adapter->wol_cap & BE_WOL_CAP)
...@@ -3297,6 +3317,7 @@ int be_cmd_set_fw_log_level(struct be_adapter *adapter, u32 level) ...@@ -3297,6 +3317,7 @@ int be_cmd_set_fw_log_level(struct be_adapter *adapter, u32 level)
(extfat_cmd.va + sizeof(struct be_cmd_resp_hdr)); (extfat_cmd.va + sizeof(struct be_cmd_resp_hdr));
for (i = 0; i < le32_to_cpu(cfgs->num_modules); i++) { for (i = 0; i < le32_to_cpu(cfgs->num_modules); i++) {
u32 num_modes = le32_to_cpu(cfgs->module[i].num_modes); u32 num_modes = le32_to_cpu(cfgs->module[i].num_modes);
for (j = 0; j < num_modes; j++) { for (j = 0; j < num_modes; j++) {
if (cfgs->module[i].trace_lvl[j].mode == MODE_UART) if (cfgs->module[i].trace_lvl[j].mode == MODE_UART)
cfgs->module[i].trace_lvl[j].dbg_lvl = cfgs->module[i].trace_lvl[j].dbg_lvl =
...@@ -3333,6 +3354,7 @@ int be_cmd_get_fw_log_level(struct be_adapter *adapter) ...@@ -3333,6 +3354,7 @@ int be_cmd_get_fw_log_level(struct be_adapter *adapter)
if (!status) { if (!status) {
cfgs = (struct be_fat_conf_params *)(extfat_cmd.va + cfgs = (struct be_fat_conf_params *)(extfat_cmd.va +
sizeof(struct be_cmd_resp_hdr)); sizeof(struct be_cmd_resp_hdr));
for (j = 0; j < le32_to_cpu(cfgs->module[0].num_modes); j++) { for (j = 0; j < le32_to_cpu(cfgs->module[0].num_modes); j++) {
if (cfgs->module[0].trace_lvl[j].mode == MODE_UART) if (cfgs->module[0].trace_lvl[j].mode == MODE_UART)
level = cfgs->module[0].trace_lvl[j].dbg_lvl; level = cfgs->module[0].trace_lvl[j].dbg_lvl;
...@@ -3429,6 +3451,7 @@ int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name) ...@@ -3429,6 +3451,7 @@ int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name)
status = be_mcc_notify_wait(adapter); status = be_mcc_notify_wait(adapter);
if (!status) { if (!status) {
struct be_cmd_resp_get_port_name *resp = embedded_payload(wrb); struct be_cmd_resp_get_port_name *resp = embedded_payload(wrb);
*port_name = resp->port_name[adapter->hba_port_num]; *port_name = resp->port_name[adapter->hba_port_num];
} else { } else {
*port_name = adapter->hba_port_num + '0'; *port_name = adapter->hba_port_num + '0';
...@@ -4052,6 +4075,7 @@ int be_cmd_get_active_profile(struct be_adapter *adapter, u16 *profile_id) ...@@ -4052,6 +4075,7 @@ int be_cmd_get_active_profile(struct be_adapter *adapter, u16 *profile_id)
if (!status) { if (!status) {
struct be_cmd_resp_get_active_profile *resp = struct be_cmd_resp_get_active_profile *resp =
embedded_payload(wrb); embedded_payload(wrb);
*profile_id = le16_to_cpu(resp->active_profile_id); *profile_id = le16_to_cpu(resp->active_profile_id);
} }
...@@ -4104,7 +4128,7 @@ int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload, ...@@ -4104,7 +4128,7 @@ int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
{ {
struct be_adapter *adapter = netdev_priv(netdev_handle); struct be_adapter *adapter = netdev_priv(netdev_handle);
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_hdr *hdr = (struct be_cmd_req_hdr *) wrb_payload; struct be_cmd_req_hdr *hdr = (struct be_cmd_req_hdr *)wrb_payload;
struct be_cmd_req_hdr *req; struct be_cmd_req_hdr *req;
struct be_cmd_resp_hdr *resp; struct be_cmd_resp_hdr *resp;
int status; int status;
......
...@@ -1005,8 +1005,8 @@ struct be_cmd_resp_link_status { ...@@ -1005,8 +1005,8 @@ struct be_cmd_resp_link_status {
/* Identifies the type of port attached to NIC */ /* Identifies the type of port attached to NIC */
struct be_cmd_req_port_type { struct be_cmd_req_port_type {
struct be_cmd_req_hdr hdr; struct be_cmd_req_hdr hdr;
u32 page_num; __le32 page_num;
u32 port; __le32 port;
}; };
enum { enum {
...@@ -1374,6 +1374,7 @@ enum { ...@@ -1374,6 +1374,7 @@ enum {
#define BE_SUPPORTED_SPEED_100MBPS 2 #define BE_SUPPORTED_SPEED_100MBPS 2
#define BE_SUPPORTED_SPEED_1GBPS 4 #define BE_SUPPORTED_SPEED_1GBPS 4
#define BE_SUPPORTED_SPEED_10GBPS 8 #define BE_SUPPORTED_SPEED_10GBPS 8
#define BE_SUPPORTED_SPEED_20GBPS 0x10
#define BE_SUPPORTED_SPEED_40GBPS 0x20 #define BE_SUPPORTED_SPEED_40GBPS 0x20
#define BE_AN_EN 0x2 #define BE_AN_EN 0x2
......
...@@ -130,6 +130,7 @@ static const struct be_ethtool_stat et_stats[] = { ...@@ -130,6 +130,7 @@ static const struct be_ethtool_stat et_stats[] = {
{DRVSTAT_INFO(roce_drops_payload_len)}, {DRVSTAT_INFO(roce_drops_payload_len)},
{DRVSTAT_INFO(roce_drops_crc)} {DRVSTAT_INFO(roce_drops_crc)}
}; };
#define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats) #define ETHTOOL_STATS_NUM ARRAY_SIZE(et_stats)
/* Stats related to multi RX queues: get_stats routine assumes bytes, pkts /* Stats related to multi RX queues: get_stats routine assumes bytes, pkts
...@@ -152,6 +153,7 @@ static const struct be_ethtool_stat et_rx_stats[] = { ...@@ -152,6 +153,7 @@ static const struct be_ethtool_stat et_rx_stats[] = {
*/ */
{DRVSTAT_RX_INFO(rx_drops_no_frags)} {DRVSTAT_RX_INFO(rx_drops_no_frags)}
}; };
#define ETHTOOL_RXSTATS_NUM (ARRAY_SIZE(et_rx_stats)) #define ETHTOOL_RXSTATS_NUM (ARRAY_SIZE(et_rx_stats))
/* Stats related to multi TX queues: get_stats routine assumes compl is the /* Stats related to multi TX queues: get_stats routine assumes compl is the
...@@ -200,6 +202,7 @@ static const struct be_ethtool_stat et_tx_stats[] = { ...@@ -200,6 +202,7 @@ static const struct be_ethtool_stat et_tx_stats[] = {
/* Pkts dropped in the driver's transmit path */ /* Pkts dropped in the driver's transmit path */
{DRVSTAT_TX_INFO(tx_drv_drops)} {DRVSTAT_TX_INFO(tx_drv_drops)}
}; };
#define ETHTOOL_TXSTATS_NUM (ARRAY_SIZE(et_tx_stats)) #define ETHTOOL_TXSTATS_NUM (ARRAY_SIZE(et_tx_stats))
static const char et_self_tests[][ETH_GSTRING_LEN] = { static const char et_self_tests[][ETH_GSTRING_LEN] = {
...@@ -333,7 +336,6 @@ static int be_get_coalesce(struct net_device *netdev, ...@@ -333,7 +336,6 @@ static int be_get_coalesce(struct net_device *netdev,
struct be_adapter *adapter = netdev_priv(netdev); struct be_adapter *adapter = netdev_priv(netdev);
struct be_aic_obj *aic = &adapter->aic_obj[0]; struct be_aic_obj *aic = &adapter->aic_obj[0];
et->rx_coalesce_usecs = aic->prev_eqd; et->rx_coalesce_usecs = aic->prev_eqd;
et->rx_coalesce_usecs_high = aic->max_eqd; et->rx_coalesce_usecs_high = aic->max_eqd;
et->rx_coalesce_usecs_low = aic->min_eqd; et->rx_coalesce_usecs_low = aic->min_eqd;
...@@ -534,10 +536,24 @@ static u32 convert_to_et_setting(struct be_adapter *adapter, u32 if_speeds) ...@@ -534,10 +536,24 @@ static u32 convert_to_et_setting(struct be_adapter *adapter, u32 if_speeds)
if (if_speeds & BE_SUPPORTED_SPEED_10GBPS) if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseKX4_Full; val |= SUPPORTED_10000baseKX4_Full;
break; break;
case PHY_TYPE_KR2_20GB:
val |= SUPPORTED_Backplane;
if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseKR_Full;
if (if_speeds & BE_SUPPORTED_SPEED_20GBPS)
val |= SUPPORTED_20000baseKR2_Full;
break;
case PHY_TYPE_KR_10GB: case PHY_TYPE_KR_10GB:
val |= SUPPORTED_Backplane | val |= SUPPORTED_Backplane |
SUPPORTED_10000baseKR_Full; SUPPORTED_10000baseKR_Full;
break; break;
case PHY_TYPE_KR4_40GB:
val |= SUPPORTED_Backplane;
if (if_speeds & BE_SUPPORTED_SPEED_10GBPS)
val |= SUPPORTED_10000baseKR_Full;
if (if_speeds & BE_SUPPORTED_SPEED_40GBPS)
val |= SUPPORTED_40000baseKR4_Full;
break;
case PHY_TYPE_QSFP: case PHY_TYPE_QSFP:
if (if_speeds & BE_SUPPORTED_SPEED_40GBPS) { if (if_speeds & BE_SUPPORTED_SPEED_40GBPS) {
switch (adapter->phy.cable_type) { switch (adapter->phy.cable_type) {
...@@ -668,8 +684,10 @@ static void be_get_ringparam(struct net_device *netdev, ...@@ -668,8 +684,10 @@ static void be_get_ringparam(struct net_device *netdev,
{ {
struct be_adapter *adapter = netdev_priv(netdev); struct be_adapter *adapter = netdev_priv(netdev);
ring->rx_max_pending = ring->rx_pending = adapter->rx_obj[0].q.len; ring->rx_max_pending = adapter->rx_obj[0].q.len;
ring->tx_max_pending = ring->tx_pending = adapter->tx_obj[0].q.len; ring->rx_pending = adapter->rx_obj[0].q.len;
ring->tx_max_pending = adapter->tx_obj[0].q.len;
ring->tx_pending = adapter->tx_obj[0].q.len;
} }
static void static void
...@@ -961,8 +979,6 @@ static void be_set_msg_level(struct net_device *netdev, u32 level) ...@@ -961,8 +979,6 @@ static void be_set_msg_level(struct net_device *netdev, u32 level)
FW_LOG_LEVEL_DEFAULT : FW_LOG_LEVEL_DEFAULT :
FW_LOG_LEVEL_FATAL); FW_LOG_LEVEL_FATAL);
adapter->msg_enable = level; adapter->msg_enable = level;
return;
} }
static u64 be_get_rss_hash_opts(struct be_adapter *adapter, u64 flow_type) static u64 be_get_rss_hash_opts(struct be_adapter *adapter, u64 flow_type)
...@@ -1181,6 +1197,7 @@ static int be_set_rxfh(struct net_device *netdev, const u32 *indir, ...@@ -1181,6 +1197,7 @@ static int be_set_rxfh(struct net_device *netdev, const u32 *indir,
if (indir) { if (indir) {
struct be_rx_obj *rxo; struct be_rx_obj *rxo;
for (i = 0; i < RSS_INDIR_TABLE_LEN; i++) { for (i = 0; i < RSS_INDIR_TABLE_LEN; i++) {
j = indir[i]; j = indir[i];
rxo = &adapter->rx_obj[j]; rxo = &adapter->rx_obj[j];
......
...@@ -86,6 +86,7 @@ static const char * const ue_status_low_desc[] = { ...@@ -86,6 +86,7 @@ static const char * const ue_status_low_desc[] = {
"JTAG ", "JTAG ",
"MPU_INTPEND " "MPU_INTPEND "
}; };
/* UE Status High CSR */ /* UE Status High CSR */
static const char * const ue_status_hi_desc[] = { static const char * const ue_status_hi_desc[] = {
"LPCMEMHOST", "LPCMEMHOST",
...@@ -122,10 +123,10 @@ static const char * const ue_status_hi_desc[] = { ...@@ -122,10 +123,10 @@ static const char * const ue_status_hi_desc[] = {
"Unknown" "Unknown"
}; };
static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q) static void be_queue_free(struct be_adapter *adapter, struct be_queue_info *q)
{ {
struct be_dma_mem *mem = &q->dma_mem; struct be_dma_mem *mem = &q->dma_mem;
if (mem->va) { if (mem->va) {
dma_free_coherent(&adapter->pdev->dev, mem->size, mem->va, dma_free_coherent(&adapter->pdev->dev, mem->size, mem->va,
mem->dma); mem->dma);
...@@ -187,6 +188,7 @@ static void be_intr_set(struct be_adapter *adapter, bool enable) ...@@ -187,6 +188,7 @@ static void be_intr_set(struct be_adapter *adapter, bool enable)
static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted) static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted)
{ {
u32 val = 0; u32 val = 0;
val |= qid & DB_RQ_RING_ID_MASK; val |= qid & DB_RQ_RING_ID_MASK;
val |= posted << DB_RQ_NUM_POSTED_SHIFT; val |= posted << DB_RQ_NUM_POSTED_SHIFT;
...@@ -198,6 +200,7 @@ static void be_txq_notify(struct be_adapter *adapter, struct be_tx_obj *txo, ...@@ -198,6 +200,7 @@ static void be_txq_notify(struct be_adapter *adapter, struct be_tx_obj *txo,
u16 posted) u16 posted)
{ {
u32 val = 0; u32 val = 0;
val |= txo->q.id & DB_TXULP_RING_ID_MASK; val |= txo->q.id & DB_TXULP_RING_ID_MASK;
val |= (posted & DB_TXULP_NUM_POSTED_MASK) << DB_TXULP_NUM_POSTED_SHIFT; val |= (posted & DB_TXULP_NUM_POSTED_MASK) << DB_TXULP_NUM_POSTED_SHIFT;
...@@ -209,6 +212,7 @@ static void be_eq_notify(struct be_adapter *adapter, u16 qid, ...@@ -209,6 +212,7 @@ static void be_eq_notify(struct be_adapter *adapter, u16 qid,
bool arm, bool clear_int, u16 num_popped) bool arm, bool clear_int, u16 num_popped)
{ {
u32 val = 0; u32 val = 0;
val |= qid & DB_EQ_RING_ID_MASK; val |= qid & DB_EQ_RING_ID_MASK;
val |= ((qid & DB_EQ_RING_ID_EXT_MASK) << DB_EQ_RING_ID_EXT_MASK_SHIFT); val |= ((qid & DB_EQ_RING_ID_EXT_MASK) << DB_EQ_RING_ID_EXT_MASK_SHIFT);
...@@ -227,6 +231,7 @@ static void be_eq_notify(struct be_adapter *adapter, u16 qid, ...@@ -227,6 +231,7 @@ static void be_eq_notify(struct be_adapter *adapter, u16 qid,
void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped) void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped)
{ {
u32 val = 0; u32 val = 0;
val |= qid & DB_CQ_RING_ID_MASK; val |= qid & DB_CQ_RING_ID_MASK;
val |= ((qid & DB_CQ_RING_ID_EXT_MASK) << val |= ((qid & DB_CQ_RING_ID_EXT_MASK) <<
DB_CQ_RING_ID_EXT_MASK_SHIFT); DB_CQ_RING_ID_EXT_MASK_SHIFT);
...@@ -488,7 +493,6 @@ static void populate_be_v2_stats(struct be_adapter *adapter) ...@@ -488,7 +493,6 @@ static void populate_be_v2_stats(struct be_adapter *adapter)
static void populate_lancer_stats(struct be_adapter *adapter) static void populate_lancer_stats(struct be_adapter *adapter)
{ {
struct be_drv_stats *drvs = &adapter->drv_stats; struct be_drv_stats *drvs = &adapter->drv_stats;
struct lancer_pport_stats *pport_stats = pport_stats_from_cmd(adapter); struct lancer_pport_stats *pport_stats = pport_stats_from_cmd(adapter);
...@@ -588,6 +592,7 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev, ...@@ -588,6 +592,7 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
for_all_rx_queues(adapter, rxo, i) { for_all_rx_queues(adapter, rxo, i) {
const struct be_rx_stats *rx_stats = rx_stats(rxo); const struct be_rx_stats *rx_stats = rx_stats(rxo);
do { do {
start = u64_stats_fetch_begin_irq(&rx_stats->sync); start = u64_stats_fetch_begin_irq(&rx_stats->sync);
pkts = rx_stats(rxo)->rx_pkts; pkts = rx_stats(rxo)->rx_pkts;
...@@ -602,6 +607,7 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev, ...@@ -602,6 +607,7 @@ static struct rtnl_link_stats64 *be_get_stats64(struct net_device *netdev,
for_all_tx_queues(adapter, txo, i) { for_all_tx_queues(adapter, txo, i) {
const struct be_tx_stats *tx_stats = tx_stats(txo); const struct be_tx_stats *tx_stats = tx_stats(txo);
do { do {
start = u64_stats_fetch_begin_irq(&tx_stats->sync); start = u64_stats_fetch_begin_irq(&tx_stats->sync);
pkts = tx_stats(txo)->tx_pkts; pkts = tx_stats(txo)->tx_pkts;
...@@ -807,6 +813,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq, ...@@ -807,6 +813,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq,
if (skb->len > skb->data_len) { if (skb->len > skb->data_len) {
int len = skb_headlen(skb); int len = skb_headlen(skb);
busaddr = dma_map_single(dev, skb->data, len, DMA_TO_DEVICE); busaddr = dma_map_single(dev, skb->data, len, DMA_TO_DEVICE);
if (dma_mapping_error(dev, busaddr)) if (dma_mapping_error(dev, busaddr))
goto dma_err; goto dma_err;
...@@ -820,6 +827,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq, ...@@ -820,6 +827,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq,
for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i]; const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i];
busaddr = skb_frag_dma_map(dev, frag, 0, busaddr = skb_frag_dma_map(dev, frag, 0,
skb_frag_size(frag), DMA_TO_DEVICE); skb_frag_size(frag), DMA_TO_DEVICE);
if (dma_mapping_error(dev, busaddr)) if (dma_mapping_error(dev, busaddr))
...@@ -910,7 +918,7 @@ static bool be_ipv6_exthdr_check(struct sk_buff *skb) ...@@ -910,7 +918,7 @@ static bool be_ipv6_exthdr_check(struct sk_buff *skb)
if (ip6h->nexthdr != NEXTHDR_TCP && if (ip6h->nexthdr != NEXTHDR_TCP &&
ip6h->nexthdr != NEXTHDR_UDP) { ip6h->nexthdr != NEXTHDR_UDP) {
struct ipv6_opt_hdr *ehdr = struct ipv6_opt_hdr *ehdr =
(struct ipv6_opt_hdr *) (skb->data + offset); (struct ipv6_opt_hdr *)(skb->data + offset);
/* offending pkt: 2nd byte following IPv6 hdr is 0xff */ /* offending pkt: 2nd byte following IPv6 hdr is 0xff */
if (ehdr->hdrlen == 0xff) if (ehdr->hdrlen == 0xff)
...@@ -1416,6 +1424,7 @@ static int be_set_vf_tx_rate(struct net_device *netdev, int vf, ...@@ -1416,6 +1424,7 @@ static int be_set_vf_tx_rate(struct net_device *netdev, int vf,
max_tx_rate, vf); max_tx_rate, vf);
return be_cmd_status(status); return be_cmd_status(status);
} }
static int be_set_vf_link_state(struct net_device *netdev, int vf, static int be_set_vf_link_state(struct net_device *netdev, int vf,
int link_state) int link_state)
{ {
...@@ -1481,7 +1490,6 @@ static void be_eqd_update(struct be_adapter *adapter) ...@@ -1481,7 +1490,6 @@ static void be_eqd_update(struct be_adapter *adapter)
tx_pkts = txo->stats.tx_reqs; tx_pkts = txo->stats.tx_reqs;
} while (u64_stats_fetch_retry_irq(&txo->stats.sync, start)); } while (u64_stats_fetch_retry_irq(&txo->stats.sync, start));
/* Skip, if wrapped around or first calculation */ /* Skip, if wrapped around or first calculation */
now = jiffies; now = jiffies;
if (!aic->jiffies || time_before(now, aic->jiffies) || if (!aic->jiffies || time_before(now, aic->jiffies) ||
...@@ -2053,7 +2061,8 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo) ...@@ -2053,7 +2061,8 @@ static void be_rx_cq_clean(struct be_rx_obj *rxo)
memset(page_info, 0, sizeof(*page_info)); memset(page_info, 0, sizeof(*page_info));
} }
BUG_ON(atomic_read(&rxq->used)); BUG_ON(atomic_read(&rxq->used));
rxq->tail = rxq->head = 0; rxq->tail = 0;
rxq->head = 0;
} }
static void be_tx_compl_clean(struct be_adapter *adapter) static void be_tx_compl_clean(struct be_adapter *adapter)
...@@ -3716,8 +3725,6 @@ static void be_netpoll(struct net_device *netdev) ...@@ -3716,8 +3725,6 @@ static void be_netpoll(struct net_device *netdev)
be_eq_notify(eqo->adapter, eqo->q.id, false, true, 0); be_eq_notify(eqo->adapter, eqo->q.id, false, true, 0);
napi_schedule(&eqo->napi); napi_schedule(&eqo->napi);
} }
return;
} }
#endif #endif
...@@ -4395,7 +4402,6 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family, ...@@ -4395,7 +4402,6 @@ static void be_add_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
return; return;
err: err:
be_disable_vxlan_offloads(adapter); be_disable_vxlan_offloads(adapter);
return;
} }
static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family, static void be_del_vxlan_port(struct net_device *netdev, sa_family_t sa_family,
...@@ -4735,7 +4741,6 @@ static void be_func_recovery_task(struct work_struct *work) ...@@ -4735,7 +4741,6 @@ static void be_func_recovery_task(struct work_struct *work)
be_detect_error(adapter); be_detect_error(adapter);
if (adapter->hw_error && lancer_chip(adapter)) { if (adapter->hw_error && lancer_chip(adapter)) {
rtnl_lock(); rtnl_lock();
netif_device_detach(adapter->netdev); netif_device_detach(adapter->netdev);
rtnl_unlock(); rtnl_unlock();
...@@ -4919,7 +4924,8 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id) ...@@ -4919,7 +4924,8 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id)
INIT_DELAYED_WORK(&adapter->work, be_worker); INIT_DELAYED_WORK(&adapter->work, be_worker);
INIT_DELAYED_WORK(&adapter->func_recovery_work, be_func_recovery_task); INIT_DELAYED_WORK(&adapter->func_recovery_work, be_func_recovery_task);
adapter->rx_fc = adapter->tx_fc = true; adapter->rx_fc = true;
adapter->tx_fc = true;
status = be_setup(adapter); status = be_setup(adapter);
if (status) if (status)
......
...@@ -174,6 +174,7 @@ int be_roce_register_driver(struct ocrdma_driver *drv) ...@@ -174,6 +174,7 @@ int be_roce_register_driver(struct ocrdma_driver *drv)
ocrdma_drv = drv; ocrdma_drv = drv;
list_for_each_entry(dev, &be_adapter_list, entry) { list_for_each_entry(dev, &be_adapter_list, entry) {
struct net_device *netdev; struct net_device *netdev;
_be_roce_dev_add(dev); _be_roce_dev_add(dev);
netdev = dev->netdev; netdev = dev->netdev;
if (netif_running(netdev) && netif_oper_up(netdev)) if (netif_running(netdev) && netif_oper_up(netdev))
......
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