src/dpdk/lib/librte_eventdev/rte_event_eth_rx_adapter.c
static inline uint32_t
rxa_do_softrss(struct rte_mbuf *m, const uint8_t *rss_key_be)
{
	uint32_t input_len;
	void *tuple;
	struct rte_ipv4_tuple ipv4_tuple;
	struct rte_ipv6_tuple ipv6_tuple;
	struct rte_ipv4_hdr *ipv4_hdr;
	struct rte_ipv6_hdr *ipv6_hdr;

	rxa_mtoip(m, &ipv4_hdr, &ipv6_hdr);

	if (ipv4_hdr) {
		ipv4_tuple.src_addr = rte_be_to_cpu_32(ipv4_hdr->src_addr);
		ipv4_tuple.dst_addr = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
		tuple = &ipv4_tuple;
		input_len = RTE_THASH_V4_L3_LEN;
	} else if (ipv6_hdr) {
		rte_thash_load_v6_addrs(ipv6_hdr,
					(union rte_thash_tuple *)&ipv6_tuple);
		tuple = &ipv6_tuple;
		input_len = RTE_THASH_V6_L3_LEN;
	} else
		return 0;

	return rte_softrss_be(tuple, input_len, rss_key_be);
}
/* Calculate RSS hash for IPv4/6 */
Calculate RSS hash for IPv4/6
Calculate RSS hash for IPv4 / 6
static inline uint32_t
rxa_do_softrss(struct rte_mbuf *m, const uint8_t *rss_key_be)
{
	uint32_t input_len;
	void *tuple;
	struct rte_ipv4_tuple ipv4_tuple;
	struct rte_ipv6_tuple ipv6_tuple;
	struct rte_ipv4_hdr *ipv4_hdr;
	struct rte_ipv6_hdr *ipv6_hdr;
	rxa_mtoip(m, &ipv4_hdr, &ipv6_hdr);
	if (ipv4_hdr) {
		ipv4_tuple.src_addr = rte_be_to_cpu_32(ipv4_hdr->src_addr);
		ipv4_tuple.dst_addr = rte_be_to_cpu_32(ipv4_hdr->dst_addr);
		tuple = &ipv4_tuple;
		input_len = RTE_THASH_V4_L3_LEN;
	} else if (ipv6_hdr) {
		rte_thash_load_v6_addrs(ipv6_hdr,
					(union rte_thash_tuple *)&ipv6_tuple);
		tuple = &ipv6_tuple;
		input_len = RTE_THASH_V6_L3_LEN;
	} else
		return 0;
	return rte_softrss_be(tuple, input_len, rss_key_be);
}
static inline uint32_t rxa_do_softrss ( struct rte_mbuf * m , const uint8_t * rss_key_be ) { uint32_t input_len ; void * tuple ; struct rte_ipv4_tuple ipv4_tuple ; struct rte_ipv6_tuple ipv6_tuple ; struct rte_ipv4_hdr * ipv4_hdr ; struct rte_ipv6_hdr * ipv6_hdr ; rxa_mtoip ( m , & ipv4_hdr , & ipv6_hdr ) ; if ( ipv4_hdr ) { ipv4_tuple . src_addr = rte_be_to_cpu_32 ( ipv4_hdr -> src_addr ) ; ipv4_tuple . dst_addr = rte_be_to_cpu_32 ( ipv4_hdr -> dst_addr ) ; tuple = & ipv4_tuple ; input_len = RTE_THASH_V4_L3_LEN ; } else if ( ipv6_hdr ) { rte_thash_load_v6_addrs ( ipv6_hdr , ( union rte_thash_tuple * ) & ipv6_tuple ) ; tuple = & ipv6_tuple ; input_len = RTE_THASH_V6_L3_LEN ; } else return 0 ; return rte_softrss_be ( tuple , input_len , rss_key_be ) ; }
Calculate RSS hash for IPv4/6
Calculate RSS hash for IPv4 / 6