All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/3] net: low latency sockets follow ups
@ 2013-06-12 11:19 ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:19 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, netdev, Jesse Brandeburg, Don Skidmore,
	e1000-devel, Willem de Bruijn, Eric Dumazet, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

David,

Here are two clean up patches, plus one that adds a socket option for LLS.

Patch 1 removes the config menu for NET_LL_RX_POLL and defaults to y.
Patch 2 converts sysctl_net_ll_poll into an unsigned int
Patch 3 adds an SO_LL socket option to allow per-socket control of busy polling.

I will reply to this thread with a patch to sockperf that enables
the socket option.

Thanks,
Eliezer


Change log:

v2
- added a patch to convert sysctl_net_ll_poll into an unsigned int.
- suggested by Eric Dimazet: treat sk_ll_usec as a u_int rather than a u_long.
- suggested by Ben Huchings: allow unprivileged user to decrease SO_LL value,
  correct return value when operation is not allowed.


^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 0/3] net: low latency sockets follow ups
@ 2013-06-12 11:19 ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:19 UTC (permalink / raw)
  To: David Miller
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, linux-kernel, Alex Rosenbaum, Jesse Brandeburg,
	Eliezer Tamir, Avner Ben Hanoch, Andi Kleen, Ben Hutchings,
	Eric Dumazet, Eilon Greenstien

David,

Here are two clean up patches, plus one that adds a socket option for LLS.

Patch 1 removes the config menu for NET_LL_RX_POLL and defaults to y.
Patch 2 converts sysctl_net_ll_poll into an unsigned int
Patch 3 adds an SO_LL socket option to allow per-socket control of busy polling.

I will reply to this thread with a patch to sockperf that enables
the socket option.

Thanks,
Eliezer


Change log:

v2
- added a patch to convert sysctl_net_ll_poll into an unsigned int.
- suggested by Eric Dimazet: treat sk_ll_usec as a u_int rather than a u_long.
- suggested by Ben Huchings: allow unprivileged user to decrease SO_LL value,
  correct return value when operation is not allowed.


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 1/3] net: remove NET_LL_RX_POLL config menue
  2013-06-12 11:19 ` Eliezer Tamir
@ 2013-06-12 11:19   ` Eliezer Tamir
  -1 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:19 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, netdev, Jesse Brandeburg, Don Skidmore,
	e1000-devel, Willem de Bruijn, Eric Dumazet, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

Remove NET_LL_RX_POLL from the config menu.
Change default to y.
Busy polling still needs to be enabled at run time.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 net/Kconfig |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/net/Kconfig b/net/Kconfig
index d6a9ce6..8fe8845 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -244,16 +244,9 @@ config NETPRIO_CGROUP
 	  a per-interface basis
 
 config NET_LL_RX_POLL
-	bool "Low Latency Receive Poll"
+	boolean
 	depends on X86_TSC
-	default n
-	---help---
-	  Support Low Latency Receive Queue Poll.
-	  (For network card drivers which support this option.)
-	  When waiting for data in read or poll call directly into the the device driver
-	  to flush packets which may be pending on the device queues into the stack.
-
-	  If unsure, say N.
+	default y
 
 config BQL
 	boolean


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 1/3] net: remove NET_LL_RX_POLL config menue
@ 2013-06-12 11:19   ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:19 UTC (permalink / raw)
  To: David Miller
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, linux-kernel, Alex Rosenbaum, Jesse Brandeburg,
	Eliezer Tamir, Avner Ben Hanoch, Andi Kleen, Ben Hutchings,
	Eric Dumazet, Eilon Greenstien

Remove NET_LL_RX_POLL from the config menu.
Change default to y.
Busy polling still needs to be enabled at run time.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 net/Kconfig |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/net/Kconfig b/net/Kconfig
index d6a9ce6..8fe8845 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -244,16 +244,9 @@ config NETPRIO_CGROUP
 	  a per-interface basis
 
 config NET_LL_RX_POLL
-	bool "Low Latency Receive Poll"
+	boolean
 	depends on X86_TSC
-	default n
-	---help---
-	  Support Low Latency Receive Queue Poll.
-	  (For network card drivers which support this option.)
-	  When waiting for data in read or poll call directly into the the device driver
-	  to flush packets which may be pending on the device queues into the stack.
-
-	  If unsure, say N.
+	default y
 
 config BQL
 	boolean


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int
  2013-06-12 11:19 ` Eliezer Tamir
@ 2013-06-12 11:20   ` Eliezer Tamir
  -1 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:20 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, netdev, Jesse Brandeburg, Don Skidmore,
	e1000-devel, Willem de Bruijn, Eric Dumazet, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

There is no reason for sysctl_net_ll_poll to be an unsigned long.
Change it into an unsigned int.
Fix the proc handler.
Add a cast in ll_end_time()

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 include/net/ll_poll.h      |    5 +++--
 net/core/sysctl_net_core.c |    4 ++--
 net/socket.c               |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
index bc262f8..d20508d 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -34,7 +34,7 @@
 #ifdef CONFIG_NET_LL_RX_POLL
 
 struct napi_struct;
-extern unsigned long sysctl_net_ll_poll __read_mostly;
+extern unsigned int sysctl_net_ll_poll __read_mostly;
 
 /* return values from ndo_ll_poll */
 #define LL_FLUSH_FAILED		-1
@@ -45,7 +45,8 @@ extern unsigned long sysctl_net_ll_poll __read_mostly;
 
 static inline cycles_t ll_end_time(void)
 {
-	return TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll) + get_cycles();
+	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll)
+		 + get_cycles();
 }
 
 static inline bool sk_valid_ll(struct sock *sk)
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 4b48f39..3c78b75 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -289,9 +289,9 @@ static struct ctl_table net_core_table[] = {
 	{
 		.procname	= "low_latency_poll",
 		.data		= &sysctl_net_ll_poll,
-		.maxlen		= sizeof(unsigned long),
+		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_doulongvec_minmax
+		.proc_handler	= proc_dointvec
 	},
 #endif
 #endif /* CONFIG_NET */
diff --git a/net/socket.c b/net/socket.c
index 21fd29f..caaffa1 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -107,7 +107,7 @@
 #include <net/ll_poll.h>
 
 #ifdef CONFIG_NET_LL_RX_POLL
-unsigned long sysctl_net_ll_poll __read_mostly;
+unsigned int sysctl_net_ll_poll __read_mostly;
 EXPORT_SYMBOL_GPL(sysctl_net_ll_poll);
 #endif
 


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int
@ 2013-06-12 11:20   ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:20 UTC (permalink / raw)
  To: David Miller
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, linux-kernel, Alex Rosenbaum, Jesse Brandeburg,
	Eliezer Tamir, Avner Ben Hanoch, Andi Kleen, Ben Hutchings,
	Eric Dumazet, Eilon Greenstien

There is no reason for sysctl_net_ll_poll to be an unsigned long.
Change it into an unsigned int.
Fix the proc handler.
Add a cast in ll_end_time()

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 include/net/ll_poll.h      |    5 +++--
 net/core/sysctl_net_core.c |    4 ++--
 net/socket.c               |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
index bc262f8..d20508d 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -34,7 +34,7 @@
 #ifdef CONFIG_NET_LL_RX_POLL
 
 struct napi_struct;
-extern unsigned long sysctl_net_ll_poll __read_mostly;
+extern unsigned int sysctl_net_ll_poll __read_mostly;
 
 /* return values from ndo_ll_poll */
 #define LL_FLUSH_FAILED		-1
@@ -45,7 +45,8 @@ extern unsigned long sysctl_net_ll_poll __read_mostly;
 
 static inline cycles_t ll_end_time(void)
 {
-	return TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll) + get_cycles();
+	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll)
+		 + get_cycles();
 }
 
 static inline bool sk_valid_ll(struct sock *sk)
diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c
index 4b48f39..3c78b75 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -289,9 +289,9 @@ static struct ctl_table net_core_table[] = {
 	{
 		.procname	= "low_latency_poll",
 		.data		= &sysctl_net_ll_poll,
-		.maxlen		= sizeof(unsigned long),
+		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_doulongvec_minmax
+		.proc_handler	= proc_dointvec
 	},
 #endif
 #endif /* CONFIG_NET */
diff --git a/net/socket.c b/net/socket.c
index 21fd29f..caaffa1 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -107,7 +107,7 @@
 #include <net/ll_poll.h>
 
 #ifdef CONFIG_NET_LL_RX_POLL
-unsigned long sysctl_net_ll_poll __read_mostly;
+unsigned int sysctl_net_ll_poll __read_mostly;
 EXPORT_SYMBOL_GPL(sysctl_net_ll_poll);
 #endif
 


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 3/3] net: add socket option for low latency polling
  2013-06-12 11:19 ` Eliezer Tamir
@ 2013-06-12 11:20   ` Eliezer Tamir
  -1 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:20 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, netdev, Jesse Brandeburg, Don Skidmore,
	e1000-devel, Willem de Bruijn, Eric Dumazet, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

adds a socket option for low latency polling.
This allows overriding the global sysctl value with a per-socket one.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 arch/alpha/include/uapi/asm/socket.h   |    2 ++
 arch/avr32/include/uapi/asm/socket.h   |    2 ++
 arch/cris/include/uapi/asm/socket.h    |    2 ++
 arch/frv/include/uapi/asm/socket.h     |    2 ++
 arch/h8300/include/uapi/asm/socket.h   |    2 ++
 arch/ia64/include/uapi/asm/socket.h    |    2 ++
 arch/m32r/include/uapi/asm/socket.h    |    2 ++
 arch/mips/include/uapi/asm/socket.h    |    2 ++
 arch/mn10300/include/uapi/asm/socket.h |    2 ++
 arch/parisc/include/uapi/asm/socket.h  |    2 ++
 arch/powerpc/include/uapi/asm/socket.h |    2 ++
 arch/s390/include/uapi/asm/socket.h    |    2 ++
 arch/sparc/include/uapi/asm/socket.h   |    2 ++
 arch/xtensa/include/uapi/asm/socket.h  |    2 ++
 include/net/ll_poll.h                  |   10 +++++-----
 include/net/sock.h                     |    2 ++
 include/uapi/asm-generic/socket.h      |    2 ++
 net/core/sock.c                        |   20 ++++++++++++++++++++
 18 files changed, 57 insertions(+), 5 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index eee6ea7..4885825 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -81,4 +81,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 37401f5..79b6179 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index ba409c9..47b1ec5 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -76,6 +76,8 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
 
 
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index 31dbb5d..dbc0852 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -74,5 +74,7 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
 
diff --git a/arch/h8300/include/uapi/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h
index 5d1c6d0..a38d38a 100644
--- a/arch/h8300/include/uapi/asm/socket.h
+++ b/arch/h8300/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index 6b4329f..d3358b7 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -83,4 +83,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 2a3b59e..44aaf46 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index 3b21150..6a07992 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -92,4 +92,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index b4ce844..db80fd3 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index 70c512a..f866fff 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -73,6 +73,8 @@
 
 #define SO_SELECT_ERR_QUEUE	0x4026
 
+#define SO_LL			0x4027
+
 /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
  * 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 a36daf3..405fb09 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -81,4 +81,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif	/* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index 2dacb306..0c5105fb 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -80,4 +80,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index 89f49b6..b46c3fa 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -70,6 +70,8 @@
 
 #define SO_SELECT_ERR_QUEUE	0x0029
 
+#define SO_LL			0x0030
+
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		0x5001
 #define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index a8f44f5..b21ace4 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -85,4 +85,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif	/* _XTENSA_SOCKET_H */
diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
index d20508d..437bf11 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -43,15 +43,15 @@ extern unsigned int sysctl_net_ll_poll __read_mostly;
 /* we don't mind a ~2.5% imprecision */
 #define TSC_MHZ (tsc_khz >> 10)
 
-static inline cycles_t ll_end_time(void)
+static inline cycles_t ll_end_time(struct sock *sk)
 {
-	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll)
+	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sk->sk_ll_usec)
 		 + get_cycles();
 }
 
 static inline bool sk_valid_ll(struct sock *sk)
 {
-	return sysctl_net_ll_poll && sk->sk_napi_id &&
+	return sk->sk_ll_usec && sk->sk_napi_id &&
 	       !need_resched() && !signal_pending(current);
 }
 
@@ -63,7 +63,7 @@ static inline bool can_poll_ll(cycles_t end_time)
 
 static inline bool sk_poll_ll(struct sock *sk, int nonblock)
 {
-	cycles_t end_time = ll_end_time();
+	cycles_t end_time = ll_end_time(sk);
 	const struct net_device_ops *ops;
 	struct napi_struct *napi;
 	int rc = false;
@@ -117,7 +117,7 @@ static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb)
 
 #else /* CONFIG_NET_LL_RX_POLL */
 
-static inline cycles_t ll_end_time(void)
+static inline cycles_t ll_end_time(struct sock *sk)
 {
 	return 0;
 }
diff --git a/include/net/sock.h b/include/net/sock.h
index ac8e181..21db792 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -230,6 +230,7 @@ struct cg_proto;
   *	@sk_wmem_queued: persistent queue size
   *	@sk_forward_alloc: space allocated forward
   *	@sk_napi_id: id of the last napi context to receive data for sk
+  *	@sk_ll_usec: usecs to busypoll when there is no data
   *	@sk_allocation: allocation mode
   *	@sk_sndbuf: size of send buffer in bytes
   *	@sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
