From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com [209.85.217.176]) by dpdk.org (Postfix) with ESMTP id D99712C18 for ; Thu, 21 Apr 2016 17:16:26 +0200 (CEST) Received: by mail-lb0-f176.google.com with SMTP id u8so28875605lbk.0 for ; Thu, 21 Apr 2016 08:16:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc:message-id:references :to; bh=MIYEa+VefKfC5ZWNzKOeMMtj68FnllqES+bpWrbhfd0=; b=cZuAML/Ti6TDeUtZiuMjE+ZvPTqlGrMRz9cVCDhjp4ZB4k+UFWfsymImdPoahDOCAk exowDm9OGTyCBPIDKeOf8S9z+g32k40NV/goqo2hrzbNjtJA6mQXQtmQGlWxRdi6qTpP 3yz6SWNIkbi4vJc+FLPJA0eqmwWfQe/PZHv4Ye+vdoS9G0yvdrfrkpMu/Eypmh2FrrKs vOdrTjYi0QRuXFzXTw/vEQ4t/pol8pVSdbyL2k9kr/WAiRX2ffphJkRIW1mr6qo61jhR k4M3KWAsxPtK0k6jcvczAGKoqJK+ApH8PYX705SBaQQk+aXuKtxHNu0dfhpTY9AAK9bR thkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=MIYEa+VefKfC5ZWNzKOeMMtj68FnllqES+bpWrbhfd0=; b=B8vWuQkLChP/XouN9XFhaIG/J/Z4FRD7RxcHi8SuiEhXANCaoRImj1cm9xE/9nzflj ymKI4PUlZgT87Phub0co2RCIEKsbvnJrF6uQ2aWarRtJvTgKXrFl65kMiDlu45Hnml38 FUxeu+49vyK/qyb75M+dbGrRdqcITJMvTlAdj3jLtUOm4Dt+noMjlZeegsWMBGLHj0gO FMJOs53pxQfvwKzQiUX0tu3BYh8V4Iz5AeeSiGA7rkboQqo1BpiGinC80qHp0DPse0Rf FHyX/lfupJXvVkC4PTqNLYkq4MH9yK7MgXua2mnNKRt7g/H2fiLBLIZOdC00ZxRi6nq+ nw2w== X-Gm-Message-State: AOPr4FW3bgal1nzQZu/3zV0LyLmuKXnVEJGH2YJc0oTeDU6oQe57bVhxtcYFvG3GnseFkA== X-Received: by 10.112.135.4 with SMTP id po4mr6668871lbb.112.1461251786579; Thu, 21 Apr 2016 08:16:26 -0700 (PDT) Received: from mbp-igor.arccn.local (vpn.arccn.ru. [95.182.74.2]) by smtp.gmail.com with ESMTPSA id lw1sm636280lbc.15.2016.04.21.08.16.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 21 Apr 2016 08:16:25 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) From: Igor Ryzhov In-Reply-To: Date: Thu, 21 Apr 2016 18:16:24 +0300 Cc: Sergey Balabanov , "dev@dpdk.org" Message-Id: <27DE54DB-C30D-4395-BE26-089622582178@nfware.com> References: <1440767187-19120-1-git-send-email-balabanovsv@ecotelecom.ru> To: "Zhang, Helin" X-Mailer: Apple Mail (2.3124) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] kni: set kni mac on ioctl_create X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Apr 2016 15:16:27 -0000 Hello. I rebased a patch and added Suggested-by string. Check it, please: http://dpdk.org/dev/patchwork/patch/12188/ = . Best regards, Igor > 18 =D0=BC=D0=B0=D1=80=D1=82=D0=B0 2016 =D0=B3., =D0=B2 5:14, Zhang, = Helin =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB(=D0= =B0): >=20 > Hi Sergey >=20 >> -----Original Message----- >> From: dev [mailto:dev-bounces@dpdk.org ] = On Behalf Of Sergey Balabanov >> Sent: Friday, August 28, 2015 9:06 PM >> To: dev@dpdk.org >> Subject: [dpdk-dev] [PATCH] kni: set kni mac on ioctl_create >>=20 >> There is a situation when ioctl returns zero mac address = (00:00:00:00:00:00) >> for just created kni. The situation happens because kni mac is set on = 'ipconfig >> up' event (kni_net_open callback) not on kni creation = (kni_ioctl_create). > Could you help to clarify a bit of the real issue? What's wrong there? >=20 >>=20 >> Signed-off-by: Sergey Balabanov >> --- >> lib/librte_eal/linuxapp/kni/kni_misc.c | 10 ++++++++++ >> lib/librte_eal/linuxapp/kni/kni_net.c | 9 --------- >> 2 files changed, 10 insertions(+), 9 deletions(-) >>=20 >> diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c >> b/lib/librte_eal/linuxapp/kni/kni_misc.c >> index 2e9fa89..61f83a0 100644 >> --- a/lib/librte_eal/linuxapp/kni/kni_misc.c >> +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c >> @@ -28,6 +28,7 @@ >> #include >> #include >> #include >> +#include /* eth_type_trans */ >>=20 >> #include >> #include "kni_dev.h" >> @@ -465,6 +466,15 @@ kni_ioctl_create(unsigned int ioctl_num, = unsigned >> long ioctl_param) >> if (pci) >> pci_dev_put(pci); >>=20 >> + if (kni->lad_dev) >> + memcpy(net_dev->dev_addr, kni->lad_dev->dev_addr, >> ETH_ALEN); >> + else >> + /* >> + * Generate random mac address. eth_random_addr() is the >> newer >> + * version of generating mac address in linux kernel. >> + */ >> + random_ether_addr(net_dev->dev_addr); >> + > A rebase is needed, as a lot of changes after that. Thanks! >=20 > Helin >> ret =3D register_netdev(net_dev); >> if (ret) { >> KNI_ERR("error %i registering device \"%s\"\n", diff = --git >> a/lib/librte_eal/linuxapp/kni/kni_net.c = b/lib/librte_eal/linuxapp/kni/kni_net.c >> index ab5add4..b50b4cf 100644 >> --- a/lib/librte_eal/linuxapp/kni/kni_net.c >> +++ b/lib/librte_eal/linuxapp/kni/kni_net.c >> @@ -70,15 +70,6 @@ kni_net_open(struct net_device *dev) >> struct rte_kni_request req; >> struct kni_dev *kni =3D netdev_priv(dev); >>=20 >> - if (kni->lad_dev) >> - memcpy(dev->dev_addr, kni->lad_dev->dev_addr, >> ETH_ALEN); >> - else >> - /* >> - * Generate random mac address. eth_random_addr() is the >> newer >> - * version of generating mac address in linux kernel. >> - */ >> - random_ether_addr(dev->dev_addr); >> - >> netif_start_queue(dev); >>=20 >> memset(&req, 0, sizeof(req)); >> -- >> 2.1.4