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 6C89243A53; Fri, 2 Feb 2024 20:33:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CED3A42E8B; Fri, 2 Feb 2024 20:33:21 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2042.outbound.protection.outlook.com [40.107.244.42]) by mails.dpdk.org (Postfix) with ESMTP id AFF9542E75; Fri, 2 Feb 2024 20:33:19 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gyZoB/5sr1N4IAtfooxMgeLcv2H3nP2yZc1SGepXRH92v1BP8xhwCpZrry8QA0DSuSicXyS7Vk3rzLGQ+Vwvek38iQcXJ2XsXV7bJdSg/wsczHhL3pS9x+jPrLBEXlNFm2JzaI+tMRbT/6jIrk6nIfUID60z5UlibWQX6Xz0qlnwfNe3lftv51IJTTM1t6JOdKa0871r/iCnh0fCbigcSXsNVgmjj2/6sMbroITm4CaM95Igwy2dax0wb42rXe0GZwjhjFWQkFdpRMXXxb1mMR0CMRXuV/pRHGasR8idJaL71wbxPyOQyjjI++Su5nL4TtsirP46Qck4JbV7shcWWw== 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=bbY+DqH2oqCO0ARRz8WXwTbKzi0RLHx4imZGC3vQJHZZnsM++qR2n03MxM/mI7VOnEWjJoveA9bgYqVKP4Z7HnLGQYGJvREjFZt0WSqViyB5jV5GtF0WhEHvxzur0UvuWwZBKWfyl91q0vnmYjeDCC1AlxgjmUgfM4SqpHra6RHpTY33kMbjMm9klTb1paJfNKiOyB2lBALNyOtyuOIL7aNA2BSg68/3kR7KhrVUL7E7gyqdpCl39klaL8BHPbjRqgCucQaQje473I1imIxux4GGznYK70AcwEehrXLLbO9hBSwJ01gv5ZHs1Ykj80cWTNHmhsT2Ty8ypSuBSzliRQ== 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=BZWQwDSeS/Yv0b4r1biE5YqXSTBxKeN+JTBN+lBExsCsj4JuWbyAVFBmc23dyDhZaxaBMahL2WhWBjcwBRFjELeuW9RXCv5LK1L4kQUY28+hWgGpuHVh/EDZaLXsOKjUYfKJ7BFajsCai7ay16rLXBuSInMeWDVhFgr0B886//g= Received: from DM6PR10CA0020.namprd10.prod.outlook.com (2603:10b6:5:60::33) by CH2PR12MB4327.namprd12.prod.outlook.com (2603:10b6:610:7d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.14; Fri, 2 Feb 2024 19:33:15 +0000 Received: from DS1PEPF0001708F.namprd03.prod.outlook.com (2603:10b6:5:60:cafe::73) by DM6PR10CA0020.outlook.office365.com (2603:10b6:5:60::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24 via Frontend Transport; Fri, 2 Feb 2024 19:33:15 +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 DS1PEPF0001708F.mail.protection.outlook.com (10.167.17.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7249.19 via Frontend Transport; Fri, 2 Feb 2024 19:33:14 +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; Fri, 2 Feb 2024 13:33:13 -0600 From: Andrew Boyer To: CC: Neel Patel , , Andrew Boyer Subject: [PATCH 04/13] net/ionic: fix missing volatile type for cqe pointers Date: Fri, 2 Feb 2024 11:32:29 -0800 Message-ID: <20240202193238.62669-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: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001708F:EE_|CH2PR12MB4327:EE_ X-MS-Office365-Filtering-Correlation-Id: 583fec33-9826-432e-81f5-08dc2425ccf9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: izNc0T7+YcrkD0wUivBXf8l4HPD0hIK//zDpVNIEUIpuslWrbHfJ1IZFu3wz+IfqWWf0UC8kd65TJPbAehECx85cRz+T9A77cgUwC5xF/Mt9gLMkptWa3LBMQDYmyVfIOyBpzJxXTErsu4jiz6/0AOmaCXszspHedFnmKfiBUAiBZz4EOb4NYjvacdVHjqsAYG6/qQihJ3dm2NtkhRAfYwGYGNUE1ceBAR+7ww1DsyUm9yPgPFy5DF6Tt5N8nHK0XKpCvcL0ITCO2Xvpz5D5TygjHoVsC20IOM+l0shbT04wqZASOu7bE0GZMQy74TFBI8iMyvAxXKSeEVQH0JlU2arBCtqTPPAdfF08nvRMAn0SUHGnqZywlO8OBcoPyRABIBbaH58xsYVTzOTkDdoXfTQJop/p06wf2XZG5tNEdwbE7xQuFh98JrHQYOlQ51vazP+/NcBHn3mlFvj1DIdBGHD/YvUHPcctZgdZq9dTiAcKx9Y1IzDoDgkgR/BMGk7V+UjgKB0D3oyEFmkuB3nMAojCM03JXDZkaEaU3e0eSV6cgCe6O3/axhGSWPJt+2mbx/p9hxdGv9jlBZGcPdaWXWA7TNlsn6aufZLxlSiGuw9IlCZLRreqgWmjWL9XJa8azk79qf4cOREvzbKC+8qkUX2PTo6HwWInO3HVNkX5zO+De/0RGPDzg/55Bj1UA+8+RKunZ7Hd7z4v8LgDZHUbeLhTGNlHdYGsIg32PO7KVolf4uJOX6TWleC0j68cb1nWG+hpajsB/wlpjB1vTr7dZw== 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)(346002)(396003)(136003)(376002)(230922051799003)(64100799003)(186009)(82310400011)(1800799012)(451199024)(36840700001)(46966006)(40470700004)(83380400001)(82740400003)(1076003)(41300700001)(44832011)(26005)(5660300002)(356005)(36860700001)(47076005)(81166007)(2616005)(16526019)(6666004)(426003)(336012)(40480700001)(40460700003)(8676002)(8936002)(4326008)(70586007)(70206006)(36756003)(478600001)(450100002)(316002)(86362001)(54906003)(6916009)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2024 19:33:14.9655 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 583fec33-9826-432e-81f5-08dc2425ccf9 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: DS1PEPF0001708F.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4327 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; -- 2.17.1