@@ -328,6 +329,7 @@ struct sock {
 #endif
 #ifdef CONFIG_NET_LL_RX_POLL
 	unsigned int		sk_napi_id;
+	unsigned int		sk_ll_usec;
 #endif
 	atomic_t		sk_drops;
 	int			sk_rcvbuf;
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index c5d2e3a..ca3a20d 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -76,4 +76,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 788c0da..1e744b1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -913,6 +913,19 @@ set_rcvbuf:
 		sock_valbool_flag(sk, SOCK_SELECT_ERR_QUEUE, valbool);
 		break;
 
+#ifdef CONFIG_NET_LL_RX_POLL
+	case SO_LL:
+		/* allow unprivileged users to decrease the value */
+		if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN))
+			ret = -EPERM;
+		else {
+			if (val < 0)
+				ret = -EINVAL;
+			else
+				sk->sk_ll_usec = val;
+		}
+		break;
+#endif
 	default:
 		ret = -ENOPROTOOPT;
 		break;
@@ -1170,6 +1183,12 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		v.val = sock_flag(sk, SOCK_SELECT_ERR_QUEUE);
 		break;
 
+#ifdef CONFIG_NET_LL_RX_POLL
+	case SO_LL:
+		v.val = sk->sk_ll_usec;
+		break;
+#endif
+
 	default:
 		return -ENOPROTOOPT;
 	}
@@ -2288,6 +2307,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 
 #ifdef CONFIG_NET_LL_RX_POLL
 	sk->sk_napi_id		=	0;
+	sk->sk_ll_usec		=	sysctl_net_ll_poll;
 #endif
 
 	/*


^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 net-next 3/3] net: add socket option for low latency polling
@ 2013-06-12 11:20   ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:20 UTC (permalink / raw)
  To: David Miller
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, linux-kernel, Alex Rosenbaum, Jesse Brandeburg,
	Eliezer Tamir, Avner Ben Hanoch, Andi Kleen, Ben Hutchings,
	Eric Dumazet, Eilon Greenstien

adds a socket option for low latency polling.
This allows overriding the global sysctl value with a per-socket one.

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 arch/alpha/include/uapi/asm/socket.h   |    2 ++
 arch/avr32/include/uapi/asm/socket.h   |    2 ++
 arch/cris/include/uapi/asm/socket.h    |    2 ++
 arch/frv/include/uapi/asm/socket.h     |    2 ++
 arch/h8300/include/uapi/asm/socket.h   |    2 ++
 arch/ia64/include/uapi/asm/socket.h    |    2 ++
 arch/m32r/include/uapi/asm/socket.h    |    2 ++
 arch/mips/include/uapi/asm/socket.h    |    2 ++
 arch/mn10300/include/uapi/asm/socket.h |    2 ++
 arch/parisc/include/uapi/asm/socket.h  |    2 ++
 arch/powerpc/include/uapi/asm/socket.h |    2 ++
 arch/s390/include/uapi/asm/socket.h    |    2 ++
 arch/sparc/include/uapi/asm/socket.h   |    2 ++
 arch/xtensa/include/uapi/asm/socket.h  |    2 ++
 include/net/ll_poll.h                  |   10 +++++-----
 include/net/sock.h                     |    2 ++
 include/uapi/asm-generic/socket.h      |    2 ++
 net/core/sock.c                        |   20 ++++++++++++++++++++
 18 files changed, 57 insertions(+), 5 deletions(-)

diff --git a/arch/alpha/include/uapi/asm/socket.h b/arch/alpha/include/uapi/asm/socket.h
index eee6ea7..4885825 100644
--- a/arch/alpha/include/uapi/asm/socket.h
+++ b/arch/alpha/include/uapi/asm/socket.h
@@ -81,4 +81,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/avr32/include/uapi/asm/socket.h b/arch/avr32/include/uapi/asm/socket.h
index 37401f5..79b6179 100644
--- a/arch/avr32/include/uapi/asm/socket.h
+++ b/arch/avr32/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* __ASM_AVR32_SOCKET_H */
diff --git a/arch/cris/include/uapi/asm/socket.h b/arch/cris/include/uapi/asm/socket.h
index ba409c9..47b1ec5 100644
--- a/arch/cris/include/uapi/asm/socket.h
+++ b/arch/cris/include/uapi/asm/socket.h
@@ -76,6 +76,8 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
 
 
diff --git a/arch/frv/include/uapi/asm/socket.h b/arch/frv/include/uapi/asm/socket.h
index 31dbb5d..dbc0852 100644
--- a/arch/frv/include/uapi/asm/socket.h
+++ b/arch/frv/include/uapi/asm/socket.h
@@ -74,5 +74,7 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
 
diff --git a/arch/h8300/include/uapi/asm/socket.h b/arch/h8300/include/uapi/asm/socket.h
index 5d1c6d0..a38d38a 100644
--- a/arch/h8300/include/uapi/asm/socket.h
+++ b/arch/h8300/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/ia64/include/uapi/asm/socket.h b/arch/ia64/include/uapi/asm/socket.h
index 6b4329f..d3358b7 100644
--- a/arch/ia64/include/uapi/asm/socket.h
+++ b/arch/ia64/include/uapi/asm/socket.h
@@ -83,4 +83,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_IA64_SOCKET_H */
diff --git a/arch/m32r/include/uapi/asm/socket.h b/arch/m32r/include/uapi/asm/socket.h
index 2a3b59e..44aaf46 100644
--- a/arch/m32r/include/uapi/asm/socket.h
+++ b/arch/m32r/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_M32R_SOCKET_H */
diff --git a/arch/mips/include/uapi/asm/socket.h b/arch/mips/include/uapi/asm/socket.h
index 3b21150..6a07992 100644
--- a/arch/mips/include/uapi/asm/socket.h
+++ b/arch/mips/include/uapi/asm/socket.h
@@ -92,4 +92,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _UAPI_ASM_SOCKET_H */
diff --git a/arch/mn10300/include/uapi/asm/socket.h b/arch/mn10300/include/uapi/asm/socket.h
index b4ce844..db80fd3 100644
--- a/arch/mn10300/include/uapi/asm/socket.h
+++ b/arch/mn10300/include/uapi/asm/socket.h
@@ -74,4 +74,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/parisc/include/uapi/asm/socket.h b/arch/parisc/include/uapi/asm/socket.h
index 70c512a..f866fff 100644
--- a/arch/parisc/include/uapi/asm/socket.h
+++ b/arch/parisc/include/uapi/asm/socket.h
@@ -73,6 +73,8 @@
 
 #define SO_SELECT_ERR_QUEUE	0x4026
 
+#define SO_LL			0x4027
+
 /* O_NONBLOCK clashes with the bits used for socket types.  Therefore we
  * 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 a36daf3..405fb09 100644
--- a/arch/powerpc/include/uapi/asm/socket.h
+++ b/arch/powerpc/include/uapi/asm/socket.h
@@ -81,4 +81,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif	/* _ASM_POWERPC_SOCKET_H */
diff --git a/arch/s390/include/uapi/asm/socket.h b/arch/s390/include/uapi/asm/socket.h
index 2dacb306..0c5105fb 100644
--- a/arch/s390/include/uapi/asm/socket.h
+++ b/arch/s390/include/uapi/asm/socket.h
@@ -80,4 +80,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* _ASM_SOCKET_H */
diff --git a/arch/sparc/include/uapi/asm/socket.h b/arch/sparc/include/uapi/asm/socket.h
index 89f49b6..b46c3fa 100644
--- a/arch/sparc/include/uapi/asm/socket.h
+++ b/arch/sparc/include/uapi/asm/socket.h
@@ -70,6 +70,8 @@
 
 #define SO_SELECT_ERR_QUEUE	0x0029
 
