mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-09-18 23:09:29 +02:00
Every devmem dmabuf binding today hands the page_pool PAGE_SIZE niovs.
This caps a single RX descriptor at PAGE_SIZE, burning CPU on buffer
churn for large flows.
Add a bind-time netlink attribute, NETDEV_A_DMABUF_RX_PAGE_SIZE, that
lets userspace request a larger niov size. The value must be a power of
two >= PAGE_SIZE.
The TX path is changed to always pass PAGE_SIZE.
Measurements:
Setup: kperf in devmem RX/TX cuda mode, 4 flows, 64 MB messages, 60s,
dctcp, num-rx-queues=4, dmabuf-rx/tx-size-mb=2048, 10 runs per niov
size, mlx5.
CPU Util:
niov net sirq % net idle % app sys % app idle %
----- ---------------- ---------------- ---------------- ----------------
4K 62.38 +/- 8.27 33.40 +/- 7.51 54.15 +/- 10.23 43.67 +/- 10.53
16K 58.91 +/- 5.35 35.23 +/- 5.88 41.05 +/- 8.87 56.42 +/- 9.24
32K 64.12 +/- 0.68 31.09 +/- 1.48 44.54 +/- 3.51 52.63 +/- 3.65
64K 54.69 +/- 5.54 39.67 +/- 5.81 35.47 +/- 3.11 61.97 +/- 3.27
RX app sys % drops ~19% from 4K to 64K.
Throughput:
niov RX dev Gbps RX flow avg Gbps
----- ---------------- -----------------
4K 300.63 +/- 53.21 75.16 +/- 13.30
16K 321.35 +/- 28.20 80.34 +/- 7.05
32K 347.63 +/- 2.20 86.91 +/- 0.55
64K 332.11 +/- 14.26 83.03 +/- 3.56
Throughput seems to increase, but the stdev is pretty wide so could just
be noise.
kperf support (not yet merged):
https://github.com/facebookexperimental/kperf/commit/8837577f920876bce6986ec18869ac04439ebcd2
Acked-by: Stanislav Fomichev <sdf@fomichev.me>
Reviewed-by: Mina Almasry <almasrymina@google.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: Bobby Eshleman <bobbyeshleman@meta.com>
Link: https://patch.msgid.link/20260805-tcpdm-large-niovs-v8-1-3e0225e2808c@meta.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
54 lines
2.2 KiB
C
54 lines
2.2 KiB
C
/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */
|
|
/* Do not edit directly, auto-generated from: */
|
|
/* Documentation/netlink/specs/netdev.yaml */
|
|
/* YNL-GEN kernel header */
|
|
/* To regenerate run: tools/net/ynl/ynl-regen.sh */
|
|
|
|
#ifndef _LINUX_NETDEV_GEN_H
|
|
#define _LINUX_NETDEV_GEN_H
|
|
|
|
#include <net/netlink.h>
|
|
#include <net/genetlink.h>
|
|
|
|
#include <uapi/linux/netdev.h>
|
|
#include <net/netdev_netlink.h>
|
|
#include <asm/page.h>
|
|
|
|
/* Common nested types */
|
|
extern const struct nla_policy netdev_lease_nl_policy[NETDEV_A_LEASE_NETNS_ID + 1];
|
|
extern const struct nla_policy netdev_page_pool_info_nl_policy[NETDEV_A_PAGE_POOL_IFINDEX + 1];
|
|
extern const struct nla_policy netdev_queue_id_nl_policy[NETDEV_A_QUEUE_TYPE + 1];
|
|
|
|
int netdev_nl_dev_get_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_dev_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb);
|
|
int netdev_nl_page_pool_get_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_page_pool_get_dumpit(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int netdev_nl_page_pool_stats_get_doit(struct sk_buff *skb,
|
|
struct genl_info *info);
|
|
int netdev_nl_page_pool_stats_get_dumpit(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int netdev_nl_queue_get_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_queue_get_dumpit(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int netdev_nl_napi_get_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb);
|
|
int netdev_nl_qstats_get_dumpit(struct sk_buff *skb,
|
|
struct netlink_callback *cb);
|
|
int netdev_nl_bind_rx_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_napi_set_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_bind_tx_doit(struct sk_buff *skb, struct genl_info *info);
|
|
int netdev_nl_queue_create_doit(struct sk_buff *skb, struct genl_info *info);
|
|
|
|
enum {
|
|
NETDEV_NLGRP_MGMT,
|
|
NETDEV_NLGRP_PAGE_POOL,
|
|
};
|
|
|
|
extern struct genl_family netdev_nl_family;
|
|
|
|
void netdev_nl_sock_priv_init(struct netdev_nl_sock *priv);
|
|
void netdev_nl_sock_priv_destroy(struct netdev_nl_sock *priv);
|
|
|
|
#endif /* _LINUX_NETDEV_GEN_H */
|