aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-11-29 03:14:37 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-01 15:47:42 -0500
commitf2cd2d3e9b3ef960612e362f0ad129d735452df2 (patch)
treebef1868cfc7dc66de7b2430a4b47b12bced05ec1 /include/linux/netdevice.h
parent0793f83f0ec2142d06abe53570417c8d95e0310a (diff)
net sched: use xps information for qdisc NUMA affinity
Allocate qdisc memory according to NUMA properties of cpus included in xps map. To be effective, qdisc should be (re)setup after changes of /sys/class/net/eth<n>/queues/tx-<n>/xps_cpus I added a numa_node field in struct netdev_queue, containing NUMA node if all cpus included in xps_cpus share same node, else -1. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Ben Hutchings <bhutchings@solarflare.com> Cc: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 4b0c7f3aa32b..a9ac5dc26e3c 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -508,7 +508,9 @@ struct netdev_queue {
508#ifdef CONFIG_RPS 508#ifdef CONFIG_RPS
509 struct kobject kobj; 509 struct kobject kobj;
510#endif 510#endif
511 511#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
512 int numa_node;
513#endif
512/* 514/*
513 * write mostly part 515 * write mostly part
514 */ 516 */
@@ -523,6 +525,22 @@ struct netdev_queue {
523 u64 tx_dropped; 525 u64 tx_dropped;
524} ____cacheline_aligned_in_smp; 526} ____cacheline_aligned_in_smp;
525 527
528static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
529{
530#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
531 return q->numa_node;
532#else
533 return -1;
534#endif
535}
536
537static inline void netdev_queue_numa_node_write(struct netdev_queue *q, int node)
538{
539#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
540 q->numa_node = node;
541#endif
542}
543
526#ifdef CONFIG_RPS 544#ifdef CONFIG_RPS
527/* 545/*
528 * This structure holds an RPS map which can be of variable length. The 546 * This structure holds an RPS map which can be of variable length. The