+#define SO_LL			0x0030
+
 /* Security levels - as per NRL IPv6 - don't actually do anything */
 #define SO_SECURITY_AUTHENTICATION		0x5001
 #define SO_SECURITY_ENCRYPTION_TRANSPORT	0x5002
diff --git a/arch/xtensa/include/uapi/asm/socket.h b/arch/xtensa/include/uapi/asm/socket.h
index a8f44f5..b21ace4 100644
--- a/arch/xtensa/include/uapi/asm/socket.h
+++ b/arch/xtensa/include/uapi/asm/socket.h
@@ -85,4 +85,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif	/* _XTENSA_SOCKET_H */
diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h
index d20508d..437bf11 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -43,15 +43,15 @@ extern unsigned int sysctl_net_ll_poll __read_mostly;
 /* we don't mind a ~2.5% imprecision */
 #define TSC_MHZ (tsc_khz >> 10)
 
-static inline cycles_t ll_end_time(void)
+static inline cycles_t ll_end_time(struct sock *sk)
 {
-	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll)
+	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sk->sk_ll_usec)
 		 + get_cycles();
 }
 
 static inline bool sk_valid_ll(struct sock *sk)
 {
-	return sysctl_net_ll_poll && sk->sk_napi_id &&
+	return sk->sk_ll_usec && sk->sk_napi_id &&
 	       !need_resched() && !signal_pending(current);
 }
 
@@ -63,7 +63,7 @@ static inline bool can_poll_ll(cycles_t end_time)
 
 static inline bool sk_poll_ll(struct sock *sk, int nonblock)
 {
-	cycles_t end_time = ll_end_time();
+	cycles_t end_time = ll_end_time(sk);
 	const struct net_device_ops *ops;
 	struct napi_struct *napi;
 	int rc = false;
@@ -117,7 +117,7 @@ static inline void sk_mark_ll(struct sock *sk, struct sk_buff *skb)
 
 #else /* CONFIG_NET_LL_RX_POLL */
 
-static inline cycles_t ll_end_time(void)
+static inline cycles_t ll_end_time(struct sock *sk)
 {
 	return 0;
 }
diff --git a/include/net/sock.h b/include/net/sock.h
index ac8e181..21db792 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -230,6 +230,7 @@ struct cg_proto;
   *	@sk_wmem_queued: persistent queue size
   *	@sk_forward_alloc: space allocated forward
   *	@sk_napi_id: id of the last napi context to receive data for sk
+  *	@sk_ll_usec: usecs to busypoll when there is no data
   *	@sk_allocation: allocation mode
   *	@sk_sndbuf: size of send buffer in bytes
   *	@sk_flags: %SO_LINGER (l_onoff), %SO_BROADCAST, %SO_KEEPALIVE,
@@ -328,6 +329,7 @@ struct sock {
 #endif
 #ifdef CONFIG_NET_LL_RX_POLL
 	unsigned int		sk_napi_id;
+	unsigned int		sk_ll_usec;
 #endif
 	atomic_t		sk_drops;
 	int			sk_rcvbuf;
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
index c5d2e3a..ca3a20d 100644
--- a/include/uapi/asm-generic/socket.h
+++ b/include/uapi/asm-generic/socket.h
@@ -76,4 +76,6 @@
 
 #define SO_SELECT_ERR_QUEUE	45
 
+#define SO_LL			46
+
 #endif /* __ASM_GENERIC_SOCKET_H */
diff --git a/net/core/sock.c b/net/core/sock.c
index 788c0da..1e744b1 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -913,6 +913,19 @@ set_rcvbuf:
 		sock_valbool_flag(sk, SOCK_SELECT_ERR_QUEUE, valbool);
 		break;
 
+#ifdef CONFIG_NET_LL_RX_POLL
+	case SO_LL:
+		/* allow unprivileged users to decrease the value */
+		if ((val > sk->sk_ll_usec) && !capable(CAP_NET_ADMIN))
+			ret = -EPERM;
+		else {
+			if (val < 0)
+				ret = -EINVAL;
+			else
+				sk->sk_ll_usec = val;
+		}
+		break;
+#endif
 	default:
 		ret = -ENOPROTOOPT;
 		break;
@@ -1170,6 +1183,12 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
 		v.val = sock_flag(sk, SOCK_SELECT_ERR_QUEUE);
 		break;
 
+#ifdef CONFIG_NET_LL_RX_POLL
+	case SO_LL:
+		v.val = sk->sk_ll_usec;
+		break;
+#endif
+
 	default:
 		return -ENOPROTOOPT;
 	}
@@ -2288,6 +2307,7 @@ void sock_init_data(struct socket *sock, struct sock *sk)
 
 #ifdef CONFIG_NET_LL_RX_POLL
 	sk->sk_napi_id		=	0;
+	sk->sk_ll_usec		=	sysctl_net_ll_poll;
 #endif
 
 	/*


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 sockperf] sockperf: add SO_LL socketop support
  2013-06-12 11:19 ` Eliezer Tamir
@ 2013-06-12 11:22   ` Eliezer Tamir
  -1 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:22 UTC (permalink / raw)
  To: David Miller
  Cc: linux-kernel, netdev, Jesse Brandeburg, Don Skidmore,
	e1000-devel, Willem de Bruijn, Eric Dumazet, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

Add lls socket option support.
use --lls (value in usecs) to override global setting.
Right now we always get and print the value of the option before we set,
to show that the option works properly.
This should be removed in an official release.
---

  src/Defs.h       |    3 +++
  src/SockPerf.cpp |   58 
+++++++++++++++++++++++++++++++++++++++++++++++++++---
  2 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/src/Defs.h b/src/Defs.h
index e38e3a4..041fa0d 100644
--- a/src/Defs.h
+++ b/src/Defs.h
@@ -161,6 +161,7 @@ enum {
  	OPT_OUTPUT_PRECISION,           //35
  	OPT_CLIENTPORT,                 //36
  	OPT_CLIENTIP,                   //37
+	OPT_LLS,			//38
  };

  #define MODULE_NAME			"sockperf"
@@ -527,6 +528,8 @@ struct user_params_t {
  //	bool stream_mode; - use b_stream instead
  	int mthread_server;
  	struct timeval* select_timeout;
+	unsigned int lls_usecs;
+	bool lls_is_set;
  	int sock_buff_size;
  	int threads_num;
  	char threads_affinity[MAX_ARGV_SIZE];
diff --git a/src/SockPerf.cpp b/src/SockPerf.cpp
index 41daf95..28569c9 100644
--- a/src/SockPerf.cpp
+++ b/src/SockPerf.cpp
@@ -207,6 +207,10 @@ static const AOPT_DESC  common_opt_desc[] =
  		"Limit the lifetime of the message (default 2)."
  	},
  	{
+		OPT_LLS, AOPT_ARG, aopt_set_literal( 0 ), aopt_set_string( "lls" ),
+		"Turn on LLS via socket option (value = us to poll)."
+	},
+	{
  		OPT_BUFFER_SIZE, AOPT_ARG, aopt_set_literal( 0 ), aopt_set_string( 
"buffer-size" ),
  		"Set total socket receive/send buffer <size> in bytes (system 
defined by default)."
  	},
@@ -292,7 +296,7 @@ static int proc_mode_help( int id, int argc, const 
char **argv )
  	int   i = 0;

  	printf(MODULE_NAME " is a tool for testing network latency and 
throughput.\n");
-	printf("version %s\n", STR(VERSION));
+	printf("version %s-lls\n", STR(VERSION));
  	printf("\n");
  	printf("Usage: " MODULE_NAME " <subcommand> [options] [args]\n");
  	printf("Type: \'" MODULE_NAME " <subcommand> --help\' for help on a 
specific subcommand.\n");
@@ -1382,8 +1386,8 @@ static int proc_mode_server( int id, int argc, 
const char **argv )
  		{
  			'B', AOPT_NOARG,	aopt_set_literal( 'B' ),	aopt_set_string( "Bridge" ),
  			"Run in Bridge mode."
-		},
-*/		
+		},
+*/
  		{
  			 OPT_THREADS_NUM, AOPT_ARG, aopt_set_literal( 0 ), aopt_set_string( 
"threads-num" ),
  			 "Run <N> threads on server side (requires '-f' option)."
@@ -1789,6 +1793,26 @@ static int parse_common_opt( const AOPT_OBJECT 
*common_obj )
  			s_user_params.is_nonblocked_send = true;
  		}

