From: Mark Kavanagh <mark.b.kavanagh@intel.com>
To: dev@dpdk.org, diproiettod@vmware.com
Cc: i.maximets@samsung.com
Subject: [dpdk-dev] [PATCH 5/7] tests: Add a new MTU test.
Date: Fri, 5 Aug 2016 15:30:11 +0100 [thread overview]
Message-ID: <1470407413-157932-5-git-send-email-mark.b.kavanagh@intel.com> (raw)
In-Reply-To: <1470407413-157932-1-git-send-email-mark.b.kavanagh@intel.com>
From: Daniele Di Proietto <diproiettod@vmware.com>
Also, netdev-dummy needs to call netdev_change_seq_changed() in
set_mtu().
Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
---
lib/netdev-dummy.c | 5 ++++-
tests/ofproto-dpif.at | 30 ++++++++++++++++++++++++++++++
2 files changed, 34 insertions(+), 1 deletion(-)
diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 92af15f..c8f82b7 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -1155,7 +1155,10 @@ netdev_dummy_set_mtu(const struct netdev *netdev, int mtu)
struct netdev_dummy *dev = netdev_dummy_cast(netdev);
ovs_mutex_lock(&dev->mutex);
- dev->mtu = mtu;
+ if (dev->mtu != mtu) {
+ dev->mtu = mtu;
+ netdev_change_seq_changed(netdev);
+ }
ovs_mutex_unlock(&dev->mutex);
return 0;
diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index a46fc81..3638063 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -8859,3 +8859,33 @@ n_packets=0
OVS_VSWITCHD_STOP
AT_CLEANUP
+
+AT_SETUP([ofproto - set mtu])
+OVS_VSWITCHD_START
+
+add_of_ports br0 1
+
+# Check that initial MTU is 1500 for 'br0' and 'p1'.
+AT_CHECK([ovs-vsctl get Interface br0 mtu], [0], [dnl
+1500
+])
+AT_CHECK([ovs-vsctl get Interface p1 mtu], [0], [dnl
+1500
+])
+
+# Request new MTU for 'p1'
+AT_CHECK([ovs-vsctl set Interface p1 mtu_request=1600])
+
+# Check that the new MTU is applied
+AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p1 mtu=1600])
+# The internal port 'br0' should have the same MTU value as p1, becase it's
+# the new bridge minimum.
+AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
+
+AT_CHECK([ovs-vsctl del-port br0 p1])
+
+# When 'p1' is deleted, the internal port should return to the default MTU
+AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1500])
+
+OVS_VSWITCHD_STOP
+AT_CLEANUP
--
1.9.3
next prev parent reply other threads:[~2016-08-05 14:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 14:30 [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 2/7] vswitchd: Introduce 'mtu_request' column in Interface Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 3/7] netdev: Pass 'netdev_class' to ->run() and ->wait() Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 4/7] netdev-dummy: Add dummy-internal class Mark Kavanagh
2016-08-05 14:30 ` Mark Kavanagh [this message]
2016-08-05 14:30 ` [dpdk-dev] [PATCH 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const Mark Kavanagh
2016-08-05 14:30 ` [dpdk-dev] [PATCH 7/7] netdev-dpdk: add support for Jumbo Frames Mark Kavanagh
2016-08-05 14:41 ` [dpdk-dev] [PATCH 1/7] ofproto: Consider datapath_type when looking for internal ports Kavanagh, Mark B
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1470407413-157932-5-git-send-email-mark.b.kavanagh@intel.com \
--to=mark.b.kavanagh@intel.com \
--cc=dev@dpdk.org \
--cc=diproiettod@vmware.com \
--cc=i.maximets@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).