From patchwork Wed Dec 12 22:18:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Stokes, Ian" X-Patchwork-Id: 1012363 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 43FWRf3DwLz9s3Z for ; Thu, 13 Dec 2018 09:18:38 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D205FF90; Wed, 12 Dec 2018 22:18:34 +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 0DFEEAA5 for ; Wed, 12 Dec 2018 22:18:33 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 9E006856 for ; Wed, 12 Dec 2018 22:18:32 +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 fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2018 14:18:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,346,1539673200"; d="scan'208";a="283121044" Received: from sivswdev08.ir.intel.com (HELO localhost.localdomain) ([10.237.217.47]) by orsmga005.jf.intel.com with ESMTP; 12 Dec 2018 14:18:30 -0800 From: Ian Stokes To: dev@openvswitch.org Date: Wed, 12 Dec 2018 22:18:28 +0000 Message-Id: <1544653108-15964-1-git-send-email-ian.stokes@intel.com> X-Mailer: git-send-email 1.7.0.7 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: liang-min.wang@intel.com Subject: [ovs-dev] [PATCH branch-2.9 1/1] netdev-dpdk: Fix flow control configuration. 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 From: Sugesh Chandran Currently devices that do not support configuring flow control via the eth_dev API (e.g. SRIOV VFs) will fail during configuration setup when the interface is added even if flow control is not requested. This is due to rte_eth_dev_flow_ctrl_get() being called regardless of whether a flow control configuration is required. Fix this by moving the rte_eth_dev_flow_ctrl_get() call to be part of the control block that avoids configuring flow control when no change has occurred. Fixes: 413c85a24353 ("netdev-dpdk: Fix failure to configure flow control at netdev-init.") Reported-by: liang-min.wang@intel.com Signed-off-by: Sugesh Chandran Co-authored-by: Ian Stokes Signed-off-by: Ian Stokes Acked-by: Tiago Lam Tested-by: Tiago Lam --- 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 762209dbb..428e6e155 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -1634,16 +1634,15 @@ netdev_dpdk_set_config(struct netdev *netdev, const struct smap *args, autoneg = smap_get_bool(args, "flow-ctrl-autoneg", false); fc_mode = fc_mode_set[tx_fc_en][rx_fc_en]; - /* Get the Flow control configuration for DPDK-ETH */ - err = rte_eth_dev_flow_ctrl_get(dev->port_id, &dev->fc_conf); - if (err) { - VLOG_INFO("cannot get flow control parameters on port "DPDK_PORT_ID_FMT - ", err=%d", dev->port_id, err); - } - if (dev->fc_conf.mode != fc_mode || autoneg != dev->fc_conf.autoneg) { dev->fc_conf.mode = fc_mode; dev->fc_conf.autoneg = 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_INFO("cannot get flow control parameters on port " + DPDK_PORT_ID_FMT", err=%d", dev->port_id, err); + } dpdk_eth_flow_ctrl_setup(dev); }