From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 740BD201 for ; Tue, 31 Jan 2017 16:46:15 +0100 (CET) Received: by mail-wm0-f44.google.com with SMTP id c85so266469707wmi.1 for ; Tue, 31 Jan 2017 07:46:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=6tEOQxVOY7TaJfY+N8LNPu74aJDGuy+8u6x0UVuAfHI=; b=j7CvKSo0kKi+hh/kSPK9wJ/wEVPJgshnBvdjptbGADfP2Zy2Y94/0vQogyu22UKVpA I3+iJuufxIWr8sUVAp6AdwRIksFA4ovKrpxwTBdDuHWEktn5a40vmvoWikHzYij8QmEX EdsmXj/Ur1Sbp26iJFJDh1KOcoNMYUK8eMFGA25vd8SXLWs4At5Qz5SHO5YqNtRV0RD+ TfKE/Brvra4E2WnfjYfXN2eaAqRpJdcNVWT8RkLqzHXj3pclOl05cFPKNUBINxyj9Gi6 LT1DQLNdO1c+Vd4C/fxzCzQDTGlgPgtSYFs1XL/eqj6ZvdnTC0NFgVeoxSkydUa4xw5C FVQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=6tEOQxVOY7TaJfY+N8LNPu74aJDGuy+8u6x0UVuAfHI=; b=rnX+2Y3mZpKQHTYp2Nl7EzmHkd26DTHSfwQt8T2TvmQ57USGMNWsm5M4ILzToWbyPh qdRkMdvTB57ax+jKyzJzRnJtTRM3P4GWph6RrLoHqyZo6Q1WE7TCrI/Ldiy0pzHPvF+K 1EndPi/Or9X8cL/dhN32BwV7pBGYtlSszAK982DUkCa/5Bl3waDSmLWz3WKiLuLNDIbT Pq5kGvbSS/G/tbO78tFjlcVhvI0oycJ7E9UjneHxGNMbIzlhrKWhmYmVoVw/79PnNXL6 o/vCbGGX5AHXvZ1yiFNcHylWTNbspyuxwUZWkf+qES8Ab+g+0TV0EkyzQwEQhz4g/ldR NOLA== X-Gm-Message-State: AIkVDXLSivkJ+nFeZu2QyDCPbBZLIX6ZHSKX5PIVwMqNBpSjklUiP0KZea7AHluo+9NXwPte X-Received: by 10.28.14.65 with SMTP id 62mr19488300wmo.46.1485877574855; Tue, 31 Jan 2017 07:46:14 -0800 (PST) Received: from [10.16.0.184] (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 10sm16553082wmi.23.2017.01.31.07.46.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 07:46:14 -0800 (PST) To: "Wiles, Keith" , "Yigit, Ferruh" References: <1485855778-15496-1-git-send-email-pascal.mazon@6wind.com> <39a46c11-66c4-d8ed-a2bc-d9421cb4afd0@6wind.com> <9fa2c783-349c-e20c-0e57-0c24e67a4683@intel.com> <9C574760-33CF-4163-94D4-A0C919F4592C@intel.com> Cc: "dev@dpdk.org" From: Pascal Mazon Message-ID: Date: Tue, 31 Jan 2017 16:44:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.6.0 MIME-Version: 1.0 In-Reply-To: <9C574760-33CF-4163-94D4-A0C919F4592C@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 1/6] net/tap: use correct tap name X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Jan 2017 15:46:15 -0000 On 01/31/2017 04:44 PM, Wiles, Keith wrote: > >> On Jan 31, 2017, at 9:38 AM, Yigit, Ferruh wrote: >> >> On 1/31/2017 3:30 PM, Pascal Mazon wrote: >>> On 01/31/2017 04:28 PM, Ferruh Yigit wrote: >>>> On 1/31/2017 2:23 PM, Pascal Mazon wrote: >>>>> On 01/31/2017 02:06 PM, Ferruh Yigit wrote:> On 1/31/2017 9:42 AM, >>>>> Pascal Mazon wrote: >>>>>>> dev->data->name contains "net_tap", the device driver name. >>>>>> >>>>>> I see what patch does, just as a note to commit log: >>>>>> >>>>>> AFAIK, "dev->data->name" is device name, and for this case it is >>>>>> "net_tap#", like "net_tap0", "net_tap1" ... >>>>>> >>>>>> "dev->data_drv_name" is the driver name which is "net_tap" >>>>> >>>>> Indeed, dev->data->name is the device name, looking like "net_tap#", >>>>> with number increasing for each vdev. >>>>> I'll put the following commit log line if that's ok: >>>>> >>>>> dev->data->name contains the device name, e.g. "net_tap0". >>>>> >>>>>> >>>>>>> dev->data->dev_private->name contains the actual iface name, >>>>>>> e.g. "dtap0". >>>>>> >>>>>> Right, I agree this is correct comparing "dev->data->name" >>>>>> >>>>>> But the problem is pmd->name is per eth_dev. >>>>>> >>>>>> If I read code correct, for multiple queue support, each queue pair will >>>>>> create a tap device, so each needs a different name. >>>>>> >>>>>> So can't just use pmd->name. Need to create a name per queue pair, it >>>>>> can be combination of pmd->name + "_" + queue_id? Or can keep a name per >>>>>> queue pair, instead of eth_dev. >>>>>> >>>>>> What do you think? >>>>> >>>>> Actually that's not exactly how it goes. >>>>> Adding a queue to a netdevice requires to open("/dev/net/tun") and setting >>>>> TUNSETIFF (through ioctl) on the resulting fd. >>>>> That's the important part: queues for a given tap device must set TUNSETIFF >>>>> with a common ifreq.ifr_name (in our case, pmd->name). >>>>> >>>>> This is best explained in the kernel doc, there: >>>> >>>> Thank you for the clarification. >>>> If so, why PMD keeps a fd per queue? >>>> >>>> Overall, patch looks good except mentioned detail in commit log. >>>> >>>> I suggest waiting Keith's patch, and rebase this set on top of it. >>>> >>>> Thanks, >>>> ferruh >>>> >>>>> >>>>> [1] >>>>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/tuntap.txt#n108 >>>>> >>>> <...> >>>> >>> >>> I would say it is because dev->{r/t}x_pkt_burst() is done per queue. >>> In these functions, we need to make our read() and write() accesses on the >>> right fd considering the queue we're required to process. >> >> If fd is same for all queues, it is possible to keep one instance in pmd >> private_data, and access it from queues. I think it is confusing to have >> multiple copy of it, but I see your point. > > In my changes I removed the fds[] array as it was not required only the rx/tx_queue has an fd variable. Sounds good to me. Ferruh, just to make sure we're on the same page, in multiqueue, there is definitely a different fd for each queue. > >> >>> >>> I'll wait for Keith's patch, then. >> >> Thanks again. >> >>> >>> Best regards, > > Regards, > Keith > -- Pascal Mazon www.6wind.com