From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by dpdk.org (Postfix) with ESMTP id 5BF147D26 for ; Sat, 29 Sep 2018 09:22:06 +0200 (CEST) Received: by mail-wr1-f67.google.com with SMTP id q5-v6so2041140wrw.12 for ; Sat, 29 Sep 2018 00:22:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9MpHsWYkjp8DjVNlN4izUjISiCkvu/UaAD6FYbB5GVg=; b=EQCUGCKVEraDqix/GgVdzVyFLn62sbhampK1joThVhPTjALa5iTQXo0u7WMqWBL8D4 pLX1NyrN4+uUSComYfgJrbzdb4HkL29ypkIadSdAfYXDs93GFhNtP885+kYsNUhnNZrC kZ70mt7bOhUMaLB3Sc4WjxgfOzW1QVZKYSHsBabByGz5plJM1QE4LtlNFrWQ+w1Ql3Ab 8rGi5vF8mdtQ4+iQZ8L+rHIYQluy18LgYC7dNeTrNE8HPFvdeYyTBwtkUsrrJfVyu+Tv amaATgkFdDI9ZVGDcwE50kqA8AJu+/qg+YZVm1Twdnb23HDtaJLXULam+ZKPUZR/OzJv iLRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9MpHsWYkjp8DjVNlN4izUjISiCkvu/UaAD6FYbB5GVg=; b=klKeUxeIgypRnkD9uqX4P9/oTdrOLZ7wGQI42c0D192iTNopfIg+WT+bs5qGahedkm qHuoBoKvCBX+N/x1AyTIk/plg3lmnOVaSKqp5ttkUzbQx/3DOJu/OV/cchj7vCBKfQAW bdnxLOPFJQRor9C4nye/nik84tgi739euIcmIjz6YEW7mmrhkV6dYCyVAwWvwF2E57v0 83/110FRo5yToxj1HxLfeUA1nL1iS7SE6QPqp+PoPrjhxJtwDTFpC1niTfnbknMxchVc c9rbzhc0+sazH4AN2eK2RlRZbKF+9gSMalbiYQEtrPO/BhmKp4KO7ACTGjF/IKjbynF+ xQpQ== X-Gm-Message-State: ABuFfoiYAFCWhx3z+nXHJLA4YhcJu9FRF6ky385KRMFnbzsZB3sfMKUv VwPOw/n2kDIRsaCOznXj4CyEHnRrPi54jw== X-Google-Smtp-Source: ACcGV62EVg1SuhwCAvMvpBynXdYoBVvihZGS7tIqvQGb2VofcmlOGtyL6EJDR+c0zAd04/et29//gA== X-Received: by 2002:adf:9227:: with SMTP id 36-v6mr1234512wrj.275.1538205726045; Sat, 29 Sep 2018 00:22:06 -0700 (PDT) Received: from shemminger-XPS-13-9360 (p578c1d60.dip0.t-ipconnect.de. [87.140.29.96]) by smtp.gmail.com with ESMTPSA id 74-v6sm1079193wmi.23.2018.09.29.00.22.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 29 Sep 2018 00:22:05 -0700 (PDT) Date: Sat, 29 Sep 2018 09:21:59 +0200 From: Stephen Hemminger To: Igor Ryzhov Cc: dev@dpdk.org Message-ID: <20180929092159.6b50e439@shemminger-XPS-13-9360> In-Reply-To: <20180927000224.4011-1-iryzhov@nfware.com> References: <20180927000224.4011-1-iryzhov@nfware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Sat, 29 Sep 2018 07:22:06 -0000 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.