[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: 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-19 15:30:44 -07:00
committed by David S. Miller
parent 4c13eb6657
commit 459a98ed88
85 changed files with 121 additions and 111 deletions

View File

@@ -773,7 +773,7 @@ static int sppp_rx_done(struct channel_data *chan)
}
chan->rx_skb->protocol = htons(ETH_P_WAN_PPP);
chan->rx_skb->dev = chan->pppdev.dev;
chan->rx_skb->mac.raw = chan->rx_skb->data;
skb_reset_mac_header(chan->rx_skb)
chan->stats.rx_packets++;
chan->stats.rx_bytes += chan->cosa->rxsize;
netif_rx(chan->rx_skb);

View File

@@ -834,7 +834,7 @@ static void cycx_x25_irq_rx(struct cycx_device *card, struct cycx_x25_cmd *cmd)
++chan->ifstats.rx_packets;
chan->ifstats.rx_bytes += pktlen;
skb->mac.raw = skb->data;
skb_reset_mac_header(skb);
netif_rx(skb);
dev->last_rx = jiffies; /* timestamp */
}

View File

@@ -176,7 +176,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
if (process)
{
/* we've set up the protocol, so discard the header */
skb->mac.raw = skb->data;
skb_reset_mac_header(skb);
skb_pull(skb, header);
dlp->stats.rx_bytes += skb->len;
netif_rx(skb);

View File

@@ -864,7 +864,7 @@ fst_tx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
static __be16 farsync_type_trans(struct sk_buff *skb, struct net_device *dev)
{
skb->dev = dev;
skb->mac.raw = skb->data;
skb_reset_mac_header(skb);
skb->pkt_type = PACKET_HOST;
return htons(ETH_P_CUST);
}

View File

@@ -1667,7 +1667,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
skb_put (skb, len);
skb->protocol = lmc_proto_type(sc, skb);
skb->protocol = htons(ETH_P_WAN_PPP);
skb->mac.raw = skb->data;
skb_reset_mac_header(skb);
// skb->nh.raw = skb->data;
skb->dev = dev;
lmc_proto_netif(sc, skb);
@@ -1705,7 +1705,7 @@ static int lmc_rx (struct net_device *dev) /*fold00*/
memcpy(skb_put(nsb, len), skb->data, len);
nsb->protocol = lmc_proto_type(sc, skb);
nsb->mac.raw = nsb->data;
skb_reset_mac_header(nsb);
// nsb->nh.raw = nsb->data;
nsb->dev = dev;
lmc_proto_netif(sc, nsb);

View File

@@ -1755,7 +1755,7 @@ cpc_trace(struct net_device *dev, struct sk_buff *skb_main, char rx_tx)
skb->dev = dev;
skb->protocol = htons(ETH_P_CUST);
skb->mac.raw = skb->data;
skb_reset_mac_header(skb);
skb->pkt_type = PACKET_HOST;
skb->len = 10 + skb_main->len;

View File

@@ -1003,7 +1003,7 @@ static void cpc_tty_trace(pc300dev_t *dev, char* buf, int len, char rxtx)
skb_put (skb, 10 + len);
skb->dev = dev->dev;
skb->protocol = htons(ETH_P_CUST);
skb->mac.raw = skb->data;
skb_reset_mac_header(skb);
skb->pkt_type = PACKET_HOST;
skb->len = 10 + len;