+		if ( !rc && aopt_check(common_obj, OPT_LLS) ) {
+			const char* optarg = aopt_value(common_obj, OPT_LLS);
+			if (optarg) {
+				errno = 0;
+				int value = strtoul(optarg, NULL, 0);
+				if (errno != 0 || value < 0) {
+					log_msg("'-%d' Invalid LLS value: %s", OPT_LLS, optarg);
+					rc = SOCKPERF_ERR_BAD_ARGUMENT;
+				}
+				else {
+					s_user_params.lls_usecs = value;
+					s_user_params.lls_is_set = true;
+				}
+			}
+			else {
+				log_msg("'-%d' Invalid value", OPT_LLS);
+				rc = SOCKPERF_ERR_BAD_ARGUMENT;
+			}
+		}
+
  		if ( !rc && aopt_check(common_obj, OPT_RECV_LOOPING) ) {

  			const char* optarg = aopt_value(common_obj, OPT_RECV_LOOPING);
@@ -2296,6 +2320,29 @@ int sock_set_reuseaddr(int fd)
  	return rc;
  }

+#ifndef SO_LL
+#define SO_LL 46
+#endif
+int sock_set_lls(int fd)
+{
+	int rc = SOCKPERF_ERR_NONE;
+	unsigned int lls;
+	int size = sizeof(lls);
+
+	if(getsockopt(fd, SOL_SOCKET, SO_LL, &lls, (socklen_t *)&size) < 0){
+		log_err("getsockopt(SO_LL) failed");
+		return SOCKPERF_ERR_SOCKET;
+	} else
+		log_msg("socket option SO_LL default was %u, changing to %u", lls, 
s_user_params.lls_usecs);
+
+	if (setsockopt(fd, SOL_SOCKET, SO_LL, &(s_user_params.lls_usecs), 
sizeof(s_user_params.lls_usecs)) < 0) {
+		log_err("setsockopt(SO_LL) failed");
+		rc = SOCKPERF_ERR_SOCKET;
+	}
+	return rc;
+}
+
+
  int sock_set_snd_rcv_bufs(int fd)
  {
  	/*
@@ -2460,6 +2507,11 @@ int prepare_socket(int fd, struct fds_data *p_data)
  	}

  	if (!rc &&
+			(s_user_params.lls_is_set == true))
+	{
+		rc = sock_set_lls(fd);
+	}
+	if (!rc &&
  			(s_user_params.sock_buff_size > 0))
  	{
  		rc = sock_set_snd_rcv_bufs(fd);



^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH v2 sockperf] sockperf: add SO_LL socketop support
@ 2013-06-12 11:22   ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 11:22 UTC (permalink / raw)
  To: David Miller
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, linux-kernel, Alex Rosenbaum, Jesse Brandeburg,
	Eliezer Tamir, Avner Ben Hanoch, Andi Kleen, Ben Hutchings,
	Eric Dumazet, Eilon Greenstien

Add lls socket option support.
use --lls (value in usecs) to override global setting.
Right now we always get and print the value of the option before we set,
to show that the option works properly.
This should be removed in an official release.
---

  src/Defs.h       |    3 +++
  src/SockPerf.cpp |   58 
+++++++++++++++++++++++++++++++++++++++++++++++++++---
  2 files changed, 58 insertions(+), 3 deletions(-)

diff --git a/src/Defs.h b/src/Defs.h
index e38e3a4..041fa0d 100644
--- a/src/Defs.h
+++ b/src/Defs.h
@@ -161,6 +161,7 @@ enum {
  	OPT_OUTPUT_PRECISION,           //35
  	OPT_CLIENTPORT,                 //36
  	OPT_CLIENTIP,                   //37
+	OPT_LLS,			//38
  };

  #define MODULE_NAME			"sockperf"
@@ -527,6 +528,8 @@ struct user_params_t {
  //	bool stream_mode; - use b_stream instead
  	int mthread_server;
  	struct timeval* select_timeout;
+	unsigned int lls_usecs;
+	bool lls_is_set;
  	int sock_buff_size;
  	int threads_num;
  	char threads_affinity[MAX_ARGV_SIZE];
diff --git a/src/SockPerf.cpp b/src/SockPerf.cpp
index 41daf95..28569c9 100644
--- a/src/SockPerf.cpp
+++ b/src/SockPerf.cpp
@@ -207,6 +207,10 @@ static const AOPT_DESC  common_opt_desc[] =
  		"Limit the lifetime of the message (default 2)."
  	},
  	{
+		OPT_LLS, AOPT_ARG, aopt_set_literal( 0 ), aopt_set_string( "lls" ),
+		"Turn on LLS via socket option (value = us to poll)."
+	},
+	{
  		OPT_BUFFER_SIZE, AOPT_ARG, aopt_set_literal( 0 ), aopt_set_string( 
"buffer-size" ),
  		"Set total socket receive/send buffer <size> in bytes (system 
defined by default)."
  	},
@@ -292,7 +296,7 @@ static int proc_mode_help( int id, int argc, const 
char **argv )
  	int   i = 0;

  	printf(MODULE_NAME " is a tool for testing network latency and 
throughput.\n");
-	printf("version %s\n", STR(VERSION));
+	printf("version %s-lls\n", STR(VERSION));
  	printf("\n");
  	printf("Usage: " MODULE_NAME " <subcommand> [options] [args]\n");
  	printf("Type: \'" MODULE_NAME " <subcommand> --help\' for help on a 
specific subcommand.\n");
@@ -1382,8 +1386,8 @@ static int proc_mode_server( int id, int argc, 
const char **argv )
  		{
  			'B', AOPT_NOARG,	aopt_set_literal( 'B' ),	aopt_set_string( "Bridge" ),
  			"Run in Bridge mode."
-		},
-*/		
+		},
+*/
  		{
  			 OPT_THREADS_NUM, AOPT_ARG, aopt_set_literal( 0 ), aopt_set_string( 
"threads-num" ),
  			 "Run <N> threads on server side (requires '-f' option)."
@@ -1789,6 +1793,26 @@ static int parse_common_opt( const AOPT_OBJECT 
*common_obj )
  			s_user_params.is_nonblocked_send = true;
  		}

