From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v6 3/3] net/tap: allow secondary process to access primary device queues Date: Wed, 17 Oct 2018 08:59:25 +0100 Message-ID: References: <1539182356-15496-1-git-send-email-rasland@mellanox.com> <1539182356-15496-3-git-send-email-rasland@mellanox.com> <46e0baeb-d6f4-3044-6ec1-a99442bd5143@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Thomas Monjalon , "dev@dpdk.org" , Shahaf Shuler , Ori Kam To: Raslan Darawsheh , "keith.wiles@intel.com" Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 936926C9B for ; Wed, 17 Oct 2018 09:59:28 +0200 (CEST) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 10/17/2018 7:54 AM, Raslan Darawsheh wrote: > Hi, > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Tuesday, October 16, 2018 2:28 PM >> To: Raslan Darawsheh ; keith.wiles@intel.com >> Cc: Thomas Monjalon ; dev@dpdk.org; Shahaf >> Shuler ; Ori Kam >> Subject: Re: [PATCH v6 3/3] net/tap: allow secondary process to access >> primary device queues >> >> On 10/16/2018 11:06 AM, Raslan Darawsheh wrote: >>> 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. >> >> What I am saying will do the same, only register in the first device probed and >> unregister in the last device. >> >> `tap_devices_count` is already there, why you don't rely on it, but call >> rte_mp_action_register() anyway and rely on it will return EEXIST in second >> and later calls. >> >> Both will work, just I think using `tap_devices_count` is simpler. >> > You are right about probing. > but, not in the closing of the ports, > since any port will try to unregister the first one which will do the unregister will succeed. > meanwhile, I need only the last one to unregister. The unregister done already with `tap_devices_count` checks, all I am suggesting is doing same thing for register part. > >>> >>> Kindest regards, >>> Raslan Darawsheh >>> >>>> -----Original Message----- >>>> From: Ferruh Yigit >>>> Sent: Thursday, October 11, 2018 7:33 PM >>>> To: Raslan Darawsheh ; keith.wiles@intel.com >>>> Cc: Thomas Monjalon ; dev@dpdk.org; Shahaf >>>> Shuler ; Ori Kam >>>> 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++; >>> > > > Kindest regards, > Raslan Darawsheh >