Skip to content

Commit 6f1cf16

Browse files
Stephen HemmingerDavid S. Miller
Stephen Hemminger
authored and
David S. Miller
committed
[NET]: Remove HIPPI private from skbuff.h
This removes the private element from skbuff, that is only used by HIPPI. Instead it uses skb->cb[] to hold the additional data that is needed in the output path from hard_header to device driver. PS: The only qdisc that might potentially corrupt this cb[] is if netem was used over HIPPI. I will take care of that by fixing netem to use skb->stamp. I don't expect many users of netem over HIPPI Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b0573de commit 6f1cf16

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

drivers/net/rrunner.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,7 @@ static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev)
14291429
{
14301430
struct rr_private *rrpriv = netdev_priv(dev);
14311431
struct rr_regs __iomem *regs = rrpriv->regs;
1432+
struct hippi_cb *hcb = (struct hippi_cb *) skb->cb;
14321433
struct ring_ctrl *txctrl;
14331434
unsigned long flags;
14341435
u32 index, len = skb->len;
@@ -1460,7 +1461,7 @@ static int rr_start_xmit(struct sk_buff *skb, struct net_device *dev)
14601461
ifield = (u32 *)skb_push(skb, 8);
14611462

14621463
ifield[0] = 0;
1463-
ifield[1] = skb->private.ifield;
1464+
ifield[1] = hcb->ifield;
14641465

14651466
/*
14661467
* We don't need the lock before we are actually going to start

include/linux/hippidevice.h

+5
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
#include <linux/if_hippi.h>
2727

2828
#ifdef __KERNEL__
29+
30+
struct hippi_cb {
31+
__u32 ifield;
32+
};
33+
2934
extern unsigned short hippi_type_trans(struct sk_buff *skb,
3035
struct net_device *dev);
3136

include/linux/skbuff.h

-6
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ struct skb_shared_info {
193193
* @nfct: Associated connection, if any
194194
* @nfctinfo: Relationship of this skb to the connection
195195
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
196-
* @private: Data which is private to the HIPPI implementation
197196
* @tc_index: Traffic control index
198197
* @tc_verd: traffic control verdict
199198
*/
@@ -265,11 +264,6 @@ struct sk_buff {
265264
struct nf_bridge_info *nf_bridge;
266265
#endif
267266
#endif /* CONFIG_NETFILTER */
268-
#if defined(CONFIG_HIPPI)
269-
union {
270-
__u32 ifield;
271-
} private;
272-
#endif
273267
#ifdef CONFIG_NET_SCHED
274268
__u32 tc_index; /* traffic control index */
275269
#ifdef CONFIG_NET_CLS_ACT

net/802/hippi.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ static int hippi_header(struct sk_buff *skb, struct net_device *dev,
5151
unsigned len)
5252
{
5353
struct hippi_hdr *hip = (struct hippi_hdr *)skb_push(skb, HIPPI_HLEN);
54+
struct hippi_cb *hcb = (struct hippi_cb *) skb->cb;
5455

5556
if (!len){
5657
len = skb->len - HIPPI_HLEN;
@@ -84,9 +85,10 @@ static int hippi_header(struct sk_buff *skb, struct net_device *dev,
8485
if (daddr)
8586
{
8687
memcpy(hip->le.dest_switch_addr, daddr + 3, 3);
87-
memcpy(&skb->private.ifield, daddr + 2, 4);
88+
memcpy(&hcb->ifield, daddr + 2, 4);
8889
return HIPPI_HLEN;
8990
}
91+
hcb->ifield = 0;
9092
return -((int)HIPPI_HLEN);
9193
}
9294

net/core/skbuff.c

-3
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,6 @@ struct sk_buff *skb_clone(struct sk_buff *skb, unsigned int __nocast gfp_mask)
365365
nf_bridge_get(skb->nf_bridge);
366366
#endif
367367
#endif /*CONFIG_NETFILTER*/
368-
#if defined(CONFIG_HIPPI)
369-
C(private);
370-
#endif
371368
#ifdef CONFIG_NET_SCHED
372369
C(tc_index);
373370
#ifdef CONFIG_NET_CLS_ACT

0 commit comments

Comments
 (0)