diff options
author | Merav Sicron <meravs@broadcom.com> | 2012-06-19 03:48:27 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-19 17:34:35 -0400 |
commit | 37ae41a965fbb810b6a98df7df8ab46fefcc15eb (patch) | |
tree | 163251214408b4594eaa0123b331e36c218f96b4 /drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |
parent | 65565884fba67d9254f32d239b0fb6c38fae88aa (diff) |
bnx2x: Move the CNIC L2 CIDs to be right after the RSS CIDs
Currently the CNIC-related L2 CIDs (for sending control FCoE / iSCSI packets)
were at fixed position, according to the maximal number of RSS queues multiplied
by the number of traffic-classes. This change makes the CIDs dynamic, as they
are defined to be right after the highest RSS CID. This decreases the memory
allocated for the context.
Signed-off-by: Merav Sicron <meravs@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x.h')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index d06064b0d063..234517f132a8 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -248,13 +248,12 @@ enum { | |||
248 | BNX2X_MAX_CNIC_ETH_CL_ID_IDX, | 248 | BNX2X_MAX_CNIC_ETH_CL_ID_IDX, |
249 | }; | 249 | }; |
250 | 250 | ||
251 | #define BNX2X_CNIC_START_ETH_CID 48 | 251 | #define BNX2X_CNIC_START_ETH_CID(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) *\ |
252 | enum { | 252 | (bp)->max_cos) |
253 | /* iSCSI L2 */ | 253 | /* iSCSI L2 */ |
254 | BNX2X_ISCSI_ETH_CID = BNX2X_CNIC_START_ETH_CID, | 254 | #define BNX2X_ISCSI_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp)) |
255 | /* FCoE L2 */ | 255 | /* FCoE L2 */ |
256 | BNX2X_FCOE_ETH_CID, | 256 | #define BNX2X_FCOE_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp) + 1) |
257 | }; | ||
258 | 257 | ||
259 | /** Additional rings budgeting */ | 258 | /** Additional rings budgeting */ |
260 | #ifdef BCM_CNIC | 259 | #ifdef BCM_CNIC |
@@ -276,8 +275,6 @@ enum { | |||
276 | #define FIRST_TX_ONLY_COS_INDEX 1 | 275 | #define FIRST_TX_ONLY_COS_INDEX 1 |
277 | #define FIRST_TX_COS_INDEX 0 | 276 | #define FIRST_TX_COS_INDEX 0 |
278 | 277 | ||
279 | #define MAX_TXQS_PER_COS FP_SB_MAX_E1x | ||
280 | |||
281 | /* rules for calculating the cids of tx-only connections */ | 278 | /* rules for calculating the cids of tx-only connections */ |
282 | #define CID_TO_FP(cid, bp) ((cid) % BNX2X_NUM_NON_CNIC_QUEUES(bp)) | 279 | #define CID_TO_FP(cid, bp) ((cid) % BNX2X_NUM_NON_CNIC_QUEUES(bp)) |
283 | #define CID_COS_TO_TX_ONLY_CID(cid, cos, bp) \ | 280 | #define CID_COS_TO_TX_ONLY_CID(cid, cos, bp) \ |
@@ -1448,10 +1445,12 @@ struct bnx2x { | |||
1448 | 1445 | ||
1449 | /* | 1446 | /* |
1450 | * Maximum CID count that might be required by the bnx2x: | 1447 | * Maximum CID count that might be required by the bnx2x: |
1451 | * Max Tss * Max_Tx_Multi_Cos + CNIC L2 Clients (FCoE and iSCSI related) | 1448 | * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI |
1452 | */ | 1449 | */ |
1453 | #define BNX2X_L2_CID_COUNT(bp) (MAX_TXQS_PER_COS * BNX2X_MULTI_TX_COS +\ | 1450 | #define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \ |
1454 | NON_ETH_CONTEXT_USE + CNIC_PRESENT) | 1451 | + NON_ETH_CONTEXT_USE + CNIC_PRESENT) |
1452 | #define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \ | ||
1453 | + NON_ETH_CONTEXT_USE + CNIC_PRESENT) | ||
1455 | #define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\ | 1454 | #define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\ |
1456 | ILT_PAGE_CIDS)) | 1455 | ILT_PAGE_CIDS)) |
1457 | 1456 | ||