net/i40e/base: add AQ command for DCB parameters
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 9 Jan 2018 20:30:08 +0000 (15:30 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 16 Jan 2018 17:47:49 +0000 (18:47 +0100)
Add new Adminq command i40e_aqc_opc_set_dcb_parameters that
helps to get DCB parameters in data structure i40e_aqc_set_dcb_parameters.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
drivers/net/i40e/base/i40e_adminq_cmd.h
drivers/net/i40e/base/i40e_common.c
drivers/net/i40e/base/i40e_prototype.h

index fcfb902..2004b8e 100644 (file)
@@ -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
index 626534a..f085e3a 100644 (file)
@@ -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;
index 9097097..27e73e7 100644 (file)
@@ -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,