Skip to contentSkip to conversation

iplink: add gro_max_size attribute handling

PATCH Applied Eric Dumazet 2 participants 2 messages Feb 3, 2022 – Feb 7, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iplink: add gro_max_size attribute handling

From: Coco Li <[email protected]>

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
---
 ip/ipaddress.c |  6 ++++++
 ip/iplink.c    | 10 ++++++++++
 2 files changed, 16 insertions(+)
ip/ipaddress.c +6 -0
index 4109d8bd2c43640bee40656c124ea6393d95a345..739b0b9c9f348141b0e51f6231b547385af00eae 100644
@@ -1219,6 +1219,12 @@ int print_linkinfo(struct nlmsghdr *n, void *arg)
 				   "gso_max_segs %u ",
 				   rta_getattr_u32(tb[IFLA_GSO_MAX_SEGS]));
 
+		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 (tb[IFLA_PHYS_PORT_NAME])
 			print_string(PRINT_ANY,
 				     "phys_port_name",
ip/iplink.c +10 -0
index a3ea775d2b23c47916e9554b8615d430a58c6a55..c0a3a9ad3e629986ee2da0ee80eaf758f98aee5f 100644
@@ -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,
Signature · 1 line
2.35.0.rc2.247.g8bbb082509-goog
#1 lore raw
This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Hello:

This patch was applied to iproute2/iproute2-next.git (main) by David Ahern <[email protected]>:

Quoted 11 lines · On Wed, 2 Feb 2022 20:45:58 -0800 you wrote:

From: Coco Li <[email protected]>

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

[...]

Here is the summary with links:
- [v2,iproute2] iplink: add gro_max_size attribute handling

    https://git.kernel.org/pub/scm/network/iproute2/iproute2-next.git/commit/?id=5d57e130362a

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html