netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Lemon <jonathan.lemon@gmail.com>
To: <netdev@vger.kernel.org>, <davem@davemloft.net>,
	<kuba@kernel.org>, <willemdebruijn.kernel@gmail.com>,
	<edumazet@google.com>, <dsahern@gmail.com>
Cc: <kernel-team@fb.com>
Subject: [RESEND PATCH net-next v1 13/13] skbuff: Rename skb_zcopy_{get|put} to net_zcopy_{get|put}
Date: Wed, 6 Jan 2021 14:18:41 -0800	[thread overview]
Message-ID: <20210106221841.1880536-14-jonathan.lemon@gmail.com> (raw)
In-Reply-To: <20210106221841.1880536-1-jonathan.lemon@gmail.com>

Unlike the rest of the skb_zcopy_ functions, these routines
operate on a 'struct ubuf', not a skb.  Remove the 'skb_'
prefix from the naming to make things clearer.

Suggested-by: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
---
 include/linux/skbuff.h | 10 +++++-----
 net/core/skbuff.c      |  2 +-
 net/ipv4/ip_output.c   |  2 +-
 net/ipv4/tcp.c         |  4 ++--
 net/ipv6/ip6_output.c  |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 3ec8b83aca3e..961908a22d0e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1443,7 +1443,7 @@ static inline struct ubuf_info *skb_zcopy(struct sk_buff *skb)
 	return is_zcopy ? skb_uarg(skb) : NULL;
 }
 
-static inline void skb_zcopy_get(struct ubuf_info *uarg)
+static inline void net_zcopy_get(struct ubuf_info *uarg)
 {
 	refcount_inc(&uarg->refcnt);
 }
@@ -1461,7 +1461,7 @@ static inline void skb_zcopy_set(struct sk_buff *skb, struct ubuf_info *uarg,
 		if (unlikely(have_ref && *have_ref))
 			*have_ref = false;
 		else
-			skb_zcopy_get(uarg);
+			net_zcopy_get(uarg);
 		skb_zcopy_init(skb, uarg);
 	}
 }
@@ -1482,19 +1482,19 @@ static inline void *skb_zcopy_get_nouarg(struct sk_buff *skb)
 	return (void *)((uintptr_t) skb_shinfo(skb)->destructor_arg & ~0x1UL);
 }
 
-static inline void skb_zcopy_put(struct ubuf_info *uarg)
+static inline void net_zcopy_put(struct ubuf_info *uarg)
 {
 	if (uarg)
 		uarg->callback(NULL, uarg, true);
 }
 
-static inline void skb_zcopy_put_abort(struct ubuf_info *uarg, bool have_uref)
+static inline void net_zcopy_put_abort(struct ubuf_info *uarg, bool have_uref)
 {
 	if (uarg) {
 		if (uarg->callback == msg_zerocopy_callback)
 			msg_zerocopy_put_abort(uarg, have_uref);
 		else if (have_uref)
-			skb_zcopy_put(uarg);
+			net_zcopy_put(uarg);
 	}
 }
 
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index ee288af095f0..45d60c5286fe 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -1165,7 +1165,7 @@ struct ubuf_info *msg_zerocopy_realloc(struct sock *sk, size_t size,
 
 			/* no extra ref when appending to datagram (MSG_MORE) */
 			if (sk->sk_type == SOCK_STREAM)
-				skb_zcopy_get(uarg);
+				net_zcopy_get(uarg);
 
 			return uarg;
 		}
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index ffee03729285..102b1998ba3c 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -1230,7 +1230,7 @@ static int __ip_append_data(struct sock *sk,
 error_efault:
 	err = -EFAULT;
 error:
-	skb_zcopy_put_abort(uarg, extra_uref);
+	net_zcopy_put_abort(uarg, extra_uref);
 	cork->length -= length;
 	IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTDISCARDS);
 	refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1954190b33c7..2267d21c73a6 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1429,7 +1429,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
 		tcp_push(sk, flags, mss_now, tp->nonagle, size_goal);
 	}
 out_nopush:
-	skb_zcopy_put(uarg);
+	net_zcopy_put(uarg);
 	return copied + copied_syn;
 
 do_error:
@@ -1440,7 +1440,7 @@ int tcp_sendmsg_locked(struct sock *sk, struct msghdr *msg, size_t size)
 	if (copied + copied_syn)
 		goto out;
 out_err:
-	skb_zcopy_put_abort(uarg, true);
+	net_zcopy_put_abort(uarg, true);
 	err = sk_stream_error(sk, flags, err);
 	/* make sure we wake any epoll edge trigger waiter */
 	if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) {
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index f59cfa39686a..072ce9678616 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1715,7 +1715,7 @@ static int __ip6_append_data(struct sock *sk,
 error_efault:
 	err = -EFAULT;
 error:
-	skb_zcopy_put_abort(uarg, extra_uref);
+	net_zcopy_put_abort(uarg, extra_uref);
 	cork->length -= length;
 	IP6_INC_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);
 	refcount_add(wmem_alloc_delta, &sk->sk_wmem_alloc);
-- 
2.24.1


  parent reply	other threads:[~2021-01-06 22:19 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 22:18 [RESEND PATCH net-next v1 00/13] Generic zcopy_* functions Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 01/13] skbuff: remove unused skb_zcopy_abort function Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 02/13] skbuff: simplify sock_zerocopy_put Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 03/13] skbuff: Push status and refcounts into sock_zerocopy_callback Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 04/13] skbuff: replace sock_zerocopy_put() with skb_zcopy_put() Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 05/13] skbuff: replace sock_zerocopy_get with skb_zcopy_get Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 06/13] skbuff: Add skb parameter to the ubuf zerocopy callback Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 07/13] skbuff: Call sock_zerocopy_put_abort from skb_zcopy_put_abort Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 08/13] skbuff: Call skb_zcopy_clear() before unref'ing fragments Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 09/13] skbuff: rename sock_zerocopy_* to msg_zerocopy_* Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 10/13] net: group skb_shinfo zerocopy related bits together Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 11/13] skbuff: add flags to ubuf_info for ubuf setup Jonathan Lemon
2021-01-06 22:18 ` [RESEND PATCH net-next v1 12/13] tap/tun: add skb_zcopy_init() helper for initialization Jonathan Lemon
2021-01-06 22:18 ` Jonathan Lemon [this message]
2021-01-08  2:19 ` [RESEND PATCH net-next v1 00/13] Generic zcopy_* functions Jakub Kicinski

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=20210106221841.1880536-14-jonathan.lemon@gmail.com \
    --to=jonathan.lemon@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=edumazet@google.com \
    --cc=kernel-team@fb.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=willemdebruijn.kernel@gmail.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).