src/dpdk/drivers/net/cxgbe/cxgbe_main.c
int cxgbe_write_rss(const struct port_info *pi, const u16 *queues)
{
	u16 *rss;
	int i, err;
	struct adapter *adapter = pi->adapter;
	const struct sge_eth_rxq *rxq;

	/*  Should never be called before setting up sge eth rx queues */
	BUG_ON(!(adapter->flags & FULL_INIT_DONE));

	rxq = &adapter->sge.ethrxq[pi->first_rxqset];
	rss = rte_zmalloc(NULL, pi->rss_size * sizeof(u16), 0);
	if (!rss)
		return -ENOMEM;

	/* map the queue indices to queue ids */
	for (i = 0; i < pi->rss_size; i++, queues++)
		rss[i] = rxq[*queues].rspq.abs_id;

	err = t4_config_rss_range(adapter, adapter->pf, pi->viid, 0,
				  pi->rss_size, rss, pi->rss_size);
	rte_free(rss);
	return err;
}
/**
 * cxgbe_write_rss - write the RSS table for a given port
 * @pi: the port
 * @queues: array of queue indices for RSS
 *
 * Sets up the portion of the HW RSS table for the port's VI to distribute
 * packets to the Rx queues in @queues.
 */
write the RSS table for a given port
@pi: the port
@queues: array of queue indices for RSS

Sets up the portion of the HW RSS table for the port's VI to distribute
packets to the Rx queues in @queues.
write the RSS table for a given port @pi : the port @queues : array of queue indices for RSS Sets up the portion of the HW RSS table for the port ' s VI to distribute packets to the Rx queues in @queues .
int cxgbe_write_rss(const struct port_info *pi, const u16 *queues)
{
	u16 *rss;
	int i, err;
	struct adapter *adapter = pi->adapter;
	const struct sge_eth_rxq *rxq;
	BUG_ON(!(adapter->flags & FULL_INIT_DONE));
	rxq = &adapter->sge.ethrxq[pi->first_rxqset];
	rss = rte_zmalloc(NULL, pi->rss_size * sizeof(u16), 0);
	if (!rss)
		return -ENOMEM;
	for (i = 0; i < pi->rss_size; i++, queues++)
		rss[i] = rxq[*queues].rspq.abs_id;
	err = t4_config_rss_range(adapter, adapter->pf, pi->viid, 0,
				  pi->rss_size, rss, pi->rss_size);
	rte_free(rss);
	return err;
}
int cxgbe_write_rss ( const struct port_info * pi , const u16 * queues ) { u16 * rss ; int i , err ; struct adapter * adapter = pi -> adapter ; const struct sge_eth_rxq * rxq ; BUG_ON ( ! ( adapter -> flags & FULL_INIT_DONE ) ) ; rxq = & adapter -> sge . ethrxq [ pi -> first_rxqset ] ; rss = rte_zmalloc ( NULL , pi -> rss_size * sizeof ( u16 ) , 0 ) ; if ( ! rss ) return - ENOMEM ; for ( i = 0 ; i < pi -> rss_size ; i ++ , queues ++ ) rss [ i ] = rxq [ * queues ] . rspq . abs_id ; err = t4_config_rss_range ( adapter , adapter -> pf , pi -> viid , 0 , pi -> rss_size , rss , pi -> rss_size ) ; rte_free ( rss ) ; return err ; }
cxgbe_write_rss - write the RSS table for a given port
 @pi: the port
 @queues: array of queue indices for RSS
cxgbe_write_rss - write the RSS table for a given port @pi : the port @queues : array of queue indices for RSS
/*  Should never be called before setting up sge eth rx queues */ /* map the queue indices to queue ids */