From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9A61D683E for ; Tue, 2 Oct 2018 18:58:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Oct 2018 09:58:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,332,1534834800"; d="scan'208";a="267859552" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.49]) ([10.237.221.49]) by fmsmga005.fm.intel.com with ESMTP; 02 Oct 2018 09:58:34 -0700 To: Igor Ryzhov , dev@dpdk.org, Stephen Hemminger References: <20180927000224.4011-1-iryzhov@nfware.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: Date: Tue, 2 Oct 2018 17:58:33 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180927000224.4011-1-iryzhov@nfware.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Tue, 02 Oct 2018 16:58:43 -0000 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 = 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 = { > .create = kni_net_header, > + .parse = kni_net_header_parse, > #ifdef HAVE_REBUILD_HEADER > .rebuild = kni_net_rebuild_header, > #endif /* < 4.1.0 */ >