From patchwork Wed Feb 7 03:13:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Boyer X-Patchwork-Id: 136461 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 0320943A2A; Wed, 7 Feb 2024 04:14:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D86A442DE9; Wed, 7 Feb 2024 04:14:26 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2082.outbound.protection.outlook.com [40.107.237.82]) by mails.dpdk.org (Postfix) with ESMTP id 99F7D42D9D; Wed, 7 Feb 2024 04:14:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cvbmbPo0wyA45w5GpaZZSMcPKEwGc4mam2GCBiTPQqRttmVMthUeq71o02QzKaBupJqoSGPMFFRbf1MepDkxRSn6wav8TjAZ8FHSvzyl+zN/7baBNrHlsp6X3DQFfJ413AJRc0WN0lx2FpUeH3G4lanuyj7t6Iu1olCcxfP6ZFGt9EXTCprVtb1BKYamZ+x3EfrDEOqE+A+ti1ONfb0CaZyya/IVQ4fBP6QyDuy/Rl1YIuf/2MNlU/qrig+gwaGNZWdy4pVUxhFu+GNGhoi6acOHbBJqlSk+E2g+vcp11F7k9yYKOEjOBfkrnUoqU3LtjxOCoVCxZ2BxWsxkwTvJBA== 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=YnhcSGuWg3jjfPIsTwcRBGYKgNSPpd01jpGgiWOtX0Rhr1k0di0u921SS71x6z3ITKLWk4VKRJqZzbGvw+0tfxREHbSVvs8Cl54OWkY12JfZ6qkIW+AiIC7zFArTIRI1d3vWYNaWLwtXsmbYizmT95b9CoWGFMXy77mYP5V9/NOCaiB2TT+S7AMhWchAjU/4HheIKRxt8w/p35N35hgYcLQgo5dlk0JZDlLZNX1BdOPnbjQoxHSoLU5PauIsu8ChNBRZM8xGiUuPj5xN4WVTc96Az88EyRVjlmJpOSaCzakRXWmeA4GNvTNjLDZXak6S4KTpJcLUPdOoUUc2RII5Ww== 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=JhKzfNcC3qWvcTVYsentw5upkJONj8LmhI9HlkNy5xRegog1Wf2H7ggnyiMkNos8edtKeLzOB2S0LajAcqmq4OoRpXg5IJO3acBphvWUEs95A3q+mXTsHImxB/2xLhH11KtvbUxSWYZy6ury92i4B9icFpUz+1TGCfwPd/hYP50= Received: from DM6PR02CA0153.namprd02.prod.outlook.com (2603:10b6:5:332::20) by BY5PR12MB4274.namprd12.prod.outlook.com (2603:10b6:a03:206::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.12; Wed, 7 Feb 2024 03:14:19 +0000 Received: from CO1PEPF000044F7.namprd21.prod.outlook.com (2603:10b6:5:332:cafe::3d) by DM6PR02CA0153.outlook.office365.com (2603:10b6:5:332::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 03:14:19 +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 CO1PEPF000044F7.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7292.0 via Frontend Transport; Wed, 7 Feb 2024 03:14:19 +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 21:14:14 -0600 From: Andrew Boyer To: CC: Neel Patel , , Andrew Boyer Subject: [PATCH v3 04/13] net/ionic: fix missing volatile type for cqe pointers Date: Tue, 6 Feb 2024 19:13:08 -0800 Message-ID: <20240207031317.32293-5-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240207031317.32293-1-andrew.boyer@amd.com> References: <20240202193238.62669-1-andrew.boyer@amd.com> <20240207031317.32293-1-andrew.boyer@amd.com> MIME-Version: 1.0 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: CO1PEPF000044F7:EE_|BY5PR12MB4274:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a8d5ef5-d083-449a-52d2-08dc278adfbb X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: iD+H+bVgJLhxhNq6CpqZStv0wbRtjPV3m/5qWFtisn3NjuJYXqs0LcczvGOhRJ0ms5nGPQzGBr4ZAYfSfTpAsEFw4YUyOsTcW/IH2v3OxIyprCOaRdUU6DjIrdUkfW9Hop/aXOl1QlLZBwlBklL+2x/uGjPHCLP8EK+pf1MXxayDIQdfbCyLMBUfA7zDcibJfNaXX2+BgXPwONc8pDlbd1j6WTUUixOJ+XxhBjkdPkSf3WMA3lnfGA6rPDHopy79cmVUQhQfmwJuc8ZpWbXi0DImUP1ubuC6VSUe/R9LQM5BPjVKYXwKiisaBgaQvH/xknNp7/N69f5L/yFn6Ixp4s2V9jdaTcM2ypN+EypyAvSNGOVJTZK4KUFUZlYY8vTILZAR09KxeqgQ7BifNTtRGtxkQWG+ItGJVLSJ19BflWt0fsBiMgwdW9dwkEyzFem9nskouW0f2cKiC/xuM5uvXvGAYxwErWB49FWQLMfS3IZ3vULugNi99544ATpHLlCHyyXbOxDmQDJb9NrBlvwWx+FPTRSixmYAYaB2SBwNrwIzB41y0cpdbkGy8xftxnv94iEHvufOOFj8O3O5JOgn2GCpucVDy6tKJcpkfokkvVCwtqO/W+ld+y6OUITJ1++y2qGpAA5BVPFRqDx+AXDWBlwGrrXxKbohgKTaOP3hAgoopWFAFuDxExCnMBuVaMVz8NQNLzyWmJjNvr7iydnqB9h8fbB0HibWyKhtTVXIJc4LkWSwnDT0JSSLCHAthItakbtb/eEXaLlcSXdtXOT1Hg== 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)(39860400002)(396003)(346002)(136003)(376002)(230922051799003)(82310400011)(186009)(64100799003)(1800799012)(451199024)(36840700001)(40470700004)(46966006)(40460700003)(40480700001)(478600001)(5660300002)(41300700001)(2616005)(86362001)(4326008)(36756003)(2906002)(81166007)(83380400001)(426003)(450100002)(26005)(356005)(54906003)(1076003)(47076005)(16526019)(70206006)(8676002)(70586007)(44832011)(6666004)(316002)(336012)(6916009)(82740400003)(8936002)(36860700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2024 03:14:19.0614 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a8d5ef5-d083-449a-52d2-08dc278adfbb 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: CO1PEPF000044F7.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4274 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 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;