Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322812
b: refs/heads/master
c: 7b5342d
h: refs/heads/master
v: v3
  • Loading branch information
Yuval Mintz authored and David S. Miller committed Sep 13, 2012
1 parent 8055a63 commit 967c3ff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2ace95103df2bcb574c9da5df96807e9b46f9b38
refs/heads/master: 7b5342d9026d537cbc01fd30b7cd9bac9b07b5ad
11 changes: 5 additions & 6 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -710,17 +710,15 @@ static inline u16 bnx2x_tx_avail(struct bnx2x *bp,
prod = txdata->tx_bd_prod;
cons = txdata->tx_bd_cons;

/* NUM_TX_RINGS = number of "next-page" entries
It will be used as a threshold */
used = SUB_S16(prod, cons) + (s16)NUM_TX_RINGS;
used = SUB_S16(prod, cons);

#ifdef BNX2X_STOP_ON_ERROR
WARN_ON(used < 0);
WARN_ON(used > bp->tx_ring_size);
WARN_ON((bp->tx_ring_size - used) > MAX_TX_AVAIL);
WARN_ON(used > txdata->tx_ring_size);
WARN_ON((txdata->tx_ring_size - used) > MAX_TX_AVAIL);
#endif

return (s16)(bp->tx_ring_size) - used;
return (s16)(txdata->tx_ring_size) - used;
}

static inline int bnx2x_tx_queue_has_work(struct bnx2x_fp_txdata *txdata)
Expand Down Expand Up @@ -1088,6 +1086,7 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp,
txdata->txq_index = txq_index;
txdata->tx_cons_sb = tx_cons_sb;
txdata->parent_fp = fp;
txdata->tx_ring_size = IS_FCOE_FP(fp) ? MAX_TX_AVAIL : bp->tx_ring_size;

DP(NETIF_MSG_IFUP, "created tx data cid %d, txq %d\n",
txdata->cid, txdata->txq_index);
Expand Down
21 changes: 16 additions & 5 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -7561,8 +7561,14 @@ int bnx2x_set_mac_one(struct bnx2x *bp, u8 *mac,
}

rc = bnx2x_config_vlan_mac(bp, &ramrod_param);
if (rc < 0)

if (rc == -EEXIST) {
DP(BNX2X_MSG_SP, "Failed to schedule ADD operations: %d\n", rc);
/* do not treat adding same MAC as error */
rc = 0;
} else if (rc < 0)
BNX2X_ERR("%s MAC failed\n", (set ? "Set" : "Del"));

return rc;
}

Expand Down Expand Up @@ -10294,13 +10300,11 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp)
dev_info.port_hw_config[port].
fcoe_wwn_node_name_lower);
} else if (!IS_MF_SD(bp)) {
u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg);

/*
* Read the WWN info only if the FCoE feature is enabled for
* this function.
*/
if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD)
if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp))
bnx2x_get_ext_wwn_info(bp, func);

} else if (IS_MF_FCOE_SD(bp))
Expand Down Expand Up @@ -11073,7 +11077,14 @@ static int bnx2x_set_uc_list(struct bnx2x *bp)
netdev_for_each_uc_addr(ha, dev) {
rc = bnx2x_set_mac_one(bp, bnx2x_uc_addr(ha), mac_obj, true,
BNX2X_UC_LIST_MAC, &ramrod_flags);
if (rc < 0) {
if (rc == -EEXIST) {
DP(BNX2X_MSG_SP,
"Failed to schedule ADD operations: %d\n", rc);
/* do not treat adding same MAC as error */
rc = 0;

} else if (rc < 0) {

BNX2X_ERR("Failed to schedule ADD operations: %d\n",
rc);
return rc;
Expand Down

0 comments on commit 967c3ff

Please sign in to comment.