From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 2554D4D27 for ; Thu, 24 Jan 2019 17:36:06 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id w7so2862707pgp.13 for ; Thu, 24 Jan 2019 08:36:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=8cBNriL6XuCAw/eUvmRkjZ05yUVg3PusMtshnifP7JE=; b=b19SkuTJPWEsZC2VFykNxvkJzlalS2DQi6Xejd/olKB+jQe7tTs89QqK0/sHrHQd90 VznIVjgYtcQGAE/Xt1i6euNJ8qUbWUny8rV8uRBdpmkihVnFlHr5nrXe8ediW8AsxYVV Sn9P4CD0azbpgrqnZ9QKHEI2K5qIoHIchWQKIOEpMWVGyY98VTEP8lsCNpfiG3HtVpu8 XxgAJFO1in48mgMFrZOnftxDpqxQusbsn449NHMiz9okZO76X3iYxTlg2t8NgnNQD74S PiWcXY1fm0ipBquS7+kr7NcQnl13eGAsvGc7vsRlueMjlh1navFmZiaPyhWOElzRMUdh NGQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8cBNriL6XuCAw/eUvmRkjZ05yUVg3PusMtshnifP7JE=; b=UE9kPESXCeW4BzWrsP9t377De6wnGnqt1IpTtjZdxR4Qe66a6I6l0S9pSxnyJcQ2hq BE07zWCFvR8JdGX0tvUnbOejpdwJBjOwZHbcq2WDFe8xpCdW7jgvK993sVkK94NvKbpR xsJUWlCFeUisbjzop9RAdV5FslBjrINzWifucOgw8MxjsA7Hu/IKBmP8H1HvNswfoR7p yWzNI6ovwyfaH7pykFqZ04C3Te8hsl84zdAeBy1ExttJoahwnQGxx7HEvy7DoloAtpUs e2fdt8+qPQs0YZfgTN5LTWibJTTBOfVglLsIP/XInMro/NmhZqP/DpyP33dZ8mXcEUSe ff4Q== X-Gm-Message-State: AJcUukflKf4cyzhaBCktbrCEUw0YdAS3soSX2yZcWpPA9uKkR3TBs9mi YxHChVMd+krPPTOpWpi4BUZA0WOFKLXdQSKfbfHRwA== X-Google-Smtp-Source: ALg8bN7ZA5Q1NzboUKXMIP10LlEJLHAZMZ3WZ+CgrgRbSlnNhG9Z2hLbtXQsCmvY8RrRsurWZ+u/Is7wDSkvk99D3ko= X-Received: by 2002:a62:1d8f:: with SMTP id d137mr7102219pfd.11.1548347765153; Thu, 24 Jan 2019 08:36:05 -0800 (PST) MIME-Version: 1.0 References: <20180927000224.4011-1-iryzhov@nfware.com> <0a5223b8-5b32-966a-7339-617957c7ba45@intel.com> In-Reply-To: <0a5223b8-5b32-966a-7339-617957c7ba45@intel.com> From: Igor Ryzhov Date: Thu, 24 Jan 2019 19:35:54 +0300 Message-ID: To: Ferruh Yigit Cc: dev@dpdk.org, Stephen Hemminger 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: implement header_ops parse method 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, 24 Jan 2019 16:36:06 -0000 Hi Ferruh, I already answered your question in my previous email, header_ops.parse method is used by packet(7) interface for packet parsing and filling sockaddr_ll structure. Here is the link on the usage =E2=80=93 https://elixir.bootlin.com/linux/latest/source/net/packet/af_packet.c#L2100 Regarding the question about eth_header_ops usage: Right now both already existing functions, kni_net_header and kni_net_rebuild_header, are implemented as copies, not using eth_header_ops functions. That's why I think my patch should be accepted as is, and the problem of eth_header_ops usage should be investigated separately, and possibly resolved by a separate patch. Best regards, Igor On Thu, Jan 24, 2019 at 5:10 PM Ferruh Yigit wrote= : > On 1/24/2019 9:18 AM, Igor Ryzhov wrote: > > Hi Ferruh, > > > > What about this patch? > > Can you merge it as-is, or should I change it to use relevant > eth_header_ops > > functions? Or maybe completely use eth_header_ops? > > Hi Igor, > > I am not clear about motivation of the patch, what use case enabled by th= is > patch? What is not working with current code? > I am for rejecting the patch without need justified. > > And if the need is justified, still there is a question that why not use > 'eth_header_parse()' directly but implement our copy? > > > And an extended question/investigation about why not use 'eth_header_ops'= , > which > seems done intentionally but I am missing the reasoning. > > > > > Best regards, > > Igor > > > > On Fri, Nov 30, 2018 at 10:07 PM Igor Ryzhov > > wrote: > > > > Hi Ferruh, > > > > header_ops.parse method is used by raw-sockets to fill sockaddr_ll > structure. > > It is used, for example, in isisd for frrouting. > > > > Regarding your question about eth_header_ops =E2=80=93 I, unfortuna= tely, > don't know > > why .cache and .cache_update are disabled for KNI. > > I also think that it will be better to use default eth_header_ops. > > > > Best regards, > > Igor > > > > On Tue, Oct 2, 2018 at 7:58 PM Ferruh Yigit > > wrote: > > > > On 9/27/2018 1:02 AM, Igor Ryzhov wrote: > > > Signed-off-by: Igor Ryzhov > > > > > > Hi Igor, > > > > What is the motivation to add this support? What is enabled by > this? > > > > > > Meanwhile, why we are not using eth_header_ops, which is alread= y > set by > > ether_setup(). > > To disable .cache & .cache_update? > > > > If so why not using relevant eth_header_ops (eth_header, > > eth_header_parse ..) > > instead of implementing ours? > > > > > --- > > > kernel/linux/kni/kni_net.c | 14 ++++++++++++++ > > > 1 file changed, 14 insertions(+) > > > > > > diff --git a/kernel/linux/kni/kni_net.c > b/kernel/linux/kni/kni_net.c > > > index 7fcfa106c..128a5477c 100644 > > > --- a/kernel/linux/kni/kni_net.c > > > +++ b/kernel/linux/kni/kni_net.c > > > @@ -678,6 +678,19 @@ kni_net_header(struct sk_buff *skb, stru= ct > > net_device *dev, > > > return dev->hard_header_len; > > > } > > > > > > +/* > > > + * Extract hardware address from packet > > > + */ > > > +static int > > > +kni_net_header_parse(const struct sk_buff *skb, unsigned cha= r > *haddr) > > > +{ > > > + const struct ethhdr *eth =3D eth_hdr(skb); > > > + > > > + memcpy(haddr, eth->h_source, ETH_ALEN); > > > + > > > + return ETH_ALEN; > > > +} > > > + > > > /* > > > * Re-fill the eth header > > > */ > > > @@ -739,6 +752,7 @@ kni_net_change_carrier(struct net_device > *dev, > > bool new_carrier) > > > > > > static const struct header_ops kni_net_header_ops =3D { > > > .create =3D kni_net_header, > > > + .parse =3D kni_net_header_parse, > > > #ifdef HAVE_REBUILD_HEADER > > > .rebuild =3D kni_net_rebuild_header, > > > #endif /* < 4.1.0 */ > > > > > > >