From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 3A0371B55C for ; Fri, 30 Nov 2018 20:07:19 +0100 (CET) Received: by mail-pl1-f194.google.com with SMTP id g9so3254543plo.3 for ; Fri, 30 Nov 2018 11:07:19 -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=B0BFCQdauxCzQcMVnLaicLM/ttkf2q+5TMDoYKyujxE=; b=ZvX7q7isfXJV5xXJRaDrAUp4/gsTOYjiKPk1RIL9B2XhH/V8ihjplB6O9ZgZ0mwQFn H+IezQidMzsjz7wQLSxEEP34lBziMTk44rG2gS8O98SYgf8f/5nBStpaSZtu9RIQvviY CoaqYZl5weIR/zotkHC4KDhYNzhmkfJD5KzvYb2fGR4SvdwGp2YDyWIEw78mhBFYi09A fURedzP/lRAeOqjIi0OYG3HPGccNjOf52Awdf8CjHhDN957V+VvH82b7fPa78+uzRS+P kIZ2bEBTdW1guI0qJibo2hUCbtvILFdRSwO0EL6cAVjpsiTd90g1UFKyqdCWknWxSpmf kGag== 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=B0BFCQdauxCzQcMVnLaicLM/ttkf2q+5TMDoYKyujxE=; b=CiJi4xnJgLmBq1eQy9qgVS2slWrlq4xoEcnIfh6QkdmepdjcvOAdQcuIujdRoCZaXV Cu4mvI8dQtIAAFCUOoWFipjQHSmjSTnFw3BKSvwnhXi5TWl80+ABJAMURIgZ5gn6wzVF XsMKBImMGSZGCUxbl5LwHoPUx3mzMENfgM+gle+XA5TEYpFMmXN9d1MtBH1DOCGFqCTp /NRqpcuZd97E8XZEK5GYlSkg/UGFzqkzXVfiMUeMWtMCxfx4sYPdn7szjX1qE/SFNmM/ tCgDXFsOkHrh3ttMKG5lCpAW7tgCYmKSctXunx3Gy+DqG4JPZ9h5v44PzbYd7XnH8BcU XDQQ== X-Gm-Message-State: AA+aEWaYWKyWk7tnonhMuCZlQczFfByx9axd2aGPEOpBYvsM9pHYd3cW hYsFWAUrJJEApBzs8mu1UiJ7Lx+G/KTsOKBS8CJp0A== X-Google-Smtp-Source: AFSGD/UPv+x6pcCkf9RV9ZcFhaf0ltMJu3kkfEOpP+b8181QY/u/E3+YBeaH0k2/a/75UywNbvyA3B3D27AHSHxAhIc= X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr6215851plb.0.1543604838380; Fri, 30 Nov 2018 11:07:18 -0800 (PST) MIME-Version: 1.0 References: <20180927000224.4011-1-iryzhov@nfware.com> In-Reply-To: From: Igor Ryzhov Date: Fri, 30 Nov 2018 22:07:07 +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: Fri, 30 Nov 2018 19:07:19 -0000 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, unfortunately, do= n'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 already 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, struct > 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 char *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 */ > > > >