]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ice: configure software LLDP in ice_init_pf_dcb
authorPaul Greenwalt <paul.greenwalt@intel.com>
Wed, 6 Nov 2019 10:05:32 +0000 (02:05 -0800)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Fri, 8 Nov 2019 20:02:50 +0000 (12:02 -0800)
Move software LLDP configuration when FW DCBX is disabled to
ice_init_pf_dcb, since that is where the FW DCBX state is determined.
Remove this software LLDP configuration from ice_vsi_setup and
ice_set_priv_flags. Software configuration includes redirecting Rx LLDP
packets up the stack, when FW DCBX is not running.

Signed-off-by: Paul Greenwalt <paul.greenwalt@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/ice/ice_dcb_lib.c
drivers/net/ethernet/intel/ice/ice_ethtool.c
drivers/net/ethernet/intel/ice/ice_lib.c

index 9448a289363d25753cc0925e2e289614487a7593..1150dbd98d0b3912928f6a6206563b2fedddf510 100644 (file)
@@ -594,6 +594,8 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
                 "DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
                 pf->hw.func_caps.common_cap.maxtc);
        if (err) {
+               struct ice_vsi *pf_vsi;
+
                /* FW LLDP is disabled, activate SW DCBX/LLDP mode */
                dev_info(&pf->pdev->dev,
                         "FW LLDP is disabled, DCBx/LLDP in SW mode.\n");
@@ -606,6 +608,19 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
                        goto dcb_init_err;
                }
 
+               /* If the FW DCBX engine is not running then Rx LLDP packets
+                * need to be redirected up the stack.
+                */
+               pf_vsi = ice_get_main_vsi(pf);
+               if (!pf_vsi) {
+                       dev_err(&pf->pdev->dev,
+                               "Failed to set local DCB config\n");
+                       err = -EIO;
+                       goto dcb_init_err;
+               }
+
+               ice_cfg_sw_lldp(pf_vsi, false, true);
+
                pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
                return 0;
        }
index f85d224f964d98ed963b7534b75756bc85a383d6..1f00091f790633fa8d12113603bca832e7ee9b41 100644 (file)
@@ -1206,11 +1206,6 @@ static int ice_set_priv_flags(struct net_device *netdev, u32 flags)
                        status = ice_init_pf_dcb(pf, true);
                        if (status)
                                dev_warn(&pf->pdev->dev, "Fail to init DCB\n");
-
-                       /* Forward LLDP packets to default VSI so that they
-                        * are passed up the stack
-                        */
-                       ice_cfg_sw_lldp(vsi, false, true);
                } else {
                        enum ice_status status;
                        bool dcbx_agent_status;
index bc37896930f2c69c2b1e259eafa321bafb467fe0..ebcf81edcb19a6c5c63506f922d20103a2b63989 100644 (file)
@@ -1881,23 +1881,17 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
         * out PAUSE or PFC frames. If enabled, FW can still send FC frames.
         * The rule is added once for PF VSI in order to create appropriate
         * recipe, since VSI/VSI list is ignored with drop action...
-        * Also add rules to handle LLDP Tx and Rx packets.  Tx LLDP packets
-        * need to be dropped so that VFs cannot send LLDP packets to reconfig
-        * DCB settings in the HW.  Also, if the FW DCBX engine is not running
-        * then Rx LLDP packets need to be redirected up the stack.
+        * Also add rules to handle LLDP Tx packets.  Tx LLDP packets need to
+        * be dropped so that VFs cannot send LLDP packets to reconfig DCB
+        * settings in the HW.
         */
-       if (!ice_is_safe_mode(pf)) {
+       if (!ice_is_safe_mode(pf))
                if (vsi->type == ICE_VSI_PF) {
                        ice_vsi_add_rem_eth_mac(vsi, true);
 
                        /* Tx LLDP packets */
                        ice_cfg_sw_lldp(vsi, true, true);
-
-                       /* Rx LLDP packets */
-                       if (!test_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags))
-                               ice_cfg_sw_lldp(vsi, false, true);
                }
-       }
 
        return vsi;