[SK_BUFF]: Introduce skb_set_mac_header()

For the cases where we want to set skb->mac.raw to an offset from skb->data.

Simple cases first, the memmove ones and specially pktgen will be left for later.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Arnaldo Carvalho de Melo
2007-03-10 12:30:58 -03:00
committed by David S. Miller
parent f64955eb11
commit 48d49d0ccd
6 changed files with 11 additions and 6 deletions

View File

@@ -965,6 +965,11 @@ static inline void skb_reset_mac_header(struct sk_buff *skb)
skb->mac.raw = skb->data;
}
static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
{
skb->mac.raw = skb->data + offset;
}
/*
* CPUs often take a performance hit when accessing unaligned memory
* locations. The actual performance hit varies, it can be small if the