+		if ( !rc && aopt_check(common_obj, OPT_LLS) ) {
+			const char* optarg = aopt_value(common_obj, OPT_LLS);
+			if (optarg) {
+				errno = 0;
+				int value = strtoul(optarg, NULL, 0);
+				if (errno != 0 || value < 0) {
+					log_msg("'-%d' Invalid LLS value: %s", OPT_LLS, optarg);
+					rc = SOCKPERF_ERR_BAD_ARGUMENT;
+				}
+				else {
+					s_user_params.lls_usecs = value;
+					s_user_params.lls_is_set = true;
+				}
+			}
+			else {
+				log_msg("'-%d' Invalid value", OPT_LLS);
+				rc = SOCKPERF_ERR_BAD_ARGUMENT;
+			}
+		}
+
  		if ( !rc && aopt_check(common_obj, OPT_RECV_LOOPING) ) {

  			const char* optarg = aopt_value(common_obj, OPT_RECV_LOOPING);
@@ -2296,6 +2320,29 @@ int sock_set_reuseaddr(int fd)
  	return rc;
  }

+#ifndef SO_LL
+#define SO_LL 46
+#endif
+int sock_set_lls(int fd)
+{
+	int rc = SOCKPERF_ERR_NONE;
+	unsigned int lls;
+	int size = sizeof(lls);
+
+	if(getsockopt(fd, SOL_SOCKET, SO_LL, &lls, (socklen_t *)&size) < 0){
+		log_err("getsockopt(SO_LL) failed");
+		return SOCKPERF_ERR_SOCKET;
+	} else
+		log_msg("socket option SO_LL default was %u, changing to %u", lls, 
s_user_params.lls_usecs);
+
+	if (setsockopt(fd, SOL_SOCKET, SO_LL, &(s_user_params.lls_usecs), 
sizeof(s_user_params.lls_usecs)) < 0) {
+		log_err("setsockopt(SO_LL) failed");
+		rc = SOCKPERF_ERR_SOCKET;
+	}
+	return rc;
+}
+
+
  int sock_set_snd_rcv_bufs(int fd)
  {
  	/*
@@ -2460,6 +2507,11 @@ int prepare_socket(int fd, struct fds_data *p_data)
  	}

  	if (!rc &&
+			(s_user_params.lls_is_set == true))
+	{
+		rc = sock_set_lls(fd);
+	}
+	if (!rc &&
  			(s_user_params.sock_buff_size > 0))
  	{
  		rc = sock_set_snd_rcv_bufs(fd);



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* RE: [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int
  2013-06-12 11:20   ` Eliezer Tamir
@ 2013-06-12 12:04     ` Avner Ben Hanoch
  -1 siblings, 0 replies; 20+ messages in thread
From: Avner Ben Hanoch @ 2013-06-12 12:04 UTC (permalink / raw)
  To: Eliezer Tamir, David Miller, sockperf-dev
  Cc: linux-kernel, netdev, Jesse Brandeburg, Don Skidmore,
	e1000-devel, Willem de Bruijn, Eric Dumazet, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Or Kehati, Eliezer Tamir

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3052 bytes --]

Hi,

Please make sure to include sockperf-dev@googlegroups.com among the recipients of this thread (I just added).
Maybe better, I suggest opening an issue in sockperf issue system - https://code.google.com/p/sockperf/issues/list .  Then anyone can add notes or read/receive them.

You can see an example for similar issue (patch for supporting IP_TOS) here: https://code.google.com/p/sockperf/issues/detail?id=44
Cheers,
  Avner

-----Original Message-----
From: Eliezer Tamir [mailto:eliezer.tamir@linux.intel.com] 
Sent: Wednesday, June 12, 2013 14:20
To: David Miller
Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Jesse Brandeburg; Don Skidmore; e1000-devel@lists.sourceforge.net; Willem de Bruijn; Eric Dumazet; Ben Hutchings; Andi Kleen; HPA; Eilon Greenstien; Or Gerlitz; Amir Vadai; Alex Rosenbaum; Avner Ben Hanoch; Or Kehati; Eliezer Tamir
Subject: [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int

There is no reason for sysctl_net_ll_poll to be an unsigned long.
Change it into an unsigned int.
Fix the proc handler.
Add a cast in ll_end_time()

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 include/net/ll_poll.h      |    5 +++--
 net/core/sysctl_net_core.c |    4 ++--
 net/socket.c               |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h index bc262f8..d20508d 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -34,7 +34,7 @@
 #ifdef CONFIG_NET_LL_RX_POLL
 
 struct napi_struct;
-extern unsigned long sysctl_net_ll_poll __read_mostly;
+extern unsigned int sysctl_net_ll_poll __read_mostly;
 
 /* return values from ndo_ll_poll */
 #define LL_FLUSH_FAILED		-1
@@ -45,7 +45,8 @@ extern unsigned long sysctl_net_ll_poll __read_mostly;
 
 static inline cycles_t ll_end_time(void)  {
-	return TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll) + get_cycles();
+	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll)
+		 + get_cycles();
 }
 
 static inline bool sk_valid_ll(struct sock *sk) diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 4b48f39..3c78b75 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -289,9 +289,9 @@ static struct ctl_table net_core_table[] = {
 	{
 		.procname	= "low_latency_poll",
 		.data		= &sysctl_net_ll_poll,
-		.maxlen		= sizeof(unsigned long),
+		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_doulongvec_minmax
+		.proc_handler	= proc_dointvec
 	},
 #endif
 #endif /* CONFIG_NET */
diff --git a/net/socket.c b/net/socket.c index 21fd29f..caaffa1 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -107,7 +107,7 @@
 #include <net/ll_poll.h>
 
 #ifdef CONFIG_NET_LL_RX_POLL
-unsigned long sysctl_net_ll_poll __read_mostly;
+unsigned int sysctl_net_ll_poll __read_mostly;
 EXPORT_SYMBOL_GPL(sysctl_net_ll_poll);
 #endif
 

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int
@ 2013-06-12 12:04     ` Avner Ben Hanoch
  0 siblings, 0 replies; 20+ messages in thread
From: Avner Ben Hanoch @ 2013-06-12 12:04 UTC (permalink / raw)
  To: Eliezer Tamir, David Miller, sockperf-dev
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, linux-kernel, Eliezer Tamir, Jesse Brandeburg,
	Andi Kleen, Alex Rosenbaum, Ben Hutchings, Eric Dumazet,
	Eilon Greenstien

Hi,

Please make sure to include sockperf-dev@googlegroups.com among the recipients of this thread (I just added).
Maybe better, I suggest opening an issue in sockperf issue system - https://code.google.com/p/sockperf/issues/list .  Then anyone can add notes or read/receive them.

You can see an example for similar issue (patch for supporting IP_TOS) here: https://code.google.com/p/sockperf/issues/detail?id=44
Cheers,
  Avner

-----Original Message-----
From: Eliezer Tamir [mailto:eliezer.tamir@linux.intel.com] 
Sent: Wednesday, June 12, 2013 14:20
To: David Miller
Cc: linux-kernel@vger.kernel.org; netdev@vger.kernel.org; Jesse Brandeburg; Don Skidmore; e1000-devel@lists.sourceforge.net; Willem de Bruijn; Eric Dumazet; Ben Hutchings; Andi Kleen; HPA; Eilon Greenstien; Or Gerlitz; Amir Vadai; Alex Rosenbaum; Avner Ben Hanoch; Or Kehati; Eliezer Tamir
Subject: [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int

There is no reason for sysctl_net_ll_poll to be an unsigned long.
Change it into an unsigned int.
Fix the proc handler.
Add a cast in ll_end_time()

Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
---

 include/net/ll_poll.h      |    5 +++--
 net/core/sysctl_net_core.c |    4 ++--
 net/socket.c               |    2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/include/net/ll_poll.h b/include/net/ll_poll.h index bc262f8..d20508d 100644
--- a/include/net/ll_poll.h
+++ b/include/net/ll_poll.h
@@ -34,7 +34,7 @@
 #ifdef CONFIG_NET_LL_RX_POLL
 
 struct napi_struct;
-extern unsigned long sysctl_net_ll_poll __read_mostly;
+extern unsigned int sysctl_net_ll_poll __read_mostly;
 
 /* return values from ndo_ll_poll */
 #define LL_FLUSH_FAILED		-1
@@ -45,7 +45,8 @@ extern unsigned long sysctl_net_ll_poll __read_mostly;
 
 static inline cycles_t ll_end_time(void)  {
-	return TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll) + get_cycles();
+	return (cycles_t)TSC_MHZ * ACCESS_ONCE(sysctl_net_ll_poll)
+		 + get_cycles();
 }
 
 static inline bool sk_valid_ll(struct sock *sk) diff --git a/net/core/sysctl_net_core.c b/net/core/sysctl_net_core.c index 4b48f39..3c78b75 100644
--- a/net/core/sysctl_net_core.c
+++ b/net/core/sysctl_net_core.c
@@ -289,9 +289,9 @@ static struct ctl_table net_core_table[] = {
 	{
 		.procname	= "low_latency_poll",
 		.data		= &sysctl_net_ll_poll,
-		.maxlen		= sizeof(unsigned long),
+		.maxlen		= sizeof(unsigned int),
 		.mode		= 0644,
-		.proc_handler	= proc_doulongvec_minmax
+		.proc_handler	= proc_dointvec
 	},
 #endif
 #endif /* CONFIG_NET */
diff --git a/net/socket.c b/net/socket.c index 21fd29f..caaffa1 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -107,7 +107,7 @@
 #include <net/ll_poll.h>
 
 #ifdef CONFIG_NET_LL_RX_POLL
-unsigned long sysctl_net_ll_poll __read_mostly;
+unsigned int sysctl_net_ll_poll __read_mostly;
 EXPORT_SYMBOL_GPL(sysctl_net_ll_poll);
 #endif
 

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 3/3] net: add socket option for low latency polling
  2013-06-12 11:20   ` Eliezer Tamir
  (?)
@ 2013-06-12 12:44   ` Eric Dumazet
  2013-06-12 12:54       ` Eliezer Tamir
  -1 siblings, 1 reply; 20+ messages in thread
From: Eric Dumazet @ 2013-06-12 12:44 UTC (permalink / raw)
  To: Eliezer Tamir
  Cc: David Miller, linux-kernel, netdev, Jesse Brandeburg,
	Don Skidmore, e1000-devel, Willem de Bruijn, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

On Wed, 2013-06-12 at 14:20 +0300, Eliezer Tamir wrote:
> adds a socket option for low latency polling.
> This allows overriding the global sysctl value with a per-socket one.
> 
> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
> ---

It seems EXPORT_SYMBOL_GPL(sysctl_net_ll_poll) can now be removed ?




^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int
  2013-06-12 12:04     ` Avner Ben Hanoch
@ 2013-06-12 12:44       ` Eliezer Tamir
  -1 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 12:44 UTC (permalink / raw)
  To: Avner Ben Hanoch
  Cc: David Miller, sockperf-dev, linux-kernel, netdev,
	Jesse Brandeburg, Don Skidmore, e1000-devel, Willem de Bruijn,
	Eric Dumazet, Ben Hutchings, Andi Kleen, HPA, Eilon Greenstien,
	Or Gerlitz, Amir Vadai, Alex Rosenbaum, Or Kehati, Eliezer Tamir

On 12/06/2013 15:04, Avner Ben Hanoch wrote:
> Maybe better, I suggest opening an issue in sockperf issue system -
 > https://code.google.com/p/sockperf/issues/list
 > Then anyone can add notes or read/receive them.

Thanks,
I will do that once the review of the Linux patch is complete.

-Eliezer

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int
@ 2013-06-12 12:44       ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 12:44 UTC (permalink / raw)
  To: Avner Ben Hanoch
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, Jesse Brandeburg, Eliezer Tamir, linux-kernel,
	Ben Hutchings, Andi Kleen, Alex Rosenbaum, sockperf-dev,
	Eric Dumazet, Eilon Greenstien, David Miller

On 12/06/2013 15:04, Avner Ben Hanoch wrote:
> Maybe better, I suggest opening an issue in sockperf issue system -
 > https://code.google.com/p/sockperf/issues/list
 > Then anyone can add notes or read/receive them.

Thanks,
I will do that once the review of the Linux patch is complete.

-Eliezer

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 3/3] net: add socket option for low latency polling
  2013-06-12 12:44   ` Eric Dumazet
@ 2013-06-12 12:54       ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 12:54 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, linux-kernel, netdev, Jesse Brandeburg,
	Don Skidmore, e1000-devel, Willem de Bruijn, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

On 12/06/2013 15:44, Eric Dumazet wrote:
> On Wed, 2013-06-12 at 14:20 +0300, Eliezer Tamir wrote:
>> adds a socket option for low latency polling.
>> This allows overriding the global sysctl value with a per-socket one.
>>
>> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>> ---
>
> It seems EXPORT_SYMBOL_GPL(sysctl_net_ll_poll) can now be removed ?

I think we would need it for poll.

Poll needs a way that is not dependent on any individual socket to know
how long to busy-wait, since we have to know it before we poll any
individual socket.

The patch I have right now for poll is not ready (and not fully tested).
But I can post it as an RFC if you want.

-Eliezer

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 3/3] net: add socket option for low latency polling
@ 2013-06-12 12:54       ` Eliezer Tamir
  0 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 12:54 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: Willem de Bruijn, Or Kehati, Or Gerlitz, e1000-devel, netdev,
	HPA, Amir Vadai, Jesse Brandeburg, Alex Rosenbaum, linux-kernel,
	Eliezer Tamir, Avner Ben Hanoch, Andi Kleen, Ben Hutchings,
	Eilon Greenstien, David Miller

