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

Function pkt_fwd_shared_rxq_check

dpdk/app/test-pmd/config.c:4630–4676  ·  view source on GitHub ↗

* Check shared rxq configuration. * * Shared group must not being scheduled on different core. */

Source from the content-addressed store, hash-verified

4628 * Shared group must not being scheduled on different core.
4629 */
4630bool
4631pkt_fwd_shared_rxq_check(void)
4632{
4633 streamid_t sm_id;
4634 streamid_t nb_fs_per_lcore;
4635 lcoreid_t nb_fc;
4636 lcoreid_t lc_id;
4637 struct fwd_stream *fs;
4638 uint16_t domain_id;
4639 struct rte_port *port;
4640 struct rte_eth_dev_info *dev_info;
4641 struct rte_eth_rxconf *rxq_conf;
4642
4643 if (rxq_share == 0)
4644 return true;
4645 nb_fc = cur_fwd_config.nb_fwd_lcores;
4646 /*
4647 * Check streams on each core, make sure the same switch domain +
4648 * group + queue doesn't get scheduled on other cores.
4649 */
4650 for (lc_id = 0; lc_id < nb_fc; lc_id++) {
4651 sm_id = fwd_lcores[lc_id]->stream_idx;
4652 nb_fs_per_lcore = fwd_lcores[lc_id]->stream_nb;
4653 for (; sm_id < fwd_lcores[lc_id]->stream_idx + nb_fs_per_lcore;
4654 sm_id++) {
4655 fs = fwd_streams[sm_id];
4656 /* Update lcore info stream being scheduled. */
4657 fs->lcore = fwd_lcores[lc_id];
4658 port = &ports[fs->rx_port];
4659 dev_info = &port->dev_info;
4660 rxq_conf = &port->rxq[fs->rx_queue].conf;
4661 if ((dev_info->dev_capa & RTE_ETH_DEV_CAPA_RXQ_SHARE)
4662 == 0 || rxq_conf->share_group == 0)
4663 /* Not shared rxq. */
4664 continue;
4665 /* Check shared rxq not scheduled on remaining cores. */
4666 domain_id = port->dev_info.switch_info.domain_id;
4667 if (fwd_stream_on_other_lcores(domain_id, lc_id,
4668 fs->rx_port,
4669 fs->rx_queue,
4670 rxq_conf->share_group,
4671 rxq_conf->share_qid))
4672 return false;
4673 }
4674 }
4675 return true;
4676}
4677
4678/*
4679 * Setup forwarding configuration for each logical core.

Callers 1

start_packet_forwardingFunction · 0.85

Calls 1

Tested by 1

start_packet_forwardingFunction · 0.68