[RFC PATCH 2/5] tcp: expose the tcp_mark_push() and skb_entail() helpers

Paolo Abeni posted 5 patches 4 years ago
Maintainers: Mat Martineau <mathew.j.martineau@linux.intel.com>, David Ahern <dsahern@kernel.org>, Eric Dumazet <edumazet@google.com>, Ayush Sawal <ayush.sawal@chelsio.com>, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>, Vinay Kumar Yadav <vinay.yadav@chelsio.com>, Jonathan Corbet <corbet@lwn.net>, Rohit Maheshwari <rohitm@chelsio.com>, Matthieu Baerts <matthieu.baerts@tessares.net>, "David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
There is a newer version of this series
[RFC PATCH 2/5] tcp: expose the tcp_mark_push() and skb_entail() helpers
Posted by Paolo Abeni 4 years ago
They will be used by the next patch.

Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
---
 include/net/tcp.h | 2 ++
 net/ipv4/tcp.c    | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3166dc15d7d6..dc52ea8adfc7 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -581,6 +581,8 @@ __u32 cookie_v6_init_sequence(const struct sk_buff *skb, __u16 *mss);
 #endif
 /* tcp_output.c */
 
+void skb_entail(struct sock *sk, struct sk_buff *skb);
+void tcp_mark_push(struct tcp_sock *tp, struct sk_buff *skb);
 void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
 			       int nonagle);
 int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb, int segs);
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index e8b48df73c85..7a3e632b0048 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -647,7 +647,7 @@ int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg)
 }
 EXPORT_SYMBOL(tcp_ioctl);
 
-static inline void tcp_mark_push(struct tcp_sock *tp, struct sk_buff *skb)
+void tcp_mark_push(struct tcp_sock *tp, struct sk_buff *skb)
 {
 	TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_PSH;
 	tp->pushed_seq = tp->write_seq;
@@ -658,7 +658,7 @@ static inline bool forced_push(const struct tcp_sock *tp)
 	return after(tp->write_seq, tp->pushed_seq + (tp->max_window >> 1));
 }
 
-static void skb_entail(struct sock *sk, struct sk_buff *skb)
+void skb_entail(struct sock *sk, struct sk_buff *skb)
 {
 	struct tcp_sock *tp = tcp_sk(sk);
 	struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
-- 
2.26.3


Re: [RFC PATCH 2/5] tcp: expose the tcp_mark_push() and skb_entail() helpers
Posted by Eric Dumazet 4 years ago
On Fri, Sep 17, 2021 at 8:39 AM Paolo Abeni <pabeni@redhat.com> wrote:
>
> They will be used by the next patch.
>
> Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> ---
>

OK, but please rename skb_entail() to tcp_skb_entail() :)

Thanks !

Re: [RFC PATCH 2/5] tcp: expose the tcp_mark_push() and skb_entail() helpers
Posted by Paolo Abeni 4 years ago
On Fri, 2021-09-17 at 09:43 -0700, Eric Dumazet wrote:
> On Fri, Sep 17, 2021 at 8:39 AM Paolo Abeni <pabeni@redhat.com> wrote:
> > They will be used by the next patch.
> > 
> > Acked-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
> > Signed-off-by: Paolo Abeni <pabeni@redhat.com>
> > ---
> > 
> 
> OK, but please rename skb_entail() to tcp_skb_entail() :)

ok, with that will also drop patch 1/5 - no more needed.

Thanks!

Paolo