On 12/06/2013 15:44, Eric Dumazet wrote:
> On Wed, 2013-06-12 at 14:20 +0300, Eliezer Tamir wrote:
>> adds a socket option for low latency polling.
>> This allows overriding the global sysctl value with a per-socket one.
>>
>> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>> ---
>
> It seems EXPORT_SYMBOL_GPL(sysctl_net_ll_poll) can now be removed ?

I think we would need it for poll.

Poll needs a way that is not dependent on any individual socket to know
how long to busy-wait, since we have to know it before we poll any
individual socket.

The patch I have right now for poll is not ready (and not fully tested).
But I can post it as an RFC if you want.

-Eliezer

------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 3/3] net: add socket option for low latency polling
  2013-06-12 12:54       ` Eliezer Tamir
  (?)
@ 2013-06-12 12:58       ` Eliezer Tamir
  -1 siblings, 0 replies; 20+ messages in thread
From: Eliezer Tamir @ 2013-06-12 12:58 UTC (permalink / raw)
  To: Eric Dumazet
  Cc: David Miller, linux-kernel, netdev, Jesse Brandeburg,
	Don Skidmore, e1000-devel, Willem de Bruijn, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

On 12/06/2013 15:54, Eliezer Tamir wrote:
> On 12/06/2013 15:44, Eric Dumazet wrote:
>> On Wed, 2013-06-12 at 14:20 +0300, Eliezer Tamir wrote:
>>> adds a socket option for low latency polling.
>>> This allows overriding the global sysctl value with a per-socket one.
>>>
>>> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
>>> ---
>>
>> It seems EXPORT_SYMBOL_GPL(sysctl_net_ll_poll) can now be removed ?
>
> I think we would need it for poll.
>
> Poll needs a way that is not dependent on any individual socket to know
> how long to busy-wait, since we have to know it before we poll any
> individual socket.

