<commit_before>/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2018-2021 HiSilicon Limited.
 */

#include <rte_ethdev.h>
#include <rte_io.h>
#include <rte_malloc.h>

#include "hns3_ethdev.h"
#include "hns3_logs.h"

/*
 * The hash key used for rss initialization.
 */
static const uint8_t hns3_hash_key[] = {
	0x6D, 0x5A, 0x56, 0xDA, 0x25, 0x5B, 0x0E, 0xC2,
	0x41, 0x67, 0x25, 0x3D, 0x43, 0xA3, 0x8F, 0xB0,
	0xD0, 0xCA, 0x2B, 0xCB, 0xAE, 0x7B, 0x30, 0xB4,
	0x77, 0xCB, 0x2D, 0xA3, 0x80, 0x30, 0xF2, 0x0C,
	0x6A, 0x42, 0xB7, 0x3B, 0xBE, 0xAC, 0x01, 0xFA
};

enum hns3_tuple_field {
	/* IPV4_TCP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D = 0,
	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S,
	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D,
	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S,

	/* IPV4_UDP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D = 8,
	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S,
	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D,
	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S,

	/* IPV4_SCTP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D = 16,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER,

	/* IPV4 ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D = 24,
	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S,
	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D,
	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S,

	/* IPV6_TCP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D = 32,
	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S,
	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D,
	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S,

	/* IPV6_UDP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D = 40,
	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S,
	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D,
	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S,

	/* IPV6_SCTP ENABLE FIELD */
	HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_D = 48,
	HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_S,
	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D,
	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S,
	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER,

	/* IPV6 ENABLE FIELD */
	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D = 56,
	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S,
	HNS3_RSS_FIELD_IPV6_FRAG_IP_D,
	HNS3_RSS_FIELD_IPV6_FRAG_IP_S
};

static const struct {
	uint64_t rss_types;
	uint64_t rss_field;
} hns3_set_tuple_table[] = {
	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_SRC_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S) },
	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP | RTE_ETH_RSS_L3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SS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L3_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L4_SRC_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_UDP | RTE_ETH_RSS_L4_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L3_SRC_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L3_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L4_SRC_ONLY,
	  BIT_ULL(HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_S) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_SCTP | RTE_ETH_RSS_L4_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L3_SRC_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_OTHER | RTE_ETH_RSS_L3_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
};

static const struct {
	uint64_t rss_types;
	uint64_t rss_field;
} hns3_set_rss_types[] = {
	{ RTE_ETH_RSS_FRAG_IPV4, BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) |
	  BIT_ULL(HNS3_RSS_FI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_RSS_FRAG_IPV6, BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP, BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S) |<commit_msg>net/hns3: delete duplicated RSS type<commit_after>/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2018-2021 HiSilicon Limited.
 */

#include <rte_ethdev.h>
#include <rte_io.h>
#include <rte_malloc.h>

#include "hns3_ethdev.h"
#include "hns3_logs.h"

/*
 * The hash key used for rss initialization.
 */
static const uint8_t hns3_hash_key[] = {
	0x6D, 0x5A, 0x56, 0xDA, 0x25, 0x5B, 0x0E, 0xC2,
	0x41, 0x67, 0x25, 0x3D, 0x43, 0xA3, 0x8F, 0xB0,
	0xD0, 0xCA, 0x2B, 0xCB, 0xAE, 0x7B, 0x30, 0xB4,
	0x77, 0xCB, 0x2D, 0xA3, 0x80, 0x30, 0xF2, 0x0C,
	0x6A, 0x42, 0xB7, 0x3B, 0xBE, 0xAC, 0x01, 0xFA
};

enum hns3_tuple_field {
	/* IPV4_TCP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D = 0,
	HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S,
	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D,
	HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S,

	/* IPV4_UDP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D = 8,
	HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S,
	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D,
	HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S,

	/* IPV4_SCTP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D = 16,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S,
	HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER,

	/* IPV4 ENABLE FIELD */
	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D = 24,
	HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S,
	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D,
	HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S,

	/* IPV6_TCP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_D = 32,
	HNS3_RSS_FIELD_IPV6_TCP_EN_TCP_S,
	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_D,
	HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S,

	/* IPV6_UDP ENABLE FIELD */
	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_D = 40,
	HNS3_RSS_FIELD_IPV6_UDP_EN_UDP_S,
	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_D,
	HNS3_RSS_FIELD_IPV6_UDP_EN_IP_S,

	/* IPV6_SCTP ENABLE FIELD */
	HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_D = 48,
	HNS3_RSS_FILED_IPV6_SCTP_EN_SCTP_S,
	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_D,
	HNS3_RSS_FIELD_IPV6_SCTP_EN_IP_S,
	HNS3_RSS_FIELD_IPV6_SCTP_EN_SCTP_VER,

	/* IPV6 ENABLE FIELD */
	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D = 56,
	HNS3_RSS_FIELD_IPV6_NONFRAG_IP_S,
	HNS3_RSS_FIELD_IPV6_FRAG_IP_D,
	HNS3_RSS_FIELD_IPV6_FRAG_IP_S
};

static const struct {
	uint64_t rss_types;
	uint64_t rss_field;
} hns3_set_tuple_table[] = {
	{ RTE_ETH_RSS_FRAG_IPV4 | RTE_ETH_RSS_L3_SRC_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_DST_ONLY,
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_NONFRAG_IP_D) },
};

static const struct {
	uint64_t rss_types;
	uint64_t rss_field;
} hns3_set_rss_types[] = {
	{ RTE_ETH_RSS_FRAG_IPV4, BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_D) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_FRAG_IP_S) },
	{ RTE_ETH_RSS_NONFRAG_IPV4_TCP, BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_IP_D) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_TCP_EN_TCP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV4_UDP, BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_IP_D) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_UDP_EN_UDP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV4_SCTP, BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_IP_D) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_D) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_SCTP_EN_SCTP_VER) },
	{ RTE_ETH_RSS_NONFRAG_IPV4_OTHER,
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV4_EN_NONFRAG_IP_D) },
	{ RTE_ETH_RSS_FRAG_IPV6, BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_S) |
	  BIT_ULL(HNS3_RSS_FIELD_IPV6_FRAG_IP_D) },
	{ RTE_ETH_RSS_NONFRAG_IPV6_TCP, BIT_ULL(HNS3_RSS_FIELD_IPV6_TCP_EN_IP_S) |
{'fraction_non_alphanumeric': 0.07122281434538384, 'fraction_numerical': 0.05444332421143598, 'mean_word_length': 8.511643835616438, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5802271', 'n_tokens_mistral': 8810, 'n_tokens_neox': 8309, 'n_words': 559}