diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-24 01:56:49 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-24 16:13:27 -0500 |
commit | 60b778ce519625102d3f72a2071ea72a05e990ce (patch) | |
tree | ecae42cc8809809287e10007643370eaed7e3055 /include/linux/netdevice.h | |
parent | 035c4c16bea2814890c64c657d177e91cec1f473 (diff) |
rfs: better sizing of dev_flow_table
Aim of this patch is to provide full range of rps_flow_cnt on 64bit arches.
Theorical limit on number of flows is 2^32
Fix some buggy RPS/RFS macros as well.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: Tom Herbert <therbert@google.com>
CC: Xi Wang <xi.wang@gmail.com>
CC: Laurent Chavey <chavey@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 603730804da5..a776a675c0e5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -597,7 +597,7 @@ struct rps_map { | |||
597 | struct rcu_head rcu; | 597 | struct rcu_head rcu; |
598 | u16 cpus[0]; | 598 | u16 cpus[0]; |
599 | }; | 599 | }; |
600 | #define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + (_num * sizeof(u16))) | 600 | #define RPS_MAP_SIZE(_num) (sizeof(struct rps_map) + ((_num) * sizeof(u16))) |
601 | 601 | ||
602 | /* | 602 | /* |
603 | * The rps_dev_flow structure contains the mapping of a flow to a CPU, the | 603 | * The rps_dev_flow structure contains the mapping of a flow to a CPU, the |
@@ -621,7 +621,7 @@ struct rps_dev_flow_table { | |||
621 | struct rps_dev_flow flows[0]; | 621 | struct rps_dev_flow flows[0]; |
622 | }; | 622 | }; |
623 | #define RPS_DEV_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_dev_flow_table) + \ | 623 | #define RPS_DEV_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_dev_flow_table) + \ |
624 | (_num * sizeof(struct rps_dev_flow))) | 624 | ((_num) * sizeof(struct rps_dev_flow))) |
625 | 625 | ||
626 | /* | 626 | /* |
627 | * The rps_sock_flow_table contains mappings of flows to the last CPU | 627 | * The rps_sock_flow_table contains mappings of flows to the last CPU |
@@ -632,7 +632,7 @@ struct rps_sock_flow_table { | |||
632 | u16 ents[0]; | 632 | u16 ents[0]; |
633 | }; | 633 | }; |
634 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ | 634 | #define RPS_SOCK_FLOW_TABLE_SIZE(_num) (sizeof(struct rps_sock_flow_table) + \ |
635 | (_num * sizeof(u16))) | 635 | ((_num) * sizeof(u16))) |
636 | 636 | ||
637 | #define RPS_NO_CPU 0xffff | 637 | #define RPS_NO_CPU 0xffff |
638 | 638 | ||
@@ -684,7 +684,7 @@ struct xps_map { | |||
684 | struct rcu_head rcu; | 684 | struct rcu_head rcu; |
685 | u16 queues[0]; | 685 | u16 queues[0]; |
686 | }; | 686 | }; |
687 | #define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + (_num * sizeof(u16))) | 687 | #define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + ((_num) * sizeof(u16))) |
688 | #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \ | 688 | #define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \ |
689 | / sizeof(u16)) | 689 | / sizeof(u16)) |
690 | 690 | ||