net/qede/base: check device personality for feature setting
authorRasesh Mody <rasesh.mody@cavium.com>
Sat, 7 Oct 2017 06:31:07 +0000 (23:31 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Thu, 12 Oct 2017 00:36:58 +0000 (01:36 +0100)
- Add non-L2 personality macros and add a personality check before
  setting the HW features

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore.h
drivers/net/qede/base/ecore_dev.c

index 5eff6aa..eaf2604 100644 (file)
@@ -361,19 +361,23 @@ enum ecore_db_rec_exec {
 struct ecore_hw_info {
        /* PCI personality */
        enum ecore_pci_personality personality;
-#define ECORE_IS_RDMA_PERSONALITY(dev)                     \
-       ((dev)->hw_info.personality == ECORE_PCI_ETH_ROCE ||  \
+#define ECORE_IS_RDMA_PERSONALITY(dev) \
+       ((dev)->hw_info.personality == ECORE_PCI_ETH_ROCE || \
         (dev)->hw_info.personality == ECORE_PCI_ETH_IWARP || \
         (dev)->hw_info.personality == ECORE_PCI_ETH_RDMA)
-#define ECORE_IS_ROCE_PERSONALITY(dev)                    \
+#define ECORE_IS_ROCE_PERSONALITY(dev) \
        ((dev)->hw_info.personality == ECORE_PCI_ETH_ROCE || \
         (dev)->hw_info.personality == ECORE_PCI_ETH_RDMA)
-#define ECORE_IS_IWARP_PERSONALITY(dev)                            \
+#define ECORE_IS_IWARP_PERSONALITY(dev) \
        ((dev)->hw_info.personality == ECORE_PCI_ETH_IWARP || \
         (dev)->hw_info.personality == ECORE_PCI_ETH_RDMA)
-#define ECORE_IS_L2_PERSONALITY(dev)                 \
+#define ECORE_IS_L2_PERSONALITY(dev) \
        ((dev)->hw_info.personality == ECORE_PCI_ETH || \
         ECORE_IS_RDMA_PERSONALITY(dev))
+#define ECORE_IS_FCOE_PERSONALITY(dev) \
+       ((dev)->hw_info.personality == ECORE_PCI_FCOE)
+#define ECORE_IS_ISCSI_PERSONALITY(dev) \
+       ((dev)->hw_info.personality == ECORE_PCI_ISCSI)
 
        /* Resource Allocation scheme results */
        u32 resc_start[ECORE_MAX_RESC];
index 75fcfae..5d9bc28 100644 (file)
@@ -2869,12 +2869,15 @@ static void ecore_hw_set_feat(struct ecore_hwfn *p_hwfn)
                                   FEAT_NUM(p_hwfn, ECORE_VF_L2_QUE));
        }
 
-       feat_num[ECORE_FCOE_CQ] = OSAL_MIN_T(u32, sb_cnt.cnt,
-                                            RESC_NUM(p_hwfn,
-                                                     ECORE_CMDQS_CQS));
-       feat_num[ECORE_ISCSI_CQ] = OSAL_MIN_T(u32, sb_cnt.cnt,
-                                             RESC_NUM(p_hwfn,
-                                                      ECORE_CMDQS_CQS));
+       if (ECORE_IS_FCOE_PERSONALITY(p_hwfn))
+               feat_num[ECORE_FCOE_CQ] =
+                       OSAL_MIN_T(u32, sb_cnt.cnt, RESC_NUM(p_hwfn,
+                                                            ECORE_CMDQS_CQS));
+
+       if (ECORE_IS_ISCSI_PERSONALITY(p_hwfn))
+               feat_num[ECORE_ISCSI_CQ] =
+                       OSAL_MIN_T(u32, sb_cnt.cnt, RESC_NUM(p_hwfn,
+                                                            ECORE_CMDQS_CQS));
 
        DP_VERBOSE(p_hwfn, ECORE_MSG_PROBE,
                   "#PF_L2_QUEUE=%d VF_L2_QUEUES=%d #ROCE_CNQ=%d #FCOE_CQ=%d #ISCSI_CQ=%d #SB=%d\n",