bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Ignatov <rdna@fb.com>
To: <sdf@google.com>
Cc: <netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
	<davem@davemloft.net>, <ast@kernel.org>, <daniel@iogearbox.net>
Subject: Re: [PATCH bpf-next 4/4] bpf: allow any port in bpf_bind helper
Date: Tue, 5 May 2020 11:20:10 -0700	[thread overview]
Message-ID: <20200505182010.GB55644@rdna-mbp> (raw)
In-Reply-To: <20200505160205.GC241848@google.com>

sdf@google.com <sdf@google.com> [Tue, 2020-05-05 09:02 -0700]:
> On 05/04, Andrey Ignatov wrote:
> > Stanislav Fomichev <sdf@google.com> [Mon, 2020-05-04 10:34 -0700]:
> > > We want to have a tighter control on what ports we bind to in
> > > the BPF_CGROUP_INET{4,6}_CONNECT hooks even if it means
> > > connect() becomes slightly more expensive. The expensive part
> > > comes from the fact that we now need to call inet_csk_get_port()
> > > that verifies that the port is not used and allocates an entry
> > > in the hash table for it.
> 
> > FWIW: Initially that IP_BIND_ADDRESS_NO_PORT limitation came from the
> > fact that on my specific use-case (mysql client making 200-500 connects
> > per sec to mysql server) disabling the option was making application
> > pretty much unusable (inet_csk_get_port was taking more time than mysql
> > client connect timeout == 3sec).
> 
> > But I guess for some use-cases that call sys_connect not too often it
> > makes sense.
> Yeah, I don't think we plan to reach those QPS numbers.
> But, for the record, did you try to bind to a random port in that
> case? And did you bail out on error or did a couple of retries?

Random port.

As for retries: no retries on low-level (no reconnecting to that same
server if sys_connect failed), but I don't quite remember how
higher-level behaved (it was choosing a server to connect to according
to some sharding scheme and I don't remember whether it was trying to
connect to next replica or not if current replica failed), sorry.

-- 
Andrey Ignatov

      parent reply	other threads:[~2020-05-05 18:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-04 17:34 [PATCH bpf-next 0/4] bpf: allow any port in bpf_bind helper Stanislav Fomichev
2020-05-04 17:34 ` [PATCH bpf-next 1/4] selftests/bpf: generalize helpers to control backround listener Stanislav Fomichev
2020-05-05  6:23   ` Andrii Nakryiko
2020-05-05 16:08     ` sdf
2020-05-05 18:50       ` Andrii Nakryiko
2020-05-04 17:34 ` [PATCH bpf-next 2/4] selftests/bpf: adopt accept_timeout from sockmap_listen Stanislav Fomichev
2020-05-04 17:34 ` [PATCH bpf-next 3/4] net: refactor arguments of inet{,6}_bind Stanislav Fomichev
2020-05-05 18:16   ` Martin KaFai Lau
2020-05-05 18:19     ` Stanislav Fomichev
2020-05-04 17:34 ` [PATCH bpf-next 4/4] bpf: allow any port in bpf_bind helper Stanislav Fomichev
2020-05-04 23:22   ` Andrey Ignatov
2020-05-05 16:02     ` sdf
2020-05-05 17:09       ` sdf
2020-05-05 17:33         ` Andrey Ignatov
2020-05-05 17:43           ` sdf
2020-05-05 18:20       ` Andrey Ignatov [this message]

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=20200505182010.GB55644@rdna-mbp \
    --to=rdna@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=sdf@google.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).