patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, qiming.yang@intel.com
Cc: dev@dpdk.org, stable@dpdk.org, ferruh.yigit@intel.com,
	junfeng.guo@intel.com, Dave Ertman <david.m.ertman@intel.com>,
	Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Subject: [dpdk-stable] [PATCH v3 3/8] net/ice/base: move LLDP function to common module
Date: Fri, 10 Jul 2020 10:14:07 +0800
Message-ID: <20200710021412.3403562-4-junfeng.guo@intel.com> (raw)
In-Reply-To: <20200710021412.3403562-1-junfeng.guo@intel.com>

From: Qi Zhang <qi.z.zhang@intel.com>

To implement a FW workaround for LFC, a set_local_mib must be
performed after every link up event.  For systems that do not
have DCB configured, we need to move the function
ice_aq_set_lldp_mib() from the DCB specific ice_dcb.c to
ice_common.c so that the driver always has access to this AQ
command.

Signed-off-by: Dave Ertman <david.m.ertman@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_common.c | 33 +++++++++++++++++++++++++++++++
 drivers/net/ice/base/ice_common.h |  3 +++
 drivers/net/ice/base/ice_dcb.c    | 33 -------------------------------
 drivers/net/ice/base/ice_dcb.h    |  3 ---
 4 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index 21044b071..cab81e0fc 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -4557,3 +4557,36 @@ bool ice_is_phy_caps_an_enabled(struct ice_aqc_get_phy_caps_data *caps)
 
 	return false;
 }
+
+/**
+ * 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);
+}
diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h
index cb41497bc..329d0b50f 100644
--- a/drivers/net/ice/base/ice_common.h
+++ b/drivers/net/ice/base/ice_common.h
@@ -220,4 +220,7 @@ void ice_print_rollback_msg(struct ice_hw *hw);
 enum ice_status
 ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,
 		     struct ice_aqc_get_elem *buf);
+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);
 #endif /* _ICE_COMMON_H_ */
diff --git a/drivers/net/ice/base/ice_dcb.c b/drivers/net/ice/base/ice_dcb.c
index 6bdec18c0..b9643b5ce 100644
--- a/drivers/net/ice/base/ice_dcb.c
+++ b/drivers/net/ice/base/ice_dcb.c
@@ -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
diff --git a/drivers/net/ice/base/ice_dcb.h b/drivers/net/ice/base/ice_dcb.h
index 3ffeb864c..83b6e4d8f 100644
--- a/drivers/net/ice/base/ice_dcb.h
+++ b/drivers/net/ice/base/ice_dcb.h
@@ -183,9 +183,6 @@ ice_aq_get_lldp_mib(struct ice_hw *hw, u8 bridge_type, u8 mib_type, void *buf,
 		    u16 buf_size, u16 *local_len, u16 *remote_len,
 		    struct ice_sq_cd *cd);
 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);
-enum ice_status
 ice_aq_get_cee_dcb_cfg(struct ice_hw *hw,
 		       struct ice_aqc_get_cee_dcb_cfg_resp *buff,
 		       struct ice_sq_cd *cd);
-- 
2.25.1


  parent reply	other threads:[~2020-07-10  2:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200701054951.2393-1-qi.z.zhang@intel.com>
2020-07-01  5:49 ` [dpdk-stable] [PATCH v2 1/8] net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist Qi Zhang
2020-07-01  5:49 ` [dpdk-stable] [PATCH v2 7/8] net/ice/base: clear and free XLT entries on reset Qi Zhang
2020-07-10  2:14 ` [dpdk-stable] [PATCH v3 0/8] update base code batch 3 Junfeng Guo
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 1/8] net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist Junfeng Guo
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 2/8] net/ice/base: cleanup some code style Junfeng Guo
2020-07-10  2:14   ` Junfeng Guo [this message]
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 4/8] net/ice/base: clean code in flow director module Junfeng Guo
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 5/8] net/ice/base: add capability list AQ function Junfeng Guo
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 6/8] net/ice/base: split capability parse into separate functions Junfeng Guo
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 7/8] net/ice/base: clear and free XLT entries on reset Junfeng Guo
2020-07-10  2:14   ` [dpdk-stable] [PATCH v3 8/8] net/ice/base: update version Junfeng Guo
2020-07-10  4:05   ` [dpdk-stable] [PATCH v3 0/8] update base code batch 3 Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200710021412.3403562-4-junfeng.guo@intel.com \
    --to=junfeng.guo@intel.com \
    --cc=david.m.ertman@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=paul.m.stillwell.jr@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git