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

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

[SK_BUFF]: Introduce skb_reset_network_header(skb)



For the common, open coded 'skb->nh.raw = skb->data' operation, so that we can
later turn skb->nh.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 57effc70
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ new_skb(ulong len)
	skb = alloc_skb(len, GFP_ATOMIC);
	if (skb) {
		skb_reset_mac_header(skb);
		skb->nh.raw = skb->data;
		skb_reset_network_header(skb);
		skb->protocol = __constant_htons(ETH_P_AOE);
		skb->priority = 0;
		skb->next = skb->prev = NULL;
+2 −1
Original line number Diff line number Diff line
@@ -1621,7 +1621,8 @@ static inline int rx_offload(struct t3cdev *tdev, struct sge_rspq *rq,
{
	rq->offload_pkts++;
	skb_reset_mac_header(skb);
	skb->nh.raw = skb->h.raw = skb->data;
	skb_reset_network_header(skb);
	skb->h.raw = skb->data;

	if (rq->polling) {
		rx_gather[gather_idx++] = skb;
+1 −1
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ static int bpq_xmit(struct sk_buff *skb, struct net_device *dev)
	}

	skb->protocol = ax25_type_trans(skb, dev);
	skb->nh.raw = skb->data;
	skb_reset_network_header(skb);
	dev->hard_header(skb, dev, ETH_P_BPQ, bpq->dest_addr, NULL, 0);
	bpq->stats.tx_packets++;
	bpq->stats.tx_bytes+=skb->len;
+1 −1
Original line number Diff line number Diff line
@@ -91,7 +91,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
			break;
		skb_reserve(nskb, 32);
		skb_set_mac_header(nskb, -ETH_HLEN);
		nskb->nh.raw = nskb->data;
		skb_reset_network_header(nskb);
		iph = nskb->nh.iph;
		memcpy(nskb->data, skb->nh.raw, doffset);
		if (skb_copy_bits(skb,
+2 −2
Original line number Diff line number Diff line
@@ -799,7 +799,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,

	/* Reserve space for headers. */
	skb_reserve(skb, dev->hard_header_len);
	skb->nh.raw = skb->data;
	skb_reset_network_header(skb);

	skb->dev = dev;

@@ -884,7 +884,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
	memcpy(ph, &hdr, sizeof(struct pppoe_hdr));
	skb2->protocol = __constant_htons(ETH_P_PPP_SES);

	skb2->nh.raw = skb2->data;
	skb_reset_network_header(skb2);

	skb2->dev = dev;

Loading