mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
net: report min and max mtu network device settings
Report the minimum and maximum MTU allowed on a device via netlink so that it can be displayed by tools like ip link. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3260155ac7
commit
3e7a50ceb1
2 changed files with 8 additions and 0 deletions
|
@ -164,6 +164,8 @@ enum {
|
||||||
IFLA_CARRIER_UP_COUNT,
|
IFLA_CARRIER_UP_COUNT,
|
||||||
IFLA_CARRIER_DOWN_COUNT,
|
IFLA_CARRIER_DOWN_COUNT,
|
||||||
IFLA_NEW_IFINDEX,
|
IFLA_NEW_IFINDEX,
|
||||||
|
IFLA_MIN_MTU,
|
||||||
|
IFLA_MAX_MTU,
|
||||||
__IFLA_MAX
|
__IFLA_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1015,6 +1015,8 @@ static noinline size_t if_nlmsg_size(const struct net_device *dev,
|
||||||
+ nla_total_size(4) /* IFLA_IF_NETNSID */
|
+ nla_total_size(4) /* IFLA_IF_NETNSID */
|
||||||
+ nla_total_size(4) /* IFLA_CARRIER_UP_COUNT */
|
+ nla_total_size(4) /* IFLA_CARRIER_UP_COUNT */
|
||||||
+ nla_total_size(4) /* IFLA_CARRIER_DOWN_COUNT */
|
+ nla_total_size(4) /* IFLA_CARRIER_DOWN_COUNT */
|
||||||
|
+ nla_total_size(4) /* IFLA_MIN_MTU */
|
||||||
|
+ nla_total_size(4) /* IFLA_MAX_MTU */
|
||||||
+ 0;
|
+ 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1601,6 +1603,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb,
|
||||||
netif_running(dev) ? dev->operstate : IF_OPER_DOWN) ||
|
netif_running(dev) ? dev->operstate : IF_OPER_DOWN) ||
|
||||||
nla_put_u8(skb, IFLA_LINKMODE, dev->link_mode) ||
|
nla_put_u8(skb, IFLA_LINKMODE, dev->link_mode) ||
|
||||||
nla_put_u32(skb, IFLA_MTU, dev->mtu) ||
|
nla_put_u32(skb, IFLA_MTU, dev->mtu) ||
|
||||||
|
nla_put_u32(skb, IFLA_MIN_MTU, dev->min_mtu) ||
|
||||||
|
nla_put_u32(skb, IFLA_MAX_MTU, dev->max_mtu) ||
|
||||||
nla_put_u32(skb, IFLA_GROUP, dev->group) ||
|
nla_put_u32(skb, IFLA_GROUP, dev->group) ||
|
||||||
nla_put_u32(skb, IFLA_PROMISCUITY, dev->promiscuity) ||
|
nla_put_u32(skb, IFLA_PROMISCUITY, dev->promiscuity) ||
|
||||||
nla_put_u32(skb, IFLA_NUM_TX_QUEUES, dev->num_tx_queues) ||
|
nla_put_u32(skb, IFLA_NUM_TX_QUEUES, dev->num_tx_queues) ||
|
||||||
|
@ -1732,6 +1736,8 @@ static const struct nla_policy ifla_policy[IFLA_MAX+1] = {
|
||||||
[IFLA_IF_NETNSID] = { .type = NLA_S32 },
|
[IFLA_IF_NETNSID] = { .type = NLA_S32 },
|
||||||
[IFLA_CARRIER_UP_COUNT] = { .type = NLA_U32 },
|
[IFLA_CARRIER_UP_COUNT] = { .type = NLA_U32 },
|
||||||
[IFLA_CARRIER_DOWN_COUNT] = { .type = NLA_U32 },
|
[IFLA_CARRIER_DOWN_COUNT] = { .type = NLA_U32 },
|
||||||
|
[IFLA_MIN_MTU] = { .type = NLA_U32 },
|
||||||
|
[IFLA_MAX_MTU] = { .type = NLA_U32 },
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
|
static const struct nla_policy ifla_info_policy[IFLA_INFO_MAX+1] = {
|
||||||
|
|
Loading…
Reference in a new issue