Skip to content

Commit 0137891

Browse files
jdamato-fslykuba-moo
authored andcommitted
netdev-genl: Dump gro_flush_timeout
Support dumping gro_flush_timeout for a NAPI ID. Signed-off-by: Joe Damato <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent acb8d4e commit 0137891

File tree

4 files changed

+17
-0
lines changed

4 files changed

+17
-0
lines changed

Documentation/netlink/specs/netdev.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ attribute-sets:
255255
type: u32
256256
checks:
257257
max: s32-max
258+
-
259+
name: gro-flush-timeout
260+
doc: The timeout, in nanoseconds, of when to trigger the NAPI watchdog
261+
timer which schedules NAPI processing. Additionally, a non-zero
262+
value will also prevent GRO from flushing recent super-frames at
263+
the end of a NAPI cycle. This may add receive latency in exchange
264+
for reducing the number of frames processed by the network stack.
265+
type: uint
258266
-
259267
name: queue
260268
attributes:
@@ -644,6 +652,7 @@ operations:
644652
- irq
645653
- pid
646654
- defer-hard-irqs
655+
- gro-flush-timeout
647656
dump:
648657
request:
649658
attributes:

include/uapi/linux/netdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ enum {
123123
NETDEV_A_NAPI_IRQ,
124124
NETDEV_A_NAPI_PID,
125125
NETDEV_A_NAPI_DEFER_HARD_IRQS,
126+
NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT,
126127

127128
__NETDEV_A_NAPI_MAX,
128129
NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)

net/core/netdev-genl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ static int
161161
netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
162162
const struct genl_info *info)
163163
{
164+
unsigned long gro_flush_timeout;
164165
u32 napi_defer_hard_irqs;
165166
void *hdr;
166167
pid_t pid;
@@ -195,6 +196,11 @@ netdev_nl_napi_fill_one(struct sk_buff *rsp, struct napi_struct *napi,
195196
napi_defer_hard_irqs))
196197
goto nla_put_failure;
197198

199+
gro_flush_timeout = napi_get_gro_flush_timeout(napi);
200+
if (nla_put_uint(rsp, NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT,
201+
gro_flush_timeout))
202+
goto nla_put_failure;
203+
198204
genlmsg_end(rsp, hdr);
199205

200206
return 0;

tools/include/uapi/linux/netdev.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ enum {
123123
NETDEV_A_NAPI_IRQ,
124124
NETDEV_A_NAPI_PID,
125125
NETDEV_A_NAPI_DEFER_HARD_IRQS,
126+
NETDEV_A_NAPI_GRO_FLUSH_TIMEOUT,
126127

127128
__NETDEV_A_NAPI_MAX,
128129
NETDEV_A_NAPI_MAX = (__NETDEV_A_NAPI_MAX - 1)

0 commit comments

Comments
 (0)