BIT(INNER_IP_PROTO) | BIT(INNER_IP_TOS) |
BIT(INNER_SRC_IP) | BIT(INNER_DST_IP) |
BIT(INNER_SRC_PORT) | BIT(INNER_DST_PORT);
+ hns3_dbg(hw, "fdir tuple: inner<vlan_tag1 eth_type ip_src ip_dst "
+ "ip_proto ip_tos l4_src_port l4_dst_port>");
/* If use max 400bit key, we can support tuples for ether type */
if (pf->fdir.fd_cfg.max_key_length == MAX_KEY_LENGTH) {
BIT(OUTER_DST_PORT) | BIT(INNER_VLAN_TAG2) |
BIT(OUTER_TUN_VNI) | BIT(OUTER_TUN_FLOW_ID) |
BIT(OUTER_ETH_TYPE) | BIT(OUTER_IP_PROTO);
+ hns3_dbg(hw, "fdir tuple more: inner<dst_mac src_mac "
+ "vlan_tag2 sctp_tag> outer<eth_type ip_proto "
+ "l4_src_port l4_dst_port tun_vni tun_flow_id>");
}
/* roce_type is used to filter roce frames
*/
key_cfg->meta_data_active = BIT(DST_VPORT) | BIT(TUNNEL_PACKET) |
BIT(VLAN_NUMBER);
+ hns3_dbg(hw, "fdir meta data: dst_vport tunnel_packet vlan_number");
ret = hns3_get_fd_allocation(hw,
&pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1],
if (ret)
return ret;
+ hns3_dbg(hw, "fdir: stage1<rules-%u counters-%u> stage2<rules-%u "
+ "counters=%u>",
+ pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_1],
+ pf->fdir.fd_cfg.cnt_num[HNS3_FD_STAGE_1],
+ pf->fdir.fd_cfg.rule_num[HNS3_FD_STAGE_2],
+ pf->fdir.fd_cfg.cnt_num[HNS3_FD_STAGE_2]);
+
return hns3_set_fd_key_config(hns);
}
struct hns3_fdir_info *fdir_info = &pf->fdir;
struct hns3_fdir_rule_ele *fdir_filter;
struct hns3_hw *hw = &hns->hw;
+ int succ_cnt = 0;
+ int fail_cnt = 0;
int ret = 0;
/* flush flow director */
rte_hash_reset(fdir_info->hash_handle);
+ memset(fdir_info->hash_map, 0,
+ sizeof(struct hns3_fdir_rule_ele *) *
+ fdir_info->fd_cfg.rule_num[HNS3_FD_STAGE_1]);
+
fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list);
while (fdir_filter) {
TAILQ_REMOVE(&fdir_info->fdir_list, fdir_filter, entries);
- ret += hns3_fd_tcam_config(hw, true,
- fdir_filter->fdir_conf.location,
- NULL, false);
+ ret = hns3_fd_tcam_config(hw, true,
+ fdir_filter->fdir_conf.location,
+ NULL, false);
+ if (ret == 0)
+ succ_cnt++;
+ else
+ fail_cnt++;
rte_free(fdir_filter);
fdir_filter = TAILQ_FIRST(&fdir_info->fdir_list);
}
- if (ret) {
- hns3_err(hw, "Fail to delete FDIR filter, ret = %d", ret);
+ if (fail_cnt > 0) {
+ hns3_err(hw, "fail to delete all FDIR filter, success num = %d "
+ "fail num = %d", succ_cnt, fail_cnt);
ret = -EIO;
}
+
return ret;
}