From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 84E6E2BD1 for ; Tue, 31 Jan 2017 15:25:16 +0100 (CET) Received: by mail-wm0-f51.google.com with SMTP id b65so81489890wmf.0 for ; Tue, 31 Jan 2017 06:25:16 -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=kUgiBzh2CqevkIiX/Tgvzv6GeE0GmgbS9Op06z7/bvo=; b=L4MHQQqjW7vJl5mGRK69CgZpU97ciC5hLFVtzL1n0EFITMZWkbeu3VS7ZdQRVmbejo cmNjo7pPtbbtdfRANOsiXzIqceFcZ/BnqSze2Q72VjvWDEbnxjrH35aeecraXivCVuwW JkQAtZMlLSK6x99RaLg8KAP5/lvt3TQCN9Tf2Psn1OQUI01tSbuoziPR2lwUXCYbqHJh oQa+rB8talR+M9kROLMUqIGZdWeufseaXygcJd4zW77z6v6gcn/j1bH97fRK36QmZfLx fKExpvrBbmIIOsMTWsKy2OksPU9+RfsxlF0MZfwO1+Q249KYgN5nFAZMpbdf5s6rN52r cKug== 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=kUgiBzh2CqevkIiX/Tgvzv6GeE0GmgbS9Op06z7/bvo=; b=m8720VxXdQBuYvPCkGqMbwVMQkoo7Ep5M88XdDt0FfGbmsPeeqZEFMEzBzIdH7hbz/ 5vy+ZgNBk6Dk6OM57uTEzWPQ+GtnRy/tH2KQQMCSGuU+Io/P9P57Sk5iSHXCLcDv7WyU IMhD0INbp2RCeIgGGJPAwWPKpizYOkH6oDnOCt4gr4Mkx/4yk/OJ1xBfOpKqIgLNKh36 YjuH9ymFw/Imy/DbJERBhbJM6YniKvas28ibg5eH/ycl9c+e0gi/yFzilCvPZ2q7MAhB Bst7hSEhabTaMPiHVJS0HqG8sAqzEAL70miXK4wzgv2Cb1sNEx6/Nxqall/LWXwqZCzr 6IYg== X-Gm-Message-State: AIkVDXKL6xDjYJqBE4eVI1uM/IXwqDbjxCWkqXmczwqW10nCQUx1JreiVv2ctNy5XaXKI9vi X-Received: by 10.28.181.145 with SMTP id e139mr17832800wmf.127.1485872716153; Tue, 31 Jan 2017 06:25:16 -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 17sm28650236wru.16.2017.01.31.06.25.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Jan 2017 06:25:15 -0800 (PST) To: Ferruh Yigit , keith.wiles@intel.com References: <1485855778-15496-1-git-send-email-pascal.mazon@6wind.com> Cc: dev@dpdk.org From: Pascal Mazon Message-ID: <39a46c11-66c4-d8ed-a2bc-d9421cb4afd0@6wind.com> Date: Tue, 31 Jan 2017 15:23:32 +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: 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 14:25:16 -0000 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: [1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/networking/tuntap.txt#n108 > >> >> In tun_alloc() especially, we want to use the latter. Otherwise the >> netdevice would be wrongly named "net_tap". Furthermore, creating >> several tap vdev would point to the same netdevice. >> >> In any case, it must to be consistent with the tun_alloc() call in >> eth_dev_tap_create(). >> >> Signed-off-by: Pascal Mazon > <...> > -- Pascal Mazon www.6wind.com