From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AA96F43A1B for ; Wed, 7 Feb 2024 03:19:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1361E42D87; Wed, 7 Feb 2024 03:19:47 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2067.outbound.protection.outlook.com [40.107.220.67]) by mails.dpdk.org (Postfix) with ESMTP id 7EC3A42D66; Wed, 7 Feb 2024 03:19:45 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PMM6Ufuzry1c/HFfXHbxhOtnctGlnOLFWgks4zs4nuFu9JrVmPAUQGeEb3j7dNiOo0es01K+m3EzF8p9dJuMUHBBKuCVkx0nUQfgd24Zh6vH2UnlY8dG2iEU2bSa0ERNAFeEgnuAHXgBv5ZRS607HKBgMgWpiV8auehKdHhOxTifRSgVqbIp2rVAvKiw9Gfq0k86AUq9FUJa3VXszcfIH+sKf1Y1XkSMxYbxmtZ4zs2/Upl3yZaNDUf8GnQsgbGq5Yj3hRLyUWBI/0fm2WedSfuo8+KyvyNxGAoS+Zvr6vytn4DUJ5BNSeLdiLaKEJYseBV1EIVmcqjUnYqU9h323Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=hdbNK4cDDyjob2hzNPI5WkWb16qJXwQWFqAbjSI/Qtw=; b=OmpNM/QqEWSv5UM9xyU0TXFHT1C24JYquxavDYEHyWPIY7HCQKeJRqik4eZgt6MzPKAbTXkm5xfWKNsYcfxAA7xyJs9b710rU/PcNoUEwOeZY+4vnOPYH1pyuo/XMeqicOnAIW9SXhUxa188ti58iO7M576Chjqn5uNMqZK4LC7AKJuc786/OUL0rzpFxwFA0GhOzTX0KvFq/Icgb23j+aVl+4wnxGdDHC74ERcpweTvhLCH/ZbL1bqpaah0Z9gwJR2KIX/BSR2NitQ+YDJ72eXXzLKs6DAZQoDeTv3orEF4afVBWcP2felb+3pDD714OX3sXnVFnKmKpmO4GftLwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hdbNK4cDDyjob2hzNPI5WkWb16qJXwQWFqAbjSI/Qtw=; b=5txjn+rA9R+KfhraD1u38n00pXl+68Xy4ZFk8c9eBQXcXBqRktuFnj8NPDEOMK6shIv5ulbAaCcUdGiqsoVzqm3khmvZGAJTD3VmO3urlZ4oFxE5Gkugq4np5FIxRstQzKLClGBtK2EBj9IP0whG16KtV6RUvRZxtTfjkIQJIKE= Received: from PR3PR09CA0015.eurprd09.prod.outlook.com (2603:10a6:102:b7::20) by CH3PR12MB9169.namprd12.prod.outlook.com (2603:10b6:610:1a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.16; Wed, 7 Feb 2024 02:19:43 +0000 Received: from SA2PEPF000015CC.namprd03.prod.outlook.com (2603:10a6:102:b7:cafe::ee) by PR3PR09CA0015.outlook.office365.com (2603:10a6:102:b7::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.36 via Frontend Transport; Wed, 7 Feb 2024 02:19:42 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SA2PEPF000015CC.mail.protection.outlook.com (10.167.241.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Wed, 7 Feb 2024 02:19:41 +0000 Received: from driver-dev1.pensando.io (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 6 Feb 2024 20:19:39 -0600 From: Andrew Boyer To: CC: Neel Patel , , Andrew Boyer Subject: [PATCH v2 04/13] net/ionic: fix missing volatile type for cqe pointers Date: Tue, 6 Feb 2024 18:18:40 -0800 Message-ID: <20240207021849.52988-5-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240202193238.62669-1-andrew.boyer@amd.com> References: <20240202193238.62669-1-andrew.boyer@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CC:EE_|CH3PR12MB9169:EE_ X-MS-Office365-Filtering-Correlation-Id: 3ec4d463-5046-436b-8f61-08dc27833e72 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1SCSLjSZF2h+K3yDBlcxW9Ca9MAH+F+BWhNh3YWu5wGZXO79+N5VVVdcoFryefljDU47LECc4AVcr469Tz5aNcfqe88tTRe5ydCIHyfbwWpBO9siwBDHHqU549F1mxVkq8MUHd3gyakG8Dt/xIqBghtcGt51P3mtgCnxIXmgknFuLrA1elRS13ZpKK6M7y3xG8x6k42VyChr1wr+jdK3oeXkhpMGS7fCue0M9teLZ9Lg7uvU21CYBv3EXklSV8xobHybghiJl49163KbVWfixB5HuSnH6E5D5m74uJekAy/ZlrsjkWcN4jTgWfsynU2TQeUqzuUdJnHhALlyHfvB0ZyKDvdwUbbdYlt0RabjvT2d6d/wpO3FWcOgDQHDRItnaGAy+AyULv5s4gImASqUZWrzIBRhVYC5ad8fdoYiWGXCch57kBCAgBwWF4Au6lvBx4Ary5eYAAMi3cKHnc7ArL2UY9pvxfdZPk+xlUw1AapvSvTA4qsS0ndhSRMOjFL/8cckS/YmsnQr4kaeqsAqgGeOnfPZVycr1CB5fXyVKnZ4L3hZcfBCTKTZN+/8vnmlJj0T7ipCLFwlaZi+c24vz8lhG2iDW+y8CVz9qF25OgdIxWKmN7XUt8N5sm1NjuCiBbjxLLyaOwOdazecqPj7cI8MCe4ItEu/V2ohWppNQuc+ujRDm3ICt5F3vv4icppSYxTvDOCQXLCR5r4JPTGKID6mwmoO58IuwmVj5nsvyU+KnZrEQgxCoOr0APeffOxE1FvypXD13dvny6Q3HLtS7w== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(136003)(39860400002)(376002)(396003)(346002)(230922051799003)(186009)(451199024)(1800799012)(64100799003)(82310400011)(36840700001)(46966006)(40470700004)(36756003)(44832011)(5660300002)(2906002)(41300700001)(86362001)(426003)(47076005)(83380400001)(336012)(16526019)(26005)(2616005)(36860700001)(40480700001)(478600001)(40460700003)(1076003)(6666004)(81166007)(356005)(82740400003)(70586007)(8936002)(6916009)(316002)(70206006)(450100002)(4326008)(54906003)(8676002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 02:19:41.9943 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3ec4d463-5046-436b-8f61-08dc27833e72 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SA2PEPF000015CC.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB9169 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Neel Patel This memory may be changed by the hardware, so the volatile keyword is required for correctness. Fixes: e86a6fcc7cf3 ("net/ionic: add optimized non-scattered Rx/Tx") cc: stable@dpdk.org Signed-off-by: Andrew Boyer Signed-off-by: Neel Patel --- drivers/net/ionic/ionic_rxtx.c | 4 ++-- drivers/net/ionic/ionic_rxtx_sg.c | 8 +++++--- drivers/net/ionic/ionic_rxtx_simple.c | 8 +++++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index d92b231f8f..d92fa1cca7 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -755,7 +755,7 @@ ionic_dev_rx_descriptor_status(void *rx_queue, uint16_t offset) { struct ionic_rx_qcq *rxq = rx_queue; struct ionic_qcq *qcq = &rxq->qcq; - struct ionic_rxq_comp *cq_desc; + volatile struct ionic_rxq_comp *cq_desc; uint16_t mask, head, tail, pos; bool done_color; @@ -794,7 +794,7 @@ ionic_dev_tx_descriptor_status(void *tx_queue, uint16_t offset) { struct ionic_tx_qcq *txq = tx_queue; struct ionic_qcq *qcq = &txq->qcq; - struct ionic_txq_comp *cq_desc; + volatile struct ionic_txq_comp *cq_desc; uint16_t mask, head, tail, pos, cq_pos; bool done_color; diff --git a/drivers/net/ionic/ionic_rxtx_sg.c b/drivers/net/ionic/ionic_rxtx_sg.c index 6c028a698c..1392342463 100644 --- a/drivers/net/ionic/ionic_rxtx_sg.c +++ b/drivers/net/ionic/ionic_rxtx_sg.c @@ -28,7 +28,8 @@ ionic_tx_flush_sg(struct ionic_tx_qcq *txq) struct ionic_queue *q = &txq->qcq.q; struct ionic_tx_stats *stats = &txq->stats; struct rte_mbuf *txm; - struct ionic_txq_comp *cq_desc, *cq_desc_base = cq->base; + struct ionic_txq_comp *cq_desc_base = cq->base; + volatile struct ionic_txq_comp *cq_desc; void **info; uint32_t i; @@ -254,7 +255,7 @@ ionic_xmit_pkts_sg(void *tx_queue, struct rte_mbuf **tx_pkts, */ static __rte_always_inline void ionic_rx_clean_one_sg(struct ionic_rx_qcq *rxq, - struct ionic_rxq_comp *cq_desc, + volatile struct ionic_rxq_comp *cq_desc, struct ionic_rx_service *rx_svc) { struct ionic_queue *q = &rxq->qcq.q; @@ -440,7 +441,8 @@ ionic_rxq_service_sg(struct ionic_rx_qcq *rxq, uint32_t work_to_do, struct ionic_cq *cq = &rxq->qcq.cq; struct ionic_queue *q = &rxq->qcq.q; struct ionic_rxq_desc *q_desc_base = q->base; - struct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base; + struct ionic_rxq_comp *cq_desc_base = cq->base; + volatile struct ionic_rxq_comp *cq_desc; uint32_t work_done = 0; uint64_t then, now, hz, delta; diff --git a/drivers/net/ionic/ionic_rxtx_simple.c b/drivers/net/ionic/ionic_rxtx_simple.c index 5969287b66..00152c885a 100644 --- a/drivers/net/ionic/ionic_rxtx_simple.c +++ b/drivers/net/ionic/ionic_rxtx_simple.c @@ -28,7 +28,8 @@ ionic_tx_flush(struct ionic_tx_qcq *txq) struct ionic_queue *q = &txq->qcq.q; struct ionic_tx_stats *stats = &txq->stats; struct rte_mbuf *txm; - struct ionic_txq_comp *cq_desc, *cq_desc_base = cq->base; + struct ionic_txq_comp *cq_desc_base = cq->base; + volatile struct ionic_txq_comp *cq_desc; void **info; cq_desc = &cq_desc_base[cq->tail_idx]; @@ -227,7 +228,7 @@ ionic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, */ static __rte_always_inline void ionic_rx_clean_one(struct ionic_rx_qcq *rxq, - struct ionic_rxq_comp *cq_desc, + volatile struct ionic_rxq_comp *cq_desc, struct ionic_rx_service *rx_svc) { struct ionic_queue *q = &rxq->qcq.q; @@ -361,7 +362,8 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do, struct ionic_cq *cq = &rxq->qcq.cq; struct ionic_queue *q = &rxq->qcq.q; struct ionic_rxq_desc *q_desc_base = q->base; - struct ionic_rxq_comp *cq_desc, *cq_desc_base = cq->base; + struct ionic_rxq_comp *cq_desc_base = cq->base; + volatile struct ionic_rxq_comp *cq_desc; uint32_t work_done = 0; uint64_t then, now, hz, delta; -- 2.17.1