Thread (13 messages) 13 messages, 3 authors, 2020-11-23

Re: [PATCH net-next v3 1/5] net: implement threaded-able napi poll loop support

From: Wei Wang <hidden>
Date: 2020-11-22 02:23:47

On Sat, Nov 21, 2020 at 4:31 PM Jakub Kicinski [off-list ref] wrote:
On Wed, 18 Nov 2020 11:10:05 -0800 Wei Wang wrote:
quoted
+int napi_set_threaded(struct napi_struct *n, bool threaded)
+{
+     ASSERT_RTNL();
+
+     if (n->dev->flags & IFF_UP)
+             return -EBUSY;
+
+     if (threaded == !!test_bit(NAPI_STATE_THREADED, &n->state))
+             return 0;
+     if (threaded)
+             set_bit(NAPI_STATE_THREADED, &n->state);
+     else
+             clear_bit(NAPI_STATE_THREADED, &n->state);
Do we really need the per-NAPI control here? Does anyone have use cases
where that makes sense? The user would be guessing which NAPI means
which queue and which bit, currently.
Thanks for reviewing this.
I think one use case might be that if the driver uses separate napi
for tx and rx, one might want to only enable threaded mode for rx, and
leave tx completion in interrupt mode.

quoted
+     /* if the device is initializing, nothing todo */
+     if (test_bit(__LINK_STATE_START, &n->dev->state))
+             return 0;
+
+     napi_thread_stop(n);
+     napi_thread_start(n);
+     return 0;
+}
+EXPORT_SYMBOL(napi_set_threaded);
Why was this exported? Do we still need that?
Yea. I guess it is not needed.
Please rejig the patches into a reviewable form. You can use the
Co-developed-by tag to give people credit on individual patches.
Will do. Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help