From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <leitao@debian.org>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<dsahern@kernel.org>, <edumazet@google.com>, <horms@kernel.org>,
<kernel-team@meta.com>, <kuba@kernel.org>, <kuniyu@amazon.co.jp>,
<kuniyu@amazon.com>, <linux-kernel@vger.kernel.org>,
<netdev@vger.kernel.org>, <pabeni@redhat.com>,
<ushankar@purestorage.com>
Subject: Re: [PATCH net-next v3 2/3] net: Add dev_getbyhwaddr_rtnl() helper
Date: Thu, 13 Feb 2025 19:52:17 +0900 [thread overview]
Message-ID: <20250213105217.37429-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20250213-prudent-olivine-bobcat-ffa64f@leitao>
From: Breno Leitao <leitao@debian.org>
Date: Thu, 13 Feb 2025 02:29:38 -0800
> Hello Kuniyuki,
>
> On Thu, Feb 13, 2025 at 04:31:29PM +0900, Kuniyuki Iwashima wrote:
> > > Subject: [PATCH net-next v3 2/3] net: Add dev_getbyhwaddr_rtnl() helper
> >
> > s/_rtnl//
>
> Ack!
>
> > looks like Uday's comment was missed due to the lore issue.
>
> hmm, I haven't seen Uday's comment. Didn't it reach lore?
I saw the reply and my another one on lore but somehow they
were removed :)
>
> > From: Breno Leitao <leitao@debian.org>
> > Date: Wed, 12 Feb 2025 09:47:25 -0800
> > > +/**
> > > + * dev_getbyhwaddr - find a device by its hardware address
> >
> > While at it, could you replace '\t' after '*' to a single '\s'
> > for all kernel-doc comment lines below ?
> >
> >
> > > + * @net: the applicable net namespace
> > > + * @type: media type of device
> > > + * @ha: hardware address
> > > + *
> > > + * Similar to dev_getbyhwaddr_rcu(), but the owner needs to hold
> > > + * rtnl_lock.
> >
> > Otherwise the text here is mis-aligned.
>
> Sorry, what is misaligned specifically? I generated the documentation,
> and I can't see it misaligned.
>
> This is what I see when generating the document (full log at
> https://pastebin.mozilla.org/YkotEoHh#L250,271)
>
>
> dev_getbyhwaddr_rcu(9) Kernel Hacker's Manual dev_getbyhwaddr_rcu(9)
>
> NAME
> dev_getbyhwaddr_rcu - find a device by its hardware address
>
> SYNOPSIS
> struct net_device * dev_getbyhwaddr_rcu (struct net *net , unsigned short type , const char *ha );
>
> ARGUMENTS
> net the applicable net namespace
>
> type media type of device
>
> ha hardware address
>
> Search for an interface by MAC address. Returns NULL if the device is not found or a pointer to the device. The caller must hold RCU. The returned device has
^^^^^^
This scentence starts from a weird position when we use '\t' after '*'.
You will see it start from the head if '\s' follows '*'.
> not had its ref count increased and the caller must therefore be careful about locking
>
> RETURN
> pointer to the net_device, or NULL if not found
>
> dev_getbyhwaddr(9) Kernel Hacker's Manual dev_getbyhwaddr(9)
>
> NAME
> dev_getbyhwaddr - find a device by its hardware address
>
> SYNOPSIS
> struct net_device * dev_getbyhwaddr (struct net *net , unsigned short type , const char *ha );
>
> ARGUMENTS
> net the applicable net namespace
>
> type media type of device
>
> ha hardware address
>
> Similar to dev_getbyhwaddr_rcu, but the owner needs to hold rtnl_lock.
>
> RETURN
> pointer to the net_device, or NULL if not found
>
>
> > $ ./scripts/kernel-doc -man net/core/dev.c | \
> > scripts/split-man.pl /tmp/man && \
> > man /tmp/man/dev_getbyhwaddr.9
> >
> > Also, the latter part should be in Context:
> >
> > Context: rtnl_lock() must be held.
>
> Sure. Should I do something similar for _rcu function as well?
>
> Context: caller must hold rcu_read_lock
Yes, that would be nice.
https://lore.kernel.org/netdev/20250213073646.14847-1-kuniyu@amazon.com/
next prev parent reply other threads:[~2025-02-13 10:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 17:47 [PATCH net-next v3 0/3] net: core: improvements to device lookup by hardware address Breno Leitao
2025-02-12 17:47 ` [PATCH net-next v3 1/3] net: document return value of dev_getbyhwaddr_rcu() Breno Leitao
2025-02-13 7:36 ` Kuniyuki Iwashima
2025-02-13 7:47 ` Kuniyuki Iwashima
2025-02-13 10:16 ` Breno Leitao
2025-02-13 10:45 ` Kuniyuki Iwashima
2025-02-12 17:47 ` [PATCH net-next v3 2/3] net: Add dev_getbyhwaddr_rtnl() helper Breno Leitao
2025-02-13 7:31 ` Kuniyuki Iwashima
2025-02-13 10:29 ` Breno Leitao
2025-02-13 10:52 ` Kuniyuki Iwashima [this message]
2025-02-13 12:29 ` Breno Leitao
2025-02-12 17:47 ` [PATCH net-next v3 3/3] arp: switch to dev_getbyhwaddr() in arp_req_set_public() Breno Leitao
2025-02-13 7:45 ` Kuniyuki Iwashima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250213105217.37429-1-kuniyu@amazon.com \
--to=kuniyu@amazon.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.co.jp \
--cc=leitao@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=ushankar@purestorage.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox