I have a multi process application that uses af_packet driver.
From dpdk 19.11 it was changed how the secondary process is configured:
- first change: the second process needs to be started with the same parameters as type primary;
- second change: request info from primary to set up Rx and Tx:
static int
rte_pmd_af_packet_probe(struct rte_vdev_device *dev)
...
if (rte_eal_process_type() == RTE_PROC_SECONDARY) {
eth_dev = rte_eth_dev_attach_secondary(name);
if (!eth_dev) {
PMD_LOG(ERR, "Failed to probe %s", name);
return -1;
}
/* TODO: request info from primary to set up Rx and Tx */
eth_dev->dev_ops = &ops;
eth_dev->device = &dev->device;
rte_eth_dev_probing_finish(eth_dev);
return 0;
}
This eth_dev = rte_eth_dev_attach_secondary(name);
tells me that somehow I need to get:
struct rte_eth_dev {
eth_rx_burst_t rx_pkt_burst; /**< Pointer to PMD receive function. */
eth_tx_burst_t tx_pkt_burst; /**< Pointer to PMD transmit function. */
eth_tx_prep_t tx_pkt_prepare; /**< Pointer to PMD transmit prepare function. */
from the primary process.
Can anyone tell me how to set the device for the secondary process from the primary in dpdk for af_packet driver? Is there any examples in dpdk repo?
Closest answer is here: Dpdk pmd vdev as secondary process I followed it but no success.