From patchwork Mon Jun 12 11:05:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kavanagh X-Patchwork-Id: 774534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wmVRt40Qsz9s3T for ; Mon, 12 Jun 2017 21:05:30 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 81BBE88A; Mon, 12 Jun 2017 11:05:26 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 430377A8 for ; Mon, 12 Jun 2017 11:05:26 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 96D7315F for ; Mon, 12 Jun 2017 11:05:25 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2017 04:05:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.39,333,1493708400"; d="scan'208"; a="1181312025" Received: from silpixa00380299.ir.intel.com ([10.237.222.17]) by fmsmga002.fm.intel.com with ESMTP; 12 Jun 2017 04:05:23 -0700 From: Mark Kavanagh To: ovs-dev@openvswitch.org, vipin.varghese@intel.com, aconole@redhat.com Date: Mon, 12 Jun 2017 12:05:22 +0100 Message-Id: <1497265522-32549-1-git-send-email-mark.b.kavanagh@intel.com> X-Mailer: git-send-email 1.9.3 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH V2] netdev-dpdk: use rte_eth_dev_set_mtu X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org DPDK provides an API to set the MTU of compatible physical devices - rte_eth_dev_set_mtu(). Prior to DPDK v16.07 however, this API was not implemented in some DPDK PMDs (i40e, specifically). To allow the use of jumbo frames with affected NICs in OvS-DPDK, MTU configuration was achieved by setting the jumbo frame flag, and corresponding maximum permitted Rx frame size, in an rte_eth_conf structure for the NIC port, and subsequently invoking rte_eth_dev_configure() with that configuration. However, that method does not set the MTU field of the underlying DPDK structure (rte_eth_dev) for the corresponding physical device; consequently, rte_eth_dev_get_mtu() reports the incorrect MTU for an OvS-DPDK phy device with non-standard MTU. Resolve this issue by invoking rte_eth_dev_set_mtu() when setting up or modifying the MTU of a DPDK phy port. Fixes: 0072e93 ("netdev-dpdk: add support for jumbo frames") Reported-by: Aaron Conole Reported-by: Vipin Varghese Signed-off-by: Mark Kavanagh Reviewed-by: Aaron Conole --- V2->v1: - add 'reported-by' tag for Aaron Conole - change VLOG_INFO to VLOG_ERR lib/netdev-dpdk.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 810800e..c141dc2 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -649,13 +649,6 @@ dpdk_eth_dev_queue_setup(struct netdev_dpdk *dev, int n_rxq, int n_txq) int i; struct rte_eth_conf conf = port_conf; - if (dev->mtu > ETHER_MTU) { - conf.rxmode.jumbo_frame = 1; - conf.rxmode.max_rx_pkt_len = dev->max_packet_len; - } else { - conf.rxmode.jumbo_frame = 0; - conf.rxmode.max_rx_pkt_len = 0; - } conf.rxmode.hw_ip_checksum = (dev->hw_ol_features & NETDEV_RX_CHECKSUM_OFFLOAD) != 0; /* A device may report more queues than it makes available (this has @@ -675,6 +668,13 @@ dpdk_eth_dev_queue_setup(struct netdev_dpdk *dev, int n_rxq, int n_txq) break; } + diag = rte_eth_dev_set_mtu(dev->port_id, dev->mtu); + if (diag) { + VLOG_ERR("Interface %s MTU (%d) setup error: %s", + dev->up.name, dev->mtu, rte_strerror(-diag)); + break; + } + for (i = 0; i < n_txq; i++) { diag = rte_eth_tx_queue_setup(dev->port_id, i, dev->txq_size, dev->socket_id, NULL);