X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Fhns3%2Fhns3_rss.h;h=b5ac8ae2cae52567529c1ee73f6600d0724f7423;hb=0f20acbf5edaeab8e4c9d400e443679d48008569;hp=3c790513295b1657fad1bf47968b39ec0f03d2b9;hpb=920be799dbc3fe27c77c665921d053e33d43e091;p=dpdk.git diff --git a/drivers/net/hns3/hns3_rss.h b/drivers/net/hns3/hns3_rss.h index 3c79051329..b5ac8ae2ca 100644 --- a/drivers/net/hns3/hns3_rss.h +++ b/drivers/net/hns3/hns3_rss.h @@ -17,7 +17,11 @@ ETH_RSS_NONFRAG_IPV6_TCP | \ ETH_RSS_NONFRAG_IPV6_UDP | \ ETH_RSS_NONFRAG_IPV6_SCTP | \ - ETH_RSS_NONFRAG_IPV6_OTHER) + ETH_RSS_NONFRAG_IPV6_OTHER | \ + ETH_RSS_L3_SRC_ONLY | \ + ETH_RSS_L3_DST_ONLY | \ + ETH_RSS_L4_SRC_ONLY | \ + ETH_RSS_L4_DST_ONLY) #define HNS3_RSS_IND_TBL_SIZE 512 /* The size of hash lookup table */ #define HNS3_RSS_KEY_SIZE 40 @@ -27,32 +31,23 @@ #define HNS3_RSS_HASH_ALGO_TOEPLITZ 0 #define HNS3_RSS_HASH_ALGO_SIMPLE 1 +#define HNS3_RSS_HASH_ALGO_SYMMETRIC_TOEP 2 #define HNS3_RSS_HASH_ALGO_MASK 0xf -#define HNS3_RSS_INPUT_TUPLE_OTHER GENMASK(3, 0) -#define HNS3_RSS_INPUT_TUPLE_SCTP GENMASK(4, 0) -#define HNS3_IP_FRAG_BIT_MASK GENMASK(3, 2) -#define HNS3_IP_OTHER_BIT_MASK GENMASK(1, 0) - struct hns3_rss_tuple_cfg { - uint8_t ipv4_tcp_en; /* Bit8.0~8.3 */ - uint8_t ipv4_udp_en; /* Bit9.0~9.3 */ - uint8_t ipv4_sctp_en; /* Bit10.0~10.4 */ - uint8_t ipv4_fragment_en; /* Bit11.0~11.3 */ - uint8_t ipv6_tcp_en; /* Bit12.0~12.3 */ - uint8_t ipv6_udp_en; /* Bit13.0~13.3 */ - uint8_t ipv6_sctp_en; /* Bit14.0~14.4 */ - uint8_t ipv6_fragment_en; /* Bit15.0~15.3 */ + uint64_t rss_tuple_fields; }; #define HNS3_RSS_QUEUES_BUFFER_NUM 64 /* Same as the Max rx/tx queue num */ struct hns3_rss_conf { /* RSS parameters :algorithm, flow_types, key, queue */ struct rte_flow_action_rss conf; + uint8_t hash_algo; /* hash function type definited by hardware */ uint8_t key[HNS3_RSS_KEY_SIZE]; /* Hash key */ struct hns3_rss_tuple_cfg rss_tuple_sets; - uint8_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE]; /* Shadow table */ + uint16_t rss_indirection_tbl[HNS3_RSS_IND_TBL_SIZE]; /* Shadow table */ uint16_t queue[HNS3_RSS_QUEUES_BUFFER_NUM]; /* Queues indices to use */ + bool valid; /* check if RSS rule is valid */ }; #ifndef ilog2 @@ -102,15 +97,15 @@ int hns3_dev_rss_reta_query(struct rte_eth_dev *dev, struct rte_eth_rss_reta_entry64 *reta_conf, uint16_t reta_size); void hns3_set_default_rss_args(struct hns3_hw *hw); -int hns3_set_rss_indir_table(struct hns3_hw *hw, uint8_t *indir, uint16_t size); +int hns3_set_rss_indir_table(struct hns3_hw *hw, uint16_t *indir, + uint16_t size); int hns3_rss_reset_indir_table(struct hns3_hw *hw); int hns3_config_rss(struct hns3_adapter *hns); void hns3_rss_uninit(struct hns3_adapter *hns); int hns3_set_rss_tuple_by_rss_hf(struct hns3_hw *hw, struct hns3_rss_tuple_cfg *tuple, uint64_t rss_hf); -int hns3_set_rss_algo_key(struct hns3_hw *hw, uint8_t hash_algo, - const uint8_t *key); +int hns3_set_rss_algo_key(struct hns3_hw *hw, const uint8_t *key); int hns3_restore_rss_filter(struct rte_eth_dev *dev); #endif /* _HNS3_RSS_H_ */