All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Jiri Pirko <jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org>
Cc: razor-duuXeNIU69eXDw4h08c5KA@public.gmane.org,
	edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	richardsonnick-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org,
	steffen.klassert-opNxpl+3fjRBDgjK7y7TUQ@public.gmane.org,
	linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lucien.xin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	yajun.deng-fxUVXftIFDnyG1zEObXtfA@public.gmane.org,
	pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	jreuter-K7Hl1MveuGQ@public.gmane.org,
	ivecera-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	arnd-r2nGTMty4D4@public.gmane.org,
	linux-hams-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dsahern-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
	jmaloy-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	tipc-discussion-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	ying.xue-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org,
	atenart-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org,
	kgraul-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org,
	hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
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-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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().

WARNING: multiple messages have this Message-ID (diff)
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 14:58 UTC|newest]

Thread overview: 12+ 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  4:39 ` Jakub Kicinski
2022-06-08  8:27 ` Jiri Pirko
2022-06-08 14:58   ` Jakub Kicinski [this message]
2022-06-08 14:58     ` Jakub Kicinski
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-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=atenart-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
    --cc=dev-yBygre7rU0TnMu66kgdUjQ@public.gmane.org \
    --cc=dsahern-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=edumazet-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=hkallweit1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ivecera-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jiri-rHqAuBHg3fBzbRFIqnYvSA@public.gmane.org \
    --cc=jmaloy-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jreuter-K7Hl1MveuGQ@public.gmane.org \
    --cc=kgraul-tEXmvtCZX7AybS5Ee8rs3A@public.gmane.org \
    --cc=linux-hams-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-s390-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=lucien.xin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=razor-duuXeNIU69eXDw4h08c5KA@public.gmane.org \
    --cc=richardsonnick-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=steffen.klassert-opNxpl+3fjRBDgjK7y7TUQ@public.gmane.org \
    --cc=tipc-discussion-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=yajun.deng-fxUVXftIFDnyG1zEObXtfA@public.gmane.org \
    --cc=ying.xue-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.