bnx2x: revised driver prints
We've revised driver prints, changing the mask of existing prints to allow better control over the debug messages, added prints to error scenarios, removed unnecessary prints and corrected some spelling. Please note that this patch contains lines with over 80 characters, as string messages were kept in a single line. Signed-off-by: Merav Sicron <meravs@broadcom.com> Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d8290ae54c
commit
51c1a580b1
|
@ -58,18 +58,22 @@
|
|||
#define DRV_MODULE_NAME "bnx2x"
|
||||
|
||||
/* for messages that are currently off */
|
||||
#define BNX2X_MSG_OFF 0
|
||||
#define BNX2X_MSG_MCP 0x010000 /* was: NETIF_MSG_HW */
|
||||
#define BNX2X_MSG_STATS 0x020000 /* was: NETIF_MSG_TIMER */
|
||||
#define BNX2X_MSG_NVM 0x040000 /* was: NETIF_MSG_HW */
|
||||
#define BNX2X_MSG_DMAE 0x080000 /* was: NETIF_MSG_HW */
|
||||
#define BNX2X_MSG_SP 0x100000 /* was: NETIF_MSG_INTR */
|
||||
#define BNX2X_MSG_FP 0x200000 /* was: NETIF_MSG_INTR */
|
||||
#define BNX2X_MSG_OFF 0x0
|
||||
#define BNX2X_MSG_MCP 0x0010000 /* was: NETIF_MSG_HW */
|
||||
#define BNX2X_MSG_STATS 0x0020000 /* was: NETIF_MSG_TIMER */
|
||||
#define BNX2X_MSG_NVM 0x0040000 /* was: NETIF_MSG_HW */
|
||||
#define BNX2X_MSG_DMAE 0x0080000 /* was: NETIF_MSG_HW */
|
||||
#define BNX2X_MSG_SP 0x0100000 /* was: NETIF_MSG_INTR */
|
||||
#define BNX2X_MSG_FP 0x0200000 /* was: NETIF_MSG_INTR */
|
||||
#define BNX2X_MSG_IOV 0x0800000
|
||||
#define BNX2X_MSG_IDLE 0x2000000 /* used for idle check*/
|
||||
#define BNX2X_MSG_ETHTOOL 0x4000000
|
||||
#define BNX2X_MSG_DCB 0x8000000
|
||||
|
||||
/* regular debug print */
|
||||
#define DP(__mask, fmt, ...) \
|
||||
do { \
|
||||
if (bp->msg_enable & (__mask)) \
|
||||
if (unlikely(bp->msg_enable & (__mask))) \
|
||||
pr_notice("[%s:%d(%s)]" fmt, \
|
||||
__func__, __LINE__, \
|
||||
bp->dev ? (bp->dev->name) : "?", \
|
||||
|
@ -78,14 +82,14 @@ do { \
|
|||
|
||||
#define DP_CONT(__mask, fmt, ...) \
|
||||
do { \
|
||||
if (bp->msg_enable & (__mask)) \
|
||||
if (unlikely(bp->msg_enable & (__mask))) \
|
||||
pr_cont(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
/* errors debug print */
|
||||
#define BNX2X_DBG_ERR(fmt, ...) \
|
||||
do { \
|
||||
if (netif_msg_probe(bp)) \
|
||||
if (unlikely(netif_msg_probe(bp))) \
|
||||
pr_err("[%s:%d(%s)]" fmt, \
|
||||
__func__, __LINE__, \
|
||||
bp->dev ? (bp->dev->name) : "?", \
|
||||
|
@ -108,7 +112,7 @@ do { \
|
|||
/* before we have a dev->name use dev_info() */
|
||||
#define BNX2X_DEV_INFO(fmt, ...) \
|
||||
do { \
|
||||
if (netif_msg_probe(bp)) \
|
||||
if (unlikely(netif_msg_probe(bp))) \
|
||||
dev_info(&bp->pdev->dev, fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
|
|
|
@ -75,11 +75,10 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
|
|||
/* prefetch skb end pointer to speedup dev_kfree_skb() */
|
||||
prefetch(&skb->end);
|
||||
|
||||
DP(BNX2X_MSG_FP, "fp[%d]: pkt_idx %d buff @(%p)->skb %p\n",
|
||||
DP(NETIF_MSG_TX_DONE, "fp[%d]: pkt_idx %d buff @(%p)->skb %p\n",
|
||||
txdata->txq_index, idx, tx_buf, skb);
|
||||
|
||||
/* unmap first bd */
|
||||
DP(BNX2X_MSG_OFF, "free bd_idx %d\n", bd_idx);
|
||||
tx_start_bd = &txdata->tx_desc_ring[bd_idx].start_bd;
|
||||
dma_unmap_single(&bp->pdev->dev, BD_UNMAP_ADDR(tx_start_bd),
|
||||
BD_UNMAP_LEN(tx_start_bd), DMA_TO_DEVICE);
|
||||
|
@ -110,7 +109,6 @@ static u16 bnx2x_free_tx_pkt(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata,
|
|||
/* now free frags */
|
||||
while (nbd > 0) {
|
||||
|
||||
DP(BNX2X_MSG_OFF, "free frag bd_idx %d\n", bd_idx);
|
||||
tx_data_bd = &txdata->tx_desc_ring[bd_idx].reg_bd;
|
||||
dma_unmap_page(&bp->pdev->dev, BD_UNMAP_ADDR(tx_data_bd),
|
||||
BD_UNMAP_LEN(tx_data_bd), DMA_TO_DEVICE);
|
||||
|
@ -152,8 +150,8 @@ int bnx2x_tx_int(struct bnx2x *bp, struct bnx2x_fp_txdata *txdata)
|
|||
|
||||
pkt_cons = TX_BD(sw_cons);
|
||||
|
||||
DP(NETIF_MSG_TX_DONE, "queue[%d]: hw_cons %u sw_cons %u "
|
||||
" pkt_cons %u\n",
|
||||
DP(NETIF_MSG_TX_DONE,
|
||||
"queue[%d]: hw_cons %u sw_cons %u pkt_cons %u\n",
|
||||
txdata->txq_index, hw_cons, sw_cons, pkt_cons);
|
||||
|
||||
bd_cons = bnx2x_free_tx_pkt(bp, txdata, pkt_cons,
|
||||
|
@ -531,8 +529,7 @@ static inline void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
|
|||
if (likely(skb)) {
|
||||
#ifdef BNX2X_STOP_ON_ERROR
|
||||
if (pad + len > fp->rx_buf_size) {
|
||||
BNX2X_ERR("skb_put is about to fail... "
|
||||
"pad %d len %d rx_buf_size %d\n",
|
||||
BNX2X_ERR("skb_put is about to fail... pad %d len %d rx_buf_size %d\n",
|
||||
pad, len, fp->rx_buf_size);
|
||||
bnx2x_panic();
|
||||
return;
|
||||
|
@ -552,8 +549,8 @@ static inline void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
|
|||
__vlan_hwaccel_put_tag(skb, tpa_info->vlan_tag);
|
||||
napi_gro_receive(&fp->napi, skb);
|
||||
} else {
|
||||
DP(NETIF_MSG_RX_STATUS, "Failed to allocate new pages"
|
||||
" - dropping packet!\n");
|
||||
DP(NETIF_MSG_RX_STATUS,
|
||||
"Failed to allocate new pages - dropping packet!\n");
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
|
||||
|
@ -629,8 +626,9 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
|
|||
cqe_fp_flags = cqe_fp->type_error_flags;
|
||||
cqe_fp_type = cqe_fp_flags & ETH_FAST_PATH_RX_CQE_TYPE;
|
||||
|
||||
DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x"
|
||||
" queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags),
|
||||
DP(NETIF_MSG_RX_STATUS,
|
||||
"CQE type %x err %x status %x queue %x vlan %x len %u\n",
|
||||
CQE_TYPE(cqe_fp_flags),
|
||||
cqe_fp_flags, cqe_fp->status_flags,
|
||||
le32_to_cpu(cqe_fp->rss_hash_result),
|
||||
le16_to_cpu(cqe_fp->vlan_tag),
|
||||
|
@ -653,8 +651,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
|
|||
if (fp->disable_tpa &&
|
||||
(CQE_TYPE_START(cqe_fp_type) ||
|
||||
CQE_TYPE_STOP(cqe_fp_type)))
|
||||
BNX2X_ERR("START/STOP packet while "
|
||||
"disable_tpa type %x\n",
|
||||
BNX2X_ERR("START/STOP packet while disable_tpa type %x\n",
|
||||
CQE_TYPE(cqe_fp_type));
|
||||
#endif
|
||||
|
||||
|
@ -708,7 +705,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
|
|||
prefetch(data + pad); /* speedup eth_type_trans() */
|
||||
/* is this an error packet? */
|
||||
if (unlikely(cqe_fp_flags & ETH_RX_ERROR_FALGS)) {
|
||||
DP(NETIF_MSG_RX_ERR,
|
||||
DP(NETIF_MSG_RX_ERR | NETIF_MSG_RX_STATUS,
|
||||
"ERROR flags %x rx packet %u\n",
|
||||
cqe_fp_flags, sw_comp_cons);
|
||||
fp->eth_q_stats.rx_err_discard_pkt++;
|
||||
|
@ -722,7 +719,7 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
|
|||
(len <= RX_COPY_THRESH)) {
|
||||
skb = netdev_alloc_skb_ip_align(bp->dev, len);
|
||||
if (skb == NULL) {
|
||||
DP(NETIF_MSG_RX_ERR,
|
||||
DP(NETIF_MSG_RX_ERR | NETIF_MSG_RX_STATUS,
|
||||
"ERROR packet dropped because of alloc failure\n");
|
||||
fp->eth_q_stats.rx_skb_alloc_failed++;
|
||||
goto reuse_rx;
|
||||
|
@ -743,9 +740,8 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget)
|
|||
}
|
||||
skb_reserve(skb, pad);
|
||||
} else {
|
||||
DP(NETIF_MSG_RX_ERR,
|
||||
"ERROR packet dropped because "
|
||||
"of alloc failure\n");
|
||||
DP(NETIF_MSG_RX_ERR | NETIF_MSG_RX_STATUS,
|
||||
"ERROR packet dropped because of alloc failure\n");
|
||||
fp->eth_q_stats.rx_skb_alloc_failed++;
|
||||
reuse_rx:
|
||||
bnx2x_reuse_rx_data(fp, bd_cons, bd_prod);
|
||||
|
@ -814,8 +810,8 @@ static irqreturn_t bnx2x_msix_fp_int(int irq, void *fp_cookie)
|
|||
struct bnx2x *bp = fp->bp;
|
||||
u8 cos;
|
||||
|
||||
DP(BNX2X_MSG_FP, "got an MSI-X interrupt on IDX:SB "
|
||||
"[fp %d fw_sd %d igusb %d]\n",
|
||||
DP(NETIF_MSG_INTR,
|
||||
"got an MSI-X interrupt on IDX:SB [fp %d fw_sd %d igusb %d]\n",
|
||||
fp->index, fp->fw_sb_id, fp->igu_sb_id);
|
||||
bnx2x_ack_sb(bp, fp->igu_sb_id, USTORM_ID, 0, IGU_INT_DISABLE, 0);
|
||||
|
||||
|
@ -1028,10 +1024,8 @@ void bnx2x_init_rx_rings(struct bnx2x *bp)
|
|||
first_buf->data = kmalloc(fp->rx_buf_size + NET_SKB_PAD,
|
||||
GFP_ATOMIC);
|
||||
if (!first_buf->data) {
|
||||
BNX2X_ERR("Failed to allocate TPA "
|
||||
"skb pool for queue[%d] - "
|
||||
"disabling TPA on this "
|
||||
"queue!\n", j);
|
||||
BNX2X_ERR("Failed to allocate TPA skb pool for queue[%d] - disabling TPA on this queue!\n",
|
||||
j);
|
||||
bnx2x_free_tpa_pool(bp, fp, i);
|
||||
fp->disable_tpa = 1;
|
||||
break;
|
||||
|
@ -1051,10 +1045,10 @@ void bnx2x_init_rx_rings(struct bnx2x *bp)
|
|||
i < MAX_RX_SGE_CNT*NUM_RX_SGE_PAGES; i++) {
|
||||
|
||||
if (bnx2x_alloc_rx_sge(bp, fp, ring_prod) < 0) {
|
||||
BNX2X_ERR("was only able to allocate "
|
||||
"%d rx sges\n", i);
|
||||
BNX2X_ERR("disabling TPA for "
|
||||
"queue[%d]\n", j);
|
||||
BNX2X_ERR("was only able to allocate %d rx sges\n",
|
||||
i);
|
||||
BNX2X_ERR("disabling TPA for queue[%d]\n",
|
||||
j);
|
||||
/* Cleanup already allocated elements */
|
||||
bnx2x_free_rx_sge_range(bp, fp,
|
||||
ring_prod);
|
||||
|
@ -1209,8 +1203,8 @@ static void bnx2x_free_msix_irqs(struct bnx2x *bp, int nvecs)
|
|||
for_each_eth_queue(bp, i) {
|
||||
if (nvecs == offset)
|
||||
return;
|
||||
DP(NETIF_MSG_IFDOWN, "about to release fp #%d->%d "
|
||||
"irq\n", i, bp->msix_table[offset].vector);
|
||||
DP(NETIF_MSG_IFDOWN, "about to release fp #%d->%d irq\n",
|
||||
i, bp->msix_table[offset].vector);
|
||||
|
||||
free_irq(bp->msix_table[offset++].vector, &bp->fp[i]);
|
||||
}
|
||||
|
@ -1232,21 +1226,21 @@ int bnx2x_enable_msix(struct bnx2x *bp)
|
|||
int msix_vec = 0, i, rc, req_cnt;
|
||||
|
||||
bp->msix_table[msix_vec].entry = msix_vec;
|
||||
DP(NETIF_MSG_IFUP, "msix_table[0].entry = %d (slowpath)\n",
|
||||
BNX2X_DEV_INFO("msix_table[0].entry = %d (slowpath)\n",
|
||||
bp->msix_table[0].entry);
|
||||
msix_vec++;
|
||||
|
||||
#ifdef BCM_CNIC
|
||||
bp->msix_table[msix_vec].entry = msix_vec;
|
||||
DP(NETIF_MSG_IFUP, "msix_table[%d].entry = %d (CNIC)\n",
|
||||
BNX2X_DEV_INFO("msix_table[%d].entry = %d (CNIC)\n",
|
||||
bp->msix_table[msix_vec].entry, bp->msix_table[msix_vec].entry);
|
||||
msix_vec++;
|
||||
#endif
|
||||
/* We need separate vectors for ETH queues only (not FCoE) */
|
||||
for_each_eth_queue(bp, i) {
|
||||
bp->msix_table[msix_vec].entry = msix_vec;
|
||||
DP(NETIF_MSG_IFUP, "msix_table[%d].entry = %d "
|
||||
"(fastpath #%u)\n", msix_vec, msix_vec, i);
|
||||
BNX2X_DEV_INFO("msix_table[%d].entry = %d (fastpath #%u)\n",
|
||||
msix_vec, msix_vec, i);
|
||||
msix_vec++;
|
||||
}
|
||||
|
||||
|
@ -1262,14 +1256,12 @@ int bnx2x_enable_msix(struct bnx2x *bp)
|
|||
/* how less vectors we will have? */
|
||||
int diff = req_cnt - rc;
|
||||
|
||||
DP(NETIF_MSG_IFUP,
|
||||
"Trying to use less MSI-X vectors: %d\n", rc);
|
||||
BNX2X_DEV_INFO("Trying to use less MSI-X vectors: %d\n", rc);
|
||||
|
||||
rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], rc);
|
||||
|
||||
if (rc) {
|
||||
DP(NETIF_MSG_IFUP,
|
||||
"MSI-X is not attainable rc %d\n", rc);
|
||||
BNX2X_DEV_INFO("MSI-X is not attainable rc %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
/*
|
||||
|
@ -1277,13 +1269,13 @@ int bnx2x_enable_msix(struct bnx2x *bp)
|
|||
*/
|
||||
bp->num_queues -= diff;
|
||||
|
||||
DP(NETIF_MSG_IFUP, "New queue configuration set: %d\n",
|
||||
BNX2X_DEV_INFO("New queue configuration set: %d\n",
|
||||
bp->num_queues);
|
||||
} else if (rc) {
|
||||
/* fall to INTx if not enough memory */
|
||||
if (rc == -ENOMEM)
|
||||
bp->flags |= DISABLE_MSI_FLAG;
|
||||
DP(NETIF_MSG_IFUP, "MSI-X is not attainable rc %d\n", rc);
|
||||
BNX2X_DEV_INFO("MSI-X is not attainable rc %d\n", rc);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1326,8 +1318,7 @@ static int bnx2x_req_msix_irqs(struct bnx2x *bp)
|
|||
|
||||
i = BNX2X_NUM_ETH_QUEUES(bp);
|
||||
offset = 1 + CNIC_PRESENT;
|
||||
netdev_info(bp->dev, "using MSI-X IRQs: sp %d fp[%d] %d"
|
||||
" ... fp[%d] %d\n",
|
||||
netdev_info(bp->dev, "using MSI-X IRQs: sp %d fp[%d] %d ... fp[%d] %d\n",
|
||||
bp->msix_table[0].vector,
|
||||
0, bp->msix_table[offset].vector,
|
||||
i - 1, bp->msix_table[offset + i - 1].vector);
|
||||
|
@ -1341,7 +1332,7 @@ int bnx2x_enable_msi(struct bnx2x *bp)
|
|||
|
||||
rc = pci_enable_msi(bp->pdev);
|
||||
if (rc) {
|
||||
DP(NETIF_MSG_IFUP, "MSI is not attainable\n");
|
||||
BNX2X_DEV_INFO("MSI is not attainable\n");
|
||||
return -1;
|
||||
}
|
||||
bp->flags |= USING_MSI_FLAG;
|
||||
|
@ -1518,7 +1509,7 @@ static inline int bnx2x_set_real_num_queues(struct bnx2x *bp)
|
|||
return rc;
|
||||
}
|
||||
|
||||
DP(NETIF_MSG_DRV, "Setting real num queues to (tx, rx) (%d, %d)\n",
|
||||
DP(NETIF_MSG_IFUP, "Setting real num queues to (tx, rx) (%d, %d)\n",
|
||||
tx, rx);
|
||||
|
||||
return rc;
|
||||
|
@ -1699,8 +1690,8 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp)
|
|||
/* Add a DEL command... */
|
||||
rc = bnx2x_config_mcast(bp, &rparam, BNX2X_MCAST_CMD_DEL);
|
||||
if (rc < 0)
|
||||
BNX2X_ERR("Failed to add a new DEL command to a multi-cast "
|
||||
"object: %d\n", rc);
|
||||
BNX2X_ERR("Failed to add a new DEL command to a multi-cast object: %d\n",
|
||||
rc);
|
||||
|
||||
/* ...and wait until all pending commands are cleared */
|
||||
rc = bnx2x_config_mcast(bp, &rparam, BNX2X_MCAST_CMD_CONT);
|
||||
|
@ -1738,8 +1729,10 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
int i, rc;
|
||||
|
||||
#ifdef BNX2X_STOP_ON_ERROR
|
||||
if (unlikely(bp->panic))
|
||||
if (unlikely(bp->panic)) {
|
||||
BNX2X_ERR("Can't load NIC when there is panic\n");
|
||||
return -EPERM;
|
||||
}
|
||||
#endif
|
||||
|
||||
bp->state = BNX2X_STATE_OPENING_WAIT4_LOAD;
|
||||
|
@ -1759,6 +1752,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
* allocated only once, fp index, max_cos, bp pointer.
|
||||
* Also set fp->disable_tpa.
|
||||
*/
|
||||
DP(NETIF_MSG_IFUP, "num queues: %d", bp->num_queues);
|
||||
for_each_queue(bp, i)
|
||||
bnx2x_bz_fp(bp, i);
|
||||
|
||||
|
@ -1815,6 +1809,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
LOAD_ERROR_EXIT(bp, load_error1);
|
||||
}
|
||||
if (load_code == FW_MSG_CODE_DRV_LOAD_REFUSED) {
|
||||
BNX2X_ERR("Driver load refused\n");
|
||||
rc = -EBUSY; /* other port in diagnostic mode */
|
||||
LOAD_ERROR_EXIT(bp, load_error1);
|
||||
}
|
||||
|
@ -1875,7 +1870,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
} else
|
||||
bp->port.pmf = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "pmf %d\n", bp->port.pmf);
|
||||
DP(NETIF_MSG_IFUP, "pmf %d\n", bp->port.pmf);
|
||||
|
||||
/* Init Function state controlling object */
|
||||
bnx2x__init_func_obj(bp);
|
||||
|
@ -1891,6 +1886,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
/* Connect to IRQs */
|
||||
rc = bnx2x_setup_irqs(bp);
|
||||
if (rc) {
|
||||
BNX2X_ERR("IRQs setup failed\n");
|
||||
bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_DONE, 0);
|
||||
LOAD_ERROR_EXIT(bp, load_error2);
|
||||
}
|
||||
|
@ -1941,21 +1937,27 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode)
|
|||
|
||||
for_each_nondefault_queue(bp, i) {
|
||||
rc = bnx2x_setup_queue(bp, &bp->fp[i], 0);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
BNX2X_ERR("Queue setup failed\n");
|
||||
LOAD_ERROR_EXIT(bp, load_error4);
|
||||
}
|
||||
}
|
||||
|
||||
rc = bnx2x_init_rss_pf(bp);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
BNX2X_ERR("PF RSS init failed\n");
|
||||
LOAD_ERROR_EXIT(bp, load_error4);
|
||||
}
|
||||
|
||||
/* Now when Clients are configured we are ready to work */
|
||||
bp->state = BNX2X_STATE_OPEN;
|
||||
|
||||
/* Configure a ucast MAC */
|
||||
rc = bnx2x_set_eth_mac(bp, true);
|
||||
if (rc)
|
||||
if (rc) {
|
||||
BNX2X_ERR("Setting Ethernet MAC failed\n");
|
||||
LOAD_ERROR_EXIT(bp, load_error4);
|
||||
}
|
||||
|
||||
if (bp->pending_max) {
|
||||
bnx2x_update_max_mf_config(bp, bp->pending_max);
|
||||
|
@ -2092,8 +2094,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode)
|
|||
bnx2x_release_leader_lock(bp);
|
||||
smp_mb();
|
||||
|
||||
DP(NETIF_MSG_HW, "Releasing a leadership...\n");
|
||||
|
||||
DP(NETIF_MSG_IFDOWN, "Releasing a leadership...\n");
|
||||
BNX2X_ERR("Can't unload in closed or error state\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -2198,7 +2200,7 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
|
|||
|
||||
/* If there is no power capability, silently succeed */
|
||||
if (!bp->pm_cap) {
|
||||
DP(NETIF_MSG_HW, "No power capability. Breaking.\n");
|
||||
BNX2X_DEV_INFO("No power capability. Breaking.\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2239,6 +2241,7 @@ int bnx2x_set_power_state(struct bnx2x *bp, pci_power_t state)
|
|||
break;
|
||||
|
||||
default:
|
||||
dev_err(&bp->pdev->dev, "Can't support state = %d\n", state);
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
|
@ -2308,7 +2311,7 @@ int bnx2x_poll(struct napi_struct *napi, int budget)
|
|||
if (!(bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
|
||||
napi_complete(napi);
|
||||
/* Re-enable interrupts */
|
||||
DP(NETIF_MSG_HW,
|
||||
DP(NETIF_MSG_RX_STATUS,
|
||||
"Update index to %d\n", fp->fp_hc_idx);
|
||||
bnx2x_ack_sb(bp, fp->igu_sb_id, USTORM_ID,
|
||||
le16_to_cpu(fp->fp_hc_idx),
|
||||
|
@ -2342,9 +2345,8 @@ static noinline u16 bnx2x_tx_split(struct bnx2x *bp,
|
|||
h_tx_bd->nbd = cpu_to_le16(nbd);
|
||||
h_tx_bd->nbytes = cpu_to_le16(hlen);
|
||||
|
||||
DP(NETIF_MSG_TX_QUEUED, "TSO split header size is %d "
|
||||
"(%x:%x) nbd %d\n", h_tx_bd->nbytes, h_tx_bd->addr_hi,
|
||||
h_tx_bd->addr_lo, h_tx_bd->nbd);
|
||||
DP(NETIF_MSG_TX_QUEUED, "TSO split header size is %d (%x:%x) nbd %d\n",
|
||||
h_tx_bd->nbytes, h_tx_bd->addr_hi, h_tx_bd->addr_lo, h_tx_bd->nbd);
|
||||
|
||||
/* now get a new data BD
|
||||
* (after the pbd) and fill it */
|
||||
|
@ -2484,8 +2486,7 @@ static int bnx2x_pkt_req_lin(struct bnx2x *bp, struct sk_buff *skb,
|
|||
exit_lbl:
|
||||
if (unlikely(to_copy))
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"Linearization IS REQUIRED for %s packet. "
|
||||
"num_frags %d hlen %d first_bd_sz %d\n",
|
||||
"Linearization IS REQUIRED for %s packet. num_frags %d hlen %d first_bd_sz %d\n",
|
||||
(xmit_type & XMIT_GSO) ? "LSO" : "non-LSO",
|
||||
skb_shinfo(skb)->nr_frags, hlen, first_bd_sz);
|
||||
|
||||
|
@ -2693,7 +2694,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
#endif
|
||||
|
||||
/* enable this debug print to view the transmission queue being used
|
||||
DP(BNX2X_MSG_FP, "indices: txq %d, fp %d, txdata %d\n",
|
||||
DP(NETIF_MSG_TX_QUEUED, "indices: txq %d, fp %d, txdata %d\n",
|
||||
txq_index, fp_index, txdata_index); */
|
||||
|
||||
/* locate the fastpath and the txdata */
|
||||
|
@ -2701,8 +2702,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
txdata = &fp->txdata[txdata_index];
|
||||
|
||||
/* enable this debug print to view the tranmission details
|
||||
DP(BNX2X_MSG_FP,"transmitting packet cid %d fp index %d txdata_index %d"
|
||||
" tx_data ptr %p fp pointer %p\n",
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"transmitting packet cid %d fp index %d txdata_index %d tx_data ptr %p fp pointer %p\n",
|
||||
txdata->cid, fp_index, txdata_index, txdata, fp); */
|
||||
|
||||
if (unlikely(bnx2x_tx_avail(bp, txdata) <
|
||||
|
@ -2713,8 +2714,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
return NETDEV_TX_BUSY;
|
||||
}
|
||||
|
||||
DP(NETIF_MSG_TX_QUEUED, "queue[%d]: SKB: summed %x protocol %x "
|
||||
"protocol(%x,%x) gso type %x xmit_type %x\n",
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"queue[%d]: SKB: summed %x protocol %x protocol(%x,%x) gso type %x xmit_type %x\n",
|
||||
txq_index, skb->ip_summed, skb->protocol, ipv6_hdr(skb)->nexthdr,
|
||||
ip_hdr(skb)->protocol, skb_shinfo(skb)->gso_type, xmit_type);
|
||||
|
||||
|
@ -2736,8 +2737,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
/* Statistics of linearization */
|
||||
bp->lin_cnt++;
|
||||
if (skb_linearize(skb) != 0) {
|
||||
DP(NETIF_MSG_TX_QUEUED, "SKB linearization failed - "
|
||||
"silently dropping this SKB\n");
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"SKB linearization failed - silently dropping this SKB\n");
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
@ -2747,8 +2748,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
mapping = dma_map_single(&bp->pdev->dev, skb->data,
|
||||
skb_headlen(skb), DMA_TO_DEVICE);
|
||||
if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
|
||||
DP(NETIF_MSG_TX_QUEUED, "SKB mapping failed - "
|
||||
"silently dropping this SKB\n");
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"SKB mapping failed - silently dropping this SKB\n");
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
@ -2843,8 +2844,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
tx_start_bd->nbytes = cpu_to_le16(skb_headlen(skb));
|
||||
pkt_size = tx_start_bd->nbytes;
|
||||
|
||||
DP(NETIF_MSG_TX_QUEUED, "first bd @%p addr (%x:%x) nbd %d"
|
||||
" nbytes %d flags %x vlan %x\n",
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"first bd @%p addr (%x:%x) nbd %d nbytes %d flags %x vlan %x\n",
|
||||
tx_start_bd, tx_start_bd->addr_hi, tx_start_bd->addr_lo,
|
||||
le16_to_cpu(tx_start_bd->nbd), le16_to_cpu(tx_start_bd->nbytes),
|
||||
tx_start_bd->bd_flags.as_bitfield,
|
||||
|
@ -2887,8 +2888,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
|
||||
unsigned int pkts_compl = 0, bytes_compl = 0;
|
||||
|
||||
DP(NETIF_MSG_TX_QUEUED, "Unable to map page - "
|
||||
"dropping packet...\n");
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"Unable to map page - dropping packet...\n");
|
||||
|
||||
/* we need unmap all buffers already mapped
|
||||
* for this SKB;
|
||||
|
@ -2944,8 +2945,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
|
||||
if (pbd_e1x)
|
||||
DP(NETIF_MSG_TX_QUEUED,
|
||||
"PBD (E1X) @%p ip_data %x ip_hlen %u ip_id %u lso_mss %u"
|
||||
" tcp_flags %x xsum %x seq %u hlen %u\n",
|
||||
"PBD (E1X) @%p ip_data %x ip_hlen %u ip_id %u lso_mss %u tcp_flags %x xsum %x seq %u hlen %u\n",
|
||||
pbd_e1x, pbd_e1x->global_data, pbd_e1x->ip_hlen_w,
|
||||
pbd_e1x->ip_id, pbd_e1x->lso_mss, pbd_e1x->tcp_flags,
|
||||
pbd_e1x->tcp_pseudo_csum, pbd_e1x->tcp_send_seq,
|
||||
|
@ -3021,23 +3021,22 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
|
|||
|
||||
/* requested to support too many traffic classes */
|
||||
if (num_tc > bp->max_cos) {
|
||||
DP(NETIF_MSG_TX_ERR, "support for too many traffic classes"
|
||||
" requested: %d. max supported is %d\n",
|
||||
BNX2X_ERR("support for too many traffic classes requested: %d. max supported is %d\n",
|
||||
num_tc, bp->max_cos);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* declare amount of supported traffic classes */
|
||||
if (netdev_set_num_tc(dev, num_tc)) {
|
||||
DP(NETIF_MSG_TX_ERR, "failed to declare %d traffic classes\n",
|
||||
num_tc);
|
||||
BNX2X_ERR("failed to declare %d traffic classes\n", num_tc);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* configure priority to traffic class mapping */
|
||||
for (prio = 0; prio < BNX2X_MAX_PRIORITY; prio++) {
|
||||
netdev_set_prio_tc_map(dev, prio, bp->prio_to_cos[prio]);
|
||||
DP(BNX2X_MSG_SP, "mapping priority %d to tc %d\n",
|
||||
DP(BNX2X_MSG_SP | NETIF_MSG_IFUP,
|
||||
"mapping priority %d to tc %d\n",
|
||||
prio, bp->prio_to_cos[prio]);
|
||||
}
|
||||
|
||||
|
@ -3057,7 +3056,8 @@ int bnx2x_setup_tc(struct net_device *dev, u8 num_tc)
|
|||
count = BNX2X_NUM_ETH_QUEUES(bp);
|
||||
offset = cos * MAX_TXQS_PER_COS;
|
||||
netdev_set_tc_queue(dev, cos, count, offset);
|
||||
DP(BNX2X_MSG_SP, "mapping tc %d to offset %d count %d\n",
|
||||
DP(BNX2X_MSG_SP | NETIF_MSG_IFUP,
|
||||
"mapping tc %d to offset %d count %d\n",
|
||||
cos, offset, count);
|
||||
}
|
||||
|
||||
|
@ -3071,12 +3071,16 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p)
|
|||
struct bnx2x *bp = netdev_priv(dev);
|
||||
int rc = 0;
|
||||
|
||||
if (!bnx2x_is_valid_ether_addr(bp, addr->sa_data))
|
||||
if (!bnx2x_is_valid_ether_addr(bp, addr->sa_data)) {
|
||||
BNX2X_ERR("Requested MAC address is not valid\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
#ifdef BCM_CNIC
|
||||
if (IS_MF_ISCSI_SD(bp) && !is_zero_ether_addr(addr->sa_data))
|
||||
if (IS_MF_ISCSI_SD(bp) && !is_zero_ether_addr(addr->sa_data)) {
|
||||
BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (netif_running(dev)) {
|
||||
|
@ -3150,7 +3154,7 @@ static void bnx2x_free_fp_mem_at(struct bnx2x *bp, int fp_index)
|
|||
for_each_cos_in_tx_queue(fp, cos) {
|
||||
struct bnx2x_fp_txdata *txdata = &fp->txdata[cos];
|
||||
|
||||
DP(BNX2X_MSG_SP,
|
||||
DP(NETIF_MSG_IFDOWN,
|
||||
"freeing tx memory of fp %d cos %d cid %d\n",
|
||||
fp_index, cos, txdata->cid);
|
||||
|
||||
|
@ -3249,8 +3253,8 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index)
|
|||
for_each_cos_in_tx_queue(fp, cos) {
|
||||
struct bnx2x_fp_txdata *txdata = &fp->txdata[cos];
|
||||
|
||||
DP(BNX2X_MSG_SP, "allocating tx memory of "
|
||||
"fp %d cos %d\n",
|
||||
DP(NETIF_MSG_IFUP,
|
||||
"allocating tx memory of fp %d cos %d\n",
|
||||
index, cos);
|
||||
|
||||
BNX2X_ALLOC(txdata->tx_buf_ring,
|
||||
|
@ -3487,6 +3491,7 @@ int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
|
|||
cp->fcoe_wwn_port_name_lo);
|
||||
break;
|
||||
default:
|
||||
BNX2X_ERR("Wrong WWN type requested - %d\n", type);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -3500,13 +3505,15 @@ int bnx2x_change_mtu(struct net_device *dev, int new_mtu)
|
|||
struct bnx2x *bp = netdev_priv(dev);
|
||||
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
netdev_err(dev, "Handling parity error recovery. Try again later\n");
|
||||
BNX2X_ERR("Can't perform change MTU during parity recovery\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if ((new_mtu > ETH_MAX_JUMBO_PACKET_SIZE) ||
|
||||
((new_mtu + ETH_HLEN) < ETH_MIN_PACKET_SIZE))
|
||||
((new_mtu + ETH_HLEN) < ETH_MIN_PACKET_SIZE)) {
|
||||
BNX2X_ERR("Can't support requested MTU size\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* This does not race with packet allocation
|
||||
* because the actual alloc size is
|
||||
|
@ -3636,7 +3643,7 @@ int bnx2x_resume(struct pci_dev *pdev)
|
|||
bp = netdev_priv(dev);
|
||||
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
netdev_err(dev, "Handling parity error recovery. Try again later\n");
|
||||
BNX2X_ERR("Handling parity error recovery. Try again later\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
|
@ -3681,7 +3688,8 @@ static inline void storm_memset_hc_timeout(struct bnx2x *bp, u8 port,
|
|||
u32 addr = BAR_CSTRORM_INTMEM +
|
||||
CSTORM_STATUS_BLOCK_DATA_TIMEOUT_OFFSET(fw_sb_id, sb_index);
|
||||
REG_WR8(bp, addr, ticks);
|
||||
DP(NETIF_MSG_HW, "port %x fw_sb_id %d sb_index %d ticks %d\n",
|
||||
DP(NETIF_MSG_IFUP,
|
||||
"port %x fw_sb_id %d sb_index %d ticks %d\n",
|
||||
port, fw_sb_id, sb_index, ticks);
|
||||
}
|
||||
|
||||
|
@ -3697,7 +3705,8 @@ static inline void storm_memset_hc_disable(struct bnx2x *bp, u8 port,
|
|||
flags &= ~HC_INDEX_DATA_HC_ENABLED;
|
||||
flags |= enable_flag;
|
||||
REG_WR16(bp, addr, flags);
|
||||
DP(NETIF_MSG_HW, "port %x fw_sb_id %d sb_index %d disable %d\n",
|
||||
DP(NETIF_MSG_IFUP,
|
||||
"port %x fw_sb_id %d sb_index %d disable %d\n",
|
||||
port, fw_sb_id, sb_index, disable);
|
||||
}
|
||||
|
||||
|
|
|
@ -598,7 +598,7 @@ static inline void bnx2x_igu_ack_sb_gen(struct bnx2x *bp, u8 igu_sb_id,
|
|||
(update << IGU_REGULAR_BUPDATE_SHIFT) |
|
||||
(op << IGU_REGULAR_ENABLE_INT_SHIFT));
|
||||
|
||||
DP(NETIF_MSG_HW, "write 0x%08x to IGU addr 0x%x\n",
|
||||
DP(NETIF_MSG_INTR, "write 0x%08x to IGU addr 0x%x\n",
|
||||
cmd_data.sb_id_and_flags, igu_addr);
|
||||
REG_WR(bp, igu_addr, cmd_data.sb_id_and_flags);
|
||||
|
||||
|
@ -648,8 +648,8 @@ static inline void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func,
|
|||
|
||||
|
||||
if (!(REG_RD(bp, igu_addr_ack) & sb_bit)) {
|
||||
DP(NETIF_MSG_HW, "Unable to finish IGU cleanup: "
|
||||
"idu_sb_id %d offset %d bit %d (cnt %d)\n",
|
||||
DP(NETIF_MSG_HW,
|
||||
"Unable to finish IGU cleanup: idu_sb_id %d offset %d bit %d (cnt %d)\n",
|
||||
idu_sb_id, idu_sb_id/32, idu_sb_id%32, cnt);
|
||||
}
|
||||
}
|
||||
|
@ -668,8 +668,6 @@ static inline void bnx2x_hc_ack_sb(struct bnx2x *bp, u8 sb_id,
|
|||
(update << IGU_ACK_REGISTER_UPDATE_INDEX_SHIFT) |
|
||||
(op << IGU_ACK_REGISTER_INTERRUPT_MODE_SHIFT));
|
||||
|
||||
DP(BNX2X_MSG_OFF, "write 0x%08x to HC addr 0x%x\n",
|
||||
(*(u32 *)&igu_ack), hc_addr);
|
||||
REG_WR(bp, hc_addr, (*(u32 *)&igu_ack));
|
||||
|
||||
/* Make sure that ACK is written */
|
||||
|
@ -703,9 +701,6 @@ static inline u16 bnx2x_hc_ack_int(struct bnx2x *bp)
|
|||
COMMAND_REG_SIMD_MASK);
|
||||
u32 result = REG_RD(bp, hc_addr);
|
||||
|
||||
DP(BNX2X_MSG_OFF, "read 0x%08x from HC addr 0x%x\n",
|
||||
result, hc_addr);
|
||||
|
||||
barrier();
|
||||
return result;
|
||||
}
|
||||
|
@ -715,7 +710,7 @@ static inline u16 bnx2x_igu_ack_int(struct bnx2x *bp)
|
|||
u32 igu_addr = (BAR_IGU_INTMEM + IGU_REG_SISR_MDPC_WMASK_LSB_UPPER*8);
|
||||
u32 result = REG_RD(bp, igu_addr);
|
||||
|
||||
DP(NETIF_MSG_HW, "read 0x%08x from IGU addr 0x%x\n",
|
||||
DP(NETIF_MSG_INTR, "read 0x%08x from IGU addr 0x%x\n",
|
||||
result, igu_addr);
|
||||
|
||||
barrier();
|
||||
|
@ -893,13 +888,16 @@ static inline int bnx2x_alloc_rx_sge(struct bnx2x *bp,
|
|||
struct eth_rx_sge *sge = &fp->rx_sge_ring[index];
|
||||
dma_addr_t mapping;
|
||||
|
||||
if (unlikely(page == NULL))
|
||||
if (unlikely(page == NULL)) {
|
||||
BNX2X_ERR("Can't alloc sge\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
mapping = dma_map_page(&bp->pdev->dev, page, 0,
|
||||
SGE_PAGE_SIZE*PAGES_PER_SGE, DMA_FROM_DEVICE);
|
||||
if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
|
||||
__free_pages(page, PAGES_PER_SGE_SHIFT);
|
||||
BNX2X_ERR("Can't map sge\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -929,6 +927,7 @@ static inline int bnx2x_alloc_rx_data(struct bnx2x *bp,
|
|||
DMA_FROM_DEVICE);
|
||||
if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
|
||||
kfree(data);
|
||||
BNX2X_ERR("Can't map rx data\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
@ -1299,7 +1298,7 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp,
|
|||
txdata->txq_index = txq_index;
|
||||
txdata->tx_cons_sb = tx_cons_sb;
|
||||
|
||||
DP(BNX2X_MSG_SP, "created tx data cid %d, txq %d\n",
|
||||
DP(NETIF_MSG_IFUP, "created tx data cid %d, txq %d\n",
|
||||
txdata->cid, txdata->txq_index);
|
||||
}
|
||||
|
||||
|
@ -1344,7 +1343,7 @@ static inline void bnx2x_init_fcoe_fp(struct bnx2x *bp)
|
|||
bnx2x_init_txdata(bp, &bnx2x_fcoe(bp, txdata[0]),
|
||||
fp->cid, FCOE_TXQ_IDX(bp), BNX2X_FCOE_L2_TX_INDEX);
|
||||
|
||||
DP(BNX2X_MSG_SP, "created fcoe tx data (fp index %d)\n", fp->index);
|
||||
DP(NETIF_MSG_IFUP, "created fcoe tx data (fp index %d)\n", fp->index);
|
||||
|
||||
/* qZone id equals to FW (per path) client id */
|
||||
bnx2x_fcoe(bp, cl_qzone_id) = bnx2x_fp_qzone_id(fp);
|
||||
|
@ -1363,8 +1362,8 @@ static inline void bnx2x_init_fcoe_fp(struct bnx2x *bp)
|
|||
BP_FUNC(bp), bnx2x_sp(bp, q_rdata),
|
||||
bnx2x_sp_mapping(bp, q_rdata), q_type);
|
||||
|
||||
DP(NETIF_MSG_IFUP, "queue[%d]: bnx2x_init_sb(%p,%p) cl_id %d fw_sb %d "
|
||||
"igu_sb %d\n",
|
||||
DP(NETIF_MSG_IFUP,
|
||||
"queue[%d]: bnx2x_init_sb(%p,%p) cl_id %d fw_sb %d igu_sb %d\n",
|
||||
fp->index, bp, fp->status_blk.e2_sb, fp->cl_id, fp->fw_sb_id,
|
||||
fp->igu_sb_id);
|
||||
}
|
||||
|
@ -1377,8 +1376,7 @@ static inline int bnx2x_clean_tx_queue(struct bnx2x *bp,
|
|||
|
||||
while (bnx2x_has_tx_work_unload(txdata)) {
|
||||
if (!cnt) {
|
||||
BNX2X_ERR("timeout waiting for queue[%d]: "
|
||||
"txdata->tx_pkt_prod(%d) != txdata->tx_pkt_cons(%d)\n",
|
||||
BNX2X_ERR("timeout waiting for queue[%d]: txdata->tx_pkt_prod(%d) != txdata->tx_pkt_cons(%d)\n",
|
||||
txdata->txq_index, txdata->tx_pkt_prod,
|
||||
txdata->tx_pkt_cons);
|
||||
#ifdef BNX2X_STOP_ON_ERROR
|
||||
|
@ -1455,8 +1453,8 @@ static inline bool bnx2x_wait_sp_comp(struct bnx2x *bp, unsigned long mask)
|
|||
|
||||
netif_addr_lock_bh(bp->dev);
|
||||
if (bp->sp_state & mask) {
|
||||
BNX2X_ERR("Filtering completion timed out. sp_state 0x%lx, "
|
||||
"mask 0x%lx\n", bp->sp_state, mask);
|
||||
BNX2X_ERR("Filtering completion timed out. sp_state 0x%lx, mask 0x%lx\n",
|
||||
bp->sp_state, mask);
|
||||
netif_addr_unlock_bh(bp->dev);
|
||||
return false;
|
||||
}
|
||||
|
@ -1492,7 +1490,7 @@ static inline u16 bnx2x_extract_max_cfg(struct bnx2x *bp, u32 mf_cfg)
|
|||
u16 max_cfg = (mf_cfg & FUNC_MF_CFG_MAX_BW_MASK) >>
|
||||
FUNC_MF_CFG_MAX_BW_SHIFT;
|
||||
if (!max_cfg) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(NETIF_MSG_IFUP | BNX2X_MSG_ETHTOOL,
|
||||
"Max BW configured to 0 - using 100 instead\n");
|
||||
max_cfg = 100;
|
||||
}
|
||||
|
@ -1655,7 +1653,7 @@ static inline void bnx2x_update_drv_flags(struct bnx2x *bp, u32 flags, u32 set)
|
|||
RESET_FLAGS(drv_flags, flags);
|
||||
|
||||
SHMEM2_WR(bp, drv_flags, drv_flags);
|
||||
DP(NETIF_MSG_HW, "drv_flags 0x%08x\n", drv_flags);
|
||||
DP(NETIF_MSG_IFUP, "drv_flags 0x%08x\n", drv_flags);
|
||||
bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_DRV_FLAGS);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,27 +167,27 @@ static void bnx2x_dump_dcbx_drv_param(struct bnx2x *bp,
|
|||
DCBX_PRI_PG_GET(features->ets.pri_pg_tbl, i));
|
||||
|
||||
/* pfc */
|
||||
DP(NETIF_MSG_LINK, "dcbx_features.pfc.pri_en_bitmap %x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_features.pfc.pri_en_bitmap %x\n",
|
||||
features->pfc.pri_en_bitmap);
|
||||
DP(NETIF_MSG_LINK, "dcbx_features.pfc.pfc_caps %x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_features.pfc.pfc_caps %x\n",
|
||||
features->pfc.pfc_caps);
|
||||
DP(NETIF_MSG_LINK, "dcbx_features.pfc.enabled %x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_features.pfc.enabled %x\n",
|
||||
features->pfc.enabled);
|
||||
|
||||
DP(NETIF_MSG_LINK, "dcbx_features.app.default_pri %x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_features.app.default_pri %x\n",
|
||||
features->app.default_pri);
|
||||
DP(NETIF_MSG_LINK, "dcbx_features.app.tc_supported %x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_features.app.tc_supported %x\n",
|
||||
features->app.tc_supported);
|
||||
DP(NETIF_MSG_LINK, "dcbx_features.app.enabled %x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_features.app.enabled %x\n",
|
||||
features->app.enabled);
|
||||
for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"dcbx_features.app.app_pri_tbl[%x].app_id %x\n",
|
||||
i, features->app.app_pri_tbl[i].app_id);
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"dcbx_features.app.app_pri_tbl[%x].pri_bitmap %x\n",
|
||||
i, features->app.app_pri_tbl[i].pri_bitmap);
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"dcbx_features.app.app_pri_tbl[%x].appBitfield %x\n",
|
||||
i, features->app.app_pri_tbl[i].appBitfield);
|
||||
}
|
||||
|
@ -221,10 +221,10 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,
|
|||
u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
|
||||
|
||||
if (GET_FLAGS(error, DCBX_LOCAL_APP_ERROR))
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_APP_ERROR\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_ERROR\n");
|
||||
|
||||
if (GET_FLAGS(error, DCBX_LOCAL_APP_MISMATCH))
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_APP_MISMATCH\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_MISMATCH\n");
|
||||
|
||||
if (app->enabled &&
|
||||
!GET_FLAGS(error, DCBX_LOCAL_APP_ERROR | DCBX_LOCAL_APP_MISMATCH)) {
|
||||
|
@ -256,7 +256,7 @@ static void bnx2x_dcbx_get_ap_feature(struct bnx2x *bp,
|
|||
LLFC_TRAFFIC_TYPE_ISCSI);
|
||||
}
|
||||
} else {
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_APP_DISABLED\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_APP_DISABLED\n");
|
||||
bp->dcbx_port_params.app.enabled = false;
|
||||
for (index = 0 ; index < LLFC_DRIVER_TRAFFIC_TYPE_MAX; index++)
|
||||
ttp[index] = INVALID_TRAFFIC_TYPE_PRIORITY;
|
||||
|
@ -276,7 +276,7 @@ static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp,
|
|||
|
||||
|
||||
if (GET_FLAGS(error, DCBX_LOCAL_ETS_ERROR))
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_ETS_ERROR\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_ETS_ERROR\n");
|
||||
|
||||
|
||||
/* Clean up old settings of ets on COS */
|
||||
|
@ -290,7 +290,7 @@ static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp,
|
|||
if (bp->dcbx_port_params.app.enabled &&
|
||||
!GET_FLAGS(error, DCBX_LOCAL_ETS_ERROR) &&
|
||||
ets->enabled) {
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_ETS_ENABLE\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_ETS_ENABLE\n");
|
||||
bp->dcbx_port_params.ets.enabled = true;
|
||||
|
||||
bnx2x_dcbx_get_ets_pri_pg_tbl(bp,
|
||||
|
@ -305,7 +305,7 @@ static void bnx2x_dcbx_get_ets_feature(struct bnx2x *bp,
|
|||
ets, pg_pri_orginal_spread);
|
||||
|
||||
} else {
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_ETS_DISABLED\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_ETS_DISABLED\n");
|
||||
bp->dcbx_port_params.ets.enabled = false;
|
||||
ets->pri_pg_tbl[0] = 0;
|
||||
|
||||
|
@ -319,7 +319,7 @@ static void bnx2x_dcbx_get_pfc_feature(struct bnx2x *bp,
|
|||
{
|
||||
|
||||
if (GET_FLAGS(error, DCBX_LOCAL_PFC_ERROR))
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_PFC_ERROR\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_PFC_ERROR\n");
|
||||
|
||||
if (bp->dcbx_port_params.app.enabled &&
|
||||
!GET_FLAGS(error, DCBX_LOCAL_PFC_ERROR | DCBX_LOCAL_PFC_MISMATCH) &&
|
||||
|
@ -328,7 +328,7 @@ static void bnx2x_dcbx_get_pfc_feature(struct bnx2x *bp,
|
|||
bp->dcbx_port_params.pfc.priority_non_pauseable_mask =
|
||||
~(pfc->pri_en_bitmap);
|
||||
} else {
|
||||
DP(NETIF_MSG_LINK, "DCBX_LOCAL_PFC_DISABLED\n");
|
||||
DP(BNX2X_MSG_DCB, "DCBX_LOCAL_PFC_DISABLED\n");
|
||||
bp->dcbx_port_params.pfc.enabled = false;
|
||||
bp->dcbx_port_params.pfc.priority_non_pauseable_mask = 0;
|
||||
}
|
||||
|
@ -352,7 +352,7 @@ static void bnx2x_dcbx_map_nw(struct bnx2x *bp)
|
|||
for (i = 0; i < ARRAY_SIZE(bp->dcbx_port_params.ets.cos_params); i++) {
|
||||
if (cos_params[i].pri_bitmask & nw_prio) {
|
||||
/* extend the bitmask with unmapped */
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"cos %d extended with 0x%08x\n", i, unmapped);
|
||||
cos_params[i].pri_bitmask |= unmapped;
|
||||
break;
|
||||
|
@ -448,7 +448,7 @@ static int bnx2x_dcbx_stop_hw_tx(struct bnx2x *bp)
|
|||
func_params.f_obj = &bp->func_obj;
|
||||
func_params.cmd = BNX2X_F_CMD_TX_STOP;
|
||||
|
||||
DP(NETIF_MSG_LINK, "STOP TRAFFIC\n");
|
||||
DP(BNX2X_MSG_DCB, "STOP TRAFFIC\n");
|
||||
return bnx2x_func_state_change(bp, &func_params);
|
||||
}
|
||||
|
||||
|
@ -463,7 +463,7 @@ static int bnx2x_dcbx_resume_hw_tx(struct bnx2x *bp)
|
|||
|
||||
bnx2x_dcbx_fw_struct(bp, tx_params);
|
||||
|
||||
DP(NETIF_MSG_LINK, "START TRAFFIC\n");
|
||||
DP(BNX2X_MSG_DCB, "START TRAFFIC\n");
|
||||
return bnx2x_func_state_change(bp, &func_params);
|
||||
}
|
||||
|
||||
|
@ -588,7 +588,7 @@ static int bnx2x_dcbx_read_shmem_remote_mib(struct bnx2x *bp)
|
|||
u32 dcbx_remote_mib_offset = SHMEM2_RD(bp, dcbx_remote_mib_offset);
|
||||
int rc;
|
||||
|
||||
DP(NETIF_MSG_LINK, "dcbx_remote_mib_offset 0x%x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_remote_mib_offset 0x%x\n",
|
||||
dcbx_remote_mib_offset);
|
||||
|
||||
if (SHMEM_DCBX_REMOTE_MIB_NONE == dcbx_remote_mib_offset) {
|
||||
|
@ -617,7 +617,7 @@ static int bnx2x_dcbx_read_shmem_neg_results(struct bnx2x *bp)
|
|||
u32 dcbx_neg_res_offset = SHMEM2_RD(bp, dcbx_neg_res_offset);
|
||||
int rc;
|
||||
|
||||
DP(NETIF_MSG_LINK, "dcbx_neg_res_offset 0x%x\n", dcbx_neg_res_offset);
|
||||
DP(BNX2X_MSG_DCB, "dcbx_neg_res_offset 0x%x\n", dcbx_neg_res_offset);
|
||||
|
||||
if (SHMEM_DCBX_NEG_RES_NONE == dcbx_neg_res_offset) {
|
||||
BNX2X_ERR("FW doesn't support dcbx_neg_res_offset\n");
|
||||
|
@ -693,7 +693,7 @@ static inline void bnx2x_dcbx_update_tc_mapping(struct bnx2x *bp)
|
|||
if (bp->dcbx_port_params.ets.cos_params[cos].pri_bitmask
|
||||
& (1 << prio)) {
|
||||
bp->prio_to_cos[prio] = cos;
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"tx_mapping %d --> %d\n", prio, cos);
|
||||
}
|
||||
}
|
||||
|
@ -712,7 +712,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
|
|||
switch (state) {
|
||||
case BNX2X_DCBX_STATE_NEG_RECEIVED:
|
||||
{
|
||||
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_NEG_RECEIVED\n");
|
||||
DP(BNX2X_MSG_DCB, "BNX2X_DCBX_STATE_NEG_RECEIVED\n");
|
||||
#ifdef BCM_DCBNL
|
||||
/**
|
||||
* Delete app tlvs from dcbnl before reading new
|
||||
|
@ -762,7 +762,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
|
|||
return;
|
||||
}
|
||||
case BNX2X_DCBX_STATE_TX_PAUSED:
|
||||
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_PAUSED\n");
|
||||
DP(BNX2X_MSG_DCB, "BNX2X_DCBX_STATE_TX_PAUSED\n");
|
||||
bnx2x_pfc_set_pfc(bp);
|
||||
|
||||
bnx2x_dcbx_update_ets_params(bp);
|
||||
|
@ -770,7 +770,7 @@ void bnx2x_dcbx_set_params(struct bnx2x *bp, u32 state)
|
|||
|
||||
return;
|
||||
case BNX2X_DCBX_STATE_TX_RELEASED:
|
||||
DP(NETIF_MSG_LINK, "BNX2X_DCBX_STATE_TX_RELEASED\n");
|
||||
DP(BNX2X_MSG_DCB, "BNX2X_DCBX_STATE_TX_RELEASED\n");
|
||||
bnx2x_fw_command(bp, DRV_MSG_CODE_DCBX_PMF_DRV_OK, 0);
|
||||
#ifdef BCM_DCBNL
|
||||
/*
|
||||
|
@ -861,7 +861,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp,
|
|||
DCBX_PG_BW_SET(af->ets.pg_bw_tbl, i,
|
||||
(u8)dp->admin_configuration_bw_precentage[i]);
|
||||
|
||||
DP(NETIF_MSG_LINK, "pg_bw_tbl[%d] = %02x\n",
|
||||
DP(BNX2X_MSG_DCB, "pg_bw_tbl[%d] = %02x\n",
|
||||
i, DCBX_PG_BW_GET(af->ets.pg_bw_tbl, i));
|
||||
}
|
||||
|
||||
|
@ -869,7 +869,7 @@ static void bnx2x_dcbx_admin_mib_updated_params(struct bnx2x *bp,
|
|||
DCBX_PRI_PG_SET(af->ets.pri_pg_tbl, i,
|
||||
(u8)dp->admin_configuration_ets_pg[i]);
|
||||
|
||||
DP(NETIF_MSG_LINK, "pri_pg_tbl[%d] = %02x\n",
|
||||
DP(BNX2X_MSG_DCB, "pri_pg_tbl[%d] = %02x\n",
|
||||
i, DCBX_PRI_PG_GET(af->ets.pri_pg_tbl, i));
|
||||
}
|
||||
|
||||
|
@ -923,7 +923,7 @@ void bnx2x_dcbx_set_state(struct bnx2x *bp, bool dcb_on, u32 dcbx_enabled)
|
|||
bp->dcb_state = false;
|
||||
bp->dcbx_enabled = BNX2X_DCBX_ENABLED_INVALID;
|
||||
}
|
||||
DP(NETIF_MSG_LINK, "DCB state [%s:%s]\n",
|
||||
DP(BNX2X_MSG_DCB, "DCB state [%s:%s]\n",
|
||||
dcb_on ? "ON" : "OFF",
|
||||
dcbx_enabled == BNX2X_DCBX_ENABLED_OFF ? "user-mode" :
|
||||
dcbx_enabled == BNX2X_DCBX_ENABLED_ON_NEG_OFF ? "on-chip static" :
|
||||
|
@ -1011,7 +1011,7 @@ void bnx2x_dcbx_init(struct bnx2x *bp)
|
|||
* the function is pmf
|
||||
* shmem2 contains DCBX support fields
|
||||
*/
|
||||
DP(NETIF_MSG_LINK, "dcb_state %d bp->port.pmf %d\n",
|
||||
DP(BNX2X_MSG_DCB, "dcb_state %d bp->port.pmf %d\n",
|
||||
bp->dcb_state, bp->port.pmf);
|
||||
|
||||
if (bp->dcb_state == BNX2X_DCB_STATE_ON && bp->port.pmf &&
|
||||
|
@ -1019,7 +1019,7 @@ void bnx2x_dcbx_init(struct bnx2x *bp)
|
|||
dcbx_lldp_params_offset =
|
||||
SHMEM2_RD(bp, dcbx_lldp_params_offset);
|
||||
|
||||
DP(NETIF_MSG_LINK, "dcbx_lldp_params_offset 0x%x\n",
|
||||
DP(BNX2X_MSG_DCB, "dcbx_lldp_params_offset 0x%x\n",
|
||||
dcbx_lldp_params_offset);
|
||||
|
||||
bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0);
|
||||
|
@ -1041,38 +1041,36 @@ bnx2x_dcbx_print_cos_params(struct bnx2x *bp,
|
|||
u8 pri = 0;
|
||||
u8 cos = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pfc_fw_cfg->dcb_version %x\n", pfc_fw_cfg->dcb_version);
|
||||
DP(NETIF_MSG_LINK,
|
||||
"pdev->params.dcbx_port_params.pfc."
|
||||
"priority_non_pauseable_mask %x\n",
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pdev->params.dcbx_port_params.pfc.priority_non_pauseable_mask %x\n",
|
||||
bp->dcbx_port_params.pfc.priority_non_pauseable_mask);
|
||||
|
||||
for (cos = 0 ; cos < bp->dcbx_port_params.ets.num_of_cos ; cos++) {
|
||||
DP(NETIF_MSG_LINK, "pdev->params.dcbx_port_params.ets."
|
||||
"cos_params[%d].pri_bitmask %x\n", cos,
|
||||
bp->dcbx_port_params.ets.cos_params[cos].pri_bitmask);
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pdev->params.dcbx_port_params.ets.cos_params[%d].pri_bitmask %x\n",
|
||||
cos, bp->dcbx_port_params.ets.cos_params[cos].pri_bitmask);
|
||||
|
||||
DP(NETIF_MSG_LINK, "pdev->params.dcbx_port_params.ets."
|
||||
"cos_params[%d].bw_tbl %x\n", cos,
|
||||
bp->dcbx_port_params.ets.cos_params[cos].bw_tbl);
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pdev->params.dcbx_port_params.ets.cos_params[%d].bw_tbl %x\n",
|
||||
cos, bp->dcbx_port_params.ets.cos_params[cos].bw_tbl);
|
||||
|
||||
DP(NETIF_MSG_LINK, "pdev->params.dcbx_port_params.ets."
|
||||
"cos_params[%d].strict %x\n", cos,
|
||||
bp->dcbx_port_params.ets.cos_params[cos].strict);
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pdev->params.dcbx_port_params.ets.cos_params[%d].strict %x\n",
|
||||
cos, bp->dcbx_port_params.ets.cos_params[cos].strict);
|
||||
|
||||
DP(NETIF_MSG_LINK, "pdev->params.dcbx_port_params.ets."
|
||||
"cos_params[%d].pauseable %x\n", cos,
|
||||
bp->dcbx_port_params.ets.cos_params[cos].pauseable);
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pdev->params.dcbx_port_params.ets.cos_params[%d].pauseable %x\n",
|
||||
cos, bp->dcbx_port_params.ets.cos_params[cos].pauseable);
|
||||
}
|
||||
|
||||
for (pri = 0; pri < LLFC_DRIVER_TRAFFIC_TYPE_MAX; pri++) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
"pfc_fw_cfg->traffic_type_to_priority_cos[%d]."
|
||||
"priority %x\n", pri,
|
||||
pfc_fw_cfg->traffic_type_to_priority_cos[pri].priority);
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pfc_fw_cfg->traffic_type_to_priority_cos[%d].priority %x\n",
|
||||
pri, pfc_fw_cfg->traffic_type_to_priority_cos[pri].priority);
|
||||
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"pfc_fw_cfg->traffic_type_to_priority_cos[%d].cos %x\n",
|
||||
pri, pfc_fw_cfg->traffic_type_to_priority_cos[pri].cos);
|
||||
}
|
||||
|
@ -1119,7 +1117,7 @@ static void bnx2x_dcbx_get_num_pg_traf_type(struct bnx2x *bp,
|
|||
help_data->num_of_pg++;
|
||||
}
|
||||
}
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"add_traf_type %d pg_found %s num_of_pg %d\n",
|
||||
add_traf_type, (false == pg_found) ? "NO" : "YES",
|
||||
help_data->num_of_pg);
|
||||
|
@ -1312,8 +1310,7 @@ static void bnx2x_dcbx_2cos_limit_cee_single_pg_to_cos_params(struct bnx2x *bp,
|
|||
}
|
||||
|
||||
if (i == LLFC_DRIVER_TRAFFIC_TYPE_MAX)
|
||||
BNX2X_ERR("Invalid value for pri_join_mask -"
|
||||
" could not find a priority\n");
|
||||
BNX2X_ERR("Invalid value for pri_join_mask - could not find a priority\n");
|
||||
|
||||
cos_data->data[0].pri_join_mask = pri_mask_without_pri;
|
||||
cos_data->data[1].pri_join_mask = pri_tested;
|
||||
|
@ -1626,8 +1623,10 @@ static int bnx2x_dcbx_spread_strict_pri(struct bnx2x *bp,
|
|||
num_of_app_pri--;
|
||||
}
|
||||
|
||||
if (num_spread_of_entries)
|
||||
if (num_spread_of_entries) {
|
||||
BNX2X_ERR("Didn't succeed to spread strict priorities\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1675,8 +1674,7 @@ static void bnx2x_dcbx_cee_fill_cos_params(struct bnx2x *bp,
|
|||
if (help_data->num_of_pg > DCBX_COS_MAX_NUM_E3B0) {
|
||||
if (bnx2x_dcbx_join_pgs(bp, ets, help_data,
|
||||
DCBX_COS_MAX_NUM_E3B0)) {
|
||||
BNX2X_ERR("Unable to reduce the number of PGs -"
|
||||
"we will disables ETS\n");
|
||||
BNX2X_ERR("Unable to reduce the number of PGs - we will disables ETS\n");
|
||||
bnx2x_dcbx_ets_disabled_entry_data(bp, cos_data,
|
||||
pri_join_mask);
|
||||
return;
|
||||
|
@ -1776,23 +1774,23 @@ static void bnx2x_dcbx_fill_cos_params(struct bnx2x *bp,
|
|||
if (p->pauseable &&
|
||||
DCBX_PFC_PRI_GET_NON_PAUSE(bp,
|
||||
p->pri_bitmask) != 0)
|
||||
BNX2X_ERR("Inconsistent config for "
|
||||
"pausable COS %d\n", i);
|
||||
BNX2X_ERR("Inconsistent config for pausable COS %d\n",
|
||||
i);
|
||||
|
||||
if (!p->pauseable &&
|
||||
DCBX_PFC_PRI_GET_PAUSE(bp,
|
||||
p->pri_bitmask) != 0)
|
||||
BNX2X_ERR("Inconsistent config for "
|
||||
"nonpausable COS %d\n", i);
|
||||
BNX2X_ERR("Inconsistent config for nonpausable COS %d\n",
|
||||
i);
|
||||
}
|
||||
}
|
||||
|
||||
if (p->pauseable)
|
||||
DP(NETIF_MSG_LINK, "COS %d PAUSABLE prijoinmask 0x%x\n",
|
||||
DP(BNX2X_MSG_DCB, "COS %d PAUSABLE prijoinmask 0x%x\n",
|
||||
i, cos_data.data[i].pri_join_mask);
|
||||
else
|
||||
DP(NETIF_MSG_LINK, "COS %d NONPAUSABLE prijoinmask "
|
||||
"0x%x\n",
|
||||
DP(BNX2X_MSG_DCB,
|
||||
"COS %d NONPAUSABLE prijoinmask 0x%x\n",
|
||||
i, cos_data.data[i].pri_join_mask);
|
||||
}
|
||||
|
||||
|
@ -1808,7 +1806,7 @@ static void bnx2x_dcbx_get_ets_pri_pg_tbl(struct bnx2x *bp,
|
|||
for (i = 0; i < DCBX_MAX_NUM_PRI_PG_ENTRIES; i++) {
|
||||
set_configuration_ets_pg[i] = DCBX_PRI_PG_GET(pri_pg_tbl, i);
|
||||
|
||||
DP(NETIF_MSG_LINK, "set_configuration_ets_pg[%d] = 0x%x\n",
|
||||
DP(BNX2X_MSG_DCB, "set_configuration_ets_pg[%d] = 0x%x\n",
|
||||
i, set_configuration_ets_pg[i]);
|
||||
}
|
||||
}
|
||||
|
@ -1904,14 +1902,14 @@ static inline bool bnx2x_dcbnl_set_valid(struct bnx2x *bp)
|
|||
static u8 bnx2x_dcbnl_get_state(struct net_device *netdev)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "state = %d\n", bp->dcb_state);
|
||||
DP(BNX2X_MSG_DCB, "state = %d\n", bp->dcb_state);
|
||||
return bp->dcb_state;
|
||||
}
|
||||
|
||||
static u8 bnx2x_dcbnl_set_state(struct net_device *netdev, u8 state)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "state = %s\n", state ? "on" : "off");
|
||||
DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off");
|
||||
|
||||
bnx2x_dcbx_set_state(bp, (state ? true : false), bp->dcbx_enabled);
|
||||
return 0;
|
||||
|
@ -1921,7 +1919,7 @@ static void bnx2x_dcbnl_get_perm_hw_addr(struct net_device *netdev,
|
|||
u8 *perm_addr)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "GET-PERM-ADDR\n");
|
||||
DP(BNX2X_MSG_DCB, "GET-PERM-ADDR\n");
|
||||
|
||||
/* first the HW mac address */
|
||||
memcpy(perm_addr, netdev->dev_addr, netdev->addr_len);
|
||||
|
@ -1938,7 +1936,7 @@ static void bnx2x_dcbnl_set_pg_tccfg_tx(struct net_device *netdev, int prio,
|
|||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
|
||||
DP(NETIF_MSG_LINK, "prio[%d] = %d\n", prio, pgid);
|
||||
DP(BNX2X_MSG_DCB, "prio[%d] = %d\n", prio, pgid);
|
||||
if (!bnx2x_dcbnl_set_valid(bp) || prio >= DCBX_MAX_NUM_PRI_PG_ENTRIES)
|
||||
return;
|
||||
|
||||
|
@ -1963,7 +1961,7 @@ static void bnx2x_dcbnl_set_pg_bwgcfg_tx(struct net_device *netdev,
|
|||
int pgid, u8 bw_pct)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "pgid[%d] = %d\n", pgid, bw_pct);
|
||||
DP(BNX2X_MSG_DCB, "pgid[%d] = %d\n", pgid, bw_pct);
|
||||
|
||||
if (!bnx2x_dcbnl_set_valid(bp) || pgid >= DCBX_MAX_NUM_PG_BW_ENTRIES)
|
||||
return;
|
||||
|
@ -1977,14 +1975,14 @@ static void bnx2x_dcbnl_set_pg_tccfg_rx(struct net_device *netdev, int prio,
|
|||
u8 up_map)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "Nothing to set; No RX support\n");
|
||||
DP(BNX2X_MSG_DCB, "Nothing to set; No RX support\n");
|
||||
}
|
||||
|
||||
static void bnx2x_dcbnl_set_pg_bwgcfg_rx(struct net_device *netdev,
|
||||
int pgid, u8 bw_pct)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "Nothing to set; No RX support\n");
|
||||
DP(BNX2X_MSG_DCB, "Nothing to set; No RX support\n");
|
||||
}
|
||||
|
||||
static void bnx2x_dcbnl_get_pg_tccfg_tx(struct net_device *netdev, int prio,
|
||||
|
@ -1992,7 +1990,7 @@ static void bnx2x_dcbnl_get_pg_tccfg_tx(struct net_device *netdev, int prio,
|
|||
u8 *up_map)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "prio = %d\n", prio);
|
||||
DP(BNX2X_MSG_DCB, "prio = %d\n", prio);
|
||||
|
||||
/**
|
||||
* bw_pct ingnored - band-width percentage devision between user
|
||||
|
@ -2018,7 +2016,7 @@ static void bnx2x_dcbnl_get_pg_bwgcfg_tx(struct net_device *netdev,
|
|||
int pgid, u8 *bw_pct)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "pgid = %d\n", pgid);
|
||||
DP(BNX2X_MSG_DCB, "pgid = %d\n", pgid);
|
||||
|
||||
*bw_pct = 0;
|
||||
|
||||
|
@ -2033,7 +2031,7 @@ static void bnx2x_dcbnl_get_pg_tccfg_rx(struct net_device *netdev, int prio,
|
|||
u8 *up_map)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "Nothing to get; No RX support\n");
|
||||
DP(BNX2X_MSG_DCB, "Nothing to get; No RX support\n");
|
||||
|
||||
*prio_type = *pgid = *bw_pct = *up_map = 0;
|
||||
}
|
||||
|
@ -2042,7 +2040,7 @@ static void bnx2x_dcbnl_get_pg_bwgcfg_rx(struct net_device *netdev,
|
|||
int pgid, u8 *bw_pct)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "Nothing to get; No RX support\n");
|
||||
DP(BNX2X_MSG_DCB, "Nothing to get; No RX support\n");
|
||||
|
||||
*bw_pct = 0;
|
||||
}
|
||||
|
@ -2051,7 +2049,7 @@ static void bnx2x_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio,
|
|||
u8 setting)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "prio[%d] = %d\n", prio, setting);
|
||||
DP(BNX2X_MSG_DCB, "prio[%d] = %d\n", prio, setting);
|
||||
|
||||
if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES)
|
||||
return;
|
||||
|
@ -2066,7 +2064,7 @@ static void bnx2x_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio,
|
|||
u8 *setting)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "prio = %d\n", prio);
|
||||
DP(BNX2X_MSG_DCB, "prio = %d\n", prio);
|
||||
|
||||
*setting = 0;
|
||||
|
||||
|
@ -2081,21 +2079,21 @@ static u8 bnx2x_dcbnl_set_all(struct net_device *netdev)
|
|||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
int rc = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "SET-ALL\n");
|
||||
DP(BNX2X_MSG_DCB, "SET-ALL\n");
|
||||
|
||||
if (!bnx2x_dcbnl_set_valid(bp))
|
||||
return 1;
|
||||
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
netdev_err(bp->dev, "Handling parity error recovery. "
|
||||
"Try again later\n");
|
||||
netdev_err(bp->dev,
|
||||
"Handling parity error recovery. Try again later\n");
|
||||
return 1;
|
||||
}
|
||||
if (netif_running(bp->dev)) {
|
||||
bnx2x_nic_unload(bp, UNLOAD_NORMAL);
|
||||
rc = bnx2x_nic_load(bp, LOAD_NORMAL);
|
||||
}
|
||||
DP(NETIF_MSG_LINK, "set_dcbx_params done (%d)\n", rc);
|
||||
DP(BNX2X_MSG_DCB, "set_dcbx_params done (%d)\n", rc);
|
||||
if (rc)
|
||||
return 1;
|
||||
|
||||
|
@ -2134,13 +2132,16 @@ static u8 bnx2x_dcbnl_get_cap(struct net_device *netdev, int capid, u8 *cap)
|
|||
*cap = BNX2X_DCBX_CAPS;
|
||||
break;
|
||||
default:
|
||||
BNX2X_ERR("Non valid capability ID\n");
|
||||
rval = -EINVAL;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
DP(BNX2X_MSG_DCB, "DCB disabled\n");
|
||||
rval = -EINVAL;
|
||||
}
|
||||
|
||||
DP(NETIF_MSG_LINK, "capid %d:%x\n", capid, *cap);
|
||||
DP(BNX2X_MSG_DCB, "capid %d:%x\n", capid, *cap);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
@ -2149,7 +2150,7 @@ static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
|
|||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
u8 rval = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "tcid %d\n", tcid);
|
||||
DP(BNX2X_MSG_DCB, "tcid %d\n", tcid);
|
||||
|
||||
if (bp->dcb_state) {
|
||||
switch (tcid) {
|
||||
|
@ -2162,11 +2163,14 @@ static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
|
|||
DCBX_COS_MAX_NUM_E2;
|
||||
break;
|
||||
default:
|
||||
BNX2X_ERR("Non valid TC-ID\n");
|
||||
rval = -EINVAL;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
DP(BNX2X_MSG_DCB, "DCB disabled\n");
|
||||
rval = -EINVAL;
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -2174,14 +2178,14 @@ static int bnx2x_dcbnl_get_numtcs(struct net_device *netdev, int tcid, u8 *num)
|
|||
static int bnx2x_dcbnl_set_numtcs(struct net_device *netdev, int tcid, u8 num)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "num tcs = %d; Not supported\n", num);
|
||||
DP(BNX2X_MSG_DCB, "num tcs = %d; Not supported\n", num);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "state = %d\n", bp->dcbx_local_feat.pfc.enabled);
|
||||
DP(BNX2X_MSG_DCB, "state = %d\n", bp->dcbx_local_feat.pfc.enabled);
|
||||
|
||||
if (!bp->dcb_state)
|
||||
return 0;
|
||||
|
@ -2192,7 +2196,7 @@ static u8 bnx2x_dcbnl_get_pfc_state(struct net_device *netdev)
|
|||
static void bnx2x_dcbnl_set_pfc_state(struct net_device *netdev, u8 state)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "state = %s\n", state ? "on" : "off");
|
||||
DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off");
|
||||
|
||||
if (!bnx2x_dcbnl_set_valid(bp))
|
||||
return;
|
||||
|
@ -2269,9 +2273,11 @@ static int bnx2x_set_admin_app_up(struct bnx2x *bp, u8 idtype, u16 idval, u8 up)
|
|||
bnx2x_admin_app_set_ent(
|
||||
&bp->dcbx_config_params.admin_priority_app_table[ff],
|
||||
idtype, idval, up);
|
||||
else
|
||||
else {
|
||||
/* app table is full */
|
||||
BNX2X_ERR("Application table is too large\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* up configured, if not 0 make sure feature is enabled */
|
||||
if (up)
|
||||
|
@ -2285,11 +2291,13 @@ static u8 bnx2x_dcbnl_set_app_up(struct net_device *netdev, u8 idtype,
|
|||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
|
||||
DP(NETIF_MSG_LINK, "app_type %d, app_id %x, prio bitmap %d\n",
|
||||
DP(BNX2X_MSG_DCB, "app_type %d, app_id %x, prio bitmap %d\n",
|
||||
idtype, idval, up);
|
||||
|
||||
if (!bnx2x_dcbnl_set_valid(bp))
|
||||
if (!bnx2x_dcbnl_set_valid(bp)) {
|
||||
DP(BNX2X_MSG_DCB, "dcbnl call not valid\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* verify idtype */
|
||||
switch (idtype) {
|
||||
|
@ -2297,6 +2305,7 @@ static u8 bnx2x_dcbnl_set_app_up(struct net_device *netdev, u8 idtype,
|
|||
case DCB_APP_IDTYPE_PORTNUM:
|
||||
break;
|
||||
default:
|
||||
DP(BNX2X_MSG_DCB, "Wrong ID type\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return bnx2x_set_admin_app_up(bp, idtype, idval, up);
|
||||
|
@ -2318,13 +2327,13 @@ static u8 bnx2x_dcbnl_get_dcbx(struct net_device *netdev)
|
|||
static u8 bnx2x_dcbnl_set_dcbx(struct net_device *netdev, u8 state)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
DP(NETIF_MSG_LINK, "state = %02x\n", state);
|
||||
DP(BNX2X_MSG_DCB, "state = %02x\n", state);
|
||||
|
||||
/* set dcbx mode */
|
||||
|
||||
if ((state & BNX2X_DCBX_CAPS) != state) {
|
||||
BNX2X_ERR("Requested DCBX mode %x is beyond advertised "
|
||||
"capabilities\n", state);
|
||||
BNX2X_ERR("Requested DCBX mode %x is beyond advertised capabilities\n",
|
||||
state);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -2348,7 +2357,7 @@ static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev, int featid,
|
|||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
u8 rval = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "featid %d\n", featid);
|
||||
DP(BNX2X_MSG_DCB, "featid %d\n", featid);
|
||||
|
||||
if (bp->dcb_state) {
|
||||
*flags = 0;
|
||||
|
@ -2374,11 +2383,14 @@ static u8 bnx2x_dcbnl_get_featcfg(struct net_device *netdev, int featid,
|
|||
*flags |= DCB_FEATCFG_ERROR;
|
||||
break;
|
||||
default:
|
||||
BNX2X_ERR("Non valid featrue-ID\n");
|
||||
rval = -EINVAL;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
DP(BNX2X_MSG_DCB, "DCB disabled\n");
|
||||
rval = -EINVAL;
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -2389,7 +2401,7 @@ static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev, int featid,
|
|||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
u8 rval = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "featid = %d flags = %02x\n", featid, flags);
|
||||
DP(BNX2X_MSG_DCB, "featid = %d flags = %02x\n", featid, flags);
|
||||
|
||||
/* ignore the 'advertise' flag */
|
||||
if (bnx2x_dcbnl_set_valid(bp)) {
|
||||
|
@ -2412,11 +2424,14 @@ static u8 bnx2x_dcbnl_set_featcfg(struct net_device *netdev, int featid,
|
|||
flags & DCB_FEATCFG_WILLING ? 1 : 0;
|
||||
break;
|
||||
default:
|
||||
BNX2X_ERR("Non valid featrue-ID\n");
|
||||
rval = -EINVAL;
|
||||
break;
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
DP(BNX2X_MSG_DCB, "dcbnl call not valid\n");
|
||||
rval = -EINVAL;
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
@ -2427,7 +2442,7 @@ static int bnx2x_peer_appinfo(struct net_device *netdev,
|
|||
int i;
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
|
||||
DP(NETIF_MSG_LINK, "APP-INFO\n");
|
||||
DP(BNX2X_MSG_DCB, "APP-INFO\n");
|
||||
|
||||
info->willing = (bp->dcbx_remote_flags & DCBX_APP_REM_WILLING) ?: 0;
|
||||
info->error = (bp->dcbx_remote_flags & DCBX_APP_RX_ERROR) ?: 0;
|
||||
|
@ -2446,7 +2461,7 @@ static int bnx2x_peer_apptable(struct net_device *netdev,
|
|||
int i, j;
|
||||
struct bnx2x *bp = netdev_priv(netdev);
|
||||
|
||||
DP(NETIF_MSG_LINK, "APP-TABLE\n");
|
||||
DP(BNX2X_MSG_DCB, "APP-TABLE\n");
|
||||
|
||||
for (i = 0, j = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
|
||||
struct dcbx_app_priority_entry *ent =
|
||||
|
|
|
@ -280,7 +280,7 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
cmd->maxtxpkt = 0;
|
||||
cmd->maxrxpkt = 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "ethtool_cmd: cmd %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL, "ethtool_cmd: cmd %d\n"
|
||||
" supported 0x%x advertising 0x%x speed %u\n"
|
||||
" duplex %d port %d phy_address %d transceiver %d\n"
|
||||
" autoneg %d maxtxpkt %d maxrxpkt %d\n",
|
||||
|
@ -301,7 +301,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
if (IS_MF_SD(bp))
|
||||
return 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "ethtool_cmd: cmd %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL, "ethtool_cmd: cmd %d\n"
|
||||
" supported 0x%x advertising 0x%x speed %u\n"
|
||||
" duplex %d port %d phy_address %d transceiver %d\n"
|
||||
" autoneg %d maxtxpkt %d maxrxpkt %d\n",
|
||||
|
@ -325,8 +325,8 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
line_speed = 10000;
|
||||
|
||||
if (bp->common.bc_ver < REQ_BC_VER_4_SET_MF_BW) {
|
||||
BNX2X_DEV_INFO("To set speed BC %X or higher "
|
||||
"is required, please upgrade BC\n",
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"To set speed BC %X or higher is required, please upgrade BC\n",
|
||||
REQ_BC_VER_4_SET_MF_BW);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -334,9 +334,8 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
part = (speed * 100) / line_speed;
|
||||
|
||||
if (line_speed < speed || !part) {
|
||||
BNX2X_DEV_INFO("Speed setting should be in a range "
|
||||
"from 1%% to 100%% "
|
||||
"of actual line speed\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"Speed setting should be in a range from 1%% to 100%% of actual line speed\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -358,7 +357,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
|
||||
if (!(bp->port.supported[0] & SUPPORTED_TP ||
|
||||
bp->port.supported[1] & SUPPORTED_TP)) {
|
||||
DP(NETIF_MSG_LINK, "Unsupported port type\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "Unsupported port type\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
bp->link_params.multi_phy_config &=
|
||||
|
@ -378,7 +377,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
|
||||
if (!(bp->port.supported[0] & SUPPORTED_FIBRE ||
|
||||
bp->port.supported[1] & SUPPORTED_FIBRE)) {
|
||||
DP(NETIF_MSG_LINK, "Unsupported port type\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "Unsupported port type\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
bp->link_params.multi_phy_config &=
|
||||
|
@ -392,7 +391,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
PORT_HW_CFG_PHY_SELECTION_SECOND_PHY;
|
||||
break;
|
||||
default:
|
||||
DP(NETIF_MSG_LINK, "Unsupported port type\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "Unsupported port type\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
/* Save new config in case command complete successully */
|
||||
|
@ -401,7 +400,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
cfg_idx = bnx2x_get_link_cfg_idx(bp);
|
||||
/* Restore old config in case command failed */
|
||||
bp->link_params.multi_phy_config = old_multi_phy_config;
|
||||
DP(NETIF_MSG_LINK, "cfg_idx = %x\n", cfg_idx);
|
||||
DP(BNX2X_MSG_ETHTOOL, "cfg_idx = %x\n", cfg_idx);
|
||||
|
||||
if (cmd->autoneg == AUTONEG_ENABLE) {
|
||||
u32 an_supported_speed = bp->port.supported[cfg_idx];
|
||||
|
@ -410,14 +409,14 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
an_supported_speed |= (SUPPORTED_100baseT_Half |
|
||||
SUPPORTED_100baseT_Full);
|
||||
if (!(bp->port.supported[cfg_idx] & SUPPORTED_Autoneg)) {
|
||||
DP(NETIF_MSG_LINK, "Autoneg not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "Autoneg not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* advertise the requested speed and duplex if supported */
|
||||
if (cmd->advertising & ~an_supported_speed) {
|
||||
DP(NETIF_MSG_LINK, "Advertisement parameters "
|
||||
"are not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"Advertisement parameters are not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -466,7 +465,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
if (cmd->duplex == DUPLEX_FULL) {
|
||||
if (!(bp->port.supported[cfg_idx] &
|
||||
SUPPORTED_10baseT_Full)) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"10M full not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -476,7 +475,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
} else {
|
||||
if (!(bp->port.supported[cfg_idx] &
|
||||
SUPPORTED_10baseT_Half)) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"10M half not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -490,7 +489,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
if (cmd->duplex == DUPLEX_FULL) {
|
||||
if (!(bp->port.supported[cfg_idx] &
|
||||
SUPPORTED_100baseT_Full)) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"100M full not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -500,7 +499,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
} else {
|
||||
if (!(bp->port.supported[cfg_idx] &
|
||||
SUPPORTED_100baseT_Half)) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"100M half not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -512,13 +511,15 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
|
||||
case SPEED_1000:
|
||||
if (cmd->duplex != DUPLEX_FULL) {
|
||||
DP(NETIF_MSG_LINK, "1G half not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"1G half not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(bp->port.supported[cfg_idx] &
|
||||
SUPPORTED_1000baseT_Full)) {
|
||||
DP(NETIF_MSG_LINK, "1G full not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"1G full not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -528,14 +529,14 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
|
||||
case SPEED_2500:
|
||||
if (cmd->duplex != DUPLEX_FULL) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"2.5G half not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(bp->port.supported[cfg_idx]
|
||||
& SUPPORTED_2500baseX_Full)) {
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"2.5G full not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -546,13 +547,15 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
|
||||
case SPEED_10000:
|
||||
if (cmd->duplex != DUPLEX_FULL) {
|
||||
DP(NETIF_MSG_LINK, "10G half not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"10G half not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(bp->port.supported[cfg_idx]
|
||||
& SUPPORTED_10000baseT_Full)) {
|
||||
DP(NETIF_MSG_LINK, "10G full not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"10G full not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -561,7 +564,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
break;
|
||||
|
||||
default:
|
||||
DP(NETIF_MSG_LINK, "Unsupported speed %u\n", speed);
|
||||
DP(BNX2X_MSG_ETHTOOL, "Unsupported speed %u\n", speed);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -570,7 +573,7 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
bp->port.advertising[cfg_idx] = advertising;
|
||||
}
|
||||
|
||||
DP(NETIF_MSG_LINK, "req_line_speed %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL, "req_line_speed %d\n"
|
||||
" req_duplex %d advertising 0x%x\n",
|
||||
bp->link_params.req_line_speed[cfg_idx],
|
||||
bp->link_params.req_duplex[cfg_idx],
|
||||
|
@ -850,13 +853,16 @@ static int bnx2x_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
|||
{
|
||||
struct bnx2x *bp = netdev_priv(dev);
|
||||
|
||||
if (wol->wolopts & ~WAKE_MAGIC)
|
||||
if (wol->wolopts & ~WAKE_MAGIC) {
|
||||
DP(BNX2X_MSG_ETHTOOL, "WOL not supproted\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (wol->wolopts & WAKE_MAGIC) {
|
||||
if (bp->flags & NO_WOL_FLAG)
|
||||
if (bp->flags & NO_WOL_FLAG) {
|
||||
DP(BNX2X_MSG_ETHTOOL, "WOL not supproted\n");
|
||||
return -EINVAL;
|
||||
|
||||
}
|
||||
bp->wol = 1;
|
||||
} else
|
||||
bp->wol = 0;
|
||||
|
@ -955,7 +961,8 @@ static int bnx2x_acquire_nvram_lock(struct bnx2x *bp)
|
|||
}
|
||||
|
||||
if (!(val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port))) {
|
||||
DP(BNX2X_MSG_NVM, "cannot get access to nvram interface\n");
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot get access to nvram interface\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
@ -986,7 +993,8 @@ static int bnx2x_release_nvram_lock(struct bnx2x *bp)
|
|||
}
|
||||
|
||||
if (val & (MCPR_NVM_SW_ARB_ARB_ARB1 << port)) {
|
||||
DP(BNX2X_MSG_NVM, "cannot free access to nvram interface\n");
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot free access to nvram interface\n");
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
@ -1060,7 +1068,9 @@ static int bnx2x_nvram_read_dword(struct bnx2x *bp, u32 offset, __be32 *ret_val,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (rc == -EBUSY)
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"nvram read timeout expired\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1072,15 +1082,15 @@ static int bnx2x_nvram_read(struct bnx2x *bp, u32 offset, u8 *ret_buf,
|
|||
__be32 val;
|
||||
|
||||
if ((offset & 0x03) || (buf_size & 0x03) || (buf_size == 0)) {
|
||||
DP(BNX2X_MSG_NVM,
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"Invalid parameter: offset 0x%x buf_size 0x%x\n",
|
||||
offset, buf_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (offset + buf_size > bp->common.flash_size) {
|
||||
DP(BNX2X_MSG_NVM, "Invalid parameter: offset (0x%x) +"
|
||||
" buf_size (0x%x) > flash_size (0x%x)\n",
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n",
|
||||
offset, buf_size, bp->common.flash_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -1125,10 +1135,13 @@ static int bnx2x_get_eeprom(struct net_device *dev,
|
|||
struct bnx2x *bp = netdev_priv(dev);
|
||||
int rc;
|
||||
|
||||
if (!netif_running(dev))
|
||||
if (!netif_running(dev)) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot access eeprom when the interface is down\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
||||
" magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
|
||||
eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,
|
||||
eeprom->len, eeprom->len);
|
||||
|
@ -1177,6 +1190,9 @@ static int bnx2x_nvram_write_dword(struct bnx2x *bp, u32 offset, u32 val,
|
|||
}
|
||||
}
|
||||
|
||||
if (rc == -EBUSY)
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"nvram write timeout expired\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1191,8 +1207,8 @@ static int bnx2x_nvram_write1(struct bnx2x *bp, u32 offset, u8 *data_buf,
|
|||
__be32 val;
|
||||
|
||||
if (offset + buf_size > bp->common.flash_size) {
|
||||
DP(BNX2X_MSG_NVM, "Invalid parameter: offset (0x%x) +"
|
||||
" buf_size (0x%x) > flash_size (0x%x)\n",
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n",
|
||||
offset, buf_size, bp->common.flash_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -1240,15 +1256,15 @@ static int bnx2x_nvram_write(struct bnx2x *bp, u32 offset, u8 *data_buf,
|
|||
return bnx2x_nvram_write1(bp, offset, data_buf, buf_size);
|
||||
|
||||
if ((offset & 0x03) || (buf_size & 0x03) || (buf_size == 0)) {
|
||||
DP(BNX2X_MSG_NVM,
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"Invalid parameter: offset 0x%x buf_size 0x%x\n",
|
||||
offset, buf_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (offset + buf_size > bp->common.flash_size) {
|
||||
DP(BNX2X_MSG_NVM, "Invalid parameter: offset (0x%x) +"
|
||||
" buf_size (0x%x) > flash_size (0x%x)\n",
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"Invalid parameter: offset (0x%x) + buf_size (0x%x) > flash_size (0x%x)\n",
|
||||
offset, buf_size, bp->common.flash_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -1296,10 +1312,13 @@ static int bnx2x_set_eeprom(struct net_device *dev,
|
|||
int port = BP_PORT(bp);
|
||||
int rc = 0;
|
||||
u32 ext_phy_config;
|
||||
if (!netif_running(dev))
|
||||
if (!netif_running(dev)) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot access eeprom when the interface is down\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
DP(BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, "ethtool_eeprom: cmd %d\n"
|
||||
" magic 0x%x offset 0x%x (%d) len 0x%x (%d)\n",
|
||||
eeprom->cmd, eeprom->magic, eeprom->offset, eeprom->offset,
|
||||
eeprom->len, eeprom->len);
|
||||
|
@ -1308,8 +1327,11 @@ static int bnx2x_set_eeprom(struct net_device *dev,
|
|||
|
||||
/* PHY eeprom can be accessed only by the PMF */
|
||||
if ((eeprom->magic >= 0x50485900) && (eeprom->magic <= 0x504859FF) &&
|
||||
!bp->port.pmf)
|
||||
!bp->port.pmf) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"wrong magic or interface is not pmf\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ext_phy_config =
|
||||
SHMEM_RD(bp,
|
||||
|
@ -1421,8 +1443,8 @@ static int bnx2x_set_ringparam(struct net_device *dev,
|
|||
struct bnx2x *bp = netdev_priv(dev);
|
||||
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
netdev_err(dev, "Handling parity error recovery. "
|
||||
"Try again later\n");
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"Handling parity error recovery. Try again later\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
|
@ -1430,8 +1452,10 @@ static int bnx2x_set_ringparam(struct net_device *dev,
|
|||
(ering->rx_pending < (bp->disable_tpa ? MIN_RX_SIZE_NONTPA :
|
||||
MIN_RX_SIZE_TPA)) ||
|
||||
(ering->tx_pending > MAX_TX_AVAIL) ||
|
||||
(ering->tx_pending <= MAX_SKB_FRAGS + 4))
|
||||
(ering->tx_pending <= MAX_SKB_FRAGS + 4)) {
|
||||
DP(BNX2X_MSG_ETHTOOL, "Command parameters not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
bp->rx_ring_size = ering->rx_pending;
|
||||
bp->tx_ring_size = ering->tx_pending;
|
||||
|
@ -1459,7 +1483,7 @@ static void bnx2x_get_pauseparam(struct net_device *dev,
|
|||
epause->tx_pause = ((cfg_reg & BNX2X_FLOW_CTRL_TX) ==
|
||||
BNX2X_FLOW_CTRL_TX);
|
||||
|
||||
DP(NETIF_MSG_LINK, "ethtool_pauseparam: cmd %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL, "ethtool_pauseparam: cmd %d\n"
|
||||
" autoneg %d rx_pause %d tx_pause %d\n",
|
||||
epause->cmd, epause->autoneg, epause->rx_pause, epause->tx_pause);
|
||||
}
|
||||
|
@ -1472,7 +1496,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev,
|
|||
if (IS_MF(bp))
|
||||
return 0;
|
||||
|
||||
DP(NETIF_MSG_LINK, "ethtool_pauseparam: cmd %d\n"
|
||||
DP(BNX2X_MSG_ETHTOOL, "ethtool_pauseparam: cmd %d\n"
|
||||
" autoneg %d rx_pause %d tx_pause %d\n",
|
||||
epause->cmd, epause->autoneg, epause->rx_pause, epause->tx_pause);
|
||||
|
||||
|
@ -1489,7 +1513,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev,
|
|||
|
||||
if (epause->autoneg) {
|
||||
if (!(bp->port.supported[cfg_idx] & SUPPORTED_Autoneg)) {
|
||||
DP(NETIF_MSG_LINK, "autoneg not supported\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "autoneg not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1499,7 +1523,7 @@ static int bnx2x_set_pauseparam(struct net_device *dev,
|
|||
}
|
||||
}
|
||||
|
||||
DP(NETIF_MSG_LINK,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"req_flow_ctrl 0x%x\n", bp->link_params.req_flow_ctrl[cfg_idx]);
|
||||
|
||||
if (netif_running(dev)) {
|
||||
|
@ -1631,8 +1655,11 @@ static int bnx2x_test_registers(struct bnx2x *bp)
|
|||
{ BNX2X_CHIP_MASK_ALL, 0xffffffff, 0, 0x00000000 }
|
||||
};
|
||||
|
||||
if (!netif_running(bp->dev))
|
||||
if (!netif_running(bp->dev)) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot access eeprom when the interface is down\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (CHIP_IS_E1(bp))
|
||||
hw = BNX2X_CHIP_MASK_E1;
|
||||
|
@ -1677,7 +1704,7 @@ static int bnx2x_test_registers(struct bnx2x *bp)
|
|||
|
||||
/* verify value is as expected */
|
||||
if ((val & mask) != (wr_val & mask)) {
|
||||
DP(NETIF_MSG_HW,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"offset 0x%x: val 0x%x != 0x%x mask 0x%x\n",
|
||||
offset, val, wr_val, mask);
|
||||
goto test_reg_exit;
|
||||
|
@ -1731,8 +1758,11 @@ static int bnx2x_test_memory(struct bnx2x *bp)
|
|||
{ NULL, 0xffffffff, {0, 0, 0, 0} }
|
||||
};
|
||||
|
||||
if (!netif_running(bp->dev))
|
||||
if (!netif_running(bp->dev)) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot access eeprom when the interface is down\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (CHIP_IS_E1(bp))
|
||||
index = BNX2X_CHIP_E1_OFST;
|
||||
|
@ -1747,7 +1777,7 @@ static int bnx2x_test_memory(struct bnx2x *bp)
|
|||
for (i = 0; prty_tbl[i].offset != 0xffffffff; i++) {
|
||||
val = REG_RD(bp, prty_tbl[i].offset);
|
||||
if (val & ~(prty_tbl[i].hw_mask[index])) {
|
||||
DP(NETIF_MSG_HW,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"%s is 0x%x\n", prty_tbl[i].name, val);
|
||||
goto test_mem_exit;
|
||||
}
|
||||
|
@ -1762,7 +1792,7 @@ static int bnx2x_test_memory(struct bnx2x *bp)
|
|||
for (i = 0; prty_tbl[i].offset != 0xffffffff; i++) {
|
||||
val = REG_RD(bp, prty_tbl[i].offset);
|
||||
if (val & ~(prty_tbl[i].hw_mask[index])) {
|
||||
DP(NETIF_MSG_HW,
|
||||
DP(BNX2X_MSG_ETHTOOL,
|
||||
"%s is 0x%x\n", prty_tbl[i].name, val);
|
||||
goto test_mem_exit;
|
||||
}
|
||||
|
@ -1783,7 +1813,7 @@ static void bnx2x_wait_for_link(struct bnx2x *bp, u8 link_up, u8 is_serdes)
|
|||
msleep(20);
|
||||
|
||||
if (cnt <= 0 && bnx2x_link_test(bp, is_serdes))
|
||||
DP(NETIF_MSG_LINK, "Timeout waiting for link up\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "Timeout waiting for link up\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1833,6 +1863,7 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode)
|
|||
bnx2x_phy_init(&bp->link_params, &bp->link_vars);
|
||||
break;
|
||||
default:
|
||||
DP(BNX2X_MSG_ETHTOOL, "Command parameters not supported\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1841,6 +1872,7 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode)
|
|||
bp->dev->mtu : ETH_MAX_PACKET_SIZE) + ETH_HLEN);
|
||||
skb = netdev_alloc_skb(bp->dev, fp_rx->rx_buf_size);
|
||||
if (!skb) {
|
||||
DP(BNX2X_MSG_ETHTOOL, "Can't allocate skb\n");
|
||||
rc = -ENOMEM;
|
||||
goto test_loopback_exit;
|
||||
}
|
||||
|
@ -1855,7 +1887,7 @@ static int bnx2x_run_loopback(struct bnx2x *bp, int loopback_mode)
|
|||
if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
|
||||
rc = -ENOMEM;
|
||||
dev_kfree_skb(skb);
|
||||
BNX2X_ERR("Unable to map SKB\n");
|
||||
DP(BNX2X_MSG_ETHTOOL, "Unable to map SKB\n");
|
||||
goto test_loopback_exit;
|
||||
}
|
||||
|
||||
|
@ -1985,13 +2017,13 @@ static int bnx2x_test_loopback(struct bnx2x *bp)
|
|||
|
||||
res = bnx2x_run_loopback(bp, BNX2X_PHY_LOOPBACK);
|
||||
if (res) {
|
||||
DP(NETIF_MSG_PROBE, " PHY loopback failed (res %d)\n", res);
|
||||
DP(BNX2X_MSG_ETHTOOL, " PHY loopback failed (res %d)\n", res);
|
||||
rc |= BNX2X_PHY_LOOPBACK_FAILED;
|
||||
}
|
||||
|
||||
res = bnx2x_run_loopback(bp, BNX2X_MAC_LOOPBACK);
|
||||
if (res) {
|
||||
DP(NETIF_MSG_PROBE, " MAC loopback failed (res %d)\n", res);
|
||||
DP(BNX2X_MSG_ETHTOOL, " MAC loopback failed (res %d)\n", res);
|
||||
rc |= BNX2X_MAC_LOOPBACK_FAILED;
|
||||
}
|
||||
|
||||
|
@ -2027,7 +2059,7 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
|
|||
|
||||
buf = kmalloc(0x350, GFP_KERNEL);
|
||||
if (!buf) {
|
||||
DP(NETIF_MSG_PROBE, "kmalloc failed\n");
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, "kmalloc failed\n");
|
||||
rc = -ENOMEM;
|
||||
goto test_nvram_exit;
|
||||
}
|
||||
|
@ -2035,13 +2067,15 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
|
|||
|
||||
rc = bnx2x_nvram_read(bp, 0, data, 4);
|
||||
if (rc) {
|
||||
DP(NETIF_MSG_PROBE, "magic value read (rc %d)\n", rc);
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"magic value read (rc %d)\n", rc);
|
||||
goto test_nvram_exit;
|
||||
}
|
||||
|
||||
magic = be32_to_cpu(buf[0]);
|
||||
if (magic != 0x669955aa) {
|
||||
DP(NETIF_MSG_PROBE, "magic value (0x%08x)\n", magic);
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"wrong magic value (0x%08x)\n", magic);
|
||||
rc = -ENODEV;
|
||||
goto test_nvram_exit;
|
||||
}
|
||||
|
@ -2051,15 +2085,15 @@ static int bnx2x_test_nvram(struct bnx2x *bp)
|
|||
rc = bnx2x_nvram_read(bp, nvram_tbl[i].offset, data,
|
||||
nvram_tbl[i].size);
|
||||
if (rc) {
|
||||
DP(NETIF_MSG_PROBE,
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"nvram_tbl[%d] read data (rc %d)\n", i, rc);
|
||||
goto test_nvram_exit;
|
||||
}
|
||||
|
||||
crc = ether_crc_le(nvram_tbl[i].size, data);
|
||||
if (crc != CRC32_RESIDUAL) {
|
||||
DP(NETIF_MSG_PROBE,
|
||||
"nvram_tbl[%d] crc value (0x%08x)\n", i, crc);
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"nvram_tbl[%d] wrong crc value (0x%08x)\n", i, crc);
|
||||
rc = -ENODEV;
|
||||
goto test_nvram_exit;
|
||||
}
|
||||
|
@ -2075,8 +2109,11 @@ static int bnx2x_test_intr(struct bnx2x *bp)
|
|||
{
|
||||
struct bnx2x_queue_state_params params = {0};
|
||||
|
||||
if (!netif_running(bp->dev))
|
||||
if (!netif_running(bp->dev)) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot access eeprom when the interface is down\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
params.q_obj = &bp->fp->q_obj;
|
||||
params.cmd = BNX2X_Q_CMD_EMPTY;
|
||||
|
@ -2092,8 +2129,8 @@ static void bnx2x_self_test(struct net_device *dev,
|
|||
struct bnx2x *bp = netdev_priv(dev);
|
||||
u8 is_serdes;
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
netdev_err(bp->dev, "Handling parity error recovery. "
|
||||
"Try again later\n");
|
||||
netdev_err(bp->dev,
|
||||
"Handling parity error recovery. Try again later\n");
|
||||
etest->flags |= ETH_TEST_FL_FAILED;
|
||||
return;
|
||||
}
|
||||
|
@ -2306,11 +2343,16 @@ static int bnx2x_set_phys_id(struct net_device *dev,
|
|||
{
|
||||
struct bnx2x *bp = netdev_priv(dev);
|
||||
|
||||
if (!netif_running(dev))
|
||||
if (!netif_running(dev)) {
|
||||
DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
|
||||
"cannot access eeprom when the interface is down\n");
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (!bp->port.pmf)
|
||||
if (!bp->port.pmf) {
|
||||
DP(BNX2X_MSG_ETHTOOL, "Interface is not pmf\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
switch (state) {
|
||||
case ETHTOOL_ID_ACTIVE:
|
||||
|
@ -2347,6 +2389,7 @@ static int bnx2x_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,
|
|||
return 0;
|
||||
|
||||
default:
|
||||
DP(BNX2X_MSG_ETHTOOL, "Command parameters not supported\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -72,8 +72,8 @@ static inline void bnx2x_exe_queue_init(struct bnx2x *bp,
|
|||
o->execute = exec;
|
||||
o->get = get;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Setup the execution queue with the chunk "
|
||||
"length of %d\n", exe_len);
|
||||
DP(BNX2X_MSG_SP, "Setup the execution queue with the chunk length of %d\n",
|
||||
exe_len);
|
||||
}
|
||||
|
||||
static inline void bnx2x_exe_queue_free_elem(struct bnx2x *bp,
|
||||
|
@ -203,8 +203,7 @@ static inline int bnx2x_exe_queue_step(struct bnx2x *bp,
|
|||
*/
|
||||
if (!list_empty(&o->pending_comp)) {
|
||||
if (test_bit(RAMROD_DRV_CLR_ONLY, ramrod_flags)) {
|
||||
DP(BNX2X_MSG_SP, "RAMROD_DRV_CLR_ONLY requested: "
|
||||
"resetting pending_comp\n");
|
||||
DP(BNX2X_MSG_SP, "RAMROD_DRV_CLR_ONLY requested: resetting a pending_comp list\n");
|
||||
__bnx2x_exe_queue_reset_pending(bp, o);
|
||||
} else {
|
||||
spin_unlock_bh(&o->lock);
|
||||
|
@ -476,11 +475,14 @@ static int bnx2x_get_n_elements(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,
|
|||
}
|
||||
|
||||
/* check_add() callbacks */
|
||||
static int bnx2x_check_mac_add(struct bnx2x_vlan_mac_obj *o,
|
||||
static int bnx2x_check_mac_add(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
struct bnx2x_vlan_mac_registry_elem *pos;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Checking MAC %pM for ADD command\n", data->mac.mac);
|
||||
|
||||
if (!is_valid_ether_addr(data->mac.mac))
|
||||
return -EINVAL;
|
||||
|
||||
|
@ -492,11 +494,14 @@ static int bnx2x_check_mac_add(struct bnx2x_vlan_mac_obj *o,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int bnx2x_check_vlan_add(struct bnx2x_vlan_mac_obj *o,
|
||||
static int bnx2x_check_vlan_add(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
struct bnx2x_vlan_mac_registry_elem *pos;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Checking VLAN %d for ADD command\n", data->vlan.vlan);
|
||||
|
||||
list_for_each_entry(pos, &o->head, link)
|
||||
if (data->vlan.vlan == pos->u.vlan.vlan)
|
||||
return -EEXIST;
|
||||
|
@ -504,11 +509,15 @@ static int bnx2x_check_vlan_add(struct bnx2x_vlan_mac_obj *o,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int bnx2x_check_vlan_mac_add(struct bnx2x_vlan_mac_obj *o,
|
||||
static int bnx2x_check_vlan_mac_add(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
struct bnx2x_vlan_mac_registry_elem *pos;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Checking VLAN_MAC (%pM, %d) for ADD command\n",
|
||||
data->vlan_mac.mac, data->vlan_mac.vlan);
|
||||
|
||||
list_for_each_entry(pos, &o->head, link)
|
||||
if ((data->vlan_mac.vlan == pos->u.vlan_mac.vlan) &&
|
||||
(!memcmp(data->vlan_mac.mac, pos->u.vlan_mac.mac,
|
||||
|
@ -521,11 +530,14 @@ static int bnx2x_check_vlan_mac_add(struct bnx2x_vlan_mac_obj *o,
|
|||
|
||||
/* check_del() callbacks */
|
||||
static struct bnx2x_vlan_mac_registry_elem *
|
||||
bnx2x_check_mac_del(struct bnx2x_vlan_mac_obj *o,
|
||||
bnx2x_check_mac_del(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
struct bnx2x_vlan_mac_registry_elem *pos;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Checking MAC %pM for DEL command\n", data->mac.mac);
|
||||
|
||||
list_for_each_entry(pos, &o->head, link)
|
||||
if (!memcmp(data->mac.mac, pos->u.mac.mac, ETH_ALEN))
|
||||
return pos;
|
||||
|
@ -534,11 +546,14 @@ static struct bnx2x_vlan_mac_registry_elem *
|
|||
}
|
||||
|
||||
static struct bnx2x_vlan_mac_registry_elem *
|
||||
bnx2x_check_vlan_del(struct bnx2x_vlan_mac_obj *o,
|
||||
bnx2x_check_vlan_del(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
struct bnx2x_vlan_mac_registry_elem *pos;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Checking VLAN %d for DEL command\n", data->vlan.vlan);
|
||||
|
||||
list_for_each_entry(pos, &o->head, link)
|
||||
if (data->vlan.vlan == pos->u.vlan.vlan)
|
||||
return pos;
|
||||
|
@ -547,11 +562,15 @@ static struct bnx2x_vlan_mac_registry_elem *
|
|||
}
|
||||
|
||||
static struct bnx2x_vlan_mac_registry_elem *
|
||||
bnx2x_check_vlan_mac_del(struct bnx2x_vlan_mac_obj *o,
|
||||
bnx2x_check_vlan_mac_del(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
struct bnx2x_vlan_mac_registry_elem *pos;
|
||||
|
||||
DP(BNX2X_MSG_SP, "Checking VLAN_MAC (%pM, %d) for DEL command\n",
|
||||
data->vlan_mac.mac, data->vlan_mac.vlan);
|
||||
|
||||
list_for_each_entry(pos, &o->head, link)
|
||||
if ((data->vlan_mac.vlan == pos->u.vlan_mac.vlan) &&
|
||||
(!memcmp(data->vlan_mac.mac, pos->u.vlan_mac.mac,
|
||||
|
@ -562,7 +581,8 @@ static struct bnx2x_vlan_mac_registry_elem *
|
|||
}
|
||||
|
||||
/* check_move() callback */
|
||||
static bool bnx2x_check_move(struct bnx2x_vlan_mac_obj *src_o,
|
||||
static bool bnx2x_check_move(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *src_o,
|
||||
struct bnx2x_vlan_mac_obj *dst_o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
{
|
||||
|
@ -572,10 +592,10 @@ static bool bnx2x_check_move(struct bnx2x_vlan_mac_obj *src_o,
|
|||
/* Check if we can delete the requested configuration from the first
|
||||
* object.
|
||||
*/
|
||||
pos = src_o->check_del(src_o, data);
|
||||
pos = src_o->check_del(bp, src_o, data);
|
||||
|
||||
/* check if configuration can be added */
|
||||
rc = dst_o->check_add(dst_o, data);
|
||||
rc = dst_o->check_add(bp, dst_o, data);
|
||||
|
||||
/* If this classification can not be added (is already set)
|
||||
* or can't be deleted - return an error.
|
||||
|
@ -587,6 +607,7 @@ static bool bnx2x_check_move(struct bnx2x_vlan_mac_obj *src_o,
|
|||
}
|
||||
|
||||
static bool bnx2x_check_move_always_err(
|
||||
struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *src_o,
|
||||
struct bnx2x_vlan_mac_obj *dst_o,
|
||||
union bnx2x_classification_ramrod_data *data)
|
||||
|
@ -740,7 +761,7 @@ static void bnx2x_set_one_mac_e2(struct bnx2x *bp,
|
|||
&rule_entry->mac.header);
|
||||
|
||||
DP(BNX2X_MSG_SP, "About to %s MAC %pM for Queue %d\n",
|
||||
add ? "add" : "delete", mac, raw->cl_id);
|
||||
(add ? "add" : "delete"), mac, raw->cl_id);
|
||||
|
||||
/* Set a MAC itself */
|
||||
bnx2x_set_fw_mac_addr(&rule_entry->mac.mac_msb,
|
||||
|
@ -833,7 +854,7 @@ static inline void bnx2x_vlan_mac_set_rdata_e1x(struct bnx2x *bp,
|
|||
cfg_entry);
|
||||
|
||||
DP(BNX2X_MSG_SP, "%s MAC %pM CLID %d CAM offset %d\n",
|
||||
add ? "setting" : "clearing",
|
||||
(add ? "setting" : "clearing"),
|
||||
mac, raw->cl_id, cam_offset);
|
||||
}
|
||||
|
||||
|
@ -1152,10 +1173,9 @@ static inline int bnx2x_validate_vlan_mac_add(struct bnx2x *bp,
|
|||
int rc;
|
||||
|
||||
/* Check the registry */
|
||||
rc = o->check_add(o, &elem->cmd_data.vlan_mac.u);
|
||||
rc = o->check_add(bp, o, &elem->cmd_data.vlan_mac.u);
|
||||
if (rc) {
|
||||
DP(BNX2X_MSG_SP, "ADD command is not allowed considering "
|
||||
"current registry state\n");
|
||||
DP(BNX2X_MSG_SP, "ADD command is not allowed considering current registry state.\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -1206,10 +1226,9 @@ static inline int bnx2x_validate_vlan_mac_del(struct bnx2x *bp,
|
|||
/* If this classification can not be deleted (doesn't exist)
|
||||
* - return a BNX2X_EXIST.
|
||||
*/
|
||||
pos = o->check_del(o, &elem->cmd_data.vlan_mac.u);
|
||||
pos = o->check_del(bp, o, &elem->cmd_data.vlan_mac.u);
|
||||
if (!pos) {
|
||||
DP(BNX2X_MSG_SP, "DEL command is not allowed considering "
|
||||
"current registry state\n");
|
||||
DP(BNX2X_MSG_SP, "DEL command is not allowed considering current registry state\n");
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
|
@ -1269,9 +1288,9 @@ static inline int bnx2x_validate_vlan_mac_move(struct bnx2x *bp,
|
|||
* Check if we can perform this operation based on the current registry
|
||||
* state.
|
||||
*/
|
||||
if (!src_o->check_move(src_o, dest_o, &elem->cmd_data.vlan_mac.u)) {
|
||||
DP(BNX2X_MSG_SP, "MOVE command is not allowed considering "
|
||||
"current registry state\n");
|
||||
if (!src_o->check_move(bp, src_o, dest_o,
|
||||
&elem->cmd_data.vlan_mac.u)) {
|
||||
DP(BNX2X_MSG_SP, "MOVE command is not allowed considering current registry state\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1285,8 +1304,7 @@ static inline int bnx2x_validate_vlan_mac_move(struct bnx2x *bp,
|
|||
/* Check DEL on source */
|
||||
query_elem.cmd_data.vlan_mac.cmd = BNX2X_VLAN_MAC_DEL;
|
||||
if (src_exeq->get(src_exeq, &query_elem)) {
|
||||
BNX2X_ERR("There is a pending DEL command on the source "
|
||||
"queue already\n");
|
||||
BNX2X_ERR("There is a pending DEL command on the source queue already\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1299,8 +1317,7 @@ static inline int bnx2x_validate_vlan_mac_move(struct bnx2x *bp,
|
|||
/* Check ADD on destination */
|
||||
query_elem.cmd_data.vlan_mac.cmd = BNX2X_VLAN_MAC_ADD;
|
||||
if (dest_exeq->get(dest_exeq, &query_elem)) {
|
||||
BNX2X_ERR("There is a pending ADD command on the "
|
||||
"destination queue already\n");
|
||||
BNX2X_ERR("There is a pending ADD command on the destination queue already\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -1475,12 +1492,10 @@ static int bnx2x_optimize_vlan_mac(struct bnx2x *bp,
|
|||
&pos->cmd_data.vlan_mac.vlan_mac_flags)) {
|
||||
if ((query.cmd_data.vlan_mac.cmd ==
|
||||
BNX2X_VLAN_MAC_ADD) && !o->put_credit(o)) {
|
||||
BNX2X_ERR("Failed to return the credit for the "
|
||||
"optimized ADD command\n");
|
||||
BNX2X_ERR("Failed to return the credit for the optimized ADD command\n");
|
||||
return -EINVAL;
|
||||
} else if (!o->get_credit(o)) { /* VLAN_MAC_DEL */
|
||||
BNX2X_ERR("Failed to recover the credit from "
|
||||
"the optimized DEL command\n");
|
||||
BNX2X_ERR("Failed to recover the credit from the optimized DEL command\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
|
@ -1546,7 +1561,7 @@ static inline int bnx2x_vlan_mac_get_registry_elem(
|
|||
reg_elem->vlan_mac_flags =
|
||||
elem->cmd_data.vlan_mac.vlan_mac_flags;
|
||||
} else /* DEL, RESTORE */
|
||||
reg_elem = o->check_del(o, &elem->cmd_data.vlan_mac.u);
|
||||
reg_elem = o->check_del(bp, o, &elem->cmd_data.vlan_mac.u);
|
||||
|
||||
*re = reg_elem;
|
||||
return 0;
|
||||
|
@ -1644,7 +1659,8 @@ static int bnx2x_execute_vlan_mac(struct bnx2x *bp,
|
|||
cmd = elem->cmd_data.vlan_mac.cmd;
|
||||
if ((cmd == BNX2X_VLAN_MAC_DEL) ||
|
||||
(cmd == BNX2X_VLAN_MAC_MOVE)) {
|
||||
reg_elem = o->check_del(o, &elem->cmd_data.vlan_mac.u);
|
||||
reg_elem = o->check_del(bp, o,
|
||||
&elem->cmd_data.vlan_mac.u);
|
||||
|
||||
WARN_ON(!reg_elem);
|
||||
|
||||
|
@ -1675,7 +1691,7 @@ error_exit:
|
|||
if (!restore &&
|
||||
((cmd == BNX2X_VLAN_MAC_ADD) ||
|
||||
(cmd == BNX2X_VLAN_MAC_MOVE))) {
|
||||
reg_elem = o->check_del(cam_obj,
|
||||
reg_elem = o->check_del(bp, cam_obj,
|
||||
&elem->cmd_data.vlan_mac.u);
|
||||
if (reg_elem) {
|
||||
list_del(®_elem->link);
|
||||
|
@ -1750,8 +1766,7 @@ int bnx2x_config_vlan_mac(
|
|||
rc = 1;
|
||||
|
||||
if (test_bit(RAMROD_DRV_CLR_ONLY, ramrod_flags)) {
|
||||
DP(BNX2X_MSG_SP, "RAMROD_DRV_CLR_ONLY requested: "
|
||||
"clearing a pending bit.\n");
|
||||
DP(BNX2X_MSG_SP, "RAMROD_DRV_CLR_ONLY requested: clearing a pending bit.\n");
|
||||
raw->clear_pending(raw);
|
||||
}
|
||||
|
||||
|
@ -2150,10 +2165,8 @@ static int bnx2x_set_rx_mode_e1x(struct bnx2x *bp,
|
|||
|
||||
DP(BNX2X_MSG_SP, "drop_ucast 0x%x\ndrop_mcast 0x%x\n accp_ucast 0x%x\n"
|
||||
"accp_mcast 0x%x\naccp_bcast 0x%x\n",
|
||||
mac_filters->ucast_drop_all,
|
||||
mac_filters->mcast_drop_all,
|
||||
mac_filters->ucast_accept_all,
|
||||
mac_filters->mcast_accept_all,
|
||||
mac_filters->ucast_drop_all, mac_filters->mcast_drop_all,
|
||||
mac_filters->ucast_accept_all, mac_filters->mcast_accept_all,
|
||||
mac_filters->bcast_accept_all);
|
||||
|
||||
/* write the MAC filter structure*/
|
||||
|
@ -2303,8 +2316,7 @@ static int bnx2x_set_rx_mode_e2(struct bnx2x *bp,
|
|||
*/
|
||||
bnx2x_rx_mode_set_rdata_hdr_e2(p->cid, &data->header, rule_idx);
|
||||
|
||||
DP(BNX2X_MSG_SP, "About to configure %d rules, rx_accept_flags 0x%lx, "
|
||||
"tx_accept_flags 0x%lx\n",
|
||||
DP(BNX2X_MSG_SP, "About to configure %d rules, rx_accept_flags 0x%lx, tx_accept_flags 0x%lx\n",
|
||||
data->header.rule_cnt, p->rx_accept_flags,
|
||||
p->tx_accept_flags);
|
||||
|
||||
|
@ -2437,8 +2449,8 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
|
|||
if (!new_cmd)
|
||||
return -ENOMEM;
|
||||
|
||||
DP(BNX2X_MSG_SP, "About to enqueue a new %d command. "
|
||||
"macs_list_len=%d\n", cmd, macs_list_len);
|
||||
DP(BNX2X_MSG_SP, "About to enqueue a new %d command. macs_list_len=%d\n",
|
||||
cmd, macs_list_len);
|
||||
|
||||
INIT_LIST_HEAD(&new_cmd->data.macs_head);
|
||||
|
||||
|
@ -3177,8 +3189,8 @@ static int bnx2x_mcast_validate_e1(struct bnx2x *bp,
|
|||
* matter.
|
||||
*/
|
||||
if (p->mcast_list_len > o->max_cmd_len) {
|
||||
BNX2X_ERR("Can't configure more than %d multicast MACs"
|
||||
"on 57710\n", o->max_cmd_len);
|
||||
BNX2X_ERR("Can't configure more than %d multicast MACs on 57710\n",
|
||||
o->max_cmd_len);
|
||||
return -EINVAL;
|
||||
}
|
||||
/* Every configured MAC should be cleared if DEL command is
|
||||
|
@ -3567,9 +3579,8 @@ int bnx2x_config_mcast(struct bnx2x *bp,
|
|||
if ((!p->mcast_list_len) && (!o->check_sched(o)))
|
||||
return 0;
|
||||
|
||||
DP(BNX2X_MSG_SP, "o->total_pending_num=%d p->mcast_list_len=%d "
|
||||
"o->max_cmd_len=%d\n", o->total_pending_num,
|
||||
p->mcast_list_len, o->max_cmd_len);
|
||||
DP(BNX2X_MSG_SP, "o->total_pending_num=%d p->mcast_list_len=%d o->max_cmd_len=%d\n",
|
||||
o->total_pending_num, p->mcast_list_len, o->max_cmd_len);
|
||||
|
||||
/* Enqueue the current command to the pending list if we can't complete
|
||||
* it in the current iteration
|
||||
|
@ -4294,9 +4305,8 @@ static int bnx2x_queue_comp_cmd(struct bnx2x *bp,
|
|||
unsigned long cur_pending = o->pending;
|
||||
|
||||
if (!test_and_clear_bit(cmd, &cur_pending)) {
|
||||
BNX2X_ERR("Bad MC reply %d for queue %d in state %d "
|
||||
"pending 0x%lx, next_state %d\n", cmd,
|
||||
o->cids[BNX2X_PRIMARY_CID_INDEX],
|
||||
BNX2X_ERR("Bad MC reply %d for queue %d in state %d pending 0x%lx, next_state %d\n",
|
||||
cmd, o->cids[BNX2X_PRIMARY_CID_INDEX],
|
||||
o->state, cur_pending, o->next_state);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
@ -4308,9 +4318,9 @@ static int bnx2x_queue_comp_cmd(struct bnx2x *bp,
|
|||
BNX2X_ERR("illegal value for next tx_only: %d. max cos was %d",
|
||||
o->next_tx_only, o->max_cos);
|
||||
|
||||
DP(BNX2X_MSG_SP, "Completing command %d for queue %d, "
|
||||
"setting state to %d\n", cmd,
|
||||
o->cids[BNX2X_PRIMARY_CID_INDEX], o->next_state);
|
||||
DP(BNX2X_MSG_SP,
|
||||
"Completing command %d for queue %d, setting state to %d\n",
|
||||
cmd, o->cids[BNX2X_PRIMARY_CID_INDEX], o->next_state);
|
||||
|
||||
if (o->next_tx_only) /* print num tx-only if any exist */
|
||||
DP(BNX2X_MSG_SP, "primary cid %d: num tx-only cons %d\n",
|
||||
|
@ -4529,8 +4539,10 @@ static void bnx2x_q_fill_setup_tx_only(struct bnx2x *bp,
|
|||
&data->tx,
|
||||
&cmd_params->params.tx_only.flags);
|
||||
|
||||
DP(BNX2X_MSG_SP, "cid %d, tx bd page lo %x hi %x\n",cmd_params->q_obj->cids[0],
|
||||
data->tx.tx_bd_page_base.lo, data->tx.tx_bd_page_base.hi);
|
||||
DP(BNX2X_MSG_SP, "cid %d, tx bd page lo %x hi %x",
|
||||
cmd_params->q_obj->cids[0],
|
||||
data->tx.tx_bd_page_base.lo,
|
||||
data->tx.tx_bd_page_base.hi);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -4677,10 +4689,8 @@ static inline int bnx2x_q_send_setup_tx_only(struct bnx2x *bp,
|
|||
/* Fill the ramrod data */
|
||||
bnx2x_q_fill_setup_tx_only(bp, params, rdata);
|
||||
|
||||
DP(BNX2X_MSG_SP, "sending tx-only ramrod: cid %d, client-id %d,"
|
||||
"sp-client id %d, cos %d\n",
|
||||
o->cids[cid_index],
|
||||
rdata->general.client_id,
|
||||
DP(BNX2X_MSG_SP, "sending tx-only ramrod: cid %d, client-id %d, sp-client id %d, cos %d\n",
|
||||
o->cids[cid_index], rdata->general.client_id,
|
||||
rdata->general.sp_client_id, rdata->general.cos);
|
||||
|
||||
/*
|
||||
|
@ -5222,9 +5232,9 @@ static inline int bnx2x_func_state_change_comp(struct bnx2x *bp,
|
|||
unsigned long cur_pending = o->pending;
|
||||
|
||||
if (!test_and_clear_bit(cmd, &cur_pending)) {
|
||||
BNX2X_ERR("Bad MC reply %d for func %d in state %d "
|
||||
"pending 0x%lx, next_state %d\n", cmd, BP_FUNC(bp),
|
||||
o->state, cur_pending, o->next_state);
|
||||
BNX2X_ERR("Bad MC reply %d for func %d in state %d pending 0x%lx, next_state %d\n",
|
||||
cmd, BP_FUNC(bp), o->state,
|
||||
cur_pending, o->next_state);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -315,7 +315,8 @@ struct bnx2x_vlan_mac_obj {
|
|||
* @return zero if the element may be added
|
||||
*/
|
||||
|
||||
int (*check_add)(struct bnx2x_vlan_mac_obj *o,
|
||||
int (*check_add)(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data);
|
||||
|
||||
/**
|
||||
|
@ -324,7 +325,8 @@ struct bnx2x_vlan_mac_obj {
|
|||
* @return true if the element may be deleted
|
||||
*/
|
||||
struct bnx2x_vlan_mac_registry_elem *
|
||||
(*check_del)(struct bnx2x_vlan_mac_obj *o,
|
||||
(*check_del)(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *o,
|
||||
union bnx2x_classification_ramrod_data *data);
|
||||
|
||||
/**
|
||||
|
@ -332,7 +334,8 @@ struct bnx2x_vlan_mac_obj {
|
|||
*
|
||||
* @return true if the element may be deleted
|
||||
*/
|
||||
bool (*check_move)(struct bnx2x_vlan_mac_obj *src_o,
|
||||
bool (*check_move)(struct bnx2x *bp,
|
||||
struct bnx2x_vlan_mac_obj *src_o,
|
||||
struct bnx2x_vlan_mac_obj *dst_o,
|
||||
union bnx2x_classification_ramrod_data *data);
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ static void bnx2x_storm_stats_post(struct bnx2x *bp)
|
|||
bp->fw_stats_req->hdr.drv_stats_counter =
|
||||
cpu_to_le16(bp->stats_counter++);
|
||||
|
||||
DP(NETIF_MSG_TIMER, "Sending statistics ramrod %d\n",
|
||||
DP(BNX2X_MSG_STATS, "Sending statistics ramrod %d\n",
|
||||
bp->fw_stats_req->hdr.drv_stats_counter);
|
||||
|
||||
|
||||
|
@ -818,29 +818,29 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
|
|||
|
||||
/* are storm stats valid? */
|
||||
if (le16_to_cpu(counters->xstats_counter) != cur_stats_counter) {
|
||||
DP(BNX2X_MSG_STATS, "stats not updated by xstorm"
|
||||
" xstorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
DP(BNX2X_MSG_STATS,
|
||||
"stats not updated by xstorm xstorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
le16_to_cpu(counters->xstats_counter), bp->stats_counter);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (le16_to_cpu(counters->ustats_counter) != cur_stats_counter) {
|
||||
DP(BNX2X_MSG_STATS, "stats not updated by ustorm"
|
||||
" ustorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
DP(BNX2X_MSG_STATS,
|
||||
"stats not updated by ustorm ustorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
le16_to_cpu(counters->ustats_counter), bp->stats_counter);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (le16_to_cpu(counters->cstats_counter) != cur_stats_counter) {
|
||||
DP(BNX2X_MSG_STATS, "stats not updated by cstorm"
|
||||
" cstorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
DP(BNX2X_MSG_STATS,
|
||||
"stats not updated by cstorm cstorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
le16_to_cpu(counters->cstats_counter), bp->stats_counter);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
if (le16_to_cpu(counters->tstats_counter) != cur_stats_counter) {
|
||||
DP(BNX2X_MSG_STATS, "stats not updated by tstorm"
|
||||
" tstorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
DP(BNX2X_MSG_STATS,
|
||||
"stats not updated by tstorm tstorm counter (0x%x) != stats_counter (0x%x)\n",
|
||||
le16_to_cpu(counters->tstats_counter), bp->stats_counter);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
@ -867,8 +867,7 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
|
|||
|
||||
u32 diff;
|
||||
|
||||
DP(BNX2X_MSG_STATS, "queue[%d]: ucast_sent 0x%x, "
|
||||
"bcast_sent 0x%x mcast_sent 0x%x\n",
|
||||
DP(BNX2X_MSG_STATS, "queue[%d]: ucast_sent 0x%x, bcast_sent 0x%x mcast_sent 0x%x\n",
|
||||
i, xclient->ucast_pkts_sent,
|
||||
xclient->bcast_pkts_sent, xclient->mcast_pkts_sent);
|
||||
|
||||
|
@ -1147,51 +1146,9 @@ static void bnx2x_stats_update(struct bnx2x *bp)
|
|||
|
||||
if (netif_msg_timer(bp)) {
|
||||
struct bnx2x_eth_stats *estats = &bp->eth_stats;
|
||||
int i, cos;
|
||||
|
||||
netdev_dbg(bp->dev, "brb drops %u brb truncate %u\n",
|
||||
estats->brb_drop_lo, estats->brb_truncate_lo);
|
||||
|
||||
for_each_eth_queue(bp, i) {
|
||||
struct bnx2x_fastpath *fp = &bp->fp[i];
|
||||
struct bnx2x_eth_q_stats *qstats = &fp->eth_q_stats;
|
||||
|
||||
pr_debug("%s: rx usage(%4u) *rx_cons_sb(%u) rx pkt(%lu) rx calls(%lu %lu)\n",
|
||||
fp->name, (le16_to_cpu(*fp->rx_cons_sb) -
|
||||
fp->rx_comp_cons),
|
||||
le16_to_cpu(*fp->rx_cons_sb),
|
||||
bnx2x_hilo(&qstats->
|
||||
total_unicast_packets_received_hi),
|
||||
fp->rx_calls, fp->rx_pkt);
|
||||
}
|
||||
|
||||
for_each_eth_queue(bp, i) {
|
||||
struct bnx2x_fastpath *fp = &bp->fp[i];
|
||||
struct bnx2x_fp_txdata *txdata;
|
||||
struct bnx2x_eth_q_stats *qstats = &fp->eth_q_stats;
|
||||
struct netdev_queue *txq;
|
||||
|
||||
pr_debug("%s: tx pkt(%lu) (Xoff events %u)",
|
||||
fp->name,
|
||||
bnx2x_hilo(
|
||||
&qstats->total_unicast_packets_transmitted_hi),
|
||||
qstats->driver_xoff);
|
||||
|
||||
for_each_cos_in_tx_queue(fp, cos) {
|
||||
txdata = &fp->txdata[cos];
|
||||
txq = netdev_get_tx_queue(bp->dev,
|
||||
FP_COS_TO_TXQ(fp, cos));
|
||||
|
||||
pr_debug("%d: tx avail(%4u) *tx_cons_sb(%u) tx calls (%lu) %s\n",
|
||||
cos,
|
||||
bnx2x_tx_avail(bp, txdata),
|
||||
le16_to_cpu(*txdata->tx_cons_sb),
|
||||
txdata->tx_pkt,
|
||||
(netif_tx_queue_stopped(txq) ?
|
||||
"Xoff" : "Xon")
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bnx2x_hw_stats_post(bp);
|
||||
|
|
Loading…
Reference in New Issue