public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: passt-dev@passt.top
Subject: Re: [PATCH 1/5] tcp: Make a helper to refill each socket pool
Date: Thu, 12 Jan 2023 19:09:21 +0100	[thread overview]
Message-ID: <20230112190921.7a6bf18c@elisabeth> (raw)
In-Reply-To: <20230109005026.24512-2-david@gibson.dropbear.id.au>

On Mon,  9 Jan 2023 11:50:22 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> tcp_sock_refill() contains two near-identical loops to refill the IPv4
> and IPv6 socket pools.  In addition, if we get an error on the IPv4 pool
> we exit early and won't attempt to refill the IPv6 pool.  That doesn't seem
> sensible, since these are essentially completely independent, and there
> may be value to filling up either one without the other.

Well, for the purposes of the single error condition that's checked
there, they're not independent, in practice: if we just had a socket
number that's too high, the next one will be, too. This is not formally
guaranteed, though.

In any case, this is indeed more elegant, and also drops a
'return -EIO' which doesn't really match the "Return: 0" comment.

-- 
Stefano


  reply	other threads:[~2023-01-12 18:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  0:50 [PATCH 0/5] Cleanups to tcp socket pool handling David Gibson
2023-01-09  0:50 ` [PATCH 1/5] tcp: Make a helper to refill each socket pool David Gibson
2023-01-12 18:09   ` Stefano Brivio [this message]
2023-01-15  0:22     ` David Gibson
2023-01-09  0:50 ` [PATCH 2/5] tcp: Split init and ns cases for tcp_sock_refill() David Gibson
2023-01-09  0:50 ` [PATCH 3/5] tcp: Move socket pool declarations around David Gibson
2023-01-12 18:09   ` Stefano Brivio
2023-01-15  0:26     ` David Gibson
2023-01-09  0:50 ` [PATCH 4/5] tcp: Split pool lookup from creating new sockets in tcp_conn_new_sock() David Gibson
2023-01-09  0:50 ` [PATCH 5/5] tcp: Improve handling of fallback if socket pool is empty on new splice David Gibson
2023-01-12 18:09   ` Stefano Brivio
2023-01-15  0:31     ` David Gibson
2023-01-23 17:47       ` Stefano Brivio

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=20230112190921.7a6bf18c@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    /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.
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).