* [PATCH iproute2] iplink: add gro_max_size attribute handling
@ 2022-02-01 23:27 Eric Dumazet
2022-02-02 0:42 ` Stephen Hemminger
2022-02-03 3:55 ` David Ahern
0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2022-02-01 23:27 UTC (permalink / raw)
To: David Ahern, Stephen Hemminger
Cc: netdev, Eric Dumazet, Eric Dumazet, Coco Li
From: Coco Li <lixiaoyan@google.com>
Add the ability to display or change the gro_max_size attribute.
ip link set dev eth1 gro_max_size 60000
ip -d link show eth1
5: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9198 qdisc mq master eth0 state UP mode DEFAULT group default qlen 1000
link/ether bc:ae:c5:39:69:66 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 46 maxmtu 9600
<...> gro_max_size 60000
Signed-off-by: Coco Li <lixiaoyan@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
ip/ipaddress.c | 5 +++++
ip/iplink.c | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index 4109d8bd2c43640bee40656c124ea6393d95a345..583c41a94a8ec964779c1e3a8305be80e43907e7 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -904,6 +904,11 @@ static int print_linkinfo_brief(FILE *fp, const char *name,
ifi->ifi_type,
b1, sizeof(b1)));
}
+ if (tb[IFLA_GRO_MAX_SIZE])
+ print_uint(PRINT_ANY,
+ "gro_max_size",
+ "gro_max_size %u ",
+ rta_getattr_u32(tb[IFLA_GRO_MAX_SIZE]));
}
if (filter.family == AF_PACKET) {
diff --git a/ip/iplink.c b/ip/iplink.c
index a3ea775d2b23c47916e9554b8615d430a58c6a55..c0a3a9ad3e629986ee2da0ee80eaf758f98aee5f 100644
--- a/ip/iplink.c
+++ b/ip/iplink.c
@@ -118,6 +118,7 @@ void iplink_usage(void)
" [ protodown { on | off } ]\n"
" [ protodown_reason PREASON { on | off } ]\n"
" [ gso_max_size BYTES ] | [ gso_max_segs PACKETS ]\n"
+ " [ gro_max_size BYTES ]\n"
"\n"
" ip link show [ DEVICE | group GROUP ] [up] [master DEV] [vrf NAME] [type TYPE]\n"
" [nomaster]\n"
@@ -942,6 +943,15 @@ int iplink_parse(int argc, char **argv, struct iplink_req *req, char **type)
*argv);
addattr32(&req->n, sizeof(*req),
IFLA_GSO_MAX_SEGS, max_segs);
+ } else if (strcmp(*argv, "gro_max_size") == 0) {
+ unsigned int max_size;
+
+ NEXT_ARG();
+ if (get_unsigned(&max_size, *argv, 0))
+ invarg("Invalid \"gro_max_size\" value\n",
+ *argv);
+ addattr32(&req->n, sizeof(*req),
+ IFLA_GRO_MAX_SIZE, max_size);
} else if (strcmp(*argv, "parentdev") == 0) {
NEXT_ARG();
addattr_l(&req->n, sizeof(*req), IFLA_PARENT_DEV_NAME,
--
2.35.0.rc2.247.g8bbb082509-goog
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] iplink: add gro_max_size attribute handling
2022-02-01 23:27 [PATCH iproute2] iplink: add gro_max_size attribute handling Eric Dumazet
@ 2022-02-02 0:42 ` Stephen Hemminger
2022-02-03 3:55 ` David Ahern
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2022-02-02 0:42 UTC (permalink / raw)
To: Eric Dumazet; +Cc: David Ahern, netdev, Eric Dumazet, Coco Li
On Tue, 1 Feb 2022 15:27:15 -0800
Eric Dumazet <eric.dumazet@gmail.com> wrote:
> From: Coco Li <lixiaoyan@google.com>
>
> Add the ability to display or change the gro_max_size attribute.
>
> ip link set dev eth1 gro_max_size 60000
> ip -d link show eth1
> 5: eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 9198 qdisc mq master eth0 state UP mode DEFAULT group default qlen 1000
> link/ether bc:ae:c5:39:69:66 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 46 maxmtu 9600
> <...> gro_max_size 60000
>
> Signed-off-by: Coco Li <lixiaoyan@google.com>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Looks good, could you send update to man page as well?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] iplink: add gro_max_size attribute handling
2022-02-01 23:27 [PATCH iproute2] iplink: add gro_max_size attribute handling Eric Dumazet
2022-02-02 0:42 ` Stephen Hemminger
@ 2022-02-03 3:55 ` David Ahern
2022-02-03 4:45 ` Eric Dumazet
1 sibling, 1 reply; 4+ messages in thread
From: David Ahern @ 2022-02-03 3:55 UTC (permalink / raw)
To: Eric Dumazet, Stephen Hemminger; +Cc: netdev, Eric Dumazet, Coco Li
On 2/1/22 4:27 PM, Eric Dumazet wrote:
> diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> index 4109d8bd2c43640bee40656c124ea6393d95a345..583c41a94a8ec964779c1e3a8305be80e43907e7 100644
> --- a/ip/ipaddress.c
> +++ b/ip/ipaddress.c
> @@ -904,6 +904,11 @@ static int print_linkinfo_brief(FILE *fp, const char *name,
> ifi->ifi_type,
> b1, sizeof(b1)));
> }
> + if (tb[IFLA_GRO_MAX_SIZE])
> + print_uint(PRINT_ANY,
> + "gro_max_size",
> + "gro_max_size %u ",
> + rta_getattr_u32(tb[IFLA_GRO_MAX_SIZE]));
> }
>
> if (filter.family == AF_PACKET) {
gso_max_segs only shows in detail mode; this change prints it only for
brief mode.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] iplink: add gro_max_size attribute handling
2022-02-03 3:55 ` David Ahern
@ 2022-02-03 4:45 ` Eric Dumazet
0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2022-02-03 4:45 UTC (permalink / raw)
To: David Ahern; +Cc: Eric Dumazet, Stephen Hemminger, netdev, Coco Li
On Wed, Feb 2, 2022 at 7:55 PM David Ahern <dsahern@gmail.com> wrote:
>
> On 2/1/22 4:27 PM, Eric Dumazet wrote:
> > diff --git a/ip/ipaddress.c b/ip/ipaddress.c
> > index 4109d8bd2c43640bee40656c124ea6393d95a345..583c41a94a8ec964779c1e3a8305be80e43907e7 100644
> > --- a/ip/ipaddress.c
> > +++ b/ip/ipaddress.c
> > @@ -904,6 +904,11 @@ static int print_linkinfo_brief(FILE *fp, const char *name,
> > ifi->ifi_type,
> > b1, sizeof(b1)));
> > }
> > + if (tb[IFLA_GRO_MAX_SIZE])
> > + print_uint(PRINT_ANY,
> > + "gro_max_size",
> > + "gro_max_size %u ",
> > + rta_getattr_u32(tb[IFLA_GRO_MAX_SIZE]));
> > }
> >
> > if (filter.family == AF_PACKET) {
>
> gso_max_segs only shows in detail mode; this change prints it only for
> brief mode.
This is a rebase error, I will send a v2.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-02-03 4:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-01 23:27 [PATCH iproute2] iplink: add gro_max_size attribute handling Eric Dumazet
2022-02-02 0:42 ` Stephen Hemminger
2022-02-03 3:55 ` David Ahern
2022-02-03 4:45 ` Eric Dumazet
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.