netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jiri Pirko <jiri@resnulli.us>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, dsahern@kernel.org,
	steffen.klassert@secunet.com, jreuter@yaina.de,
	razor@blackwall.org, kgraul@linux.ibm.com, ivecera@redhat.com,
	jmaloy@redhat.com, ying.xue@windriver.com, lucien.xin@gmail.com,
	arnd@arndb.de, yajun.deng@linux.dev, atenart@kernel.org,
	richardsonnick@google.com, hkallweit1@gmail.com,
	linux-hams@vger.kernel.org, dev@openvswitch.org,
	linux-s390@vger.kernel.org,
	tipc-discussion@lists.sourceforge.net
Subject: Re: [PATCH net-next] net: rename reference+tracking helpers
Date: Wed, 8 Jun 2022 07:58:27 -0700	[thread overview]
Message-ID: <20220608075827.2af7a35f@kernel.org> (raw)
In-Reply-To: <YqBdY0NzK9XJG7HC@nanopsycho>

On Wed, 8 Jun 2022 10:27:15 +0200 Jiri Pirko wrote:
> Wed, Jun 08, 2022 at 06:39:55AM CEST, kuba@kernel.org wrote:
> >Netdev reference helpers have a dev_ prefix for historic
> >reasons. Renaming the old helpers would be too much churn  
> 
> Hmm, I think it would be great to eventually rename the rest too in
> order to maintain unique prefix for netdev things. Why do you think the
> "churn" would be an issue?

Felt like we're better of moving everyone to the new tracking helpers
than doing just a pure rename. But I'm not opposed to a pure rename.

> >diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c
> >index 817577e713d7..815738c0e067 100644
> >--- a/drivers/net/macsec.c
> >+++ b/drivers/net/macsec.c
> >@@ -3462,7 +3462,7 @@ static int macsec_dev_init(struct net_device *dev)
> > 		memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
> > 
> > 	/* Get macsec's reference to real_dev */
> >-	dev_hold_track(real_dev, &macsec->dev_tracker, GFP_KERNEL);
> >+	netdev_hold(real_dev, &macsec->dev_tracker, GFP_KERNEL);  
> 
> So we later decide to rename dev_hold() to obey the netdev_*() naming
> scheme, we would have collision.

dev_hold() should not be used in new code, we should use tracking
everywhere. Given that we can name the old helpers __netdev_hold().

> Also, seems to me odd to have:
> OLDPREFIX_x()
> and
> NEWPREFIX_x()
> to be different functions.
> 
> For the sake of not making naming mess, could we rather have:
> netdev_hold_track()
> or
> netdev_hold_tr() if the prior is too long
> ?

See above, one day non-track version should be removed.
IMO to encourage use of the track-capable API we could keep their names
short and call the legacy functions __netdev_hold() as I mentioned or
maybe netdev_hold_notrack().

  reply	other threads:[~2022-06-08 15:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08  4:39 [PATCH net-next] net: rename reference+tracking helpers Jakub Kicinski
2022-06-08  8:27 ` Jiri Pirko
2022-06-08 14:58   ` Jakub Kicinski [this message]
2022-06-08 22:58     ` David Ahern
2022-06-08 23:00       ` Eric Dumazet
2022-06-09 11:49         ` Paolo Abeni
2022-06-09 13:53           ` Eric Dumazet
2022-06-09  3:29       ` Jakub Kicinski
2022-06-09  4:40     ` Jiri Pirko
2022-06-10  5:40 ` patchwork-bot+netdevbpf

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=20220608075827.2af7a35f@kernel.org \
    --to=kuba@kernel.org \
    --cc=arnd@arndb.de \
    --cc=atenart@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dev@openvswitch.org \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=jmaloy@redhat.com \
    --cc=jreuter@yaina.de \
    --cc=kgraul@linux.ibm.com \
    --cc=linux-hams@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=lucien.xin@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=richardsonnick@google.com \
    --cc=steffen.klassert@secunet.com \
    --cc=tipc-discussion@lists.sourceforge.net \
    --cc=yajun.deng@linux.dev \
    --cc=ying.xue@windriver.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;
as well as URLs for NNTP newsgroup(s).