Or maybe, since the time constants seem to be different, we should have
two separate sysctl values, one for read and another for poll?

(and then the one for read does not need to be exported to modules.)

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 3/3] net: add socket option for low latency polling
  2013-06-12 12:54       ` Eliezer Tamir
@ 2013-06-12 13:55         ` Eric Dumazet
  -1 siblings, 0 replies; 20+ messages in thread
From: Eric Dumazet @ 2013-06-12 13:55 UTC (permalink / raw)
  To: Eliezer Tamir
  Cc: David Miller, linux-kernel, netdev, Jesse Brandeburg,
	Don Skidmore, e1000-devel, Willem de Bruijn, Ben Hutchings,
	Andi Kleen, HPA, Eilon Greenstien, Or Gerlitz, Amir Vadai,
	Alex Rosenbaum, Avner Ben Hanoch, Or Kehati, Eliezer Tamir

On Wed, 2013-06-12 at 15:54 +0300, Eliezer Tamir wrote:
> On 12/06/2013 15:44, Eric Dumazet wrote:
> > On Wed, 2013-06-12 at 14:20 +0300, Eliezer Tamir wrote:
> >> adds a socket option for low latency polling.
> >> This allows overriding the global sysctl value with a per-socket one.
> >>
> >> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
> >> ---
> >
> > It seems EXPORT_SYMBOL_GPL(sysctl_net_ll_poll) can now be removed ?
> 
> I think we would need it for poll.

Hmm, poll is part of the kernel, not in a module, but lets see.



^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2 net-next 3/3] net: add socket option for low latency polling
@ 2013-06-12 13:55         ` Eric Dumazet
  0 siblings, 0 replies; 20+ messages in thread
From: Eric Dumazet @ 2013-06-12 13:55 UTC (permalink / raw)
  To: Eliezer Tamir
  Cc: Willem de Bruijn, Don, Or Kehati, Or Gerlitz, e1000-devel,
	netdev, HPA, Amir Vadai, Jesse Brandeburg, Alex Rosenbaum,
	linux-kernel, Eliezer Tamir, Avner Ben Hanoch, Andi Kleen,
	Ben Hutchings, Eilon Greenstien, David Miller

On Wed, 2013-06-12 at 15:54 +0300, Eliezer Tamir wrote:
> On 12/06/2013 15:44, Eric Dumazet wrote:
> > On Wed, 2013-06-12 at 14:20 +0300, Eliezer Tamir wrote:
> >> adds a socket option for low latency polling.
> >> This allows overriding the global sysctl value with a per-socket one.
> >>
> >> Signed-off-by: Eliezer Tamir <eliezer.tamir@linux.intel.com>
> >> ---
> >
> > It seems EXPORT_SYMBOL_GPL(sysctl_net_ll_poll) can now be removed ?
> 
> I think we would need it for poll.

Hmm, poll is part of the kernel, not in a module, but lets see.



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-06-12 13:55 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-12 11:19 [PATCH v2 net-next 0/3] net: low latency sockets follow ups Eliezer Tamir
2013-06-12 11:19 ` Eliezer Tamir
2013-06-12 11:19 ` [PATCH v2 net-next 1/3] net: remove NET_LL_RX_POLL config menue Eliezer Tamir
2013-06-12 11:19   ` Eliezer Tamir
2013-06-12 11:20 ` [PATCH v2 net-next 2/3] net: change sysctl_net_ll_poll into an unsigned int Eliezer Tamir
2013-06-12 11:20   ` Eliezer Tamir
2013-06-12 12:04   ` Avner Ben Hanoch
2013-06-12 12:04     ` Avner Ben Hanoch
2013-06-12 12:44     ` Eliezer Tamir
2013-06-12 12:44       ` Eliezer Tamir
2013-06-12 11:20 ` [PATCH v2 net-next 3/3] net: add socket option for low latency polling Eliezer Tamir
2013-06-12 11:20   ` Eliezer Tamir
2013-06-12 12:44   ` Eric Dumazet
2013-06-12 12:54     ` Eliezer Tamir
2013-06-12 12:54       ` Eliezer Tamir
2013-06-12 12:58       ` Eliezer Tamir
2013-06-12 13:55       ` Eric Dumazet
2013-06-12 13:55         ` Eric Dumazet
2013-06-12 11:22 ` [PATCH v2 sockperf] sockperf: add SO_LL socketop support Eliezer Tamir
2013-06-12 11:22   ` Eliezer Tamir

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.