[dpdk-dev] [PATCH] kni: implement header_ops parse method
Stephen Hemminger
stephen at networkplumber.org
Sat Sep 29 09:21:59 CEST 2018
On Thu, 27 Sep 2018 03:02:24 +0300
Igor Ryzhov <iryzhov at nfware.com> 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.
More information about the dev
mailing list