Skip to content

Commit 89527be

Browse files
edumazetdavem330
authored andcommitted
net: add IFLA_TSO_{MAX_SIZE|SEGS} attributes
New netlink attributes IFLA_TSO_MAX_SIZE and IFLA_TSO_MAX_SEGS are used to report to user-space the device TSO limits. ip -d link sh dev eth1 ... tso_max_size 65536 tso_max_segs 65535 Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Alexander Duyck <alexanderduyck@fb.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5cf15ce commit 89527be

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

include/uapi/linux/if_link.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ enum {
368368
IFLA_PARENT_DEV_NAME,
369369
IFLA_PARENT_DEV_BUS_NAME,
370370
IFLA_GRO_MAX_SIZE,
371+
IFLA_TSO_MAX_SIZE,
372+
IFLA_TSO_MAX_SEGS,
371373

372374
__IFLA_MAX
373375
};

net/core/rtnetlink.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,6 +1064,8 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev,
10641064
+ nla_total_size(4) /* IFLA_GSO_MAX_SEGS */
10651065
+ nla_total_size(4) /* IFLA_GSO_MAX_SIZE */
10661066
+ nla_total_size(4) /* IFLA_GRO_MAX_SIZE */
1067+
+ nla_total_size(4) /* IFLA_TSO_MAX_SIZE */
1068+
+ nla_total_size(4) /* IFLA_TSO_MAX_SEGS */
10671069
+ nla_total_size(1) /* IFLA_OPERSTATE */
10681070
+ nla_total_size(1) /* IFLA_LINKMODE */
10691071
+ nla_total_size(4) /* IFLA_CARRIER_CHANGES */
@@ -1769,6 +1771,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb,
17691771
nla_put_u32(skb, IFLA_GSO_MAX_SEGS, dev->gso_max_segs) ||
17701772
nla_put_u32(skb, IFLA_GSO_MAX_SIZE, dev->gso_max_size) ||
17711773
nla_put_u32(skb, IFLA_GRO_MAX_SIZE, dev->gro_max_size) ||
1774+
nla_put_u32(skb, IFLA_TSO_MAX_SIZE, dev->tso_max_size) ||
1775+
nla_put_u32(skb, IFLA_TSO_MAX_SEGS, dev->tso_max_segs) ||
17721776
#ifdef CONFIG_RPS
17731777
nla_put_u32(skb, IFLA_NUM_RX_QUEUES, dev->num_rx_queues) ||
17741778
#endif
@@ -1922,6 +1926,8 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = {
19221926
[IFLA_NEW_IFINDEX] = NLA_POLICY_MIN(NLA_S32, 1),
19231927
[IFLA_PARENT_DEV_NAME] = { .type = NLA_NUL_STRING },
19241928
[IFLA_GRO_MAX_SIZE] = { .type = NLA_U32 },
1929+
[IFLA_TSO_MAX_SIZE] = { .type = NLA_REJECT },
1930+
[IFLA_TSO_MAX_SEGS] = { .type = NLA_REJECT },
19251931
};
19261932

19271933
static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {

tools/include/uapi/linux/if_link.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,8 @@ enum {
348348
IFLA_PARENT_DEV_NAME,
349349
IFLA_PARENT_DEV_BUS_NAME,
350350
IFLA_GRO_MAX_SIZE,
351+
IFLA_TSO_MAX_SIZE,
352+
IFLA_TSO_MAX_SEGS,
351353

352354
__IFLA_MAX
353355
};

0 commit comments

Comments
 (0)