History

net: Introduce SO_INCOMING_NAPI_ID

This socket option returns the NAPI ID associated with the queue on which the last frame is received. This information can be used by the apps to split the incoming flows among the threads based on the Rx queue on which they are received. If the NAPI ID actually represents a sender_cpu then the value is ignored and 0 is returned.

Sridhar Samudrala committed 9 years ago

Commit 6d433901 parent bf3b9f614 files · +37 −0Browse files

Unified · Split

14 files
  1. arch/alpha/include/uapi/asm/socket.h +2 −0
  2. arch/avr32/include/uapi/asm/socket.h +2 −0
  3. arch/frv/include/uapi/asm/socket.h +2 −0
  4. arch/ia64/include/uapi/asm/socket.h +2 −0
  5. arch/m32r/include/uapi/asm/socket.h +2 −0
  6. arch/mips/include/uapi/asm/socket.h +1 −0
  7. arch/mn10300/include/uapi/asm/socket.h +2 −0
  8. arch/parisc/include/uapi/asm/socket.h +2 −0
  9. arch/powerpc/include/uapi/asm/socket.h +2 −0
  10. arch/s390/include/uapi/asm/socket.h +2 −0
  11. arch/sparc/include/uapi/asm/socket.h +2 −0
  12. arch/xtensa/include/uapi/asm/socket.h +2 −0
  13. include/uapi/asm-generic/socket.h +2 −0
  14. net/core/sock.c +12 −0
arch/alpha/include/uapi/asm/socket.h+2−0
@@ -101,4 +101,6 @@ · 100 unmodified lines
101101
102102 #define SO_MEMINFO 55
103103
104+#define SO_INCOMING_NAPI_ID 56
105+
104106 #endif /* _UAPI_ASM_SOCKET_H */
arch/avr32/include/uapi/asm/socket.h+2−0
@@ -94,4 +94,6 @@ · 93 unmodified lines
9494
9595 #define SO_MEMINFO 55
9696
97+#define SO_INCOMING_NAPI_ID 56
98+
9799 #endif /* _UAPI__ASM_AVR32_SOCKET_H */
arch/frv/include/uapi/asm/socket.h+2−0
@@ -94,5 +94,7 @@ · 93 unmodified lines
9494
9595 #define SO_MEMINFO 55
9696
97+#define SO_INCOMING_NAPI_ID 56
98+
9799 #endif /* _ASM_SOCKET_H */
98100
arch/ia64/include/uapi/asm/socket.h+2−0
@@ -103,4 +103,6 @@ · 102 unmodified lines
103103
104104 #define SO_MEMINFO 55
105105
106+#define SO_INCOMING_NAPI_ID 56
107+
106108 #endif /* _ASM_IA64_SOCKET_H */
arch/m32r/include/uapi/asm/socket.h+2−0
@@ -94,4 +94,6 @@ · 93 unmodified lines
9494
9595 #define SO_MEMINFO 55
9696
97+#define SO_INCOMING_NAPI_ID 56
98+
9799 #endif /* _ASM_M32R_SOCKET_H */
arch/mips/include/uapi/asm/socket.h+1−0
@@ -112,5 +112,6 @@ · 111 unmodified lines
112112
113113 #define SO_MEMINFO 55
114114
115+#define SO_INCOMING_NAPI_ID 56
115116
116117 #endif /* _UAPI_ASM_SOCKET_H */
arch/mn10300/include/uapi/asm/socket.h+2−0
@@ -94,4 +94,6 @@ · 93 unmodified lines
9494
9595 #define SO_MEMINFO 55
9696
97+#define SO_INCOMING_NAPI_ID 56
98+
9799 #endif /* _ASM_SOCKET_H */
arch/parisc/include/uapi/asm/socket.h+2−0
@@ -93,4 +93,6 @@ · 92 unmodified lines
9393
9494 #define SO_MEMINFO 0x4030
9595
96+#define SO_INCOMING_NAPI_ID 0x4031
97+
9698 #endif /* _UAPI_ASM_SOCKET_H */
arch/powerpc/include/uapi/asm/socket.h+2−0
@@ -101,4 +101,6 @@ · 100 unmodified lines
101101
102102 #define SO_MEMINFO 55
103103
104+#define SO_INCOMING_NAPI_ID 56
105+
104106 #endif /* _ASM_POWERPC_SOCKET_H */
arch/s390/include/uapi/asm/socket.h+2−0
@@ -100,4 +100,6 @@ · 99 unmodified lines
100100
101101 #define SO_MEMINFO 55
102102
103+#define SO_INCOMING_NAPI_ID 56
104+
103105 #endif /* _ASM_SOCKET_H */
arch/sparc/include/uapi/asm/socket.h+2−0
@@ -90,6 +90,8 @@ · 89 unmodified lines
9090
9191 #define SO_MEMINFO 0x0039
9292
93+#define SO_INCOMING_NAPI_ID 0x003a
94+
9395 /* Security levels - as per NRL IPv6 - don't actually do anything */
9496 #define SO_SECURITY_AUTHENTICATION 0x5001
9597 #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
arch/xtensa/include/uapi/asm/socket.h+2−0
@@ -105,4 +105,6 @@ · 104 unmodified lines
105105
106106 #define SO_MEMINFO 55
107107
108+#define SO_INCOMING_NAPI_ID 56
109+
108110 #endif /* _XTENSA_SOCKET_H */
include/uapi/asm-generic/socket.h+2−0
@@ -96,4 +96,6 @@ · 95 unmodified lines
9696
9797 #define SO_MEMINFO 55
9898
99+#define SO_INCOMING_NAPI_ID 56
100+
99101 #endif /* __ASM_GENERIC_SOCKET_H */
net/core/sock.c+12−0
@@ -1328,6 +1328,18 @@ int sock_getsockopt(struct socket *sock, int level, int optname, · 1327 unmodified lines
13281328
13291329 goto lenout;
13301330 }
1331+
1332+#ifdef CONFIG_NET_RX_BUSY_POLL
1333+ case SO_INCOMING_NAPI_ID:
1334+ v.val = READ_ONCE(sk->sk_napi_id);
1335+
1336+ /* aggregate non-NAPI IDs down to 0 */
1337+ if (v.val < MIN_NAPI_ID)
1338+ v.val = 0;
1339+
1340+ break;
1341+#endif
1342+
13311343 default:
13321344 /* We implement the SO_SNDLOWAT etc to not be settable
13331345 * (1003.1g 7).

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t