Re: [PATCH] net/enic: fix multi-process operation
From: Thomas Monjalon <hidden>
Date: 2017-09-18 22:25:27
18/09/2017 23:27, Ferruh Yigit:
On 9/11/2017 7:58 PM, John Daley wrote:quoted
- Use rte_malloc() instead of malloc() for the per device 'vdev' structure so that it can be shared across processes. - Only initialize the device if the process type is RTE_PROC_PRIMARY - Only allow the primary process to do queue setup, start/stop, promisc allmulticast, mac add/del, mtu.
[...]
quoted
--- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c@@ -142,6 +142,10 @@ enicpmd_dev_filter_ctrl(struct rte_eth_dev *dev, static void enicpmd_dev_tx_queue_release(void *txq) { ENICPMD_FUNC_TRACE(); + + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return; +Hi John, I am not sure about these updates. Agree that these functions should know process type, but all others PMDs don't do this. Added a few more people for comment, but as far I understand its application responsibility to NOT call these functions if it is secondary process. For device init/uninit, that is part of eal_init() and have to be called both for primary and secondary process and PMD needs to protect it, for other functions application's responsibility.
Yes for now it is the policy. But it is a gray area and it could be clearer with my "ownership proposal": http://dpdk.org/ml/archives/dev/2017-September/074656.html A secondary process could manage the ports it owns. Feel free to comment the proposal.