diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-02-12 03:36:11 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 02:31:05 -0500 |
commit | 555f6c78373f969f14487253abe331d085449360 (patch) | |
tree | aa5d388ebd501f795bd9cec3c3727bedb97d59a7 /drivers/net/bnx2x.h | |
parent | 8d9c5f34a25d6a30d15a800d83a3428ad44271d8 (diff) |
bnx2x: Multi-queue
Adding Tx multi-queue and enabling multi-queue by default
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x.h')
-rw-r--r-- | drivers/net/bnx2x.h | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index de094d4b68a0..7edad1f9b330 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -25,6 +25,10 @@ | |||
25 | #endif | 25 | #endif |
26 | 26 | ||
27 | 27 | ||
28 | #define BNX2X_MULTI_QUEUE | ||
29 | |||
30 | #define BNX2X_NEW_NAPI | ||
31 | |||
28 | /* error/debug prints */ | 32 | /* error/debug prints */ |
29 | 33 | ||
30 | #define DRV_MODULE_NAME "bnx2x" | 34 | #define DRV_MODULE_NAME "bnx2x" |
@@ -266,6 +270,7 @@ struct bnx2x_fastpath { | |||
266 | u64 tpa_queue_used; | 270 | u64 tpa_queue_used; |
267 | #endif | 271 | #endif |
268 | 272 | ||
273 | char name[IFNAMSIZ]; | ||
269 | struct bnx2x *bp; /* parent */ | 274 | struct bnx2x *bp; /* parent */ |
270 | }; | 275 | }; |
271 | 276 | ||
@@ -680,11 +685,7 @@ struct bnx2x_eth_stats { | |||
680 | (offsetof(struct bnx2x_eth_stats, stat_name) / 4) | 685 | (offsetof(struct bnx2x_eth_stats, stat_name) / 4) |
681 | 686 | ||
682 | 687 | ||
683 | #ifdef BNX2X_MULTI | ||
684 | #define MAX_CONTEXT 16 | 688 | #define MAX_CONTEXT 16 |
685 | #else | ||
686 | #define MAX_CONTEXT 1 | ||
687 | #endif | ||
688 | 689 | ||
689 | union cdu_context { | 690 | union cdu_context { |
690 | struct eth_context eth; | 691 | struct eth_context eth; |
@@ -859,8 +860,9 @@ struct bnx2x { | |||
859 | #define BNX2X_STATE_DIAG 0xe000 | 860 | #define BNX2X_STATE_DIAG 0xe000 |
860 | #define BNX2X_STATE_ERROR 0xf000 | 861 | #define BNX2X_STATE_ERROR 0xf000 |
861 | 862 | ||
862 | int num_queues; | 863 | int multi_mode; |
863 | #define BP_MAX_QUEUES(bp) (IS_E1HMF(bp) ? 4 : 16) | 864 | int num_rx_queues; |
865 | int num_tx_queues; | ||
864 | 866 | ||
865 | u32 rx_mode; | 867 | u32 rx_mode; |
866 | #define BNX2X_RX_MODE_NONE 0 | 868 | #define BNX2X_RX_MODE_NONE 0 |
@@ -911,11 +913,19 @@ struct bnx2x { | |||
911 | }; | 913 | }; |
912 | 914 | ||
913 | 915 | ||
914 | #define for_each_queue(bp, var) for (var = 0; var < bp->num_queues; var++) | 916 | #define BNX2X_MAX_QUEUES(bp) (IS_E1HMF(bp) ? (MAX_CONTEXT / E1HVN_MAX) : \ |
917 | MAX_CONTEXT) | ||
918 | #define BNX2X_NUM_QUEUES(bp) max(bp->num_rx_queues, bp->num_tx_queues) | ||
919 | #define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 1) | ||
915 | 920 | ||
921 | #define for_each_rx_queue(bp, var) \ | ||
922 | for (var = 0; var < bp->num_rx_queues; var++) | ||
923 | #define for_each_tx_queue(bp, var) \ | ||
924 | for (var = 0; var < bp->num_tx_queues; var++) | ||
925 | #define for_each_queue(bp, var) \ | ||
926 | for (var = 0; var < BNX2X_NUM_QUEUES(bp); var++) | ||
916 | #define for_each_nondefault_queue(bp, var) \ | 927 | #define for_each_nondefault_queue(bp, var) \ |
917 | for (var = 1; var < bp->num_queues; var++) | 928 | for (var = 1; var < BNX2X_NUM_QUEUES(bp); var++) |
918 | #define is_multi(bp) (bp->num_queues > 1) | ||
919 | 929 | ||
920 | 930 | ||
921 | void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); | 931 | void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32); |
@@ -1120,12 +1130,13 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, | |||
1120 | AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR) | 1130 | AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR) |
1121 | 1131 | ||
1122 | 1132 | ||
1123 | #define MULTI_FLAGS \ | 1133 | #define MULTI_FLAGS(bp) \ |
1124 | (TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY | \ | 1134 | (TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY | \ |
1125 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY | \ | 1135 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY | \ |
1126 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY | \ | 1136 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY | \ |
1127 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY | \ | 1137 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_TCP_CAPABILITY | \ |
1128 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_DEFAULT_ENABLE) | 1138 | (bp->multi_mode << \ |
1139 | TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_MODE_SHIFT)) | ||
1129 | 1140 | ||
1130 | #define MULTI_MASK 0x7f | 1141 | #define MULTI_MASK 0x7f |
1131 | 1142 | ||