Hi Ferruh, I didn't do it this way since I don't want it to unregister in case it was the second device for example and it failed to prob. Which means only the first probed tap and the last removed tap will handle this registration and deregistration.
Kindest regards, Raslan Darawsheh > -----Original Message----- > From: Ferruh Yigit <ferruh.yi...@intel.com> > Sent: Thursday, October 11, 2018 7:33 PM > To: Raslan Darawsheh <rasl...@mellanox.com>; keith.wi...@intel.com > Cc: Thomas Monjalon <tho...@monjalon.net>; dev@dpdk.org; Shahaf > Shuler <shah...@mellanox.com>; Ori Kam <or...@mellanox.com> > Subject: Re: [PATCH v6 3/3] net/tap: allow secondary process to access > primary device queues > > On 10/10/2018 3:39 PM, Raslan Darawsheh wrote: > > @@ -2082,6 +2214,14 @@ rte_pmd_tap_probe(struct rte_vdev_device > *dev) > > TAP_LOG(NOTICE, "Initializing pmd_tap for %s as %s", > > name, tap_name); > > > > + /* Register IPC feed callback */ > > + ret = rte_mp_action_register(TAP_MP_KEY, tap_mp_sync_queues); > > + if (ret < 0 && rte_errno != EEXIST && tap_devices_count) { > > + TAP_LOG(ERR, "%s: Failed to register IPC callback: %s", > > + tuntap_name, strerror(rte_errno)); > > + goto leave; > > + } > > + tap_devices_count++; > > ret = eth_dev_tap_create(dev, tap_name, remote_iface, > &user_mac, > > ETH_TUNTAP_TYPE_TAP); > > Why not rely on "tap_devices_count" but call rte_mp_action_register() > every time and try to figure out status from ret? > > if (tap_devices_count == 0) { > ret = rte_mp_action_register(TAP_MP_KEY, tap_mp_sync_queues); > if (ret < 0) { > TAP_LOG(); > goto leave; > } > } > tap_devices_count++;