From patchwork Wed Dec 21 02:07:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanumanth Pothula X-Patchwork-Id: 121140 X-Patchwork-Delegate: ferruh.yigit@amd.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 0C248A0545; Wed, 21 Dec 2022 03:07:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9B6FF40698; Wed, 21 Dec 2022 03:07:34 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id AD77A40684 for ; Wed, 21 Dec 2022 03:07:32 +0100 (CET) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BL1JDfA018303; Tue, 20 Dec 2022 18:07:29 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=hrxiT91euoq9dlo8jkkTuAaSy8TjsoXNyeib11nZsAA=; b=DO/5T/ZoQb57NWaa7BEJWjPVnWDMaAVPk9GpQDwTWknGH63jq5yxZ6Fx0kSgQvNrCCxF qHcPmrk+EPRihOAU9m13k02Rv8gU46nK0jMaqxKExy4mcQk0/FxCK25mN7D/aTrkqB1m c44ST9g+lsV64oPztbt6q/5K+S70ILdAm141xDfKC1/45Dk0kWkSi3T1UresaBdSwtR+ 87MSFR8adpAkToffdMRWLQi7pATLSPgkhKEWd7DdmdLDz5+Ahknx8tCo3zT14TsaVeVW UvY7g0T832WorNuWRB0DNeMwEEWLkwnWifyGFdn6x1LrnASRxl0D9FujWL8SdHT6i9uF Kw== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3mhe5rpv6a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 20 Dec 2022 18:07:29 -0800 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 20 Dec 2022 18:07:27 -0800 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Tue, 20 Dec 2022 18:07:27 -0800 Received: from localhost.localdomain (unknown [10.28.36.155]) by maili.marvell.com (Postfix) with ESMTP id 10F6A3F704B; Tue, 20 Dec 2022 18:07:24 -0800 (PST) From: Hanumanth Pothula To: Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko CC: , , , , Subject: [PATCH v5 1/2] ethdev: fix ethdev configuration state on reset Date: Wed, 21 Dec 2022 07:37:11 +0530 Message-ID: <20221221020713.2803232-1-hpothula@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221220200250.2413443-1-hpothula@marvell.com> References: <20221220200250.2413443-1-hpothula@marvell.com> MIME-Version: 1.0 X-Proofpoint-GUID: yfNP6iH1_IbuSHEcHEui94TOFKRWYAje X-Proofpoint-ORIG-GUID: yfNP6iH1_IbuSHEcHEui94TOFKRWYAje X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-20_08,2022-12-20_01,2022-06-22_01 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 Presently, on device reset, ethdev configuration state, dev_configured, is not reset. On device reset, reset ethdev configuration state to make sure device reconfiguration happens cleanly. Signed-off-by: Hanumanth Pothula --- v5: - Move nic-to-pmd-rx-metadata declaration to struct rte_port. v4: - As per spec rte_eth_rx_metadata_negotiate() is processed only when dev_configured is set. Hence can't enable automatically when a flow command requests metadata. - Add new testpmd command to allow NIC to PMD Rx metadata negotiation. v3: - Updated run_app.rst with the new command line argument, nic-to-pmd-rx-metadata. - Updated commit text. v2: - taken cared alignment issues - renamed command line argument from rx-metadata to nic-to-pmd-rx-metadata - renamed variable name from rx-metadata to nic_to_pmd_rx_metadata --- lib/ethdev/rte_ethdev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 5d5e18db1e..18c59044bc 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -1629,6 +1629,8 @@ rte_eth_dev_reset(uint16_t port_id) port_id, rte_strerror(-ret)); } ret = dev->dev_ops->dev_reset(dev); + if (!ret) + dev->data->dev_configured = 0; return eth_err(port_id, ret); }