diff options
Diffstat (limited to 'drivers/net/bnx2x/bnx2x_cmn.c')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index d724a18b5285..37e5790681ad 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -63,8 +63,9 @@ static inline void bnx2x_bz_fp(struct bnx2x *bp, int index) | |||
63 | fp->disable_tpa = ((bp->flags & TPA_ENABLE_FLAG) == 0); | 63 | fp->disable_tpa = ((bp->flags & TPA_ENABLE_FLAG) == 0); |
64 | 64 | ||
65 | #ifdef BCM_CNIC | 65 | #ifdef BCM_CNIC |
66 | /* We don't want TPA on FCoE, FWD and OOO L2 rings */ | 66 | /* We don't want TPA on an FCoE L2 ring */ |
67 | bnx2x_fcoe(bp, disable_tpa) = 1; | 67 | if (IS_FCOE_FP(fp)) |
68 | fp->disable_tpa = 1; | ||
68 | #endif | 69 | #endif |
69 | } | 70 | } |
70 | 71 | ||
@@ -1404,10 +1405,9 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) | |||
1404 | u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) | 1405 | u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) |
1405 | { | 1406 | { |
1406 | struct bnx2x *bp = netdev_priv(dev); | 1407 | struct bnx2x *bp = netdev_priv(dev); |
1408 | |||
1407 | #ifdef BCM_CNIC | 1409 | #ifdef BCM_CNIC |
1408 | if (NO_FCOE(bp)) | 1410 | if (!NO_FCOE(bp)) { |
1409 | return skb_tx_hash(dev, skb); | ||
1410 | else { | ||
1411 | struct ethhdr *hdr = (struct ethhdr *)skb->data; | 1411 | struct ethhdr *hdr = (struct ethhdr *)skb->data; |
1412 | u16 ether_type = ntohs(hdr->h_proto); | 1412 | u16 ether_type = ntohs(hdr->h_proto); |
1413 | 1413 | ||
@@ -1424,8 +1424,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
1424 | return bnx2x_fcoe_tx(bp, txq_index); | 1424 | return bnx2x_fcoe_tx(bp, txq_index); |
1425 | } | 1425 | } |
1426 | #endif | 1426 | #endif |
1427 | /* Select a none-FCoE queue: if FCoE is enabled, exclude FCoE L2 ring | 1427 | /* select a non-FCoE queue */ |
1428 | */ | ||
1429 | return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp)); | 1428 | return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp)); |
1430 | } | 1429 | } |
1431 | 1430 | ||
@@ -1448,6 +1447,28 @@ void bnx2x_set_num_queues(struct bnx2x *bp) | |||
1448 | bp->num_queues += NON_ETH_CONTEXT_USE; | 1447 | bp->num_queues += NON_ETH_CONTEXT_USE; |
1449 | } | 1448 | } |
1450 | 1449 | ||
1450 | /** | ||
1451 | * bnx2x_set_real_num_queues - configure netdev->real_num_[tx,rx]_queues | ||
1452 | * | ||
1453 | * @bp: Driver handle | ||
1454 | * | ||
1455 | * We currently support for at most 16 Tx queues for each CoS thus we will | ||
1456 | * allocate a multiple of 16 for ETH L2 rings according to the value of the | ||
1457 | * bp->max_cos. | ||
1458 | * | ||
1459 | * If there is an FCoE L2 queue the appropriate Tx queue will have the next | ||
1460 | * index after all ETH L2 indices. | ||
1461 | * | ||
1462 | * If the actual number of Tx queues (for each CoS) is less than 16 then there | ||
1463 | * will be the holes at the end of each group of 16 ETh L2 indices (0..15, | ||
1464 | * 16..31,...) with indicies that are not coupled with any real Tx queue. | ||
1465 | * | ||
1466 | * The proper configuration of skb->queue_mapping is handled by | ||
1467 | * bnx2x_select_queue() and __skb_tx_hash(). | ||
1468 | * | ||
1469 | * bnx2x_setup_tc() takes care of the proper TC mappings so that __skb_tx_hash() | ||
1470 | * will return a proper Tx index if TC is enabled (netdev->num_tc > 0). | ||
1471 | */ | ||
1451 | static inline int bnx2x_set_real_num_queues(struct bnx2x *bp) | 1472 | static inline int bnx2x_set_real_num_queues(struct bnx2x *bp) |
1452 | { | 1473 | { |
1453 | int rc, tx, rx; | 1474 | int rc, tx, rx; |