|
@@ -80,11 +80,6 @@ static inline void skb_mark_napi_id(struct sk_buff *skb,
|
|
|
skb->napi_id = napi->napi_id;
|
|
|
}
|
|
|
|
|
|
-/* used in the protocol hanlder to propagate the napi_id to the socket */
|
|
|
-static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb)
|
|
|
-{
|
|
|
- sk->sk_napi_id = skb->napi_id;
|
|
|
-}
|
|
|
|
|
|
#else /* CONFIG_NET_RX_BUSY_POLL */
|
|
|
static inline unsigned long net_busy_loop_on(void)
|
|
@@ -107,10 +102,6 @@ static inline void skb_mark_napi_id(struct sk_buff *skb,
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-static inline void sk_mark_napi_id(struct sock *sk, struct sk_buff *skb)
|
|
|
-{
|
|
|
-}
|
|
|
-
|
|
|
static inline bool busy_loop_timeout(unsigned long end_time)
|
|
|
{
|
|
|
return true;
|
|
@@ -122,4 +113,23 @@ static inline bool sk_busy_loop(struct sock *sk, int nonblock)
|
|
|
}
|
|
|
|
|
|
#endif /* CONFIG_NET_RX_BUSY_POLL */
|
|
|
+
|
|
|
+/* used in the protocol hanlder to propagate the napi_id to the socket */
|
|
|
+static inline void sk_mark_napi_id(struct sock *sk, const struct sk_buff *skb)
|
|
|
+{
|
|
|
+#ifdef CONFIG_NET_RX_BUSY_POLL
|
|
|
+ sk->sk_napi_id = skb->napi_id;
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
+/* variant used for unconnected sockets */
|
|
|
+static inline void sk_mark_napi_id_once(struct sock *sk,
|
|
|
+ const struct sk_buff *skb)
|
|
|
+{
|
|
|
+#ifdef CONFIG_NET_RX_BUSY_POLL
|
|
|
+ if (!sk->sk_napi_id)
|
|
|
+ sk->sk_napi_id = skb->napi_id;
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
#endif /* _LINUX_NET_BUSY_POLL_H */
|