public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] tcp: make tcp_sock_set_bufsize() static (again)
@ 2023-12-04 14:23 Laurent Vivier
  2023-12-05  0:46 ` David Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Laurent Vivier @ 2023-12-04 14:23 UTC (permalink / raw)
  To: passt-dev; +Cc: Laurent Vivier, david

e5eefe77435a ("tcp: Refactor to use events instead of states, split out
spliced implementation") has exported tcp_sock_set_bufsize() to
be able to use it in tcp_splice.c, but 6ccab72d9b40 has removed its use
in tcp_splice.c, so we can set it static again.

Fixes: 6ccab72d9b40 ("tcp: Improve handling of fallback if socket pool is empty on new splice")
Cc: david@gibson.dropbear.id.au
Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 tcp.c | 2 +-
 tcp.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/tcp.c b/tcp.c
index f506cfdd3bc7..1680b516b5b9 100644
--- a/tcp.c
+++ b/tcp.c
@@ -929,7 +929,7 @@ static void tcp_get_sndbuf(struct tcp_tap_conn *conn)
  * tcp_sock_set_bufsize() - Set SO_RCVBUF and SO_SNDBUF to maximum values
  * @s:		Socket, can be -1 to avoid check in the caller
  */
-void tcp_sock_set_bufsize(const struct ctx *c, int s)
+static void tcp_sock_set_bufsize(const struct ctx *c, int s)
 {
 	int v = INT_MAX / 2; /* Kernel clamps and rounds, no need to check */
 
diff --git a/tcp.h b/tcp.h
index 27b11668f258..87a6bf9f0ee8 100644
--- a/tcp.h
+++ b/tcp.h
@@ -23,7 +23,6 @@ int tcp_init(struct ctx *c);
 void tcp_timer(struct ctx *c, const struct timespec *ts);
 void tcp_defer_handler(struct ctx *c);
 
-void tcp_sock_set_bufsize(const struct ctx *c, int s);
 void tcp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s);
 
 /**
-- 
@@ -23,7 +23,6 @@ int tcp_init(struct ctx *c);
 void tcp_timer(struct ctx *c, const struct timespec *ts);
 void tcp_defer_handler(struct ctx *c);
 
-void tcp_sock_set_bufsize(const struct ctx *c, int s);
 void tcp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s);
 
 /**
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcp: make tcp_sock_set_bufsize() static (again)
  2023-12-04 14:23 [PATCH] tcp: make tcp_sock_set_bufsize() static (again) Laurent Vivier
@ 2023-12-05  0:46 ` David Gibson
  2023-12-27 20:25   ` Stefano Brivio
  0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2023-12-05  0:46 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: passt-dev

[-- Attachment #1: Type: text/plain, Size: 1933 bytes --]

On Mon, Dec 04, 2023 at 03:23:11PM +0100, Laurent Vivier wrote:
> e5eefe77435a ("tcp: Refactor to use events instead of states, split out
> spliced implementation") has exported tcp_sock_set_bufsize() to
> be able to use it in tcp_splice.c, but 6ccab72d9b40 has removed its use
> in tcp_splice.c, so we can set it static again.
> 
> Fixes: 6ccab72d9b40 ("tcp: Improve handling of fallback if socket pool is empty on new splice")
> Cc: david@gibson.dropbear.id.au
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>

Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

Of course, it might get obsoleted if I get around to removing the
socket buffer setting entirely.

> ---
>  tcp.c | 2 +-
>  tcp.h | 1 -
>  2 files changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/tcp.c b/tcp.c
> index f506cfdd3bc7..1680b516b5b9 100644
> --- a/tcp.c
> +++ b/tcp.c
> @@ -929,7 +929,7 @@ static void tcp_get_sndbuf(struct tcp_tap_conn *conn)
>   * tcp_sock_set_bufsize() - Set SO_RCVBUF and SO_SNDBUF to maximum values
>   * @s:		Socket, can be -1 to avoid check in the caller
>   */
> -void tcp_sock_set_bufsize(const struct ctx *c, int s)
> +static void tcp_sock_set_bufsize(const struct ctx *c, int s)
>  {
>  	int v = INT_MAX / 2; /* Kernel clamps and rounds, no need to check */
>  
> diff --git a/tcp.h b/tcp.h
> index 27b11668f258..87a6bf9f0ee8 100644
> --- a/tcp.h
> +++ b/tcp.h
> @@ -23,7 +23,6 @@ int tcp_init(struct ctx *c);
>  void tcp_timer(struct ctx *c, const struct timespec *ts);
>  void tcp_defer_handler(struct ctx *c);
>  
> -void tcp_sock_set_bufsize(const struct ctx *c, int s);
>  void tcp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s);
>  
>  /**

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] tcp: make tcp_sock_set_bufsize() static (again)
  2023-12-05  0:46 ` David Gibson
@ 2023-12-27 20:25   ` Stefano Brivio
  0 siblings, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2023-12-27 20:25 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: David Gibson, passt-dev

On Tue, 5 Dec 2023 11:46:10 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Mon, Dec 04, 2023 at 03:23:11PM +0100, Laurent Vivier wrote:
> > e5eefe77435a ("tcp: Refactor to use events instead of states, split out
> > spliced implementation") has exported tcp_sock_set_bufsize() to
> > be able to use it in tcp_splice.c, but 6ccab72d9b40 has removed its use
> > in tcp_splice.c, so we can set it static again.
> > 
> > Fixes: 6ccab72d9b40 ("tcp: Improve handling of fallback if socket pool is empty on new splice")
> > Cc: david@gibson.dropbear.id.au
> > Signed-off-by: Laurent Vivier <lvivier@redhat.com>  
> 
> Reviewed-by: David Gibson <david@gibson.dropbear.id.au>

Applied.

-- 
Stefano


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-27 20:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-04 14:23 [PATCH] tcp: make tcp_sock_set_bufsize() static (again) Laurent Vivier
2023-12-05  0:46 ` David Gibson
2023-12-27 20:25   ` Stefano Brivio

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

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 IMAP folder(s).