Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 193598
b: refs/heads/master
c: 0a9627f
h: refs/heads/master
v: v3
  • Loading branch information
Tom Herbert authored and David S. Miller committed Mar 17, 2010
1 parent de79dda commit 463133c
Show file tree
Hide file tree
Showing 6 changed files with 539 additions and 60 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: 768bbedf9ca4cc4784eae2003f37abe0818fe0b0
refs/heads/master: 0a9627f2649a02bea165cfd529d7bcb625c2fcad
32 changes: 30 additions & 2 deletions trunk/include/linux/netdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ struct netif_rx_stats {
unsigned dropped;
unsigned time_squeeze;
unsigned cpu_collision;
unsigned received_rps;
};

DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
Expand Down Expand Up @@ -530,6 +531,24 @@ struct netdev_queue {
unsigned long tx_dropped;
} ____cacheline_aligned_in_smp;

/*
* This structure holds an RPS map which can be of variable length. The
* map is an array of CPUs.
*/
struct rps_map {
unsigned int len;
struct rcu_head rcu;
u16 cpus[0];
};
#define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16)))

/* This structure contains an instance of an RX queue. */
struct netdev_rx_queue {
struct rps_map *rps_map;
struct kobject kobj;
struct netdev_rx_queue *first;
atomic_t count;
} ____cacheline_aligned_in_smp;

/*
* This structure defines the management hooks for network devices.
Expand Down Expand Up @@ -878,6 +897,13 @@ struct net_device {

unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */

struct kset *queues_kset;

struct netdev_rx_queue *_rx;

/* Number of RX queues allocated at alloc_netdev_mq() time */
unsigned int num_rx_queues;

struct netdev_queue rx_queue;

struct netdev_queue *_tx ____cacheline_aligned_in_smp;
Expand Down Expand Up @@ -1311,14 +1337,16 @@ static inline int unregister_gifconf(unsigned int family)
*/
struct softnet_data {
struct Qdisc *output_queue;
struct sk_buff_head input_pkt_queue;
struct list_head poll_list;
struct sk_buff *completion_queue;

/* Elements below can be accessed between CPUs for RPS */
struct call_single_data csd ____cacheline_aligned_in_smp;
struct sk_buff_head input_pkt_queue;
struct napi_struct backlog;
};

DECLARE_PER_CPU(struct softnet_data,softnet_data);
DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);

#define HAVE_NETIF_QUEUE

Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ typedef unsigned char *sk_buff_data_t;
* @nfct_reasm: netfilter conntrack re-assembly pointer
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
* @skb_iif: ifindex of device we arrived on
* @rxhash: the packet hash computed on receive
* @queue_mapping: Queue mapping for multiqueue devices
* @tc_index: Traffic control index
* @tc_verd: traffic control verdict
Expand Down Expand Up @@ -375,6 +376,8 @@ struct sk_buff {
#endif
#endif

__u32 rxhash;

kmemcheck_bitfield_begin(flags2);
__u16 queue_mapping:16;
#ifdef CONFIG_IPV6_NDISC_NODETYPE
Expand Down
Loading

0 comments on commit 463133c

Please sign in to comment.