From: Yonglong Liu liuyonglong@huawei.com
driver inclusion category: cleanup bugzilla: NA CVE: NA
----------------------------
Signed-off-by: Yonglong Liu liuyonglong@huawei.com Reviewed-by: Yongxin Li liyongxin1@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 4 +--- .../net/ethernet/hisilicon/hns3/hns3_ethtool.c | 2 +- .../ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h | 1 + .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 15 ++++++++++----- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.h | 1 + .../ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 1 + .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 5 +---- .../ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h | 1 - 8 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 885ff9463097..2f292bb477fa 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -824,7 +824,6 @@ static void hns3_set_outer_l2l3l4(struct sk_buff *skb, u8 ol4_proto, hns3_set_field(*ol_type_vlan_len_msec, HNS3_TXD_OL3T_S, HNS3_OL3T_IPV4_NO_CSUM); - } else if (skb->protocol == htons(ETH_P_IPV6)) { hns3_set_field(*ol_type_vlan_len_msec, HNS3_TXD_OL3T_S, HNS3_OL3T_IPV6); @@ -1260,7 +1259,7 @@ static bool hns3_skb_need_linearized(struct sk_buff *skb, unsigned int *bd_size,
void hns3_shinfo_pack(struct skb_shared_info *shinfo, __u32 *size) { - int i = 0; + int i;
for (i = 0; i < MAX_SKB_FRAGS; i++) size[i] = skb_frag_size(&shinfo->frags[i]); @@ -1276,7 +1275,6 @@ static int hns3_nic_maybe_stop_tx(struct hns3_enet_ring *ring,
bd_num = hns3_tx_bd_num(skb, bd_size); if (unlikely(bd_num > HNS3_MAX_NON_TSO_BD_NUM)) { - if (bd_num <= HNS3_MAX_TSO_BD_NUM && skb_is_gso(skb) && !hns3_skb_need_linearized(skb, bd_size, bd_num)) { trace_hns3_over_8bd(skb); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c index 98db2efd8737..bc92a4eb1e47 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c @@ -964,11 +964,11 @@ static int hns3_set_ringparam(struct net_device *ndev, { struct hns3_nic_priv *priv = netdev_priv(ndev); struct hnae3_handle *h = priv->ae_handle; - struct hns3_enet_ring *tmp_rings; bool if_running = netif_running(ndev); u32 old_tx_desc_num, new_tx_desc_num; u32 old_rx_desc_num, new_rx_desc_num; u16 queue_num = h->kinfo.num_tqps; + struct hns3_enet_ring *tmp_rings; int ret, i;
ret = hns3_check_ringparam(ndev, param); diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h index cf529cfbb2dc..325771326679 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h @@ -795,6 +795,7 @@ struct hclge_vlan_filter_ctrl_cmd { #define HCLGE_VLAN_BYTE_SIZE 8 #define HCLGE_VLAN_OFFSET_BITMAP \ (HCLGE_VLAN_ID_OFFSET_STEP / HCLGE_VLAN_BYTE_SIZE) + struct hclge_vlan_filter_pf_cfg_cmd { u8 vlan_offset; u8 vlan_cfg; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index df746f2b9091..cac278ea1c50 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -1305,9 +1305,11 @@ static void hclge_parse_cfg(struct hclge_cfg *cfg, struct hclge_desc *desc) cfg->speed_ability = hnae3_get_field(__le32_to_cpu(req->param[1]), HCLGE_CFG_SPEED_ABILITY_M, HCLGE_CFG_SPEED_ABILITY_S); + cfg->vlan_mode_sel = hnae3_get_field(__le32_to_cpu(req->param[1]), HCLGE_CFG_VLAN_MODE_M, HCLGE_CFG_VLAN_MODE_S); + cfg->umv_space = hnae3_get_field(__le32_to_cpu(req->param[1]), HCLGE_CFG_UMV_TBL_SPACE_M, HCLGE_CFG_UMV_TBL_SPACE_S); @@ -6595,8 +6597,8 @@ static void hclge_cfg_mac_mode(struct hclge_dev *hdev, bool enable) "mac enable fail, ret =%d.\n", ret); }
-static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid, u8 value, - u8 param_mask) +static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid, + u8 switch_param, u8 param_mask) { struct hclge_mac_vlan_switch_cmd *req; struct hclge_desc desc; @@ -6621,7 +6623,7 @@ static int hclge_config_switch_param(struct hclge_dev *hdev, int vfid, u8 value,
/* modify and write new config parameter */ hclge_cmd_reuse_desc(&desc, false); - req->switch_param = (req->switch_param & param_mask) | value; + req->switch_param = (req->switch_param & param_mask) | switch_param; req->param_mask = param_mask;
ret = hclge_cmd_send(&hdev->hw, &desc, 1); @@ -8310,7 +8312,6 @@ static int hclge_set_vlan_filter_ctrl(struct hclge_dev *hdev, u8 vlan_type,
/* read current vlan filter parameter */ hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_VLAN_FILTER_CTRL, true); - req = (struct hclge_vlan_filter_ctrl_cmd *)desc.data; req->vlan_type = vlan_type; req->vf_id = vf_id; @@ -9034,6 +9035,7 @@ int hclge_en_hw_strip_rxvtag(struct hnae3_handle *handle, bool enable) bool hclge_vf_vlan_need_enable(struct hclge_vport *vport) { #define VLAN_CHECK_START_NUM 1 + struct hclge_dev *hdev = vport->back; u16 vlan_id;
@@ -9101,6 +9103,7 @@ static int hclge_update_vlan_filter_entries(struct hclge_vport *vport, new_info->vlan_tag, false); } + vport->port_base_vlan_cfg.tbl_sta = false;
/* force add vlan 0 */ @@ -9206,6 +9209,7 @@ static u16 hclge_get_port_base_vlan_state(struct hclge_vport *vport, } else { if (!vlan && !qos) return HNAE3_PORT_BASE_VLAN_DISABLE; + if (vport->port_base_vlan_cfg.vlan_info.vlan_tag == vlan && vport->port_base_vlan_cfg.vlan_info.qos == qos) return HNAE3_PORT_BASE_VLAN_NOCHANGE; @@ -9283,7 +9287,7 @@ static void hclge_clear_vf_vlan(struct hclge_dev *hdev) vlan_info->vlan_tag, true); if (ret) dev_err(&hdev->pdev->dev, - "failed to clear vf vlan for vf%d, ret = %d.\n", + "failed to clear vf vlan for vf%d, ret = %d\n", vf - HCLGE_VF_VPORT_START_NUM, ret); } } @@ -11401,6 +11405,7 @@ static void hclge_sync_promisc_mode(struct hclge_dev *hdev) tmp_flags & HNAE3_MPE); if (!ret) { clear_bit(HCLGE_STATE_PROMISC_CHANGED, &hdev->state); + vlan_en = (tmp_flags & HNAE3_USER_UPE) ? false : hclge_vf_vlan_need_enable(vport);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h index 419b6c4acaf8..539bc4f2d20c 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.h @@ -843,6 +843,7 @@ struct hclge_dev { unsigned long fd_bmap[BITS_TO_LONGS(MAX_FD_FILTER_NUM)]; enum HCLGE_FD_ACTIVE_RULE_TYPE fd_active_type; u8 fd_en; + u8 vlan_mode;
u16 wanted_umv_size; diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c index 2f5dae517df9..697cc5704d00 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c @@ -538,6 +538,7 @@ static void hclge_get_vf_media_type(struct hclge_vport *vport, #define HCLGE_VF_MEDIA_TYPE_OFFSET 0 #define HCLGE_VF_MODULE_TYPE_OFFSET 1 #define HCLGE_VF_MEDIA_TYPE_LENGTH 2 + struct hclge_dev *hdev = vport->back;
resp_msg->data[HCLGE_VF_MEDIA_TYPE_OFFSET] = diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 553ceeb3f866..8f07ca1c80e4 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -1661,7 +1661,6 @@ static int hclgevf_reset_tqp(struct hnae3_handle *handle, u16 queue_id)
hclgevf_build_send_msg(&send_msg, HCLGE_MBX_QUEUE_RESET, 0); memcpy(send_msg.data, &queue_id, sizeof(queue_id)); - return hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0); }
@@ -1672,7 +1671,6 @@ static int hclgevf_set_mtu(struct hnae3_handle *handle, int new_mtu)
hclgevf_build_send_msg(&send_msg, HCLGE_MBX_SET_MTU, 0); memcpy(send_msg.data, &new_mtu, sizeof(new_mtu)); - return hclgevf_send_mbx_msg(hdev, &send_msg, true, NULL, 0); }
@@ -2296,6 +2294,7 @@ static enum hclgevf_evt_cause hclgevf_check_evt_cause(struct hclgevf_dev *hdev, dev_info(&hdev->pdev->dev, "vector 0 interrupt from unknown source, cmdq_src = %#x\n", cmdq_stat_reg); + return HCLGEVF_VECTOR0_EVENT_OTHER; }
@@ -2424,7 +2423,6 @@ static void hclgevf_rss_init_cfg(struct hclgevf_dev *hdev)
rss_cfg->hash_algo = HCLGEVF_RSS_HASH_ALGO_TOEPLITZ; rss_cfg->rss_size = hdev->nic.kinfo.rss_size; - tuple_sets = &rss_cfg->rss_tuple_sets; if (hdev->pdev->revision >= 0x21) { rss_cfg->hash_algo = HCLGEVF_RSS_HASH_ALGO_SIMPLE; @@ -2543,7 +2541,6 @@ static int hclgevf_set_alive(struct hnae3_handle *handle, bool alive) hclgevf_build_send_msg(&send_msg, HCLGE_MBX_SET_ALIVE, 0); send_msg.data[0] = alive ? HCLGEVF_STATE_ALIVE : HCLGEVF_STATE_NOT_ALIVE; - return hclgevf_send_mbx_msg(hdev, &send_msg, false, NULL, 0); }
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h index 8396ea21a454..cb24f3144222 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.h @@ -17,7 +17,6 @@ #define HCLGEVF_MISC_VECTOR_NUM 0
#define HCLGEVF_INVALID_VPORT 0xffff - #define HCLGEVF_GENERAL_TASK_INTERVAL 5 #define HCLGEVF_KEEP_ALIVE_TASK_INTERVAL 2