From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id A870B201 for ; Thu, 29 Mar 2018 03:16:44 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Mar 2018 18:16:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,374,1517904000"; d="scan'208";a="43073454" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by orsmga001.jf.intel.com with ESMTP; 28 Mar 2018 18:16:40 -0700 Date: Thu, 29 Mar 2018 09:15:05 +0800 From: Tiwei Bie To: "Tan, Jianfeng" Cc: =?utf-8?B?U2XDoW4=?= Harte , Ning Li , Yuanhan Liu , Maxime Coquelin , "dev@dpdk.org" Message-ID: <20180329011505.2qwg5mzo4fgldd45@debian> References: <1513251494-9980-1-git-send-email-muziding001@163.com> <1514518722-27302-1-git-send-email-muziding001@163.com> <20171229094448.endx2qvwohxi7q47@debian-xvivbkq.sh.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: specify the MAC of the tap 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: Thu, 29 Mar 2018 01:16:45 -0000 On Thu, Mar 29, 2018 at 08:50:37AM +0800, Tan, Jianfeng wrote: > > -----Original Message----- > > From: Seán Harte [mailto:seanbh@gmail.com] > > Sent: Thursday, March 29, 2018 12:55 AM > > To: Ning Li; Yuanhan Liu; Maxime Coquelin; Bie, Tiwei > > Cc: dev@dpdk.org; Tan, Jianfeng > > Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: specify the MAC of the tap > > > > On 29/12/2017 09:44, tiwei.bie at intel.com (Tiwei Bie) wrote: > > > Hi Ning, > > > > > > On Fri, Dec 29, 2017 at 11:38:42AM +0800, Ning Li wrote: > > >> When using virtio-user with vhost-kernel to exchange > > >> packet with kernel networking stack, application can > > >> set the MAC of the tap interface via parameter. > > >> > > >> Signed-off-by: Ning Li > > > > Reviewed-by: Seán Harte > > Tested-by: Seán Harte > > Reviewed-by: Jianfeng Tan > > > >> --- [...] > > >> --- a/drivers/net/virtio/virtio_user/vhost_kernel.c > > >> +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c > > >> @@ -380,7 +380,8 @@ struct vhost_memory_kernel { > > >> else > > >> hdr_size = sizeof(struct virtio_net_hdr); > > >> > > >> - tapfd = vhost_kernel_open_tap(&dev->ifname, hdr_size, req_mq); > > >> + tapfd = vhost_kernel_open_tap(&dev->ifname, hdr_size, req_mq, > > >> + (char *)dev->mac_addr); > > > > > > I think it's better to add a new device argument for > > > virtio-user to specify the MAC for the corresponding > > > tap. But I don't have a very strong opinion on this > > > for now. So I'd like to hear others' opinions. > > > > No harm if it was a seperate argument, although I can't think of a > > scenario where you care about the MAC address and would want the tap and > > virtio devices to have differnet MAC addresses. > > I would also prefer to keep it as simple as possible before we find a real use case for different mac addr. > Logically they're different virtual ports, so my first thought is that they deserve different devargs and MACs. But after a second thought, I also can't find a scenario where we would want the tap and virtio device to have different MACs. So I'd like to hear others' opinions. If that's the case, maybe we can take it. Thanks > > > > > > > > > > snip... > > > > > > > > > I'm not sure if this patch is still under consideration, but it looks > > good to me, and works. > > I think yes. Maxime, would you like to consider merging this patch? > > Thanks, > Jianfeng