From patchwork Thu Apr 20 15:57:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zhang X-Patchwork-Id: 126292 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 872C842993; Thu, 20 Apr 2023 09:39:24 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDD0141143; Thu, 20 Apr 2023 09:39:23 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D72B340687; Thu, 20 Apr 2023 09:39:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1681976362; x=1713512362; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=s8EcXfjcDBdM/gf4CpD83/45qM7U/v6wrrAFL7Lw0c8=; b=S/cVJ+SjCr+G6qHfuJJomw/R0bOcU5dUXpWD3cxWWE4sGDkvMOSTLItA +pLSQ4DTdpzUFkfPEZXwsHW3fSDzqT6oB+qMdUzDCxxnxo28VmXzMc1vy XAR1NjUZMUy1Q0Qb7pgVLglrS2up/VlWxidIiC34l9pcufNONuJC7ajWH Y8+BugJYVm2Cga+JM4DpjD+ZolE4+VncQ9pEpk5lU0nKp4JmfN2b7fhdz SA/iJ5ICC4tFJW8vBoxE76J8nwdP7M5Bqws5FPk7SRWwlRCInIUZqu55j 5OCnPSueZPXOI8uNjefW5IqoCoeNsIsxOlzDqZ9EFo9at/XeFmzwwyJ5k Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="347522945" X-IronPort-AV: E=Sophos;i="5.99,211,1677571200"; d="scan'208";a="347522945" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Apr 2023 00:38:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10685"; a="1021491907" X-IronPort-AV: E=Sophos;i="5.99,211,1677571200"; d="scan'208";a="1021491907" Received: from dpdk-qzhan15-test02.sh.intel.com ([10.67.115.37]) by fmsmga005.fm.intel.com with ESMTP; 20 Apr 2023 00:38:30 -0700 From: Qi Zhang To: beilei.xing@intel.com Cc: dev@dpdk.org, Qi Zhang , stable@dpdk.org Subject: [PATCH] common/idpf: remove device stop flag Date: Thu, 20 Apr 2023 11:57:24 -0400 Message-Id: <20230420155724.625567-1-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Remove device stop flag, as we already have dev->data-dev_started. This also fixed the issue when close port directly without start it first, some error message will be reported in dev_stop. Fixes: 14aa6ed8f2ec ("net/idpf: support device start and stop") Fixes: 1082a773a86b ("common/idpf: add vport structure") Cc: stable@dpdk.org Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- drivers/common/idpf/idpf_common_device.h | 2 -- drivers/net/cpfl/cpfl_ethdev.c | 6 +----- drivers/net/idpf/idpf_ethdev.c | 6 +----- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/common/idpf/idpf_common_device.h b/drivers/common/idpf/idpf_common_device.h index c2dc2f16b9..7a54f7c937 100644 --- a/drivers/common/idpf/idpf_common_device.h +++ b/drivers/common/idpf/idpf_common_device.h @@ -110,8 +110,6 @@ struct idpf_vport { uint16_t devarg_id; - bool stopped; - bool rx_vec_allowed; bool tx_vec_allowed; bool rx_use_avx512; diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index ede730fd50..f1d4425ce2 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -798,8 +798,6 @@ cpfl_dev_start(struct rte_eth_dev *dev) if (cpfl_dev_stats_reset(dev)) PMD_DRV_LOG(ERR, "Failed to reset stats"); - vport->stopped = 0; - return 0; err_vport: @@ -817,7 +815,7 @@ cpfl_dev_stop(struct rte_eth_dev *dev) { struct idpf_vport *vport = dev->data->dev_private; - if (vport->stopped == 1) + if (dev->data->dev_started == 0) return 0; idpf_vc_vport_ena_dis(vport, false); @@ -828,8 +826,6 @@ cpfl_dev_stop(struct rte_eth_dev *dev) idpf_vc_vectors_dealloc(vport); - vport->stopped = 1; - return 0; } diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c index e02ec2ec5a..e01eb3a2ec 100644 --- a/drivers/net/idpf/idpf_ethdev.c +++ b/drivers/net/idpf/idpf_ethdev.c @@ -792,8 +792,6 @@ idpf_dev_start(struct rte_eth_dev *dev) if (idpf_dev_stats_reset(dev)) PMD_DRV_LOG(ERR, "Failed to reset stats"); - vport->stopped = 0; - return 0; err_vport: @@ -811,7 +809,7 @@ idpf_dev_stop(struct rte_eth_dev *dev) { struct idpf_vport *vport = dev->data->dev_private; - if (vport->stopped == 1) + if (dev->data->dev_started == 0) return 0; idpf_vc_vport_ena_dis(vport, false); @@ -822,8 +820,6 @@ idpf_dev_stop(struct rte_eth_dev *dev) idpf_vc_vectors_dealloc(vport); - vport->stopped = 1; - return 0; }