From patchwork Thu Aug 9 10:46:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chandran, Sugesh" X-Patchwork-Id: 955440 X-Patchwork-Delegate: ian.stokes@intel.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=intel.com 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 41mQ0h40v0z9s1c for ; Thu, 9 Aug 2018 20:46:27 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 81AADCB6; Thu, 9 Aug 2018 10:46:24 +0000 (UTC) X-Original-To: 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 6A8DECA5 for ; Thu, 9 Aug 2018 10:46:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id E291C1FB for ; Thu, 9 Aug 2018 10:46:22 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Aug 2018 03:46:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,214,1531810800"; d="scan'208";a="247440321" Received: from silpixa00389820.ir.intel.com (HELO silpixa00389820.ger.corp.intel.com) ([10.237.222.159]) by orsmga005.jf.intel.com with ESMTP; 09 Aug 2018 03:46:21 -0700 From: Sugesh Chandran To: ian.stokes@intel.com, dev@openvswitch.org Date: Thu, 9 Aug 2018 11:46:17 +0100 Message-Id: <20180809104617.3635-1-sugesh.chandran@intel.com> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 Branch2.8] netdev-dpdk: Fix failure to configure flow control at netdev-init. 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 This patch backports the commit from the latest OVS master to OVS-2.8. Configuring flow control at ixgbe netdev-init is throwing error in port start. For eg: without this fix, user cannot configure flow control on ixgbe dpdk port as below, " ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk \ options:dpdk-devargs=0000:05:00.1 options:rx-flow-ctrl=true " Instead, it must be configured as two different commands, " ovs-vsctl add-port br0 dpdk0 -- set Interface dpdk0 type=dpdk \ options:dpdk-devargs=0000:05:00.1 ovs-vsctl set Interface dpdk0 options:rx-flow-ctrl=true " The DPDK ixgbe driver is now validating all the 'rte_eth_fc_conf' fields before trying to configuring the dpdk ethdev. Hence OVS can no longer set the 'dont care' fields to just '0' as before. This commit make sure all the 'rte_eth_fc_conf' fields are populated with default values before the dev init. Also to avoid read error on unsupported ports, the flow control parameters are now read only when user is trying to configure/update it. Signed-off-by: Sugesh Chandran --- lib/netdev-dpdk.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 9bf76ee32..f7c80e0dc 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -866,13 +866,6 @@ dpdk_eth_dev_init(struct netdev_dpdk *dev) mbp_priv = rte_mempool_get_priv(dev->dpdk_mp->mp); dev->buf_size = mbp_priv->mbuf_data_room_size - RTE_PKTMBUF_HEADROOM; - /* Get the Flow control configuration for DPDK-ETH */ - diag = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf); - if (diag) { - VLOG_DBG("cannot get flow control parameters on port=%"PRIu8", err=%d", - dev->port_id, diag); - } - return 0; } @@ -1404,6 +1397,12 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args, fc_mode = fc_mode_set[tx_fc_en][rx_fc_en]; if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) { + /* Get the Flow control configuration for DPDK-ETH */ + err = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf); + if (err) { + VLOG_WARN("Cannot get flow control parameters on port " + "%"PRIu16", err=%d", dev->port_id, err); + } dev->fc_conf.mode = fc_mode; dev->fc_conf.autoneg = autoneg; dpdk_eth_flow_ctrl_setup(dev);