From: Thomas Karlsson <thomas.karlsson@paneda.se>
To: David Ahern <dsahern@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, <stephen@networkplumber.org>,
<kuznet@ms2.inr.ac.ru>
Subject: Re: [PATCH iproute2-next v2] iplink:macvlan: Added bcqueuelen parameter
Date: Mon, 14 Dec 2020 18:50:27 +0100 [thread overview]
Message-ID: <ffe5b799-b9d9-369d-54fb-b8e87d8a462c@paneda.se> (raw)
In-Reply-To: <25e06e96-3c8d-06c0-4148-3409d7cecc6a@gmail.com>
On 2020-12-14 18:03, David Ahern wrote:
> On 12/14/20 3:42 AM, Thomas Karlsson wrote:
>> This patch allows the user to set and retrieve the
>> IFLA_MACVLAN_BC_QUEUE_LEN parameter via the bcqueuelen
>> command line argument
>>
>> This parameter controls the requested size of the queue for
>> broadcast and multicast packages in the macvlan driver.
>>
>> If not specified, the driver default (1000) will be used.
>>
>> Note: The request is per macvlan but the actually used queue
>> length per port is the maximum of any request to any macvlan
>> connected to the same port.
>>
>> For this reason, the used queue length IFLA_MACVLAN_BC_QUEUE_LEN_USED
>> is also retrieved and displayed in order to aid in the understanding
>> of the setting. However, it can of course not be directly set.
>>
>> Signed-off-by: Thomas Karlsson <thomas.karlsson@paneda.se>
>> ---
>>
>> Note: This patch controls the parameter added in net-next
>> with commit d4bff72c8401e6f56194ecf455db70ebc22929e2
>>
>> v2 Rebased on origin/main
>> v1 Initial version
>>
>> ip/iplink_macvlan.c | 33 +++++++++++++++++++++++++++++++--
>> man/man8/ip-link.8.in | 33 +++++++++++++++++++++++++++++++++
>> 2 files changed, 64 insertions(+), 2 deletions(-)
>>
>> diff --git a/ip/iplink_macvlan.c b/ip/iplink_macvlan.c
>> index b966a615..302a3748 100644
>> --- a/ip/iplink_macvlan.c
>> +++ b/ip/iplink_macvlan.c
>> @@ -30,12 +30,13 @@
>> static void print_explain(struct link_util *lu, FILE *f)
>> {
>> fprintf(f,
>> - "Usage: ... %s mode MODE [flag MODE_FLAG] MODE_OPTS\n"
>> + "Usage: ... %s mode MODE [flag MODE_FLAG] MODE_OPTS [bcqueuelen BC_QUEUE_LEN]\n"
>> "\n"
>> "MODE: private | vepa | bridge | passthru | source\n"
>> "MODE_FLAG: null | nopromisc\n"
>> "MODE_OPTS: for mode \"source\":\n"
>> - "\tmacaddr { { add | del } <macaddr> | set [ <macaddr> [ <macaddr> ... ] ] | flush }\n",
>> + "\tmacaddr { { add | del } <macaddr> | set [ <macaddr> [ <macaddr> ... ] ] | flush }\n"
>> + "BC_QUEUE_LEN: Length of the rx queue for broadcast/multicast: [0-4294967295]\n",
>
> Are we really allowing a BC queue up to 4G? seems a bit much. is a u16
> and 64k not more than sufficient?
>
>
No, 64k is not sufficient when you have very high packet rate and very small packages.
I can easily see myself retrieving more than 300 kpps and 65k is then only just around
200 ms of buffer head-room, which I don't consider much saftey margin at all, especially if
the incoming data is not perfectly spaced out but rather comes in bursts.
If you start adding 10Gbps cards in the mix you could get 10 times that and the buffer
would be down to only 20ms. And we would get back to the situation where unicast works
fine but multicast does not.
So for sure a larger max than 64k is needed.
The reason I didn't add an upper limit beside the u32 was that I didn't want to pick an
arbitrary limit that works for me now but maybe not support someone elses use case later.
I'm now looking at net.core.netdev_max_backlog for inspiration. Which, at least on my system,
seems to have a limit of 2147483647 (signed 32 bit int). So perhaps this setting could be
aligned with that number since the settings are sort of related instead of using the full range
if you prefer that?
next prev parent reply other threads:[~2020-12-14 17:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <485531aec7e243659ee4e3bb7fa2186d@paneda.se>
2020-11-23 14:22 ` Hardcoded multicast queue length in macvlan.c driver causes poor multicast receive performance Thomas Karlsson
2020-11-23 22:30 ` Jakub Kicinski
2020-11-25 12:51 ` Thomas Karlsson
2020-11-25 16:57 ` [PATCH] macvlan: Support for high multicast packet rate Thomas Karlsson
2020-11-25 21:55 ` [PATCH net-next v2] " Thomas Karlsson
2020-11-25 16:58 ` Hardcoded multicast queue length in macvlan.c driver causes poor multicast receive performance Jakub Kicinski
2020-11-25 17:12 ` Thomas Karlsson
2020-11-25 18:07 ` Jakub Kicinski
2020-11-25 22:15 ` Thomas Karlsson
2020-11-25 23:01 ` Jakub Kicinski
2020-11-26 20:00 ` Thomas Karlsson
2020-11-27 17:27 ` Jakub Kicinski
2020-11-27 23:13 ` Thomas Karlsson
2020-11-30 14:00 ` [PATCH net-next v3] macvlan: Support for high multicast packet rate Thomas Karlsson
2020-12-01 19:11 ` Jakub Kicinski
2020-12-02 11:28 ` Thomas Karlsson
2020-12-02 16:44 ` Jakub Kicinski
2020-11-30 14:23 ` [PATCH iproute2-next v1] iplink macvlan: Added bcqueuelen parameter Thomas Karlsson
2020-12-10 16:07 ` Thomas Karlsson
2020-12-11 0:36 ` Jakub Kicinski
2020-12-02 18:49 ` [PATCH net-next v4] macvlan: Support for high multicast packet rate Thomas Karlsson
2020-12-03 16:20 ` Jakub Kicinski
2020-12-03 16:53 ` Thomas Karlsson
2020-12-14 10:42 ` [PATCH iproute2-next v2] iplink:macvlan: Added bcqueuelen parameter Thomas Karlsson
2020-12-14 17:03 ` David Ahern
2020-12-14 17:50 ` Thomas Karlsson [this message]
2020-12-16 4:07 ` David Ahern
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=ffe5b799-b9d9-369d-54fb-b8e87d8a462c@paneda.se \
--to=thomas.karlsson@paneda.se \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=kuba@kernel.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/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).