DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: beilei.xing@intel.com
Cc: dev@dpdk.org, jingjing.wu@intel.com, Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH 10/25] net/i40e/base: add AQ command for DCB parameters
Date: Sun,  7 Jan 2018 22:43:20 -0500	[thread overview]
Message-ID: <1515383015-28042-11-git-send-email-qi.z.zhang@intel.com> (raw)
In-Reply-To: <1515383015-28042-1-git-send-email-qi.z.zhang@intel.com>

Add new Adminq command i40e_aqc_opc_set_dcb_parameters that
help to get DCB parameters in data structure i40e_aqc_set_dcb_parameters.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/i40e/base/i40e_adminq_cmd.h | 12 ++++++++++++
 drivers/net/i40e/base/i40e_common.c     | 27 +++++++++++++++++++++++++++
 drivers/net/i40e/base/i40e_prototype.h  |  4 ++++
 3 files changed, 43 insertions(+)

diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h
index fcfb90253..2004b8e19 100644
--- a/drivers/net/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
@@ -214,6 +214,7 @@ enum i40e_admin_queue_opc {
 	/* DCB commands */
 	i40e_aqc_opc_dcb_ignore_pfc	= 0x0301,
 	i40e_aqc_opc_dcb_updated	= 0x0302,
+	i40e_aqc_opc_set_dcb_parameters = 0x0303,
 
 	/* TX scheduler */
 	i40e_aqc_opc_configure_vsi_bw_limit		= 0x0400,
@@ -2457,6 +2458,17 @@ struct i40e_aqc_lldp_start {
 
 I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_start);
 
+/* Set DCB (direct 0x0303) */
+struct i40e_aqc_set_dcb_parameters {
+	u8 command;
+#define I40E_AQ_DCB_SET_AGENT	0x1
+#define I40E_DCB_VALID		0x1
+	u8 valid_flags;
+	u8 reserved[14];
+};
+
+I40E_CHECK_CMD_LENGTH(i40e_aqc_set_dcb_parameters);
+
 /* Get CEE DCBX Oper Config (0x0A07)
  * uses the generic descriptor struct
  * returns below as indirect response
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index 626534a50..f085e3a99 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -4424,7 +4424,34 @@ enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,
 	i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_lldp_start);
 
 	cmd->command = I40E_AQ_LLDP_AGENT_START;
+	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
 
+	return status;
+}
+
+/**
+ * i40e_aq_set_dcb_parameters
+ * @hw: pointer to the hw struct
+ * @cmd_details: pointer to command details structure or NULL
+ * @dcb_enable: True if DCB configuration needs to be applied
+ *
+ **/
+enum i40e_status_code
+i40e_aq_set_dcb_parameters(struct i40e_hw *hw, bool dcb_enable,
+			   struct i40e_asq_cmd_details *cmd_details)
+{
+	struct i40e_aq_desc desc;
+	struct i40e_aqc_set_dcb_parameters *cmd =
+		(struct i40e_aqc_set_dcb_parameters *)&desc.params.raw;
+	enum i40e_status_code status;
+
+	i40e_fill_default_direct_cmd_desc(&desc,
+					  i40e_aqc_opc_set_dcb_parameters);
+
+	if (dcb_enable) {
+		cmd->valid_flags = I40E_DCB_VALID;
+		cmd->command = I40E_AQ_DCB_SET_AGENT;
+	}
 	status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
 
 	return status;
diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h
index 909709784..27e73e70c 100644
--- a/drivers/net/i40e/base/i40e_prototype.h
+++ b/drivers/net/i40e/base/i40e_prototype.h
@@ -290,6 +290,10 @@ enum i40e_status_code i40e_aq_delete_lldp_tlv(struct i40e_hw *hw,
 				struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_stop_lldp(struct i40e_hw *hw, bool shutdown_agent,
 				struct i40e_asq_cmd_details *cmd_details);
+enum i40e_status_code i40e_aq_set_dcb_parameters(struct i40e_hw *hw,
+						 bool dcb_enable,
+						 struct i40e_asq_cmd_details
+						 *cmd_details);
 enum i40e_status_code i40e_aq_start_lldp(struct i40e_hw *hw,
 				struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_get_cee_dcb_config(struct i40e_hw *hw,
-- 
2.14.1

  parent reply	other threads:[~2018-01-08 10:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08  3:43 [dpdk-dev] [PATCH 00/25] net/i40e: update base code Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 01/25] net/i40e/base: add new PHY type Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 02/25] net/i40e/base: add capability macros Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 03/25] net/i40e/base: add (Q)SFP module memory access definitions Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 04/25] net/i40e/base: release spinlock before function returns Qi Zhang
2018-01-09  6:32   ` Xing, Beilei
2018-01-08  3:43 ` [dpdk-dev] [PATCH 05/25] net/i40e/base: retry AQC to overcome IRCRead hangs Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 06/25] net/i40e/base: add byte swaps in PHY register access Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 07/25] net/i40e/base: add macro for 25G device Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 08/25] net/i40e/base: code refactoring for LED blink Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 09/25] net/i40e/base: add link speed convert function Qi Zhang
2018-01-08  3:43 ` Qi Zhang [this message]
2018-01-08  3:43 ` [dpdk-dev] [PATCH 11/25] net/i40e/base: fix NVM lock Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 12/25] net/i40e/base: code clean Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 13/25] net/i40e/base: add NVM update preservation flags Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 14/25] net/i40e/base: enable AQ event get in NVM update Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 15/25] net/i40e/base: fix link LED blink Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 16/25] net/i40e/base: add defines for flat NVM Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 17/25] net/i40e/base: enhanced loopback AQ command Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 18/25] net/i40e/base: add rearrange process " Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 19/25] net/i40e/base: add AQ critical error type Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 20/25] net/i40e/base: fix compile issue for GCC 6.3 Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 21/25] net/i40e/base: code clean Qi Zhang
2018-01-09  6:21   ` Xing, Beilei
2018-01-08  3:43 ` [dpdk-dev] [PATCH 22/25] net/i40e/base: fix reading LLDP configuration Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 23/25] net/i40e/base: fix unaligned data issue Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 24/25] net/i40e: rename a field Qi Zhang
2018-01-08  3:43 ` [dpdk-dev] [PATCH 25/25] net/i40e/base: update README file Qi Zhang

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=1515383015-28042-11-git-send-email-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).