bnxt_en: Restrict a PF in Multi-Host mode from changing port PHY configuration
authorDeepak Khungar <deepak.khungar@broadcom.com>
Sat, 22 Apr 2017 00:11:26 +0000 (20:11 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Apr 2017 17:54:47 +0000 (13:54 -0400)
This change restricts the PF in multi-host mode from setting any port
level PHY configuration.  The settings are controlled by firmware in
Multi-Host mode.

Signed-off-by: Deepak Khungar <deepak.khungar@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c
drivers/net/ethernet/broadcom/bnxt/bnxt.h

index 9130628..b3ba660 100644 (file)
@@ -4482,10 +4482,15 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp)
                vf->vlan = le16_to_cpu(resp->vlan) & VLAN_VID_MASK;
        }
 #endif
-       if (BNXT_PF(bp) && (le16_to_cpu(resp->flags) &
-                           (FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED |
-                            FUNC_QCFG_RESP_FLAGS_FW_LLDP_AGENT_ENABLED)))
-               bp->flags |= BNXT_FLAG_FW_LLDP_AGENT;
+       if (BNXT_PF(bp)) {
+               u16 flags = le16_to_cpu(resp->flags);
+
+               if (flags & (FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED |
+                            FUNC_QCFG_RESP_FLAGS_FW_LLDP_AGENT_ENABLED))
+                       bp->flags |= BNXT_FLAG_FW_LLDP_AGENT;
+               if (flags & FUNC_QCFG_RESP_FLAGS_MULTI_HOST)
+                       bp->flags |= BNXT_FLAG_MULTI_HOST;
+       }
 
        switch (resp->port_partition_type) {
        case FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0:
index 25fef61..3ef42db 100644 (file)
@@ -1005,6 +1005,7 @@ struct bnxt {
        #define BNXT_FLAG_NO_AGG_RINGS  0x20000
        #define BNXT_FLAG_RX_PAGE_MODE  0x40000
        #define BNXT_FLAG_FW_LLDP_AGENT 0x80000
+       #define BNXT_FLAG_MULTI_HOST    0x100000
        #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
 
        #define BNXT_FLAG_ALL_CONFIG_FEATS (BNXT_FLAG_TPA |             \
@@ -1014,7 +1015,8 @@ struct bnxt {
 #define BNXT_PF(bp)            (!((bp)->flags & BNXT_FLAG_VF))
 #define BNXT_VF(bp)            ((bp)->flags & BNXT_FLAG_VF)
 #define BNXT_NPAR(bp)          ((bp)->port_partition_type)
-#define BNXT_SINGLE_PF(bp)     (BNXT_PF(bp) && !BNXT_NPAR(bp))
+#define BNXT_MH(bp)            ((bp)->flags & BNXT_FLAG_MULTI_HOST)
+#define BNXT_SINGLE_PF(bp)     (BNXT_PF(bp) && !BNXT_NPAR(bp) && !BNXT_MH(bp))
 #define BNXT_CHIP_TYPE_NITRO_A0(bp) ((bp)->flags & BNXT_FLAG_CHIP_NITRO_A0)
 #define BNXT_RX_PAGE_MODE(bp)  ((bp)->flags & BNXT_FLAG_RX_PAGE_MODE)