Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libteam: Set buffer size of netlink cli sockets #2442

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 12528607db866fe84b870127de64d40efb0a98a0 Mon Sep 17 00:00:00 2001
From: Shu0T1an ChenG <shuche@microsoft.com>
Date: Mon, 14 Jan 2019 16:58:36 -0800
Subject: [PATCH] Set buffer size of netlink cli sockets

Set both netlink cli sock and netlink cli event sock receive buffer
size to 98304.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you decribe the problem trying to address in this patch?


Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
---
libteam/libteam.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/libteam/libteam.c b/libteam/libteam.c
index 106e5cf..f7010b9 100644
--- a/libteam/libteam.c
+++ b/libteam/libteam.c
@@ -600,6 +600,17 @@ int team_init(struct team_handle *th, uint32_t ifindex)
return -nl2syserr(err);
}

+ err = nl_socket_set_buffer_size(th->nl_cli.sock, 98304, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this value? a magic number?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set buffer size failed on my DUT. Does this value rely on certain sysctl setting?

+ if (err) {
+ err(th, "Failed to set buffer size of netlink cli sock.");
+ return -nl2syserr(err);
+ }
+ err = nl_socket_set_buffer_size(th->nl_cli.sock_event, 98304, 0);
+ if (err) {
+ err(th, "Failed to set buffer size of netlink cli event sock.");
+ return -nl2syserr(err);
+ }
+
th->family = genl_ctrl_resolve(th->nl_sock, TEAM_GENL_NAME);
if (th->family < 0) {
err(th, "Failed to resolve netlink family.");
--
2.1.4

1 change: 1 addition & 0 deletions src/libteam/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
git apply ../0003-teamd-lacp-runner-will-send-lacp-update-right-after-.patch
git apply ../0004-libteam-Add-lacp-fallback-support-for-single-member-.patch
git apply ../0005-libteam-Add-warm_reboot-mode.patch
git apply ../0006-libteam-Set-buffer-size-of-netlink-cli-sockets.patch
popd

# Obtain debian packaging
Expand Down