bnx2x: Add run-time CNIC support
PATCH v2 1/1 bnx2x: Add run-time CNIC support
This patch replaces the BCM_CNIC compilation flag with a run-time flag. This is mainly important for the SR-IOV driver, as this driver will share the same code with the PF/hypervisor driver. Since storage is not supported in SR-IOV (while is usually enabled in the non-SR-IOV driver), we don't want to waste resources on it.
In addition this change makes the code prettier.
---
Hi Dave,
Diffrences comparing to v1:
1. Make struct net_device_ops const. Use a diffrent net_device_ops structure when CNIC is not enabled.
2. Use the IS_ENABLED() macro instead of #ifdef on config options (thanks Eric), and use it inline (until SR_IOV support is added).
Please consider applying this patch to net-next.
Thanks,
Merav
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | 74 +-- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 179 +++--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 17 +- drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c | 9 +- .../net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 4 +- .../net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h | 2 - drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 584 ++++++++++---------- 7 files changed, 403 insertions(+), 466 deletions(-)
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +24 -50
@@ -34,18 +34,10 @@#include "bnx2x_hsi.h" -#if defined(CONFIG_CNIC ) || defined(CONFIG_CNIC_MODULE ) -#define BCM_CNIC 1#include "../cnic_if.h" -#endif -#ifdef BCM_CNIC -#define BNX2X_MIN_MSIX_VEC_CNT 3 -#define BNX2X_MSIX_VEC_FP_START 2 -#else -#define BNX2X_MIN_MSIX_VEC_CNT 2 -#define BNX2X_MSIX_VEC_FP_START 1 -#endif + +#define BNX2X_MIN_MSIX_VEC_CNT (bp) ((bp)->min_msix_vec_cnt)#include <linux/mdio.h>
@@ -251,20 +243,13 @@ enum {#define BNX2X_CNIC_START_ETH_CID (bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) *\ (bp)->max_cos) +/* iSCSI L2 */ #define BNX2X_ISCSI_ETH_CID (bp) (BNX2X_CNIC_START_ETH_CID(bp))/* FCoE L2 */ #define BNX2X_FCOE_ETH_CID (bp) (BNX2X_CNIC_START_ETH_CID(bp) + 1) -/** Additional rings budgeting */ -#ifdef BCM_CNIC -#define CNIC_PRESENT 1 -#define FCOE_PRESENT 1 -#else -#define CNIC_PRESENT 0 -#define FCOE_PRESENT 0 -#endif /* BCM_CNIC */ -#define NON_ETH_CONTEXT_USE (FCOE_PRESENT) +#define CNIC_ENABLED (bp) ((bp)->cnic_enabled)#define AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR \ AEU_INPUTS_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR
@@ -297,9 +282,7 @@ enum { OOO_TXQ_IDX_OFFSET, };#define MAX_ETH_TXQ_IDX (bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * (bp)->max_cos) -#ifdef BCM_CNIC #define FCOE_TXQ_IDX (bp) (MAX_ETH_TXQ_IDX(bp) + FCOE_TXQ_IDX_OFFSET) -#endif /* fast path */ /*
@@ -584,15 +567,10 @@ struct bnx2x_fastpath { ->var) -#define IS_ETH_FP (fp) (fp->index < \ - BNX2X_NUM_ETH_QUEUES(fp->bp)) -#ifdef BCM_CNIC -#define IS_FCOE_FP (fp) (fp->index == FCOE_IDX(fp->bp)) -#define IS_FCOE_IDX (idx) ((idx) == FCOE_IDX(bp)) -#else -#define IS_FCOE_FP (fp) false -#define IS_FCOE_IDX (idx) false -#endif +#define IS_ETH_FP (fp) ((fp)->index < BNX2X_NUM_ETH_QUEUES((fp)->bp)) +#define IS_FCOE_FP (fp) ((fp)->index == FCOE_IDX((fp)->bp) && \ + CNIC_ENABLED((fp)->bp)) +#define IS_FCOE_IDX (idx) (CNIC_ENABLED(bp) && ((idx) == FCOE_IDX(bp)))/* MC hsi */
@@ -979,18 +957,15 @@ union cdu_context {#define CDU_ILT_PAGE_SZ (8192 << CDU_ILT_PAGE_SZ_HW)/* 32K */ #define ILT_PAGE_CIDS (CDU_ILT_PAGE_SZ / sizeof(union cdu_context)) -#ifdef BCM_CNIC #define CNIC_ISCSI_CID_MAX 256#define CNIC_FCOE_CID_MAX 2048#define CNIC_CID_MAX (CNIC_ISCSI_CID_MAX + CNIC_FCOE_CID_MAX)#define CNIC_ILT_LINES DIV_ROUND_UP(CNIC_CID_MAX, ILT_PAGE_CIDS) -#endif #define QM_ILT_PAGE_SZ_HW 0#define QM_ILT_PAGE_SZ (4096 << QM_ILT_PAGE_SZ_HW)/* 4K */ #define QM_CID_ROUND 1024 -#ifdef BCM_CNIC /* TM (timers) host DB constants */ #define TM_ILT_PAGE_SZ_HW 0#define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW)/* 4K */
@@ -1008,8 +983,6 @@ union cdu_context {#define SRC_T2_SZ SRC_ILT_SZ#define SRC_ILT_LINES DIV_ROUND_UP(SRC_ILT_SZ, SRC_ILT_PAGE_SZ) -#endif -#define MAX_DMAE_C 8/* DMA memory not used in fastpath */
@@ -1203,7 +1176,6 @@ struct bnx2x {struct bnx2x_sp_objs *sp_objs;struct bnx2x_fp_stats *fp_stats;struct bnx2x_fp_txdata *bnx2x_txq; -int bnx2x_txq_size;void __iomem *regview;void __iomem *doorbells;u16 db_size;
@@ -1326,6 +1298,8 @@ struct bnx2x {#define NO_ISCSI_OOO (bp) ((bp)->flags & NO_ISCSI_OOO_FLAG)#define NO_FCOE (bp) ((bp)->flags & NO_FCOE_FLAG) +int cnic_enabled; +int pm_cap;int mrrs;
@@ -1396,6 +1370,9 @@ struct bnx2x {#define BNX2X_MAX_COS 3#define BNX2X_MAX_TX_COS 2int num_queues; +uint num_ethernet_queues; +uint num_cnic_queues; +/* The number of queues to whom MSI-X vector and napi was allocated */ int num_napi_queues;int disable_tpa;
@@ -1409,6 +1386,7 @@ struct bnx2x {u8 igu_dsb_id;u8 igu_base_sb;u8 igu_sb_cnt; +u8 min_msix_vec_cnt;dma_addr_t def_status_blk_mapping;
@@ -1454,16 +1432,16 @@ struct bnx2x {* Maximum supported number of RSS queues: number of IGU SBs minus one that goes * to CNIC. */ -#define BNX2X_MAX_RSS_COUNT (bp) ((bp)->igu_sb_cnt - CNIC_PRESENT) +#define BNX2X_MAX_RSS_COUNT (bp) ((bp)->igu_sb_cnt - CNIC_ENABLED(bp))/* * Maximum CID count that might be required by the bnx2x: * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI */ #define BNX2X_L2_CID_COUNT (bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \ - + NON_ETH_CONTEXT_USE + CNIC_PRESENT) + + 2 * CNIC_ENABLED(bp))#define BNX2X_L2_MAX_CID (bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \ - + NON_ETH_CONTEXT_USE + CNIC_PRESENT) + + 2 * CNIC_ENABLED(bp))#define L2_ILT_LINES (bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\ ILT_PAGE_CIDS))
@@ -1471,9 +1449,6 @@ struct bnx2x {int dropless_fc; -#ifdef BCM_CNIC -u32 cnic_flags; -#define BNX2X_CNIC_FLAG_MAC_SET 1void *t2;dma_addr_t t2_mapping;struct cnic_ops __rcu *cnic_ops;
@@ -1494,7 +1469,6 @@ struct bnx2x {/* Start index of the "special" (CNIC related) L2 cleints */ u8 cnic_base_cl_id; -#endif int dmae_ready;/* used to synchronize dmae accesses */
@@ -1623,9 +1597,10 @@ struct bnx2x {/* Tx queues may be less or equal to Rx queues */ extern int num_queues;#define BNX2X_NUM_QUEUES (bp) (bp->num_queues) -#define BNX2X_NUM_ETH_QUEUES (bp) (BNX2X_NUM_QUEUES(bp) - NON_ETH_CONTEXT_USE) +#define BNX2X_INIT_NUM_QUEUES (bp) ((bp)->init_num_queues) +#define BNX2X_NUM_ETH_QUEUES (bp) ((bp)->num_ethernet_queues)#define BNX2X_NUM_NON_CNIC_QUEUES (bp) (BNX2X_NUM_QUEUES(bp) - \ - NON_ETH_CONTEXT_USE) + (bp)->num_cnic_queues)#define BNX2X_NUM_RX_QUEUES (bp) BNX2X_NUM_QUEUES(bp)#define is_multi (bp) (BNX2X_NUM_QUEUES(bp) > 1)
@@ -2167,7 +2142,6 @@ void bnx2x_notify_link_changed(struct bnx2x *bp);#define BNX2X_MF_SD_PROTOCOL (bp) \ ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK) -#ifdef BCM_CNIC #define BNX2X_IS_MF_SD_PROTOCOL_ISCSI (bp) \ (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI)
@@ -2180,13 +2154,13 @@ void bnx2x_notify_link_changed(struct bnx2x *bp);#define BNX2X_MF_EXT_PROTOCOL_FCOE (bp) ((bp)->mf_ext_config & \ MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) -#define IS_MF_FCOE_AFEX (bp) (IS_MF_AFEX(bp) && BNX2X_MF_EXT_PROTOCOL_FCOE(bp)) +#define IS_MF_FCOE_AFEX (bp) (IS_MF_AFEX(bp) && \ + BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && CNIC_ENABLED(bp)) +#define IS_MF_STORAGE_SD (bp) (IS_MF_SD(bp) && \ (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \ BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp))) -#else -#define IS_MF_FCOE_AFEX (bp) false -#endif +#endif /* bnx2x.h */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +79 -100
418 lines not on this page · raw message
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +4 -13
@@ -229,7 +229,6 @@ irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance);* @dev_instance: private instance */ irqreturn_t bnx2x_interrupt (int irq,void *dev_instance); -#ifdef BCM_CNIC /** * bnx2x_cnic_notify - send command to cnic driver
@@ -253,8 +252,6 @@ void bnx2x_setup_cnic_irq_info(struct bnx2x *bp);*/ void bnx2x_setup_cnic_info (struct bnx2x *bp); -#endif -/** * bnx2x_int_enable - enable HW interrupts. *
@@ -537,7 +534,7 @@ void bnx2x_free_mem_bp(struct bnx2x *bp);*/ int bnx2x_change_mtu (struct net_device *dev,int new_mtu); -#if defined(NETDEV_FCOE_WWNN ) && defined(BCM_CNIC ) +#ifdef NETDEV_FCOE_WWNN /** * bnx2x_fcoe_get_wwn - return the requested WWN value for this port *
@@ -971,11 +968,9 @@ static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) {struct bnx2x *bp = fp->bp;if (!CHIP_IS_E1x (bp)) { -#ifdef BCM_CNIC /* there are special statistics counters for FCoE 136..140 */ if (IS_FCOE_FP (fp))return bp->cnic_base_cl_id + (bp->pf_num >>1 ); -#endif return fp->cl_id; }return fp->cl_id +BP_PORT (bp) * FP_SB_MAX_E1x;
@@ -1093,7 +1088,6 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp, txdata->cid, txdata->txq_index); } -#ifdef BCM_CNIC static inline u8 bnx2x_cnic_eth_cl_id (struct bnx2x *bp,u8 cl_idx) { return bp->cnic_base_cl_id + cl_idx +
@@ -1153,7 +1147,6 @@ static inline void bnx2x_init_fcoe_fp(struct bnx2x *bp) fp->index, bp, fp->status_blk.e2_sb, fp->cl_id, fp->fw_sb_id, fp->igu_sb_id); } -#endif static inline int bnx2x_clean_tx_queue (struct bnx2x *bp,struct bnx2x_fp_txdata *txdata)
@@ -1271,7 +1264,7 @@ static inline bool bnx2x_mtu_allows_gro(int mtu)*/ return mtu <=SGE_PAGE_SIZE && (U_ETH_SGL_SIZE * fpp) <=MAX_SKB_FRAGS ; } -#ifdef BCM_CNIC +/** * bnx2x_get_iscsi_info - update iSCSI params according to licensing info. *
@@ -1279,7 +1272,6 @@ static inline bool bnx2x_mtu_allows_gro(int mtu)* */ void bnx2x_get_iscsi_info (struct bnx2x *bp); -#endif /** * bnx2x_link_sync_notify - send notification to other functions.
@@ -1333,11 +1325,10 @@ static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr) {if (is_valid_ether_addr (addr))return true; -#ifdef BCM_CNIC -if (is_zero_ether_addr (addr) && +if (CNIC_ENABLED (bp) &&is_zero_ether_addr (addr) && (IS_MF_STORAGE_SD (bp) ||IS_MF_FCOE_AFEX (bp)))return true; -#endif +return false; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +5 -4
@@ -1912,10 +1912,11 @@ static void bnx2x_dcbnl_get_perm_hw_addr(struct net_device *netdev,/* first the HW mac address */ memcpy (perm_addr, netdev->dev_addr, netdev->addr_len); -#ifdef BCM_CNIC -/* second SAN address */ -memcpy (perm_addr+netdev->addr_len, bp->fip_mac, netdev->addr_len); -#endif + +if (CNIC_ENABLED (bp)) +/* second SAN address */ +memcpy (perm_addr+netdev->addr_len, bp->fip_mac, + netdev->addr_len); } static void bnx2x_dcbnl_set_pg_tccfg_tx(struct net_device *netdev, int prio,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +3 -1
@@ -2890,7 +2890,9 @@ static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss) {bnx2x_del_all_napi (bp);bnx2x_disable_msi (bp); -BNX2X_NUM_QUEUES (bp) = num_rss +NON_ETH_CONTEXT_USE ; + bp->num_ethernet_queues = num_rss; + bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues; +BNX2X_DEV_INFO ("set number of queues to %d\n" , bp->num_queues);bnx2x_set_int_mode (bp);bnx2x_add_all_napi (bp); }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h +0 -2
@@ -890,7 +890,6 @@ static void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count,/**************************************************************************** * SRC initializations ****************************************************************************/ -#ifdef BCM_CNIC /* called during init func stage */ static void bnx2x_src_init_t2 (struct bnx2x *bp,struct src_ent *t2,dma_addr_t t2_mapping,int src_cid_count)
@@ -915,5 +914,4 @@ static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,U64_HI ((u64 )t2_mapping + (src_cid_count-1) * sizeof(struct src_ent))); } -#endif #endif /* BNX2X_INIT_OPS_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +288 -296
1,141 lines not on this page · raw message
--
1.7.10
David Miller
maintainerFrom: "Merav Sicron" <[email protected]>
Date: Mon, 9 Jul 2012 13:00:55 +0300
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c static int __devinit bnx2x_init_one(struct pci_dev *pdev, · line 11817
Quoted 2 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1
-1- max_non_def_sbs =bnx2x_get_num_non_def_sbs (pdev); + cnic_enabled =IS_ENABLED (CONFIG_CNIC ) ?1 :0 ;
This, as I said, it pointless.
Every distribution is going to turn on this Kconfig option so guarding this at all using the Kconfig option is largely valueless.
Quoted 11 lines · David Miller
From: "Merav Sicron" <[email protected]>
Date: Mon, 9 Jul 2012 13:00:55 +0300drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c static int __devinit bnx2x_init_one(struct pci_dev *pdev, · line 11817
Quoted 2 lines
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +1
-1- max_non_def_sbs =bnx2x_get_num_non_def_sbs (pdev); + cnic_enabled =IS_ENABLED (CONFIG_CNIC ) ?1 :0 ;This, as I said, it pointless.
Every distribution is going to turn on this
Kconfigoption so guarding this at all using theKconfigoption is largely valueless.
There are still two advantages in disabling CNIC in bnx2x: Saving resources (MSI-X vector and memory) as well as reducing some latency. When the HW is configured to storage-offload (rather than NIC-only mode) it does connection search over the PCI, which is additional 0.5usec - 2.5usec, depending on the system load. When CNIC is not enabled, the HW is configured to eliminate the search.
While it is true that distributions enable the CNIC Kconfig option, some users that care about resources and latency compile a kernel without it.
Can you please re-consider this patch?
Thanks,
Merav
David Miller
maintainerFrom: "Merav Sicron" <[email protected]>
Date: Tue, 10 Jul 2012 15:17:00 +0300
Quoted 2 lines
There are still two advantages in disabling CNIC in bnx2x: Saving resources (MSI-X vector and memory) as well as reducing some latency.
But, nobody does this. No end user can do this easily, this is therefore of zero value to him.
Quoted 2 lines
While it is true that distributions enable the CNIC
Kconfigoption, some users that care about resources and latency compile a kernel without it.
This, therefore, results in a terrible user experience.
Quoted 1 line
Can you please re-consider this patch?
Absolutely not.
Make it really dynamic, and properly configurable at run time, so people don't have to go through hoops to get the "advantages" you speak so highly of.
Quoted 8 lines · David Miller
From: "Merav Sicron" <[email protected]>
Date: Tue, 10 Jul 2012 15:17:00 +0300Quoted 2 lines
There are still two advantages in disabling CNIC in bnx2x: Saving resources (MSI-X vector and memory) as well as reducing some latency.
But, nobody does this. No end user can do this easily, this is therefore of zero value to him.
Most do not, but I'm aware of two customers that play with their own kernel that do that - they can play with the driver and tweak it to disable this mode manually, but that is similar to supporting something outside the tree.
Quoted 4 lines
Quoted 2 lines
While it is true that distributions enable the CNIC
Kconfigoption, some users that care about resources and latency compile a kernel without it.This, therefore, results in a terrible user experience.
We are using the Kconfig since it is meant for advanced users that customize their kernel to their needs.
Quoted 7 lines
Quoted 1 line
Can you please re-consider this patch?
Absolutely not.
Make it really dynamic, and properly configurable at run time, so people don't have to go through hoops to get the "advantages" you speak so highly of.
This is possible for the resources, but not for the latency - we cannot change the HW mode once traffic started to run. Why is that so bad to support Kconfig as a working mode like we did thus far? We are using it specifically for users that wants to optimize the kernel, so Kconfig does not sound that bad in that context.
David Miller
maintainerFrom: "Eilon Greenstein" <[email protected]>
Date: Tue, 10 Jul 2012 15:33:54 +0300
Quoted 10 lines · David Miller
Quoted 3 lines
Make it really dynamic, and properly configurable at run time, so people don't have to go through hoops to get the "advantages" you speak so highly of.
This is possible for the resources, but not for the latency - we cannot change the HW mode once traffic started to run. Why is that so bad to support
Kconfigas a working mode like we did thus far? We are using it specifically for users that wants to optimize the kernel, soKconfigdoes not sound that bad in that context.
Sure you can find a way to make this work, you just really aren't trying hard enough.
The current situation is a huge and gross hack. I'm not letting you continue spreading this disease.
Implement this properly, I really mean it.
Quoted 14 lines · David Miller
From: "Eilon Greenstein" <[email protected]>
Date: Tue, 10 Jul 2012 15:33:54 +0300Quoted 10 lines · David Miller
Quoted 3 lines
Make it really dynamic, and properly configurable at run time, so people don't have to go through hoops to get the "advantages" you speak so highly of.
This is possible for the resources, but not for the latency - we cannot change the HW mode once traffic started to run. Why is that so bad to support
Kconfigas a working mode like we did thus far? We are using it specifically for users that wants to optimize the kernel, soKconfigdoes not sound that bad in that context.
Quoted 8 lines
Sure you can find a way to make this work, you just really aren't trying hard enough.
The current situation is a huge and gross hack. I'm not letting you continue spreading this disease.
Implement this properly, I really mean it.
OK. Since it blocks the ability to add SR-IOV support, is it acceptable to submit it as constant enabled for PF and disabled for VF (SR-IOV)?
David Miller
maintainerFrom: "Eilon Greenstein" <[email protected]>
Date: Tue, 10 Jul 2012 15:41:29 +0300
Quoted 2 lines
OK. Since it blocks the ability to add SR-IOV support, is it acceptable to submit it as constant enabled for PF and disabled for VF (SR-IOV)?
You're not describing to me why you guys are turning on features like the CNIC mode before you necessarily have any users of that feature.
Why can't you turn CNIC off at the start, and if a CNIC user actually arrives and is activated, reset the entire chip and put it into CNIC mode?
And if CNIC being on is such a latency killer, why in the world haven't you done things more reasonably like that from the very beginning?
Why are you making it so that lower latency with your chips is only available to a group of users who are effectively statistically insignificant?
Quoted 8 lines · David Miller
From: "Eilon Greenstein" <[email protected]>
Date: Tue, 10 Jul 2012 15:41:29 +0300Quoted 2 lines
OK. Since it blocks the ability to add SR-IOV support, is it acceptable to submit it as constant enabled for PF and disabled for VF (SR-IOV)?
You're not describing to me why you guys are turning on features like the CNIC mode before you necessarily have any users of that feature.
The chips controlled by the bnx2x have shared HW - there is more than one port using the same HW. So changing shared HW configuration affects more than one interface and therefore should not be done in runtime - one of the requirements is that operations on one interface will not affect any other interface.
Quoted 3 lines
Why can't you turn CNIC off at the start, and if a CNIC user actually arrives and is activated, reset the entire chip and put it into CNIC mode?
Since the CNIC mode should not change under traffic, and since it is a shared HW attribute, we need to consider a scenario on which one interface is loaded and running in L2 only mode, and then on another interface the CNIC is required, but enabling it will affect the first interface that is already running.
Quoted 7 lines
And if CNIC being on is such a latency killer, why in the world haven't you done things more reasonably like that from the very beginning?
Why are you making it so that lower latency with your chips is only available to a group of users who are effectively statistically insignificant?
The chip latency is advertised with the CNIC support for customers. However, some of them have full control over the environment and do not care about offloaded storage and they were able to optimize it by removing the CNIC completely. This is somewhat similar to customers that do not want the other port and we tweak the device nvram to completely shutdown one port and by that save some power - most customers that use only one port cannot benefit from this additional power saving of completely disabling that port. Most of our customers are OEM that sells machines that might run Linux, and they want to allow users to use iSCSI and FCoE - and we are not enabling this extra optimization for those - simply because the HW was designed to be a converged NIC and this L2 only optimization was added later for those special cases.
This patch is removing the ifdefs from all over the bnx2x and placing the equivalent ifdef about the Kconfig in one location - this will allow adding support for the SR-IOV that cannot support the CNIC alongside with PF that does support it.
David Miller
maintainerFrom: "Eilon Greenstein" <[email protected]>
Date: Tue, 10 Jul 2012 17:38:05 +0300
Quoted 10 lines · David Miller
Quoted 3 lines
Why can't you turn CNIC off at the start, and if a CNIC user actually arrives and is activated, reset the entire chip and put it into CNIC mode?
Since the CNIC mode should not change under traffic, and since it is a shared HW attribute, we need to consider a scenario on which one interface is loaded and running in L2 only mode, and then on another interface the CNIC is required, but enabling it will affect the first interface that is already running.
If CNIC is off, the only effect for other users of the chips is perhaps some dropped packets. This is acceptable.
That is why I said you should only go from CNIC off to CNIC on, and never the other way around.
I have yet to see a justification why you cannot implement this properly, and my patience is completely exhausted on this issue.