Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 459a98ed authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller
Browse files

[SK_BUFF]: Introduce skb_reset_mac_header(skb)



For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can
later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in
64bit land while possibly keeping it as a pointer on 32bit.

This one touches just the most simple case, next will handle the slightly more
"complex" cases.

Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4c13eb66
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ static int uml_net_rx(struct net_device *dev)

	skb->dev = dev;
	skb_put(skb, dev->mtu);
	skb->mac.raw = skb->data;
	skb_reset_mac_header(skb);
	pkt_len = (*lp->read)(lp->fd, &skb, lp);

	if (pkt_len > 0) {
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ static int iss_net_rx(struct net_device *dev)
	/* Setup skb */

	skb->dev = dev;
	skb->mac.raw = skb->data;
	skb_reset_mac_header(skb);
	pkt_len = lp->tp.read(lp, &skb);
	skb_put(skb, pkt_len);

+2 −1
Original line number Diff line number Diff line
@@ -27,7 +27,8 @@ new_skb(ulong len)

	skb = alloc_skb(len, GFP_ATOMIC);
	if (skb) {
		skb->nh.raw = skb->mac.raw = skb->data;
		skb_reset_mac_header(skb);
		skb->nh.raw = skb->data;
		skb->protocol = __constant_htons(ETH_P_AOE);
		skb->priority = 0;
		skb->next = skb->prev = NULL;
+1 −1
Original line number Diff line number Diff line
@@ -834,7 +834,7 @@ static inline u16 ether1394_type_trans(struct sk_buff *skb,
	struct eth1394hdr *eth;
	unsigned char *rawp;

	skb->mac.raw = skb->data;
	skb_reset_mac_header(skb);
	skb_pull (skb, ETH1394_HLEN);
	eth = eth1394_hdr(skb);

+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ void ipoib_cm_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
	skb_put_frags(skb, IPOIB_CM_HEAD_SIZE, wc->byte_len, newskb);

	skb->protocol = ((struct ipoib_header *) skb->data)->proto;
	skb->mac.raw = skb->data;
	skb_reset_mac_header(skb);
	skb_pull(skb, IPOIB_ENCAP_LEN);

	dev->last_rx = jiffies;
Loading