Fix ENOBUFS error in large transactions with --echo
Status from this message: Applied, thanks.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | mnl: Maximize socket receive buffer by defaultsrc/ | +21 | 0 replies | |
| 2/4 | mnl: Increase receive buffer in mnl_batch_talk()src/ | +1 | 2 replies | |
| 3/4 | mnl: Fix and simplify mnl_batch_talk()src/ | +22 | 1 reply | |
| 4/4 | tests/shell: Test large transaction with echo outputtests/ | +14 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [nft PATCH 0/4] Fix ENOBUFS error in large transactions with --echo
When committing a larger transaction (e.g. adding 300 rules) with echo output turned on, mnl_batch_talk() would report ENOBUFS after the first call to mnl_socket_recvfrom(). (ENOBUFS indicates congestion in netlink socket.)
The problem in mnl_batch_talk() was a combination of unmodified socket recv buffer, use of select() and unhandled ENOBUFS condition (abort instead of retry).
This series solves the issue, admittedly a bit in sledge hammer method:
Maximize nf_sock receive buffer size for all users, make mnl_batch_talk() fetch more messages at once and retry upon ENOBUFS instead of just giving up.
There was also a problem with select() use which motivated the loop rewrite in Patch 3. Actually, replacing the whole loop by a simple call to nft_mnl_recv() worked and was even sufficient in avoiding ENOBUFS condition, but I am not sure if that has other side-effects.
Phil Sutter (4):
mnl: Maximize socket receive buffer by default
mnl: Increase receive buffer in mnl_batch_talk()
mnl: Fix and simplify mnl_batch_talk() tests/shell: Test large transaction with echo output
src/mnl.c | 82 ++++++++++--------- tests/shell/testcases/transactions/0049huge_0 | 14 ++++ 2 files changed, 58 insertions(+), 38 deletions(-) create mode 100755 tests/shell/testcases/transactions/0049huge_0
Signature · 1 line
2.21.0