src/dpdk/drivers/net/hinic/hinic_pmd_ethdev.c
static int hinic_rss_indirtbl_query(struct rte_eth_dev *dev,
			     struct rte_eth_rss_reta_entry64 *reta_conf,
			     uint16_t reta_size)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	u8 tmpl_idx = nic_dev->rss_tmpl_idx;
	int err = 0;
	u32 indirtbl[NIC_RSS_INDIR_SIZE] = {0};
	u16 idx, shift;
	u16 i = 0;

	if (reta_size != NIC_RSS_INDIR_SIZE) {
		PMD_DRV_LOG(ERR, "Invalid reta size, reta_size: %d", reta_size);
		return HINIC_ERROR;
	}

	err = hinic_rss_get_indir_tbl(nic_dev->hwdev, tmpl_idx, indirtbl);
	if (err) {
		PMD_DRV_LOG(ERR, "Get rss indirect table failed, error: %d",
			    err);
		return err;
	}

	for (i = 0; i < reta_size; i++) {
		idx = i / RTE_RETA_GROUP_SIZE;
		shift = i % RTE_RETA_GROUP_SIZE;
		if (reta_conf[idx].mask & (1ULL << shift))
			reta_conf[idx].reta[shift] = (uint16_t)indirtbl[i];
	}

	return HINIC_OK;
}
/**
 * DPDK callback to get the RSS indirection table.
 *
 * @param dev
 *   Pointer to Ethernet device structure.
 * @param reta_conf
 *   Pointer to RSS reta configuration data.
 * @param reta_size
 *   Size of the RETA table.
 *
 * @return
 *   0 on success, negative error value otherwise.
 */
DPDK callback to get the RSS indirection table.
@param dev
Pointer to Ethernet device structure.
@param reta_conf
Pointer to RSS reta configuration data.
@param reta_size
Size of the RETA table.

@return
0 on success, negative error value otherwise.
DPDK callback to get the RSS indirection table . @param dev Pointer to Ethernet device structure . @param reta_conf Pointer to RSS reta configuration data . @param reta_size Size of the RETA table . @return 0 on success negative error value otherwise .
static int hinic_rss_indirtbl_query(struct rte_eth_dev *dev,
			     struct rte_eth_rss_reta_entry64 *reta_conf,
			     uint16_t reta_size)
{
	struct hinic_nic_dev *nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV(dev);
	u8 tmpl_idx = nic_dev->rss_tmpl_idx;
	int err = 0;
	u32 indirtbl[NIC_RSS_INDIR_SIZE] = {0};
	u16 idx, shift;
	u16 i = 0;
	if (reta_size != NIC_RSS_INDIR_SIZE) {
		PMD_DRV_LOG(ERR, "Invalid reta size, reta_size: %d", reta_size);
		return HINIC_ERROR;
	}
	err = hinic_rss_get_indir_tbl(nic_dev->hwdev, tmpl_idx, indirtbl);
	if (err) {
		PMD_DRV_LOG(ERR, "Get rss indirect table failed, error: %d",
			    err);
		return err;
	}
	for (i = 0; i < reta_size; i++) {
		idx = i / RTE_RETA_GROUP_SIZE;
		shift = i % RTE_RETA_GROUP_SIZE;
		if (reta_conf[idx].mask & (1ULL << shift))
			reta_conf[idx].reta[shift] = (uint16_t)indirtbl[i];
	}
	return HINIC_OK;
}
static int hinic_rss_indirtbl_query ( struct rte_eth_dev * dev , struct rte_eth_rss_reta_entry64 * reta_conf , uint16_t reta_size ) { struct hinic_nic_dev * nic_dev = HINIC_ETH_DEV_TO_PRIVATE_NIC_DEV ( dev ) ; u8 tmpl_idx = nic_dev -> rss_tmpl_idx ; int err = 0 ; u32 indirtbl [ NIC_RSS_INDIR_SIZE ] = { 0 } ; u16 idx , shift ; u16 i = 0 ; if ( reta_size != NIC_RSS_INDIR_SIZE ) { PMD_DRV_LOG ( ERR , " " , reta_size ) ; return HINIC_ERROR ; } err = hinic_rss_get_indir_tbl ( nic_dev -> hwdev , tmpl_idx , indirtbl ) ; if ( err ) { PMD_DRV_LOG ( ERR , " " , err ) ; return err ; } for ( i = 0 ; i < reta_size ; i ++ ) { idx = i / RTE_RETA_GROUP_SIZE ; shift = i % RTE_RETA_GROUP_SIZE ; if ( reta_conf [ idx ] . mask & ( 1ULL << shift ) ) reta_conf [ idx ] . reta [ shift ] = ( uint16_t ) indirtbl [ i ] ; } return HINIC_OK ; }
DPDK callback to get the RSS indirection table.
DPDK callback to get the RSS indirection table .