From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 37D601150 for ; Thu, 24 Jan 2019 10:18:28 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id r136so2694391pfc.6 for ; Thu, 24 Jan 2019 01:18:28 -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=pAVFZc3NseGClfLVYxu5Ol+7qULSfZoV+vyYnLHBUi8=; b=E/tAy5Pxz2gkJ1Kvo7nivrZ9K9nuwDWqV0SVgh/S/GKNho/GkwOOhpX3zvGRDs/IXh vn4AdOgm/FUxsgacgCGqBn47i6d2IN3WyzQV51Q9CyiA+YraLLqccRMQc0kuN1GhrThM OsMmYmCGGkrOeeyf1ZdCHkuk1CRYagZBRUqY+4uUJyX4V6/CFTOUxLpIHWTpcNpws7Hn CIHX12jfdQecdyWbXt3gRMiWGATXRAx1Z+9m8HVsN09kqrbWk+/qKNAp7xIBo/gDyJXh vG/rI3aYs634GODL7A7s0HT64EZVsvK+yxrJhpwYy73eUO7PgCiR7L0GQdZ5TECUCqT7 2YNg== 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=pAVFZc3NseGClfLVYxu5Ol+7qULSfZoV+vyYnLHBUi8=; b=MwpjUoGaaVAYW6dE0+tRIDZvqBBVOXRWl6lWLUzn1+bZT8lcKLwcTOw3rrK6YwxhuM fmQOJ6kFb/Kuvp53HX94cbnLg3zxIQFNfKhuRYwmpxbBd0lod+RH3eTCpsZVBJvTJ+CR 1RqMsD+Th13uRZjmq6MNVeu3ygoDQ+jD5sLJQcfGAvVTqa/B3+PahZiWqXtq+n7Z1f6w O36DyQokUP3XOhA3oESCzkZTkLdyd19IKzcbR4FHSDnOpQGem7XukA5EkMJAXhSP+8aK wjTCk5evGsB0geQXOaVrcBaZ+Cn8Ev+7d74iY1L+P+FWEiIArww80BnWUP8+7O2nJJH/ YISw== X-Gm-Message-State: AJcUukcf4fQrAilLyfiT+WTGh8KcSNfQJApTRyyy4fZOwZotmT2lQvOt MFPBEs1ZvNDCJOhAPbj4jaYb5j+mJbwDGuzQzkUKKpPt X-Google-Smtp-Source: ALg8bN4mq4eevwuQzUHsPTA/B/Bxmzq/eevJAgBiqdmHbrlvThhFDebN8JIQV7qD5OO0aEQjF8SL1jfuOM1LDrBM3/U= X-Received: by 2002:a63:ab08:: with SMTP id p8mr5135619pgf.87.1548321507254; Thu, 24 Jan 2019 01:18:27 -0800 (PST) MIME-Version: 1.0 References: <20180927000224.4011-1-iryzhov@nfware.com> In-Reply-To: From: Igor Ryzhov Date: Thu, 24 Jan 2019 12:18:16 +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 09:18:28 -0000 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? 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, unfortunately, = 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 already set by >> ether_setup(). >> To disable .cache & .cache_update? >> >> If so why not using relevant eth_header_ops (eth_header, eth_header_pars= e >> ..) >> 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, boo= l >> 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 */ >> > >> >>