mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
datapath: Strip down vport interface : OVS_VPORT_ATTR_MTU
There is no need to have vport attribute MTU (OVS_VPORT_ATTR_MTU) as linux net-dev-ioctl can be used to get/set MTU for linux device. Following patch removes OVS_VPORT_ATTR_MTU from datapath protocol. This patch also adds netdev_set_mtu interface. So that MTU adjustments can be done from OVS userspace. get_mtu() interface is also changed, now get_mtu() returns EOPNOTSUPP rather than returning 0 and setting *pmtu to INT_MAX in case there is no MTU attribute for given device. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -1238,7 +1238,6 @@ dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport *vport,
|
||||
.min_len = ETH_ADDR_LEN,
|
||||
.max_len = ETH_ADDR_LEN,
|
||||
.optional = true },
|
||||
[OVS_VPORT_ATTR_MTU] = { .type = NL_A_U32, .optional = true },
|
||||
[OVS_VPORT_ATTR_OPTIONS] = { .type = NL_A_NESTED, .optional = true },
|
||||
[OVS_VPORT_ATTR_IFINDEX] = { .type = NL_A_U32, .optional = true },
|
||||
};
|
||||
@@ -1273,11 +1272,6 @@ dpif_linux_vport_from_ofpbuf(struct dpif_linux_vport *vport,
|
||||
if (a[OVS_VPORT_ATTR_ADDRESS]) {
|
||||
vport->address = nl_attr_get(a[OVS_VPORT_ATTR_ADDRESS]);
|
||||
}
|
||||
if (a[OVS_VPORT_ATTR_MTU]) {
|
||||
vport->mtu = nl_attr_get_u32(a[OVS_VPORT_ATTR_MTU]);
|
||||
} else {
|
||||
vport->mtu = INT_MAX;
|
||||
}
|
||||
if (a[OVS_VPORT_ATTR_OPTIONS]) {
|
||||
vport->options = nl_attr_get(a[OVS_VPORT_ATTR_OPTIONS]);
|
||||
vport->options_len = nl_attr_get_size(a[OVS_VPORT_ATTR_OPTIONS]);
|
||||
@@ -1324,10 +1318,6 @@ dpif_linux_vport_to_ofpbuf(const struct dpif_linux_vport *vport,
|
||||
vport->address, ETH_ADDR_LEN);
|
||||
}
|
||||
|
||||
if (vport->mtu && vport->mtu != INT_MAX) {
|
||||
nl_msg_put_u32(buf, OVS_VPORT_ATTR_MTU, vport->mtu);
|
||||
}
|
||||
|
||||
if (vport->options) {
|
||||
nl_msg_put_nested(buf, OVS_VPORT_ATTR_OPTIONS,
|
||||
vport->options, vport->options_len);
|
||||
|
Reference in New Issue
Block a user