MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cxgbe_write_rss

Function cxgbe_write_rss

dpdk/drivers/net/cxgbe/cxgbe_main.c:1870–1893  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1868 * packets to the Rx queues in @queues.
1869 */
1870int cxgbe_write_rss(const struct port_info *pi, const u16 *queues)
1871{
1872 u16 *rss;
1873 int i, err;
1874 struct adapter *adapter = pi->adapter;
1875 const struct sge_eth_rxq *rxq;
1876
1877 /* Should never be called before setting up sge eth rx queues */
1878 BUG_ON(!(adapter->flags & FULL_INIT_DONE));
1879
1880 rxq = &adapter->sge.ethrxq[pi->first_rxqset];
1881 rss = rte_zmalloc(NULL, pi->rss_size * sizeof(u16), 0);
1882 if (!rss)
1883 return -ENOMEM;
1884
1885 /* map the queue indices to queue ids */
1886 for (i = 0; i < pi->rss_size; i++, queues++)
1887 rss[i] = rxq[*queues].rspq.abs_id;
1888
1889 err = t4_config_rss_range(adapter, adapter->pf, pi->viid, 0,
1890 pi->rss_size, rss, pi->rss_size);
1891 rte_free(rss);
1892 return err;
1893}
1894
1895/**
1896 * setup_rss - configure RSS

Callers 2

cxgbe_setup_rssFunction · 0.85

Calls 3

rte_zmallocFunction · 0.85
t4_config_rss_rangeFunction · 0.85
rte_freeFunction · 0.85

Tested by

no test coverage detected