DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] kni: implement header_ops parse method
@ 2018-09-27  0:02 Igor Ryzhov
  2018-09-29  7:21 ` Stephen Hemminger
                   ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Igor Ryzhov @ 2018-09-27  0:02 UTC (permalink / raw)
  To: dev

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
---
 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

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2019-04-19 10:36 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-27  0:02 [dpdk-dev] [PATCH] kni: implement header_ops parse method Igor Ryzhov
2018-09-29  7:21 ` Stephen Hemminger
2018-09-29 19:19   ` Igor Ryzhov
2018-09-30  8:22     ` Igor Ryzhov
2018-10-02 16:58 ` Ferruh Yigit
2018-11-30 19:07   ` Igor Ryzhov
2019-01-24  9:18     ` Igor Ryzhov
2019-01-24 14:10       ` Ferruh Yigit
2019-01-24 16:35         ` Igor Ryzhov
2019-01-24 17:15           ` Ferruh Yigit
2019-01-24 18:05             ` Igor Ryzhov
2019-04-08 16:59               ` Igor Ryzhov
2019-04-08 16:59                 ` Igor Ryzhov
2019-04-09 20:30                 ` Ferruh Yigit
2019-04-09 20:30                   ` Ferruh Yigit
2019-04-10 10:30 ` [dpdk-dev] [PATCH v2] " Igor Ryzhov
2019-04-10 10:30   ` Igor Ryzhov
2019-04-12 14:52   ` Ferruh Yigit
2019-04-12 14:52     ` Ferruh Yigit
2019-04-12 14:53     ` Ferruh Yigit
2019-04-12 14:53       ` Ferruh Yigit
2019-04-12 17:12       ` Igor Ryzhov
2019-04-12 17:12         ` Igor Ryzhov
2019-04-12 17:15         ` Ferruh Yigit
2019-04-12 17:15           ` Ferruh Yigit
2019-04-15  8:37           ` Igor Ryzhov
2019-04-15  8:37             ` Igor Ryzhov
2019-04-15 15:49             ` Ferruh Yigit
2019-04-15 15:49               ` Ferruh Yigit
2019-04-19 10:36     ` Thomas Monjalon
2019-04-19 10:36       ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).