X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhns3%2Fhns3_fdir.c;h=896540df78ea4a4db0c284bbbcccd559ad167a60;hb=6ceb7ab83f168fa6b8e90e4bd5a1392de1a48c70;hp=65ab19db767d559bb85f838aa824755b340793a5;hpb=f8e7fcbfd0b8d883343d11a5e621350362ad77ac;p=dpdk.git diff --git a/drivers/net/hns3/hns3_fdir.c b/drivers/net/hns3/hns3_fdir.c index 65ab19db76..896540df78 100644 --- a/drivers/net/hns3/hns3_fdir.c +++ b/drivers/net/hns3/hns3_fdir.c @@ -2,8 +2,7 @@ * Copyright(c) 2018-2019 Hisilicon Limited. */ -#include -#include +#include #include #include #include @@ -46,6 +45,8 @@ #define HNS3_FD_AD_QUEUE_REGION_SIZE_M GENMASK(20, 17) #define HNS3_FD_AD_COUNTER_HIGH_BIT 7 #define HNS3_FD_AD_COUNTER_HIGH_BIT_B 26 +#define HNS3_FD_AD_QUEUE_ID_HIGH_BIT 10 +#define HNS3_FD_AD_QUEUE_ID_HIGH_BIT_B 21 enum HNS3_PORT_TYPE { HOST_PORT, @@ -125,7 +126,6 @@ static const struct key_info tuple_key_info[] = { {INNER_SCTP_TAG, 32}, }; -#define HNS3_BITS_PER_BYTE 8 #define MAX_KEY_LENGTH 400 #define MAX_200B_KEY_LENGTH 200 #define MAX_META_DATA_LENGTH 16 @@ -320,7 +320,7 @@ int hns3_init_fd_config(struct hns3_adapter *hns) hns3_warn(hw, "Unsupported tunnel filter in 4K*200Bit"); break; default: - hns3_err(hw, "Unsupported flow director mode %d", + hns3_err(hw, "Unsupported flow director mode %u", pf->fdir.fd_cfg.fd_mode); return -EOPNOTSUPP; } @@ -438,6 +438,9 @@ static int hns3_fd_ad_config(struct hns3_hw *hw, int loc, /* set extend bit if counter_id is in [128 ~ 255] */ if (action->counter_id & BIT(HNS3_FD_AD_COUNTER_HIGH_BIT)) hns3_set_bit(ad_data, HNS3_FD_AD_COUNTER_HIGH_BIT_B, 1); + /* set extend bit if queue id > 1024 */ + if (action->queue_id & BIT(HNS3_FD_AD_QUEUE_ID_HIGH_BIT)) + hns3_set_bit(ad_data, HNS3_FD_AD_QUEUE_ID_HIGH_BIT_B, 1); ad_data <<= HNS3_FD_AD_DATA_S; hns3_set_bit(ad_data, HNS3_FD_AD_DROP_B, action->drop_packet); if (action->nb_queues == 1) @@ -614,7 +617,7 @@ static bool hns3_fd_convert_tuple(struct hns3_hw *hw, key_conf->mask.ip_proto); break; default: - hns3_warn(hw, "not support tuple of (%d)", tuple); + hns3_warn(hw, "not support tuple of (%u)", tuple); break; } return true; @@ -741,14 +744,14 @@ static int hns3_config_key(struct hns3_adapter *hns, ret = hns3_fd_tcam_config(hw, false, rule->location, key_y, true); if (ret) { - hns3_err(hw, "Config fd key_y fail, loc=%d, ret=%d", + hns3_err(hw, "Config fd key_y fail, loc=%u, ret=%d", rule->queue_id, ret); return ret; } ret = hns3_fd_tcam_config(hw, true, rule->location, key_x, true); if (ret) - hns3_err(hw, "Config fd key_x fail, loc=%d, ret=%d", + hns3_err(hw, "Config fd key_x fail, loc=%u, ret=%d", rule->queue_id, ret); return ret; } @@ -962,8 +965,8 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, ret = hns3_fd_tcam_config(hw, true, rule->location, NULL, false); if (ret) - hns3_err(hw, "Failed to delete fdir: %d src_ip:%x " - "dst_ip:%x src_port:%d dst_port:%d ret = %d", + hns3_err(hw, "Failed to delete fdir: %u src_ip:%x " + "dst_ip:%x src_port:%u dst_port:%u ret = %d", rule->location, rule->key_conf.spec.src_ip[IP_ADDR_KEY_ID], rule->key_conf.spec.dst_ip[IP_ADDR_KEY_ID], @@ -1003,8 +1006,8 @@ int hns3_fdir_filter_program(struct hns3_adapter *hns, ret = hns3_config_key(hns, rule); rte_spinlock_unlock(&fdir_info->flows_lock); if (ret) { - hns3_err(hw, "Failed to config fdir: %d src_ip:%x dst_ip:%x " - "src_port:%d dst_port:%d ret = %d", + hns3_err(hw, "Failed to config fdir: %u src_ip:%x dst_ip:%x " + "src_port:%u dst_port:%u ret = %d", rule->location, rule->key_conf.spec.src_ip[IP_ADDR_KEY_ID], rule->key_conf.spec.dst_ip[IP_ADDR_KEY_ID],