diff options
author | Vladislav Zolotarov <vladz@broadcom.com> | 2011-08-08 23:08:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-11 10:14:53 -0400 |
commit | cdb9d6ae8d128cc01d7a0649201102cd7de356e0 (patch) | |
tree | fb7f936e590237f590851c183fbacf8566d438b7 /drivers/net | |
parent | 45d3539a2309858906abd8261c26f8ba8e50405a (diff) |
bnx2x: fix select_queue when FCoE is disabled
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_cmn.c | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 64df0ef97e02..37e5790681ad 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -1405,10 +1405,9 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) | |||
1405 | 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) |
1406 | { | 1406 | { |
1407 | struct bnx2x *bp = netdev_priv(dev); | 1407 | struct bnx2x *bp = netdev_priv(dev); |
1408 | |||
1408 | #ifdef BCM_CNIC | 1409 | #ifdef BCM_CNIC |
1409 | if (NO_FCOE(bp)) | 1410 | if (!NO_FCOE(bp)) { |
1410 | return skb_tx_hash(dev, skb); | ||
1411 | else { | ||
1412 | struct ethhdr *hdr = (struct ethhdr *)skb->data; | 1411 | struct ethhdr *hdr = (struct ethhdr *)skb->data; |
1413 | u16 ether_type = ntohs(hdr->h_proto); | 1412 | u16 ether_type = ntohs(hdr->h_proto); |
1414 | 1413 | ||
@@ -1425,8 +1424,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) | |||
1425 | return bnx2x_fcoe_tx(bp, txq_index); | 1424 | return bnx2x_fcoe_tx(bp, txq_index); |
1426 | } | 1425 | } |
1427 | #endif | 1426 | #endif |
1428 | /* Select a none-FCoE queue: if FCoE is enabled, exclude FCoE L2 ring | 1427 | /* select a non-FCoE queue */ |
1429 | */ | ||
1430 | return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp)); | 1428 | return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp)); |
1431 | } | 1429 | } |
1432 | 1430 | ||
@@ -1449,6 +1447,28 @@ void bnx2x_set_num_queues(struct bnx2x *bp) | |||
1449 | bp->num_queues += NON_ETH_CONTEXT_USE; | 1447 | bp->num_queues += NON_ETH_CONTEXT_USE; |
1450 | } | 1448 | } |
1451 | 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 | */ | ||
1452 | static inline int bnx2x_set_real_num_queues(struct bnx2x *bp) | 1472 | static inline int bnx2x_set_real_num_queues(struct bnx2x *bp) |
1453 | { | 1473 | { |
1454 | int rc, tx, rx; | 1474 | int rc, tx, rx; |