From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) by dpdk.org (Postfix) with ESMTP id F13FD1B11E for ; Sat, 29 Sep 2018 21:19:48 +0200 (CEST) Received: by mail-pf1-f195.google.com with SMTP id x26-v6so6478402pfn.4 for ; Sat, 29 Sep 2018 12:19:48 -0700 (PDT) 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=7mFMZdUeAB9wNPULz4zT8tILFxGHbe0P9bHzdPB9UrQ=; b=YPrg70Ojg5MMs2B+oNWTp75alB9tBPh1bWmWD1+6oONnYP5F9ifzpB59in7b2Mx4ww u5WBYzxu6li1XKiuicobbNj+fd/iQS4VgKBAU2LfbsRchNWDL1pUKPjiaKtTEoWO/peE WE8VoJBMNiU/KByRdV1lg05IUKS4zWKKGu4riMjH60smc84LqhIQndQWD/fBz6hrWT/z Fu0uw4R828m8zuaxQdHAc8tnphpaN2Y+d8KRPYHa8MqEOwPnGtgLOyzeL/uBhhuJJSWm fq+zBmkdPe2Z3Jj5z5RIvs+QScNMgItfI23y07y7IciA9OYuXvDA/Pg41NpkOTzDf/tB 0F2w== 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=7mFMZdUeAB9wNPULz4zT8tILFxGHbe0P9bHzdPB9UrQ=; b=ZZK0jbC69OXdR0odN1D6n58tz9PgXwgVPNXiMoqV40Wa8Vqe3DQdiuWUkCrWJByzQF N1fqT6fnxYqvJ7YOpucJ3L6FIx/+ijhDyux/FITvb4ss/LqNORZD1uFGxzL/FW4K04CN 4Ce5rJWfVctTCDp4DGr2iPkw7hPdvalyljPDuB9cYNAGSNtlZI/YP73wKWiZB2dDGZCu nbmuzRKvDiSG7i3OBRpnaEf5GriSttShGRQWcgAIhfMGd0KZZHzbFbLL7mFug5k060Qe zAjXY06fiY6J2At8g10x8bHpmQ2ftQ9Sjsrg7N+0pjX/oDNMksXjnvAohb9U65wVQg5y zyyg== X-Gm-Message-State: ABuFfoi3pdHrOmM7c9+Yd9o+H4FZveSSp99pslKtbB5JDhjXg0W1LUpK ALx8R09aiz4ZSlhusVTUA2L5pUGpf/68evl0OBjMmUPMCfc= X-Google-Smtp-Source: ACcGV60GMdvqcCBT61nzbDxI6E2C8GkG/HTYZO20HPqtHeKIQ7A3t1y7bq8tZp97hXkdCzE9aQsbgOwYXz22PwgymYw= X-Received: by 2002:a17:902:b212:: with SMTP id t18-v6mr4432621plr.136.1538248787980; Sat, 29 Sep 2018 12:19:47 -0700 (PDT) MIME-Version: 1.0 References: <20180927000224.4011-1-iryzhov@nfware.com> <20180929092159.6b50e439@shemminger-XPS-13-9360> In-Reply-To: <20180929092159.6b50e439@shemminger-XPS-13-9360> From: Igor Ryzhov Date: Sat, 29 Sep 2018 22:19:38 +0300 Message-ID: To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" 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: Sat, 29 Sep 2018 19:19:49 -0000 It's just exact copy of eth_header_parse function from Linux kernel. No problem, can do that with ether_addr_copy. On Sat, Sep 29, 2018 at 10:22 AM Stephen Hemminger < stephen@networkplumber.org> wrote: > On Thu, 27 Sep 2018 03:02:24 +0300 > Igor Ryzhov wrote: > > > +/* > > + * 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; > > +} > > Kernel has function ether_addr_copy which is marginally faster and > commonly used. >