net/ice: support PPPoE RSS
[dpdk.git] / drivers / net / ice / base / ice_dcb.c
index 008c7a1..b9643b5 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2001-2019
+ * Copyright(c) 2001-2020 Intel Corporation
  */
 
 #include "ice_common.h"
@@ -135,39 +135,6 @@ ice_aq_start_lldp(struct ice_hw *hw, bool persist, struct ice_sq_cd *cd)
        return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
 }
 
-/**
- * ice_aq_set_lldp_mib - Set the LLDP MIB
- * @hw: pointer to the HW struct
- * @mib_type: Local, Remote or both Local and Remote MIBs
- * @buf: pointer to the caller-supplied buffer to store the MIB block
- * @buf_size: size of the buffer (in bytes)
- * @cd: pointer to command details structure or NULL
- *
- * Set the LLDP MIB. (0x0A08)
- */
-enum ice_status
-ice_aq_set_lldp_mib(struct ice_hw *hw, u8 mib_type, void *buf, u16 buf_size,
-                   struct ice_sq_cd *cd)
-{
-       struct ice_aqc_lldp_set_local_mib *cmd;
-       struct ice_aq_desc desc;
-
-       cmd = &desc.params.lldp_set_mib;
-
-       if (buf_size == 0 || !buf)
-               return ICE_ERR_PARAM;
-
-       ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_lldp_set_local_mib);
-
-       desc.flags |= CPU_TO_LE16((u16)ICE_AQ_FLAG_RD);
-       desc.datalen = CPU_TO_LE16(buf_size);
-
-       cmd->type = mib_type;
-       cmd->length = CPU_TO_LE16(buf_size);
-
-       return ice_aq_send_cmd(hw, &desc, buf, buf_size, cd);
-}
-
 /**
  * ice_get_dcbx_status
  * @hw: pointer to the HW struct
@@ -445,9 +412,15 @@ ice_parse_cee_pgcfg_tlv(struct ice_cee_feat_tlv *tlv,
         *        |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
         *        ---------------------------------
         */
-       ice_for_each_traffic_class(i)
+       ice_for_each_traffic_class(i) {
                etscfg->tcbwtable[i] = buf[offset++];
 
+               if (etscfg->prio_table[i] == ICE_CEE_PGID_STRICT)
+                       dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_STRICT;
+               else
+                       dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_ETS;
+       }
+
        /* Number of TCs supported (1 octet) */
        etscfg->maxtcs = buf[offset];
 }
@@ -625,8 +598,7 @@ ice_parse_org_tlv(struct ice_lldp_org_tlv *tlv, struct ice_dcbx_cfg *dcbcfg)
  *
  * Parse DCB configuration from the LLDPDU
  */
-enum ice_status
-ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
+enum ice_status ice_lldp_to_dcb_cfg(u8 *lldpmib, struct ice_dcbx_cfg *dcbcfg)
 {
        struct ice_lldp_org_tlv *tlv;
        enum ice_status ret = ICE_SUCCESS;
@@ -960,9 +932,9 @@ enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change)
            pi->dcbx_status == ICE_DCBX_STATUS_NOT_STARTED) {
                /* Get current DCBX configuration */
                ret = ice_get_dcb_cfg(pi);
-               pi->is_sw_lldp = (hw->adminq.sq_last_status == ICE_AQ_RC_EPERM);
                if (ret)
                        return ret;
+               pi->is_sw_lldp = false;
        } else if (pi->dcbx_status == ICE_DCBX_STATUS_DIS) {
                return ICE_ERR_NOT_READY;
        }
@@ -970,8 +942,8 @@ enum ice_status ice_init_dcb(struct ice_hw *hw, bool enable_mib_change)
        /* Configure the LLDP MIB change event */
        if (enable_mib_change) {
                ret = ice_aq_cfg_lldp_mib_change(hw, true, NULL);
-               if (!ret)
-                       pi->is_sw_lldp = false;
+               if (ret)
+                       pi->is_sw_lldp = true;
        }
 
        return ret;
@@ -1317,13 +1289,13 @@ enum ice_status ice_set_dcb_cfg(struct ice_port_info *pi)
 }
 
 /**
- * ice_aq_query_port_ets - query port ets configuration
+ * ice_aq_query_port_ets - query port ETS configuration
  * @pi: port information structure
  * @buf: pointer to buffer
  * @buf_size: buffer size in bytes
  * @cd: pointer to command details structure or NULL
  *
- * query current port ets configuration
+ * query current port ETS configuration
  */
 enum ice_status
 ice_aq_query_port_ets(struct ice_port_info *pi,
@@ -1410,13 +1382,13 @@ ice_update_port_tc_tree_cfg(struct ice_port_info *pi,
 }
 
 /**
- * ice_query_port_ets - query port ets configuration
+ * ice_query_port_ets - query port ETS configuration
  * @pi: port information structure
  * @buf: pointer to buffer
  * @buf_size: buffer size in bytes
  * @cd: pointer to command details structure or NULL
  *
- * query current port ets configuration and update the
+ * query current port ETS configuration and update the
  * SW DB with the TC changes
  */
 enum ice_status