* [PATCH iproute2] dcb: Do not leave ACKs in socket receive buffer
@ 2022-12-27 11:03 Ido Schimmel
2022-12-29 16:50 ` patchwork-bot+netdevbpf
0 siblings, 1 reply; 2+ messages in thread
From: Ido Schimmel @ 2022-12-27 11:03 UTC (permalink / raw)
To: netdev; +Cc: stephen, dsahern, chenjunxin1, petrm, mlxsw, Ido Schimmel
Originally, the dcb utility only stopped receiving messages from a
socket when it found the attribute it was looking for. Cited commit
changed that, so that the utility will also stop when seeing an ACK
(NLMSG_ERROR message), by setting the NLM_F_ACK flag on requests.
This is problematic because it means a successful request will leave an
ACK in the socket receive buffer, causing the next request to bail
before reading its response.
Fix that by not stopping when finding the required attribute in a
response. Instead, stop on the subsequent ACK.
Fixes: 84c036972659 ("dcb: unblock mnl_socket_recvfrom if not message received")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
---
dcb/dcb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dcb/dcb.c b/dcb/dcb.c
index 3ffa91d64d0d..9b996abac529 100644
--- a/dcb/dcb.c
+++ b/dcb/dcb.c
@@ -72,7 +72,7 @@ static int dcb_get_attribute_attr_ieee_cb(const struct nlattr *attr, void *data)
ga->payload = mnl_attr_get_payload(attr);
ga->payload_len = mnl_attr_get_payload_len(attr);
- return MNL_CB_STOP;
+ return MNL_CB_OK;
}
static int dcb_get_attribute_attr_cb(const struct nlattr *attr, void *data)
@@ -126,7 +126,7 @@ static int dcb_set_attribute_attr_cb(const struct nlattr *attr, void *data)
return MNL_CB_ERROR;
}
- return MNL_CB_STOP;
+ return MNL_CB_OK;
}
static int dcb_set_attribute_cb(const struct nlmsghdr *nlh, void *data)
--
2.37.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH iproute2] dcb: Do not leave ACKs in socket receive buffer
2022-12-27 11:03 [PATCH iproute2] dcb: Do not leave ACKs in socket receive buffer Ido Schimmel
@ 2022-12-29 16:50 ` patchwork-bot+netdevbpf
0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-12-29 16:50 UTC (permalink / raw)
To: Ido Schimmel; +Cc: netdev, stephen, dsahern, chenjunxin1, petrm, mlxsw
Hello:
This patch was applied to iproute2/iproute2.git (main)
by Stephen Hemminger <stephen@networkplumber.org>:
On Tue, 27 Dec 2022 13:03:18 +0200 you wrote:
> Originally, the dcb utility only stopped receiving messages from a
> socket when it found the attribute it was looking for. Cited commit
> changed that, so that the utility will also stop when seeing an ACK
> (NLMSG_ERROR message), by setting the NLM_F_ACK flag on requests.
>
> This is problematic because it means a successful request will leave an
> ACK in the socket receive buffer, causing the next request to bail
> before reading its response.
>
> [...]
Here is the summary with links:
- [iproute2] dcb: Do not leave ACKs in socket receive buffer
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=d0e02f35af33
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-12-29 16:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-27 11:03 [PATCH iproute2] dcb: Do not leave ACKs in socket receive buffer Ido Schimmel
2022-12-29 16:50 ` patchwork-bot+netdevbpf
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).