From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id 167B81B1EB for ; Thu, 27 Sep 2018 02:02:32 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id a82-v6so637063lfa.4 for ; Wed, 26 Sep 2018 17:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nfware-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=T6LhoS3shXfCtFiSBi9Dwxm0MsEcvn4OnhBsD4V3dOk=; b=GLHRwAdmGC0FxfAaQ2UX+Yrb4Y/rDnmKpuyZYDEGpNlcSBRm0Bxxri4BuGAVDjfYap mIWY76XlGjoRf3yXK7qlTjIAPz6i8jwhqKWfZDdS21lHGNir1bITdz5y6pF5qgWPym5B MBdU0fnSFZ65kqKTgLZL5i7EVfoji3Zq/BDGcHHzQlxlri7eRTGoFm8H+1sm1nQ/Fkwi IaYZVzFGewOmvrHRi+u5F/IpagsNmfvoEwlejWQDcJGu5RwaLh4qEHjRhHDeB2zydrej gUZfv46Lz8QJSeW5tBpF8SzFevkN2ggPsiM5ulF5hhE7i3qsPWKPOT22QPwADvPxYKOV tbTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=T6LhoS3shXfCtFiSBi9Dwxm0MsEcvn4OnhBsD4V3dOk=; b=EgRgRTU/7vPC/9MIztwnK05Qd4PTisfpEG1by3LPnD3LLsm6FCglsA1ve1ZowbECaR X3k8h70pC3XheHo1PeN03icERzIudPBrFlMM5NCwiuPuJ+cKfG5AE6i0aWMnqXWzDguL bq1cz42ejwf2Vzidc0ZUvZvQ7kRvwytiXWlRD10FEBoXlIrQfRZUtPZls8p66l52Om1x kIDbNusrdHWR2p3t4C7n9AP0qFA23EGS46g/6BuEcxHtlpWOpH7yjyaELOb2yj19/7RL pak/zYxGtuSOSWmuSSmGo6PkCMQOWHI1YCM8d+kw+WlMEJjDd+54eg0//yc1QdWJ8+3h l4Mw== X-Gm-Message-State: ABuFfoiwSx10gR8sOnJoo2ijHNQqor34whmtGgPbktCtLGDbudZfKjiO QgVhtxMZ/JxN8wKLxeT9seMIsqgsRWX+1w== X-Google-Smtp-Source: ACcGV6057oBxgycVHJq9XL/1vNls5vcnW7mykULy01m9c/msH1GBwgWZN5Bq6NEYeTejWLghH5QZNQ== X-Received: by 2002:a19:e013:: with SMTP id x19-v6mr5369098lfg.89.1538006551014; Wed, 26 Sep 2018 17:02:31 -0700 (PDT) Received: from localhost.localdomain ([77.105.176.214]) by smtp.gmail.com with ESMTPSA id l14-v6sm72648ljc.68.2018.09.26.17.02.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Sep 2018 17:02:29 -0700 (PDT) From: Igor Ryzhov To: dev@dpdk.org Date: Thu, 27 Sep 2018 03:02:24 +0300 Message-Id: <20180927000224.4011-1-iryzhov@nfware.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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, 27 Sep 2018 00:02:33 -0000 Signed-off-by: Igor Ryzhov --- 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 */ -- 2.19.0