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. Signed-off-by: Sridhar Samudrala <sridhar.samudrala@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
bf3b9f6372
commit
6d4339028b
@@ -1328,6 +1328,18 @@ int sock_getsockopt(struct socket *sock, int level, int optname,
|
||||
|
||||
goto lenout;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NET_RX_BUSY_POLL
|
||||
case SO_INCOMING_NAPI_ID:
|
||||
v.val = READ_ONCE(sk->sk_napi_id);
|
||||
|
||||
/* aggregate non-NAPI IDs down to 0 */
|
||||
if (v.val < MIN_NAPI_ID)
|
||||
v.val = 0;
|
||||
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
/* We implement the SO_SNDLOWAT etc to not be settable
|
||||
* (1003.1g 7).
|
||||
|
Reference in New Issue
Block a user