From patchwork Tue Aug 9 16:01:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kavanagh X-Patchwork-Id: 657354 X-Patchwork-Delegate: diproiettod@vmware.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3s7zYB2VPJz9sf9 for ; Wed, 10 Aug 2016 02:01:34 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 136A510ABC; Tue, 9 Aug 2016 09:01:28 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id B0F97109E8 for ; Tue, 9 Aug 2016 09:01:26 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 021A91E04ED for ; Tue, 9 Aug 2016 10:01:26 -0600 (MDT) X-ASG-Debug-ID: 1470758485-09eadd627a01550001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id UKTPnjSNEYCK3485 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 09 Aug 2016 10:01:25 -0600 (MDT) X-Barracuda-Envelope-From: mark.b.kavanagh@intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mga02.intel.com) (134.134.136.20) by mx1-pf1.cudamail.com with SMTP; 9 Aug 2016 16:01:24 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at intel.com designates 134.134.136.20 as permitted sender) X-Barracuda-Apparent-Source-IP: 134.134.136.20 X-Barracuda-RBL-IP: 134.134.136.20 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP; 09 Aug 2016 09:01:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,495,1464678000"; d="scan'208";a="153076986" Received: from silpixa00380299.ir.intel.com ([10.237.222.17]) by fmsmga004.fm.intel.com with ESMTP; 09 Aug 2016 09:01:24 -0700 X-CudaMail-Envelope-Sender: mark.b.kavanagh@intel.com From: Mark Kavanagh To: dev@openvswitch.org, diproiettod@vmware.com X-CudaMail-MID: CM-E1-808037294 X-CudaMail-DTE: 080916 X-CudaMail-Originating-IP: 134.134.136.20 Date: Tue, 9 Aug 2016 17:01:15 +0100 X-ASG-Orig-Subj: [##CM-E1-808037294##][ovs-dev][PATCH V7 2/7] vswitchd: Introduce 'mtu_request' column in Interface. Message-Id: <1470758480-133197-2-git-send-email-mark.b.kavanagh@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1470758480-133197-1-git-send-email-mark.b.kavanagh@intel.com> References: <1470758480-133197-1-git-send-email-mark.b.kavanagh@intel.com> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1470758485 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-ASG-Whitelist: EmailCat (corporate) Cc: i.maximets@samsung.com Subject: [ovs-dev] [PATCH V7 2/7] vswitchd: Introduce 'mtu_request' column in Interface. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" From: Daniele Di Proietto The 'mtu_request' column can be used to set the MTU of a specific interface. This column is useful because it will allow changing the MTU of DPDK devices (implemented in a future commit), which are not accessible outside the ovs-vswitchd process, but it can be used for kernel interfaces as well. The current implementation of set_mtu() in netdev-dpdk is removed because it's broken. It will be reintroduced by a subsequent commit on this series. Signed-off-by: Daniele Di Proietto Acked-by: Ilya Maximets --- NEWS | 2 ++ lib/netdev-dpdk.c | 53 +--------------------------------------------- vswitchd/bridge.c | 9 ++++++++ vswitchd/vswitch.ovsschema | 10 +++++++-- vswitchd/vswitch.xml | 52 +++++++++++++++++++++++++++++++++------------ 5 files changed, 58 insertions(+), 68 deletions(-) diff --git a/NEWS b/NEWS index c2ed71d..ce10982 100644 --- a/NEWS +++ b/NEWS @@ -101,6 +101,8 @@ Post-v2.5.0 - ovs-pki: Changed message digest algorithm from SHA-1 to SHA-512 because SHA-1 is no longer secure and some operating systems have started to disable it in OpenSSL. + - Add 'mtu_request' column to the Interface table. It can be used to + configure the MTU of non-internal ports. v2.5.0 - 26 Feb 2016 diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index f37ec1c..60db568 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1639,57 +1639,6 @@ netdev_dpdk_get_mtu(const struct netdev *netdev, int *mtup) } static int -netdev_dpdk_set_mtu(const struct netdev *netdev, int mtu) -{ - struct netdev_dpdk *dev = netdev_dpdk_cast(netdev); - int old_mtu, err, dpdk_mtu; - struct dpdk_mp *old_mp; - struct dpdk_mp *mp; - uint32_t buf_size; - - ovs_mutex_lock(&dpdk_mutex); - ovs_mutex_lock(&dev->mutex); - if (dev->mtu == mtu) { - err = 0; - goto out; - } - - buf_size = dpdk_buf_size(mtu); - dpdk_mtu = FRAME_LEN_TO_MTU(buf_size); - - mp = dpdk_mp_get(dev->socket_id, dpdk_mtu); - if (!mp) { - err = ENOMEM; - goto out; - } - - rte_eth_dev_stop(dev->port_id); - - old_mtu = dev->mtu; - old_mp = dev->dpdk_mp; - dev->dpdk_mp = mp; - dev->mtu = mtu; - dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu); - - err = dpdk_eth_dev_init(dev); - if (err) { - dpdk_mp_put(mp); - dev->mtu = old_mtu; - dev->dpdk_mp = old_mp; - dev->max_packet_len = MTU_TO_FRAME_LEN(dev->mtu); - dpdk_eth_dev_init(dev); - goto out; - } - - dpdk_mp_put(old_mp); - netdev_change_seq_changed(netdev); -out: - ovs_mutex_unlock(&dev->mutex); - ovs_mutex_unlock(&dpdk_mutex); - return err; -} - -static int netdev_dpdk_get_carrier(const struct netdev *netdev, bool *carrier); static int @@ -2964,7 +2913,7 @@ netdev_dpdk_vhost_cuse_reconfigure(struct netdev *netdev) netdev_dpdk_set_etheraddr, \ netdev_dpdk_get_etheraddr, \ netdev_dpdk_get_mtu, \ - netdev_dpdk_set_mtu, \ + NULL, /* set_mtu */ \ netdev_dpdk_get_ifindex, \ GET_CARRIER, \ netdev_dpdk_get_carrier_resets, \ diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index ddf1fe5..397be70 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -775,6 +775,15 @@ bridge_delete_or_reconfigure_ports(struct bridge *br) goto delete; } + if (iface->cfg->n_mtu_request == 1 + && strcmp(iface->type, + ofproto_port_open_type(br->type, "internal"))) { + /* Try to set the MTU to the requested value. This is not done + * for internal interfaces, since their MTU is decided by the + * ofproto module, based on other ports in the bridge. */ + netdev_set_mtu(iface->netdev, *iface->cfg->mtu_request); + } + /* If the requested OpenFlow port for 'iface' changed, and it's not * already the correct port, then we might want to temporarily delete * this interface, so we can add it back again with the new OpenFlow diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema index 32fdf28..8966803 100644 --- a/vswitchd/vswitch.ovsschema +++ b/vswitchd/vswitch.ovsschema @@ -1,6 +1,6 @@ {"name": "Open_vSwitch", - "version": "7.13.0", - "cksum": "889248633 22774", + "version": "7.14.0", + "cksum": "3974332717 22936", "tables": { "Open_vSwitch": { "columns": { @@ -321,6 +321,12 @@ "mtu": { "type": {"key": "integer", "min": 0, "max": 1}, "ephemeral": true}, + "mtu_request": { + "type": { + "key": {"type": "integer", + "minInteger": 1}, + "min": 0, + "max": 1}}, "error": { "type": {"key": "string", "min": 0, "max": 1}}}, "indexes": [["name"]]}, diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index 65acdc7..780bd2d 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -2380,6 +2380,44 @@ + +

+ The MTU (maximum transmission unit) is the largest amount of data + that can fit into a single Ethernet frame. The standard Ethernet + MTU is 1500 bytes. Some physical media and many kinds of virtual + interfaces can be configured with higher MTUs. +

+ +

+ A client may change a non-internal interface MTU by filling in + . Internal interfaces MTU, instead, is set + by Open vSwitch to the minimum of non-internal interfaces MTU in the + bridge. In any case, Open vSwitch then reports in + the currently configured value. +

+ + +

+ This column will be empty for an interface that does not + have an MTU as, for example, some kinds of tunnels do not. +

+ +

+ Open vSwitch sets this column's value, so other clients should treat + it as read-only. +

+
+ + +

+ Requested MTU (Maximum Transmission Unit) for the interface. A client + can fill this column to change the MTU of a non-internal interface. +

+
+ +
+

Status information about interfaces attached to bridges, updated every @@ -2422,20 +2460,6 @@

- -

- The MTU (maximum transmission unit); i.e. the largest - amount of data that can fit into a single Ethernet frame. - The standard Ethernet MTU is 1500 bytes. Some physical media - and many kinds of virtual interfaces can be configured with - higher MTUs. -

-

- This column will be empty for an interface that does not - have an MTU as, for example, some kinds of tunnels do not. -

-
- Boolean value indicating LACP status for this interface. If true, this interface has current LACP information about its LACP partner. This