src/dpdk/drivers/net/nfp/nfp_net.c
static int
nfp_net_reta_query(struct rte_eth_dev *dev,
		   struct rte_eth_rss_reta_entry64 *reta_conf,
		   uint16_t reta_size)
{
	uint8_t i, j, mask;
	int idx, shift;
	uint32_t reta;
	struct nfp_net_hw *hw;

	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);

	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
		return -EINVAL;

	if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) {
		PMD_DRV_LOG(ERR, "The size of hash lookup table configured "
			"(%d) doesn't match the number hardware can supported "
			"(%d)", reta_size, NFP_NET_CFG_RSS_ITBL_SZ);
		return -EINVAL;
	}

	/*
	 * Reading Redirection Table. There are 128 8bit-entries which can be
	 * manage as 32 32bit-entries
	 */
	for (i = 0; i < reta_size; i += 4) {
		/* Handling 4 RSS entries per loop */
		idx = i / RTE_RETA_GROUP_SIZE;
		shift = i % RTE_RETA_GROUP_SIZE;
		mask = (uint8_t)((reta_conf[idx].mask >> shift) & 0xF);

		if (!mask)
			continue;

		reta = nn_cfg_readl(hw, NFP_NET_CFG_RSS_ITBL + (idx * 64) +
				    shift);
		for (j = 0; j < 4; j++) {
			if (!(mask & (0x1 << j)))
				continue;
			reta_conf[idx].reta[shift + j] =
				(uint8_t)((reta >> (8 * j)) & 0xF);
		}
	}
	return 0;
}
/* Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device. */
Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
Query Redirection Table ( RETA ) of Receive Side Scaling of Ethernet device .
static int
nfp_net_reta_query(struct rte_eth_dev *dev,
		   struct rte_eth_rss_reta_entry64 *reta_conf,
		   uint16_t reta_size)
{
	uint8_t i, j, mask;
	int idx, shift;
	uint32_t reta;
	struct nfp_net_hw *hw;
	hw = NFP_NET_DEV_PRIVATE_TO_HW(dev->data->dev_private);
	if (!(hw->ctrl & NFP_NET_CFG_CTRL_RSS))
		return -EINVAL;
	if (reta_size != NFP_NET_CFG_RSS_ITBL_SZ) {
		PMD_DRV_LOG(ERR, "The size of hash lookup table configured "
			"(%d) doesn't match the number hardware can supported "
			"(%d)", reta_size, NFP_NET_CFG_RSS_ITBL_SZ);
		return -EINVAL;
	}
	for (i = 0; i < reta_size; i += 4) {
		idx = i / RTE_RETA_GROUP_SIZE;
		shift = i % RTE_RETA_GROUP_SIZE;
		mask = (uint8_t)((reta_conf[idx].mask >> shift) & 0xF);
		if (!mask)
			continue;
		reta = nn_cfg_readl(hw, NFP_NET_CFG_RSS_ITBL + (idx * 64) +
				    shift);
		for (j = 0; j < 4; j++) {
			if (!(mask & (0x1 << j)))
				continue;
			reta_conf[idx].reta[shift + j] =
				(uint8_t)((reta >> (8 * j)) & 0xF);
		}
	}
	return 0;
}
static int nfp_net_reta_query ( struct rte_eth_dev * dev , struct rte_eth_rss_reta_entry64 * reta_conf , uint16_t reta_size ) { uint8_t i , j , mask ; int idx , shift ; uint32_t reta ; struct nfp_net_hw * hw ; hw = NFP_NET_DEV_PRIVATE_TO_HW ( dev -> data -> dev_private ) ; if ( ! ( hw -> ctrl & NFP_NET_CFG_CTRL_RSS ) ) return - EINVAL ; if ( reta_size != NFP_NET_CFG_RSS_ITBL_SZ ) { PMD_DRV_LOG ( ERR , " " " " " " , reta_size , NFP_NET_CFG_RSS_ITBL_SZ ) ; return - EINVAL ; } for ( i = 0 ; i < reta_size ; i += 4 ) { idx = i / RTE_RETA_GROUP_SIZE ; shift = i % RTE_RETA_GROUP_SIZE ; mask = ( uint8_t ) ( ( reta_conf [ idx ] . mask >> shift ) & 0xF ) ; if ( ! mask ) continue ; reta = nn_cfg_readl ( hw , NFP_NET_CFG_RSS_ITBL + ( idx * 64 ) + shift ) ; for ( j = 0 ; j < 4 ; j ++ ) { if ( ! ( mask & ( 0x1 << j ) ) ) continue ; reta_conf [ idx ] . reta [ shift + j ] = ( uint8_t ) ( ( reta >> ( 8 * j ) ) & 0xF ) ; } } return 0 ; }
Query Redirection Table(RETA) of Receive Side Scaling of Ethernet device.
Query Redirection Table ( RETA ) of Receive Side Scaling of Ethernet device .
/*
	 * Reading Redirection Table. There are 128 8bit-entries which can be
	 * manage as 32 32bit-entries
	 */ /* Handling 4 RSS entries per loop */