Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310781
b: refs/heads/master
c: 5ee31c6
h: refs/heads/master
i:
  310779: 3970f10
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Jun 12, 2012
1 parent d0346fa commit 3824c37
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a93664df90db983cfede122f9b4ddb3a8284e52
refs/heads/master: 5ee31c6898ea5537fcea160999d60dc63bc0c305
9 changes: 5 additions & 4 deletions trunk/drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#include <net/route.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
#include <net/pkt_sched.h>
#include "bonding.h"
#include "bond_3ad.h"
#include "bond_alb.h"
Expand Down Expand Up @@ -381,8 +382,6 @@ struct vlan_entry *bond_next_vlan(struct bonding *bond, struct vlan_entry *curr)
return next;
}

#define bond_queue_mapping(skb) (*(u16 *)((skb)->cb))

/**
* bond_dev_queue_xmit - Prepare skb for xmit.
*
Expand All @@ -395,7 +394,9 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb,
{
skb->dev = slave_dev;

skb->queue_mapping = bond_queue_mapping(skb);
BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
sizeof(qdisc_skb_cb(skb)->bond_queue_mapping));
skb->queue_mapping = qdisc_skb_cb(skb)->bond_queue_mapping;

if (unlikely(netpoll_tx_running(slave_dev)))
bond_netpoll_send_skb(bond_get_slave_by_dev(bond, slave_dev), skb);
Expand Down Expand Up @@ -4171,7 +4172,7 @@ static u16 bond_select_queue(struct net_device *dev, struct sk_buff *skb)
/*
* Save the original txq to restore before passing to the driver
*/
bond_queue_mapping(skb) = skb->queue_mapping;
qdisc_skb_cb(skb)->bond_queue_mapping = skb->queue_mapping;

if (unlikely(txq >= dev->real_num_tx_queues)) {
do {
Expand Down
7 changes: 5 additions & 2 deletions trunk/include/net/sch_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,16 @@ struct tcf_proto {

struct qdisc_skb_cb {
unsigned int pkt_len;
unsigned char data[24];
u16 bond_queue_mapping;
u16 _pad;
unsigned char data[20];
};

static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
{
struct qdisc_skb_cb *qcb;
BUILD_BUG_ON(sizeof(skb->cb) < sizeof(unsigned int) + sz);

BUILD_BUG_ON(sizeof(skb->cb) < offsetof(struct qdisc_skb_cb, data) + sz);
BUILD_BUG_ON(sizeof(qcb->data) < sz);
}

Expand Down

0 comments on commit 3824c37

Please sign in to comment.