netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* atl1c drivers run 'napi/eth%d-385' named threads with unsubstituted %d
@ 2022-01-21 21:57 Sergei Trofimovich
  2022-01-21 23:45 ` Andrew Lunn
  0 siblings, 1 reply; 8+ messages in thread
From: Sergei Trofimovich @ 2022-01-21 21:57 UTC (permalink / raw)
  To: netdev

Hia atl1c maintainers!

This cosmetics bothered me for some time: atl1c driver
shows unexpanded % in kernel thread names. Looks like a
minor bug:

    $ ping -f 172.16.0.1  # host1
    $ top  # host2
    ...
    621 root 20 0 0 0 0 S 11.0 0.0 0:05.01 napi/eth%d-385
    622 root 20 0 0 0 0 S  5.6 0.0 0:02.64 napi/eth%d-386
    ...

Was happening for a few years. Likely not a recent regression.

System:
- linux-5.16.1
- x86_64
- 02:00.0 Ethernet controller: Qualcomm Atheros AR8151 v2.0 Gigabit Ethernet (rev c0)

From what I understand thread name comes from somewhere around:

  net/core/dev.c:
    int dev_set_threaded(struct net_device *dev, bool threaded)
    ...
        err = napi_kthread_create(napi);
    ...
    static int napi_kthread_create(struct napi_struct *n)
    ...
        n->thread = kthread_run(napi_threaded_poll, n, "napi/%s-%d",

  drivers/net/ethernet/atheros/atl1c/atl1c_main.c:
    static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
    ...
        dev_set_threaded(netdev, true);

  ${somewhere} (not sure where):
    ...
      strcpy(netdev->name, "eth%d");

I was not able to pinpoint where expansion should ideally happen.
Looks like many driver do `strcpy(netdev->name, "eth%d");` style
initialization and almost none call `dev_set_threaded(netdev, true);`.

Can you help me find it out how it should be fixed?

Thank you!

-- 

  Sergei

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

end of thread, other threads:[~2022-01-22 22:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 21:57 atl1c drivers run 'napi/eth%d-385' named threads with unsubstituted %d Sergei Trofimovich
2022-01-21 23:45 ` Andrew Lunn
2022-01-22  1:03   ` Stephen Hemminger
2022-01-22  1:53     ` Andrew Lunn
2022-01-22 12:12       ` Sergei Trofimovich
2022-01-22 15:54         ` Andrew Lunn
2022-01-22 19:40         ` Andrew Lunn
2022-01-22 22:01           ` Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).