diff options
author | David S. Miller <davem@davemloft.net> | 2013-07-10 20:10:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-10 20:10:40 -0400 |
commit | 0e00fd479465d00bf0a97cb371c63787e1887a2e (patch) | |
tree | f4701c62374a44db9f3be2d46f9420a328cd49ee | |
parent | bfffbea1aaeeb1eb6500c83ff9653416daa5b490 (diff) | |
parent | 64b0dc517ea1b35d02565a779e6cb77ae9045685 (diff) |
Merge "net: finish renaming lls to busy poll"
Eliezer Tamir says:
====================
Here are three patches that complete the rename of lls to busy-poll
1. rename include/net/ll_poll.h to include/net/busy_poll.h
2. Rename ndo_ll_poll to ndo_busy_poll.
Rename sk_mark_ll to sk_mark_napi_id.
Rename skb_mark_ll to skb_mark_napi_id.
Correct all useres of these functions.
Update comments and defines in include/net/busy_poll.h
3. Rename LL_SO to BUSY_POLL_SO
Rename sysctl_net_ll_{read,poll} to sysctl_busy_{read,poll}
Fix up users of these variables.
Fix documentation for sysctl.
v2 fixed forgetting the ndo changes in v1
v3 is a resend with -M
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
34 files changed, 74 insertions, 71 deletions
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt index d69e14c9002c..1c15043aaee4 100644 --- a/Documentation/sysctl/net.txt +++ b/Documentation/sysctl/net.txt | |||
@@ -50,26 +50,27 @@ The maximum number of packets that kernel can handle on a NAPI interrupt, | |||
50 | it's a Per-CPU variable. | 50 | it's a Per-CPU variable. |
51 | Default: 64 | 51 | Default: 64 |
52 | 52 | ||
53 | low_latency_read | 53 | busy_read |
54 | ---------------- | 54 | ---------------- |
55 | Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL) | 55 | Low latency busy poll timeout for socket reads. (needs CONFIG_NET_LL_RX_POLL) |
56 | Approximate time in us to busy loop waiting for packets on the device queue. | 56 | Approximate time in us to busy loop waiting for packets on the device queue. |
57 | This sets the default value of the SO_LL socket option. | 57 | This sets the default value of the SO_BUSY_POLL socket option. |
58 | Can be set or overridden per socket by setting socket option SO_LL, which is | 58 | Can be set or overridden per socket by setting socket option SO_BUSY_POLL, |
59 | the preferred method of enabling. | 59 | which is the preferred method of enabling. If you need to enable the feature |
60 | If you need to enable the feature globally via sysctl, a value of 50 is recommended. | 60 | globally via sysctl, a value of 50 is recommended. |
61 | Will increase power usage. | 61 | Will increase power usage. |
62 | Default: 0 (off) | 62 | Default: 0 (off) |
63 | 63 | ||
64 | low_latency_poll | 64 | busy_poll |
65 | ---------------- | 65 | ---------------- |
66 | Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL) | 66 | Low latency busy poll timeout for poll and select. (needs CONFIG_NET_LL_RX_POLL) |
67 | Approximate time in us to busy loop waiting for events. | 67 | Approximate time in us to busy loop waiting for events. |
68 | Recommended value depends on the number of sockets you poll on. | 68 | Recommended value depends on the number of sockets you poll on. |
69 | For several sockets 50, for several hundreds 100. | 69 | For several sockets 50, for several hundreds 100. |
70 | For more than that you probably want to use epoll. | 70 | For more than that you probably want to use epoll. |
71 | Note that only sockets with SO_LL set will be busy polled, so you want to either | 71 | Note that only sockets with SO_BUSY_POLL set will be busy polled, |
72 | selectively set SO_LL on those sockets or set sysctl.net.low_latency_read globally. | 72 | so you want to either selectively set SO_BUSY_POLL on those sockets or set |
73 | sysctl.net.busy_read globally. | ||
73 | Will increase power usage. | 74 | Will increase power usage. |
74 | Default: 0 (off) | 75 | Default: 0 (off) |
75 | 76 | ||
diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h index 4885825e498d..467de010ea7e 100644 --- a/arch/alpha/include/uapi/asm/socket.h +++ b/arch/alpha/include/uapi/asm/socket.h | |||
@@ -81,6 +81,6 @@ | |||
81 | 81 | ||
82 | #define SO_SELECT_ERR_QUEUE 45 | 82 | #define SO_SELECT_ERR_QUEUE 45 |
83 | 83 | ||
84 | #define SO_LL 46 | 84 | #define SO_BUSY_POLL 46 |
85 | 85 | ||
86 | #endif /* _UAPI_ASM_SOCKET_H */ | 86 | #endif /* _UAPI_ASM_SOCKET_H */ |
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h index 79b61798ebf8..11c4259c62fb 100644 --- a/arch/avr32/include/uapi/asm/socket.h +++ b/arch/avr32/include/uapi/asm/socket.h | |||
@@ -74,6 +74,6 @@ | |||
74 | 74 | ||
75 | #define SO_SELECT_ERR_QUEUE 45 | 75 | #define SO_SELECT_ERR_QUEUE 45 |
76 | 76 | ||
77 | #define SO_LL 46 | 77 | #define SO_BUSY_POLL 46 |
78 | 78 | ||
79 | #endif /* __ASM_AVR32_SOCKET_H */ | 79 | #endif /* __ASM_AVR32_SOCKET_H */ |
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h index 47b1ec55092d..eb723e51554e 100644 --- a/arch/cris/include/uapi/asm/socket.h +++ b/arch/cris/include/uapi/asm/socket.h | |||
@@ -76,7 +76,7 @@ | |||
76 | 76 | ||
77 | #define SO_SELECT_ERR_QUEUE 45 | 77 | #define SO_SELECT_ERR_QUEUE 45 |
78 | 78 | ||
79 | #define SO_LL 46 | 79 | #define SO_BUSY_POLL 46 |
80 | 80 | ||
81 | #endif /* _ASM_SOCKET_H */ | 81 | #endif /* _ASM_SOCKET_H */ |
82 | 82 | ||
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h index dbc08520f22c..f0cb1c341163 100644 --- a/arch/frv/include/uapi/asm/socket.h +++ b/arch/frv/include/uapi/asm/socket.h | |||
@@ -74,7 +74,7 @@ | |||
74 | 74 | ||
75 | #define SO_SELECT_ERR_QUEUE 45 | 75 | #define SO_SELECT_ERR_QUEUE 45 |
76 | 76 | ||
77 | #define SO_LL 46 | 77 | #define SO_BUSY_POLL 46 |
78 | 78 | ||
79 | #endif /* _ASM_SOCKET_H */ | 79 | #endif /* _ASM_SOCKET_H */ |
80 | 80 | ||
diff --git a/arch/h8300/include/uapi/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h index a38d38a6520b..9490758c5e2b 100644 --- a/arch/h8300/include/uapi/asm/socket.h +++ b/arch/h8300/include/uapi/asm/socket.h | |||
@@ -74,6 +74,6 @@ | |||
74 | 74 | ||
75 | #define SO_SELECT_ERR_QUEUE 45 | 75 | #define SO_SELECT_ERR_QUEUE 45 |
76 | 76 | ||
77 | #define SO_LL 46 | 77 | #define SO_BUSY_POLL 46 |
78 | 78 | ||
79 | #endif /* _ASM_SOCKET_H */ | 79 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h index d3358b760681..556d0701a155 100644 --- a/arch/ia64/include/uapi/asm/socket.h +++ b/arch/ia64/include/uapi/asm/socket.h | |||
@@ -83,6 +83,6 @@ | |||
83 | 83 | ||
84 | #define SO_SELECT_ERR_QUEUE 45 | 84 | #define SO_SELECT_ERR_QUEUE 45 |
85 | 85 | ||
86 | #define SO_LL 46 | 86 | #define SO_BUSY_POLL 46 |
87 | 87 | ||
88 | #endif /* _ASM_IA64_SOCKET_H */ | 88 | #endif /* _ASM_IA64_SOCKET_H */ |
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h index 44aaf4639a4a..24be7c8da86a 100644 --- a/arch/m32r/include/uapi/asm/socket.h +++ b/arch/m32r/include/uapi/asm/socket.h | |||
@@ -74,6 +74,6 @@ | |||
74 | 74 | ||
75 | #define SO_SELECT_ERR_QUEUE 45 | 75 | #define SO_SELECT_ERR_QUEUE 45 |
76 | 76 | ||
77 | #define SO_LL 46 | 77 | #define SO_BUSY_POLL 46 |
78 | 78 | ||
79 | #endif /* _ASM_M32R_SOCKET_H */ | 79 | #endif /* _ASM_M32R_SOCKET_H */ |
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h index 6a07992ba6c6..61c01f054d1b 100644 --- a/arch/mips/include/uapi/asm/socket.h +++ b/arch/mips/include/uapi/asm/socket.h | |||
@@ -92,6 +92,6 @@ | |||
92 | 92 | ||
93 | #define SO_SELECT_ERR_QUEUE 45 | 93 | #define SO_SELECT_ERR_QUEUE 45 |
94 | 94 | ||
95 | #define SO_LL 46 | 95 | #define SO_BUSY_POLL 46 |
96 | 96 | ||
97 | #endif /* _UAPI_ASM_SOCKET_H */ | 97 | #endif /* _UAPI_ASM_SOCKET_H */ |
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h index db80fd3e398b..e2a2b203eb00 100644 --- a/arch/mn10300/include/uapi/asm/socket.h +++ b/arch/mn10300/include/uapi/asm/socket.h | |||
@@ -74,6 +74,6 @@ | |||
74 | 74 | ||
75 | #define SO_SELECT_ERR_QUEUE 45 | 75 | #define SO_SELECT_ERR_QUEUE 45 |
76 | 76 | ||
77 | #define SO_LL 46 | 77 | #define SO_BUSY_POLL 46 |
78 | 78 | ||
79 | #endif /* _ASM_SOCKET_H */ | 79 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h index f866fff9a004..71700e636a8e 100644 --- a/arch/parisc/include/uapi/asm/socket.h +++ b/arch/parisc/include/uapi/asm/socket.h | |||
@@ -73,7 +73,7 @@ | |||
73 | 73 | ||
74 | #define SO_SELECT_ERR_QUEUE 0x4026 | 74 | #define SO_SELECT_ERR_QUEUE 0x4026 |
75 | 75 | ||
76 | #define SO_LL 0x4027 | 76 | #define SO_BUSY_POLL 0x4027 |
77 | 77 | ||
78 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we | 78 | /* O_NONBLOCK clashes with the bits used for socket types. Therefore we |
79 | * have to define SOCK_NONBLOCK to a different value here. | 79 | * have to define SOCK_NONBLOCK to a different value here. |
diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h index 405fb09bda94..a6d74467c9ed 100644 --- a/arch/powerpc/include/uapi/asm/socket.h +++ b/arch/powerpc/include/uapi/asm/socket.h | |||
@@ -81,6 +81,6 @@ | |||
81 | 81 | ||
82 | #define SO_SELECT_ERR_QUEUE 45 | 82 | #define SO_SELECT_ERR_QUEUE 45 |
83 | 83 | ||
84 | #define SO_LL 46 | 84 | #define SO_BUSY_POLL 46 |
85 | 85 | ||
86 | #endif /* _ASM_POWERPC_SOCKET_H */ | 86 | #endif /* _ASM_POWERPC_SOCKET_H */ |
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h index 0c5105fbaaf3..92494494692e 100644 --- a/arch/s390/include/uapi/asm/socket.h +++ b/arch/s390/include/uapi/asm/socket.h | |||
@@ -80,6 +80,6 @@ | |||
80 | 80 | ||
81 | #define SO_SELECT_ERR_QUEUE 45 | 81 | #define SO_SELECT_ERR_QUEUE 45 |
82 | 82 | ||
83 | #define SO_LL 46 | 83 | #define SO_BUSY_POLL 46 |
84 | 84 | ||
85 | #endif /* _ASM_SOCKET_H */ | 85 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h index b46c3fa0b265..4e1d66c3ce71 100644 --- a/arch/sparc/include/uapi/asm/socket.h +++ b/arch/sparc/include/uapi/asm/socket.h | |||
@@ -70,7 +70,7 @@ | |||
70 | 70 | ||
71 | #define SO_SELECT_ERR_QUEUE 0x0029 | 71 | #define SO_SELECT_ERR_QUEUE 0x0029 |
72 | 72 | ||
73 | #define SO_LL 0x0030 | 73 | #define SO_BUSY_POLL 0x0030 |
74 | 74 | ||
75 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | 75 | /* Security levels - as per NRL IPv6 - don't actually do anything */ |
76 | #define SO_SECURITY_AUTHENTICATION 0x5001 | 76 | #define SO_SECURITY_AUTHENTICATION 0x5001 |
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h index b21ace4fc9ba..c114483010c1 100644 --- a/arch/xtensa/include/uapi/asm/socket.h +++ b/arch/xtensa/include/uapi/asm/socket.h | |||
@@ -85,6 +85,6 @@ | |||
85 | 85 | ||
86 | #define SO_SELECT_ERR_QUEUE 45 | 86 | #define SO_SELECT_ERR_QUEUE 45 |
87 | 87 | ||
88 | #define SO_LL 46 | 88 | #define SO_BUSY_POLL 46 |
89 | 89 | ||
90 | #endif /* _XTENSA_SOCKET_H */ | 90 | #endif /* _XTENSA_SOCKET_H */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index ec3aa1d451e8..3353efe79194 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <net/tcp.h> | 24 | #include <net/tcp.h> |
25 | #include <net/ipv6.h> | 25 | #include <net/ipv6.h> |
26 | #include <net/ip6_checksum.h> | 26 | #include <net/ip6_checksum.h> |
27 | #include <net/ll_poll.h> | 27 | #include <net/busy_poll.h> |
28 | #include <linux/prefetch.h> | 28 | #include <linux/prefetch.h> |
29 | #include "bnx2x_cmn.h" | 29 | #include "bnx2x_cmn.h" |
30 | #include "bnx2x_init.h" | 30 | #include "bnx2x_init.h" |
@@ -990,7 +990,7 @@ reuse_rx: | |||
990 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), | 990 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), |
991 | le16_to_cpu(cqe_fp->vlan_tag)); | 991 | le16_to_cpu(cqe_fp->vlan_tag)); |
992 | 992 | ||
993 | skb_mark_ll(skb, &fp->napi); | 993 | skb_mark_napi_id(skb, &fp->napi); |
994 | 994 | ||
995 | if (bnx2x_fp_ll_polling(fp)) | 995 | if (bnx2x_fp_ll_polling(fp)) |
996 | netif_receive_skb(skb); | 996 | netif_receive_skb(skb); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 15a528bda87c..e5da07858a2f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -12027,7 +12027,7 @@ static const struct net_device_ops bnx2x_netdev_ops = { | |||
12027 | #endif | 12027 | #endif |
12028 | 12028 | ||
12029 | #ifdef CONFIG_NET_LL_RX_POLL | 12029 | #ifdef CONFIG_NET_LL_RX_POLL |
12030 | .ndo_ll_poll = bnx2x_low_latency_recv, | 12030 | .ndo_busy_poll = bnx2x_low_latency_recv, |
12031 | #endif | 12031 | #endif |
12032 | }; | 12032 | }; |
12033 | 12033 | ||
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index fb098b46c6a6..7be725cdfea8 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -52,7 +52,7 @@ | |||
52 | #include <linux/dca.h> | 52 | #include <linux/dca.h> |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | #include <net/ll_poll.h> | 55 | #include <net/busy_poll.h> |
56 | 56 | ||
57 | #ifdef CONFIG_NET_LL_RX_POLL | 57 | #ifdef CONFIG_NET_LL_RX_POLL |
58 | #define LL_EXTENDED_STATS | 58 | #define LL_EXTENDED_STATS |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 047ebaaf0141..bad8f14b1941 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -1978,7 +1978,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
1978 | } | 1978 | } |
1979 | 1979 | ||
1980 | #endif /* IXGBE_FCOE */ | 1980 | #endif /* IXGBE_FCOE */ |
1981 | skb_mark_ll(skb, &q_vector->napi); | 1981 | skb_mark_napi_id(skb, &q_vector->napi); |
1982 | ixgbe_rx_skb(q_vector, skb); | 1982 | ixgbe_rx_skb(q_vector, skb); |
1983 | 1983 | ||
1984 | /* update budget accounting */ | 1984 | /* update budget accounting */ |
@@ -7228,7 +7228,7 @@ static const struct net_device_ops ixgbe_netdev_ops = { | |||
7228 | .ndo_poll_controller = ixgbe_netpoll, | 7228 | .ndo_poll_controller = ixgbe_netpoll, |
7229 | #endif | 7229 | #endif |
7230 | #ifdef CONFIG_NET_LL_RX_POLL | 7230 | #ifdef CONFIG_NET_LL_RX_POLL |
7231 | .ndo_ll_poll = ixgbe_low_latency_recv, | 7231 | .ndo_busy_poll = ixgbe_low_latency_recv, |
7232 | #endif | 7232 | #endif |
7233 | #ifdef IXGBE_FCOE | 7233 | #ifdef IXGBE_FCOE |
7234 | .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get, | 7234 | .ndo_fcoe_ddp_setup = ixgbe_fcoe_ddp_get, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index caf204770569..5eac871399d8 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #include <linux/slab.h> | 38 | #include <linux/slab.h> |
39 | #include <linux/hash.h> | 39 | #include <linux/hash.h> |
40 | #include <net/ip.h> | 40 | #include <net/ip.h> |
41 | #include <net/ll_poll.h> | 41 | #include <net/busy_poll.h> |
42 | 42 | ||
43 | #include <linux/mlx4/driver.h> | 43 | #include <linux/mlx4/driver.h> |
44 | #include <linux/mlx4/device.h> | 44 | #include <linux/mlx4/device.h> |
@@ -2141,7 +2141,7 @@ static const struct net_device_ops mlx4_netdev_ops = { | |||
2141 | .ndo_rx_flow_steer = mlx4_en_filter_rfs, | 2141 | .ndo_rx_flow_steer = mlx4_en_filter_rfs, |
2142 | #endif | 2142 | #endif |
2143 | #ifdef CONFIG_NET_LL_RX_POLL | 2143 | #ifdef CONFIG_NET_LL_RX_POLL |
2144 | .ndo_ll_poll = mlx4_en_low_latency_recv, | 2144 | .ndo_busy_poll = mlx4_en_low_latency_recv, |
2145 | #endif | 2145 | #endif |
2146 | }; | 2146 | }; |
2147 | 2147 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 76997b93fdfe..dec455c8f627 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -31,7 +31,7 @@ | |||
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #include <net/ll_poll.h> | 34 | #include <net/busy_poll.h> |
35 | #include <linux/mlx4/cq.h> | 35 | #include <linux/mlx4/cq.h> |
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/mlx4/qp.h> | 37 | #include <linux/mlx4/qp.h> |
@@ -767,7 +767,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
767 | timestamp); | 767 | timestamp); |
768 | } | 768 | } |
769 | 769 | ||
770 | skb_mark_ll(skb, &cq->napi); | 770 | skb_mark_napi_id(skb, &cq->napi); |
771 | 771 | ||
772 | /* Push it up the stack */ | 772 | /* Push it up the stack */ |
773 | netif_receive_skb(skb); | 773 | netif_receive_skb(skb); |
diff --git a/fs/select.c b/fs/select.c index f9f49c40cfd4..35d4adc749d9 100644 --- a/fs/select.c +++ b/fs/select.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/hrtimer.h> | 28 | #include <linux/hrtimer.h> |
29 | #include <linux/sched/rt.h> | 29 | #include <linux/sched/rt.h> |
30 | #include <linux/freezer.h> | 30 | #include <linux/freezer.h> |
31 | #include <net/ll_poll.h> | 31 | #include <net/busy_poll.h> |
32 | 32 | ||
33 | #include <asm/uaccess.h> | 33 | #include <asm/uaccess.h> |
34 | 34 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index bb82871b8494..0741a1e919a5 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -974,7 +974,7 @@ struct net_device_ops { | |||
974 | void (*ndo_netpoll_cleanup)(struct net_device *dev); | 974 | void (*ndo_netpoll_cleanup)(struct net_device *dev); |
975 | #endif | 975 | #endif |
976 | #ifdef CONFIG_NET_LL_RX_POLL | 976 | #ifdef CONFIG_NET_LL_RX_POLL |
977 | int (*ndo_ll_poll)(struct napi_struct *dev); | 977 | int (*ndo_busy_poll)(struct napi_struct *dev); |
978 | #endif | 978 | #endif |
979 | int (*ndo_set_vf_mac)(struct net_device *dev, | 979 | int (*ndo_set_vf_mac)(struct net_device *dev, |
980 | int queue, u8 *mac); | 980 | int queue, u8 *mac); |
diff --git a/include/net/ll_poll.h b/include/net/busy_poll.h index 76f034087743..a14339c2985f 100644 --- a/include/net/ll_poll.h +++ b/include/net/busy_poll.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Low Latency Sockets | 2 | * net busy poll support |
3 | * Copyright(c) 2013 Intel Corporation. | 3 | * Copyright(c) 2013 Intel Corporation. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
@@ -21,8 +21,8 @@ | |||
21 | * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> | 21 | * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net> |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #ifndef _LINUX_NET_LL_POLL_H | 24 | #ifndef _LINUX_NET_BUSY_POLL_H |
25 | #define _LINUX_NET_LL_POLL_H | 25 | #define _LINUX_NET_BUSY_POLL_H |
26 | 26 | ||
27 | #include <linux/netdevice.h> | 27 | #include <linux/netdevice.h> |
28 | #include <net/ip.h> | 28 | #include <net/ip.h> |
@@ -30,8 +30,8 @@ | |||
30 | #ifdef CONFIG_NET_LL_RX_POLL | 30 | #ifdef CONFIG_NET_LL_RX_POLL |
31 | 31 | ||
32 | struct napi_struct; | 32 | struct napi_struct; |
33 | extern unsigned int sysctl_net_ll_read __read_mostly; | 33 | extern unsigned int sysctl_net_busy_read __read_mostly; |
34 | extern unsigned int sysctl_net_ll_poll __read_mostly; | 34 | extern unsigned int sysctl_net_busy_poll __read_mostly; |
35 | 35 | ||
36 | /* return values from ndo_ll_poll */ | 36 | /* return values from ndo_ll_poll */ |
37 | #define LL_FLUSH_FAILED -1 | 37 | #define LL_FLUSH_FAILED -1 |
@@ -39,7 +39,7 @@ extern unsigned int sysctl_net_ll_poll __read_mostly; | |||
39 | 39 | ||
40 | static inline bool net_busy_loop_on(void) | 40 | static inline bool net_busy_loop_on(void) |
41 | { | 41 | { |
42 | return sysctl_net_ll_poll; | 42 | return sysctl_net_busy_poll; |
43 | } | 43 | } |
44 | 44 | ||
45 | /* a wrapper to make debug_smp_processor_id() happy | 45 | /* a wrapper to make debug_smp_processor_id() happy |
@@ -72,7 +72,7 @@ static inline unsigned long sk_busy_loop_end_time(struct sock *sk) | |||
72 | /* in poll/select we use the global sysctl_net_ll_poll value */ | 72 | /* in poll/select we use the global sysctl_net_ll_poll value */ |
73 | static inline unsigned long busy_loop_end_time(void) | 73 | static inline unsigned long busy_loop_end_time(void) |
74 | { | 74 | { |
75 | return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_ll_poll); | 75 | return busy_loop_us_clock() + ACCESS_ONCE(sysctl_net_busy_poll); |
76 | } | 76 | } |
77 | 77 | ||
78 | static inline bool sk_can_busy_loop(struct sock *sk) | 78 | static inline bool sk_can_busy_loop(struct sock *sk) |
@@ -110,11 +110,11 @@ static inline bool sk_busy_loop(struct sock *sk, int nonblock) | |||
110 | goto out; | 110 | goto out; |
111 | 111 | ||
112 | ops = napi->dev->netdev_ops; | 112 | ops = napi->dev->netdev_ops; |
113 | if (!ops->ndo_ll_poll) | 113 | if (!ops->ndo_busy_poll) |
114 | goto out; | 114 | goto out; |
115 | 115 | ||
116 | do { | 116 | do { |
117 | rc = ops->ndo_ll_poll(napi); | 117 | rc = ops->ndo_busy_poll(napi); |
118 | 118 | ||
119 | if (rc == LL_FLUSH_FAILED) | 119 | if (rc == LL_FLUSH_FAILED) |
120 | break; /* permanent failure */ | 120 | break; /* permanent failure */ |
@@ -134,13 +134,14 @@ out: | |||
134 | } | 134 | } |
135 | 135 | ||
136 | /* used in the NIC receive handler to mark the skb */ | 136 | /* used in the NIC receive handler to mark the skb */ |
137 | static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi) | 137 | static inline void skb_mark_napi_id(struct sk_buff *skb, |
138 | struct napi_struct *napi) | ||
138 | { | 139 | { |
139 | skb->napi_id = napi->napi_id; | 140 | skb->napi_id = napi->napi_id; |
140 | } | 141 | } |
141 | 142 | ||
142 | /* used in the protocol hanlder to propagate the napi_id to the socket */ | 143 | /* used in the protocol hanlder to propagate the napi_id to the socket */ |
143 | static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb) | 144 | static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb) |
144 | { | 145 | { |
145 | sk->sk_napi_id = skb->napi_id; | 146 | sk->sk_napi_id = skb->napi_id; |
146 | } | 147 | } |
@@ -166,11 +167,12 @@ static inline bool sk_busy_poll(struct sock *sk, int nonblock) | |||
166 | return false; | 167 | return false; |
167 | } | 168 | } |
168 | 169 | ||
169 | static inline void skb_mark_ll(struct sk_buff *skb, struct napi_struct *napi) | 170 | static inline void skb_mark_napi_id(struct sk_buff *skb, |
171 | struct napi_struct *napi) | ||
170 | { | 172 | { |
171 | } | 173 | } |
172 | 174 | ||
173 | static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb) | 175 | static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb) |
174 | { | 176 | { |
175 | } | 177 | } |
176 | 178 | ||
@@ -180,4 +182,4 @@ static inline bool busy_loop_timeout(unsigned long end_time) | |||
180 | } | 182 | } |
181 | 183 | ||
182 | #endif /* CONFIG_NET_LL_RX_POLL */ | 184 | #endif /* CONFIG_NET_LL_RX_POLL */ |
183 | #endif /* _LINUX_NET_LL_POLL_H */ | 185 | #endif /* _LINUX_NET_BUSY_POLL_H */ |
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index ca3a20d772ac..f04b69b6abf2 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
@@ -76,6 +76,6 @@ | |||
76 | 76 | ||
77 | #define SO_SELECT_ERR_QUEUE 45 | 77 | #define SO_SELECT_ERR_QUEUE 45 |
78 | 78 | ||
79 | #define SO_LL 46 | 79 | #define SO_BUSY_POLL 46 |
80 | 80 | ||
81 | #endif /* __ASM_GENERIC_SOCKET_H */ | 81 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/net/core/datagram.c b/net/core/datagram.c index 6e9ab31e457e..8ab48cd89559 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
@@ -56,7 +56,7 @@ | |||
56 | #include <net/sock.h> | 56 | #include <net/sock.h> |
57 | #include <net/tcp_states.h> | 57 | #include <net/tcp_states.h> |
58 | #include <trace/events/skb.h> | 58 | #include <trace/events/skb.h> |
59 | #include <net/ll_poll.h> | 59 | #include <net/busy_poll.h> |
60 | 60 | ||
61 | /* | 61 | /* |
62 | * Is a socket 'connection oriented' ? | 62 | * Is a socket 'connection oriented' ? |
diff --git a/net/core/sock.c b/net/core/sock.c index ab06b719f5b1..548d716c5f62 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -139,7 +139,7 @@ | |||
139 | #include <net/tcp.h> | 139 | #include <net/tcp.h> |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | #include <net/ll_poll.h> | 142 | #include <net/busy_poll.h> |
143 | 143 | ||
144 | static DEFINE_MUTEX(proto_list_mutex); | 144 | static DEFINE_MUTEX(proto_list_mutex); |
145 | static LIST_HEAD(proto_list); | 145 | static LIST_HEAD(proto_list); |
@@ -901,7 +901,7 @@ set_rcvbuf: | |||
901 | break; | 901 | break; |
902 | 902 | ||
903 | #ifdef CONFIG_NET_LL_RX_POLL | 903 | #ifdef CONFIG_NET_LL_RX_POLL |
904 | case SO_LL: | 904 | case SO_BUSY_POLL: |
905 | /* allow unprivileged users to decrease the value */ | 905 | /* allow unprivileged users to decrease the value */ |
906 | if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) | 906 | if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN)) |
907 | ret = -EPERM; | 907 | ret = -EPERM; |
@@ -1171,7 +1171,7 @@ int sock_getsockopt(struct socket *sock, int level, int optname, | |||
1171 | break; | 1171 | break; |
1172 | 1172 | ||
1173 | #ifdef CONFIG_NET_LL_RX_POLL | 1173 | #ifdef CONFIG_NET_LL_RX_POLL |
1174 | case SO_LL: | 1174 | case SO_BUSY_POLL: |
1175 | v.val = sk->sk_ll_usec; | 1175 | v.val = sk->sk_ll_usec; |
1176 | break; | 1176 | break; |
1177 | #endif | 1177 | #endif |
@@ -2294,7 +2294,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) | |||
2294 | 2294 | ||
2295 | #ifdef CONFIG_NET_LL_RX_POLL | 2295 | #ifdef CONFIG_NET_LL_RX_POLL |
2296 | sk->sk_napi_id = 0; | 2296 | sk->sk_napi_id = 0; |
2297 | sk->sk_ll_usec = sysctl_net_ll_read; | 2297 | sk->sk_ll_usec = sysctl_net_busy_read; |
2298 | #endif | 2298 | #endif |
2299 | 2299 | ||
2300 | /* | 2300 | /* |
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index afc677eadd93..660968616637 100644 --- a/net/core/sysctl_net_core.c +++ b/net/core/sysctl_net_core.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <net/ip.h> | 19 | #include <net/ip.h> |
20 | #include <net/sock.h> | 20 | #include <net/sock.h> |
21 | #include <net/net_ratelimit.h> | 21 | #include <net/net_ratelimit.h> |
22 | #include <net/ll_poll.h> | 22 | #include <net/busy_poll.h> |
23 | 23 | ||
24 | static int one = 1; | 24 | static int one = 1; |
25 | 25 | ||
@@ -300,15 +300,15 @@ static struct ctl_table net_core_table[] = { | |||
300 | #endif /* CONFIG_NET_FLOW_LIMIT */ | 300 | #endif /* CONFIG_NET_FLOW_LIMIT */ |
301 | #ifdef CONFIG_NET_LL_RX_POLL | 301 | #ifdef CONFIG_NET_LL_RX_POLL |
302 | { | 302 | { |
303 | .procname = "low_latency_poll", | 303 | .procname = "busy_poll", |
304 | .data = &sysctl_net_ll_poll, | 304 | .data = &sysctl_net_busy_poll, |
305 | .maxlen = sizeof(unsigned int), | 305 | .maxlen = sizeof(unsigned int), |
306 | .mode = 0644, | 306 | .mode = 0644, |
307 | .proc_handler = proc_dointvec | 307 | .proc_handler = proc_dointvec |
308 | }, | 308 | }, |
309 | { | 309 | { |
310 | .procname = "low_latency_read", | 310 | .procname = "busy_read", |
311 | .data = &sysctl_net_ll_read, | 311 | .data = &sysctl_net_busy_read, |
312 | .maxlen = sizeof(unsigned int), | 312 | .maxlen = sizeof(unsigned int), |
313 | .mode = 0644, | 313 | .mode = 0644, |
314 | .proc_handler = proc_dointvec | 314 | .proc_handler = proc_dointvec |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 15cbfa94bd8e..5423223e93c2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -279,7 +279,7 @@ | |||
279 | 279 | ||
280 | #include <asm/uaccess.h> | 280 | #include <asm/uaccess.h> |
281 | #include <asm/ioctls.h> | 281 | #include <asm/ioctls.h> |
282 | #include <net/ll_poll.h> | 282 | #include <net/busy_poll.h> |
283 | 283 | ||
284 | int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT; | 284 | int sysctl_tcp_fin_timeout __read_mostly = TCP_FIN_TIMEOUT; |
285 | 285 | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 35675e46aff8..b299da5ff499 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -75,7 +75,7 @@ | |||
75 | #include <net/netdma.h> | 75 | #include <net/netdma.h> |
76 | #include <net/secure_seq.h> | 76 | #include <net/secure_seq.h> |
77 | #include <net/tcp_memcontrol.h> | 77 | #include <net/tcp_memcontrol.h> |
78 | #include <net/ll_poll.h> | 78 | #include <net/busy_poll.h> |
79 | 79 | ||
80 | #include <linux/inet.h> | 80 | #include <linux/inet.h> |
81 | #include <linux/ipv6.h> | 81 | #include <linux/ipv6.h> |
@@ -1994,7 +1994,7 @@ process: | |||
1994 | if (sk_filter(sk, skb)) | 1994 | if (sk_filter(sk, skb)) |
1995 | goto discard_and_relse; | 1995 | goto discard_and_relse; |
1996 | 1996 | ||
1997 | sk_mark_ll(sk, skb); | 1997 | sk_mark_napi_id(sk, skb); |
1998 | skb->dev = NULL; | 1998 | skb->dev = NULL; |
1999 | 1999 | ||
2000 | bh_lock_sock_nested(sk); | 2000 | bh_lock_sock_nested(sk); |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 6b270e53c207..a0d7151ffbd9 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -109,7 +109,7 @@ | |||
109 | #include <trace/events/udp.h> | 109 | #include <trace/events/udp.h> |
110 | #include <linux/static_key.h> | 110 | #include <linux/static_key.h> |
111 | #include <trace/events/skb.h> | 111 | #include <trace/events/skb.h> |
112 | #include <net/ll_poll.h> | 112 | #include <net/busy_poll.h> |
113 | #include "udp_impl.h" | 113 | #include "udp_impl.h" |
114 | 114 | ||
115 | struct udp_table udp_table __read_mostly; | 115 | struct udp_table udp_table __read_mostly; |
@@ -1713,7 +1713,7 @@ int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
1713 | if (sk != NULL) { | 1713 | if (sk != NULL) { |
1714 | int ret; | 1714 | int ret; |
1715 | 1715 | ||
1716 | sk_mark_ll(sk, skb); | 1716 | sk_mark_napi_id(sk, skb); |
1717 | ret = udp_queue_rcv_skb(sk, skb); | 1717 | ret = udp_queue_rcv_skb(sk, skb); |
1718 | sock_put(sk); | 1718 | sock_put(sk); |
1719 | 1719 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5cffa5c3e6b8..6e1649d58533 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -63,7 +63,7 @@ | |||
63 | #include <net/inet_common.h> | 63 | #include <net/inet_common.h> |
64 | #include <net/secure_seq.h> | 64 | #include <net/secure_seq.h> |
65 | #include <net/tcp_memcontrol.h> | 65 | #include <net/tcp_memcontrol.h> |
66 | #include <net/ll_poll.h> | 66 | #include <net/busy_poll.h> |
67 | 67 | ||
68 | #include <asm/uaccess.h> | 68 | #include <asm/uaccess.h> |
69 | 69 | ||
@@ -1499,7 +1499,7 @@ process: | |||
1499 | if (sk_filter(sk, skb)) | 1499 | if (sk_filter(sk, skb)) |
1500 | goto discard_and_relse; | 1500 | goto discard_and_relse; |
1501 | 1501 | ||
1502 | sk_mark_ll(sk, skb); | 1502 | sk_mark_napi_id(sk, skb); |
1503 | skb->dev = NULL; | 1503 | skb->dev = NULL; |
1504 | 1504 | ||
1505 | bh_lock_sock_nested(sk); | 1505 | bh_lock_sock_nested(sk); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index b6f31437a1f8..f4058150262b 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #include <net/ip6_checksum.h> | 46 | #include <net/ip6_checksum.h> |
47 | #include <net/xfrm.h> | 47 | #include <net/xfrm.h> |
48 | #include <net/inet6_hashtables.h> | 48 | #include <net/inet6_hashtables.h> |
49 | #include <net/ll_poll.h> | 49 | #include <net/busy_poll.h> |
50 | 50 | ||
51 | #include <linux/proc_fs.h> | 51 | #include <linux/proc_fs.h> |
52 | #include <linux/seq_file.h> | 52 | #include <linux/seq_file.h> |
@@ -844,7 +844,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable, | |||
844 | if (sk != NULL) { | 844 | if (sk != NULL) { |
845 | int ret; | 845 | int ret; |
846 | 846 | ||
847 | sk_mark_ll(sk, skb); | 847 | sk_mark_napi_id(sk, skb); |
848 | ret = udpv6_queue_rcv_skb(sk, skb); | 848 | ret = udpv6_queue_rcv_skb(sk, skb); |
849 | sock_put(sk); | 849 | sock_put(sk); |
850 | 850 | ||
diff --git a/net/socket.c b/net/socket.c index 45afa648364a..829b460acb87 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -104,11 +104,11 @@ | |||
104 | #include <linux/route.h> | 104 | #include <linux/route.h> |
105 | #include <linux/sockios.h> | 105 | #include <linux/sockios.h> |
106 | #include <linux/atalk.h> | 106 | #include <linux/atalk.h> |
107 | #include <net/ll_poll.h> | 107 | #include <net/busy_poll.h> |
108 | 108 | ||
109 | #ifdef CONFIG_NET_LL_RX_POLL | 109 | #ifdef CONFIG_NET_LL_RX_POLL |
110 | unsigned int sysctl_net_ll_read __read_mostly; | 110 | unsigned int sysctl_net_busy_read __read_mostly; |
111 | unsigned int sysctl_net_ll_poll __read_mostly; | 111 | unsigned int sysctl_net_busy_poll __read_mostly; |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | static int sock_no_open(struct inode *irrelevant, struct file *dontcare); | 114 | static int sock_no_open(struct inode *irrelevant, struct file *dontcare); |