Thread (36 messages) 36 messages, 6 authors, 2022-05-23

Re: [PATCH net-next 03/19] net: add dev_hold_track() and dev_put_track() helpers

From: Eric Dumazet <hidden>
Date: 2022-05-23 18:37:03

On Mon, May 23, 2022 at 11:03 AM Jakub Kicinski [off-list ref] wrote:
On Wed,  1 Dec 2021 19:21:23 -0800 Eric Dumazet wrote:
quoted
+static inline void dev_hold_track(struct net_device *dev,
+                               netdevice_tracker *tracker, gfp_t gfp)
+{
+     if (dev) {
+             dev_hold(dev);
+#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
+             ref_tracker_alloc(&dev->refcnt_tracker, tracker, gfp);
+#endif
+     }
+}
+
+static inline void dev_put_track(struct net_device *dev,
+                              netdevice_tracker *tracker)
+{
+     if (dev) {
+#ifdef CONFIG_NET_DEV_REFCNT_TRACKER
+             ref_tracker_free(&dev->refcnt_tracker, tracker);
+#endif
+             dev_put(dev);
+     }
+}
Hi Eric, how bad would it be if we renamed dev_hold/put_track() to
netdev_hold/put()? IIUC we use the dev_ prefix for "historic reasons"
could this be an opportunity to stop doing that?
Sure, we can do that, 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