From: Yanglong Wu Date: Thu, 8 Feb 2018 04:59:53 +0000 (+0800) Subject: net/i40e: revert enhancing loopback AQ command X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=5712e640708984f56a888dc5a27d30c64d2c0b8e;p=dpdk.git net/i40e: revert enhancing loopback AQ command This reverts commit 7b7711bea5f4 ("net/i40e/base: enhance loopback AQ command"). It was to support multiple type of loopbacks, which results to configuration error about adminq. So revert it as agreed. Fixes: 7b7711bea5f4 ("net/i40e/base: enhance loopback AQ command") Signed-off-by: Yanglong Wu Acked-by: Qi Zhang --- diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index bbf094add3..801c0ff1be 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -2130,28 +2130,11 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_an_advt_reg); /* Set Loopback mode (0x0618) */ struct i40e_aqc_set_lb_mode { - u8 lb_level; -#define I40E_AQ_LB_NONE 0 -#define I40E_AQ_LB_MAC 1 -#define I40E_AQ_LB_SERDES 2 -#define I40E_AQ_LB_PHY_INT 3 -#define I40E_AQ_LB_PHY_EXT 4 -#define I40E_AQ_LB_CPVL_PCS 5 -#define I40E_AQ_LB_CPVL_EXT 6 + __le16 lb_mode; #define I40E_AQ_LB_PHY_LOCAL 0x01 #define I40E_AQ_LB_PHY_REMOTE 0x02 #define I40E_AQ_LB_MAC_LOCAL 0x04 - u8 lb_type; -#define I40E_AQ_LB_LOCAL 0 -#define I40E_AQ_LB_FAR 0x01 - u8 speed; -#define I40E_AQ_LB_SPEED_NONE 0 -#define I40E_AQ_LB_SPEED_1G 1 -#define I40E_AQ_LB_SPEED_10G 2 -#define I40E_AQ_LB_SPEED_40G 3 -#define I40E_AQ_LB_SPEED_20G 4 - u8 force_speed; - u8 reserved[12]; + u8 reserved[14]; }; I40E_CHECK_CMD_LENGTH(i40e_aqc_set_lb_mode); diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 6c65a32360..e0a5be14c5 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -2172,9 +2172,9 @@ aq_get_partner_advt_exit: * * Sets loopback modes. **/ -enum i40e_status_code -i40e_aq_set_lb_modes(struct i40e_hw *hw, u8 lb_level, u8 lb_type, u8 speed, - struct i40e_asq_cmd_details *cmd_details) +enum i40e_status_code i40e_aq_set_lb_modes(struct i40e_hw *hw, + u16 lb_modes, + struct i40e_asq_cmd_details *cmd_details) { struct i40e_aq_desc desc; struct i40e_aqc_set_lb_mode *cmd = @@ -2184,11 +2184,7 @@ i40e_aq_set_lb_modes(struct i40e_hw *hw, u8 lb_level, u8 lb_type, u8 speed, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_lb_modes); - cmd->lb_level = lb_level; - cmd->lb_type = lb_type; - cmd->speed = speed; - if (speed) - cmd->force_speed = 1; + cmd->lb_mode = CPU_TO_LE16(lb_modes); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); diff --git a/drivers/net/i40e/base/i40e_diag.c b/drivers/net/i40e/base/i40e_diag.c index 0efa59de3d..c3c76a0c82 100644 --- a/drivers/net/i40e/base/i40e_diag.c +++ b/drivers/net/i40e/base/i40e_diag.c @@ -45,21 +45,8 @@ enum i40e_status_code i40e_diag_set_loopback(struct i40e_hw *hw, enum i40e_lb_mode mode) { enum i40e_status_code ret_code = I40E_SUCCESS; - u8 speed = I40E_AQ_LB_SPEED_10G; - u8 level = 0; - u8 type = 0; - - if (mode == I40E_LB_MODE_PHY_LOCAL) { - level = I40E_AQ_LB_PHY_INT; - type = I40E_AQ_LB_LOCAL; - } else if (mode == I40E_LB_MODE_PHY_REMOTE) { - level = I40E_AQ_LB_PHY_INT; - type = I40E_AQ_LB_FAR; - } else if (mode == I40E_LB_MODE_MAC_LOCAL) { - level = I40E_AQ_LB_MAC; - type = I40E_AQ_LB_LOCAL; - } - if (i40e_aq_set_lb_modes(hw, level, type, speed, NULL)) + + if (i40e_aq_set_lb_modes(hw, mode, NULL)) ret_code = I40E_ERR_DIAG_TEST_FAILED; return ret_code; diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h index 1edfb2d182..c6ec2d7695 100644 --- a/drivers/net/i40e/base/i40e_prototype.h +++ b/drivers/net/i40e/base/i40e_prototype.h @@ -142,9 +142,8 @@ enum i40e_status_code i40e_aq_get_local_advt_reg(struct i40e_hw *hw, enum i40e_status_code i40e_aq_get_partner_advt(struct i40e_hw *hw, u64 *advt_reg, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code -i40e_aq_set_lb_modes(struct i40e_hw *hw, u8 lb_level, u8 lb_type, u8 speed, - struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_set_lb_modes(struct i40e_hw *hw, u16 lb_modes, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_clear_pxe_mode(struct i40e_hw *hw, struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_set_link_restart_an(struct i40e_hw *hw, diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 06b0f03a1e..65a4b7ad74 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -33,7 +33,6 @@ #include "base/i40e_type.h" #include "base/i40e_register.h" #include "base/i40e_dcb.h" -#include "base/i40e_diag.h" #include "i40e_ethdev.h" #include "i40e_rxtx.h" #include "i40e_pf.h" @@ -2097,7 +2096,6 @@ i40e_dev_start(struct rte_eth_dev *dev) /* Enable all queues which have been configured */ ret = i40e_dev_switch_queues(pf, TRUE); - if (ret != I40E_SUCCESS) { PMD_DRV_LOG(ERR, "Failed to enable VSI"); goto err_up; @@ -2127,7 +2125,7 @@ i40e_dev_start(struct rte_eth_dev *dev) /* Enable mac loopback mode */ if (dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_MODE_NONE || dev->data->dev_conf.lpbk_mode == I40E_AQ_LB_PHY_LOCAL) { - ret = i40e_diag_set_loopback(hw, dev->data->dev_conf.lpbk_mode); + ret = i40e_aq_set_lb_modes(hw, dev->data->dev_conf.lpbk_mode, NULL); if (ret != I40E_SUCCESS) { PMD_DRV_LOG(ERR, "fail to set loopback link"); goto err_up;