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 7EE9EA0560; Tue, 18 Oct 2022 21:45:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 54828427F4; Tue, 18 Oct 2022 21:45:09 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2057.outbound.protection.outlook.com [40.107.100.57]) by mails.dpdk.org (Postfix) with ESMTP id E445240395 for ; Tue, 18 Oct 2022 21:45:07 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ainHfL0h41RCCvbpce24TUBJStn2qKDOxIo7OOm40yhPgo7/X90y46Naql+UAt7B3vceEa+MMHosEIUGI3hm+MYNspw8RfmjE33GNBh0wyQsQet3VLFlDQjBs9GCrR/b2uMLdZzPjMwGaHBG0hlyEuWcNh9TCCUNQlyDXsPgsIuzYS02SKy1whW69mpIYvipY8qim1RUHEo/VNfxzIGZ0FiKXhbxCBdj0KCB3EI5gunZk6CgR9gIlcQBXO1CeL6m3kBAucrY2x8eu7gUcuGmaCe8iHVGO9qiQAVzBDTztVVSSp3gXr4N24s21Yl+y138OPO8CLKM5sP3bx3yydifYA== 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=WiDidyto0MGFmUSf4Vficiu/kyE+Qc60fVZU4MgMEdU=; b=Mb9Gvyef9b4fS++/aURvJwpuof4NXHk6TSubhS7OgVQUzb9obaP5NH7Z/q687EJ11HK3kRIWcKv+IyFzY13+wPezi+081fkI5d8g6C66dtsEd+A6eLjlxqN3TvKvqPwV3lyoPJ64nQ2FKoCRCa12g/cce4pYZBBReVN+nkook5FO90mrEtZW2O6FqicxPp+5cPT2kUxjKAHf90jIgNR9bOtHBbQhb3Rn3IohbLpGunI9wghHR3v4f9J6ABBj40jeSWsrRftZB35kfnlrOWBQiaK+OFBOs72XW213yKmkvBJa7QK+TAjzFhFH/pMA9rZB17r5xlzcKuLpRfQcJZmqjg== 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 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=WiDidyto0MGFmUSf4Vficiu/kyE+Qc60fVZU4MgMEdU=; b=wuhN556ScMliqMy9DrCA13sBuMxix358vMguAqYjda9dRAOTsolx1bBg7nTh7iWpQiGbf1Y+hKBrukNWMqZbjxgofa4mdipphwb1UoMmu/JUFiFksaqIx23grB9c6njQ2FLlvMCL7Bv06lo1zJbUOqJbwIC1hoz0bKqlviPj8xc= Received: from DS7P222CA0013.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:2e::22) by MW4PR12MB7437.namprd12.prod.outlook.com (2603:10b6:303:223::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.29; Tue, 18 Oct 2022 19:45:06 +0000 Received: from DM6NAM11FT114.eop-nam11.prod.protection.outlook.com (2603:10b6:8:2e:cafe::c) by DS7P222CA0013.outlook.office365.com (2603:10b6:8:2e::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.30 via Frontend Transport; Tue, 18 Oct 2022 19:45:04 +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 DM6NAM11FT114.mail.protection.outlook.com (10.13.172.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5746.16 via Frontend Transport; Tue, 18 Oct 2022 19:45:04 +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.2375.31; Tue, 18 Oct 2022 14:45:03 -0500 From: Andrew Boyer To: CC: Andrew Boyer Subject: [PATCH v2 15/36] net/ionic: replace void pointer with actual type Date: Tue, 18 Oct 2022 12:41:10 -0700 Message-ID: <20221018194131.23006-16-andrew.boyer@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221011005032.47584-1-andrew.boyer@amd.com> References: <20221011005032.47584-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: DM6NAM11FT114:EE_|MW4PR12MB7437:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a787bb1-5ff8-4ecc-82f3-08dab1414096 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5mS5bxLerfCSRqcJEGgsTJSBhMPeEqJzzMik8SUjBLo2Y1NX6CbWKcgysw3PzVERzobLLjWwHlJtrcHzCcxuAPUfYTKWkLCcCL6tDWfbccaxj2EFQhai+4GBBgDo14AhBldaBIcJB9OvK2uKznvexhCjKV1xfgRUf9dXlZRwFYuyJg7UMDQdW+k7m3G6lkZpihGpaIyb1I+wo2xTspI7EG0QFKkNSDZleVLMrNM8NWkLiIw3mrCM5masqFXXsQuwSNWeDyEgxtdQ+hke16ijcvhE0mgM1ZSksopFDS8YprEnFCnsZswsdCr4vaXiKqHhSOesyiMFYMHJ/T29ww5kkRX80b5rPTT3DBtuYZIA7z6Zx+x0H8xX4ty90dO9fQhqiX88kDZx3WSBioQ4Z0AY5Ov7d4kndUgutGeWcCUZXYvqpAf5R5WnzI4iaxRvfhrnpzETRWO7oRpV+UEyZzvGPG82tQGoFYizesRBFYGHrterVFhXcFYZuvjsHpYbkPtMfnwOfyGFlML5UntIp5pxGrlpzTqaBVQacByCEHcQPHtAue7/K+yjJyj0/kNTqNTksJOFf7GkBxydhsOF9lKQUlP6WNUHc5JrSv+RJbMai0bbikWCtfBGrGUnFoyAW0KgrvXz/3xE58/Z+gAuU9dtmBONVqNSArvL5lVU7rXiW7ovNwwqRUiGt9eCXo5Rl5n0w3CWfDBOuIDuEOhKKS+idMn0sIfONt37c0zTP27D54R6yGx3JoM3IZZJYL+HoRiyCiIt8SsY/WDECztSJde97CLYOg6SUVA37IJoNL+UN76WflrkGCWslbYMpdDe7lla 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:(13230022)(4636009)(136003)(346002)(376002)(39860400002)(396003)(451199015)(36840700001)(46966006)(40470700004)(478600001)(81166007)(356005)(8936002)(83380400001)(316002)(6916009)(82740400003)(41300700001)(82310400005)(186003)(26005)(36756003)(40480700001)(4326008)(426003)(6666004)(1076003)(16526019)(40460700003)(2616005)(336012)(2906002)(5660300002)(47076005)(8676002)(86362001)(70586007)(36860700001)(44832011)(70206006)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2022 19:45:04.0161 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4a787bb1-5ff8-4ecc-82f3-08dab1414096 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: DM6NAM11FT114.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR12MB7437 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 This makes the code safer by helping the compiler catch errors. Rename the variables, too; they're not callbacks anymore. Signed-off-by: Andrew Boyer --- drivers/net/ionic/ionic_rxtx.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/net/ionic/ionic_rxtx.c b/drivers/net/ionic/ionic_rxtx.c index ce1bdbc2c3..c90d3d62f3 100644 --- a/drivers/net/ionic/ionic_rxtx.c +++ b/drivers/net/ionic/ionic_rxtx.c @@ -765,7 +765,7 @@ ionic_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, static __rte_always_inline void ionic_rx_clean(struct ionic_rx_qcq *rxq, uint32_t q_desc_index, uint32_t cq_desc_index, - void *service_cb_arg) + struct ionic_rx_service *rx_svc) { struct ionic_queue *q = &rxq->qcq.q; struct ionic_cq *cq = &rxq->qcq.cq; @@ -775,8 +775,6 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, uint64_t pkt_flags = 0; uint32_t pkt_type; struct ionic_rx_stats *stats = &rxq->stats; - struct ionic_rx_service *recv_args = (struct ionic_rx_service *) - service_cb_arg; uint32_t buf_size = (uint16_t) (rte_pktmbuf_data_room_size(rxq->mb_pool) - RTE_PKTMBUF_HEADROOM); @@ -789,7 +787,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm = info[0]; - if (!recv_args) { + if (!rx_svc) { stats->no_cb_arg++; /* Flush */ rte_pktmbuf_free(rxm); @@ -806,7 +804,7 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, return; } - if (recv_args->nb_rx >= recv_args->nb_pkts) { + if (rx_svc->nb_rx >= rx_svc->nb_pkts) { stats->no_room++; ionic_rx_recycle(q, q_desc_index, rxm); return; @@ -907,8 +905,8 @@ ionic_rx_clean(struct ionic_rx_qcq *rxq, rxm->packet_type = pkt_type; - recv_args->rx_pkts[recv_args->nb_rx] = rxm; - recv_args->nb_rx++; + rx_svc->rx_pkts[rx_svc->nb_rx] = rxm; + rx_svc->nb_rx++; stats->packets++; stats->bytes += rxm->pkt_len; @@ -1052,7 +1050,7 @@ ionic_dev_rx_queue_start(struct rte_eth_dev *eth_dev, uint16_t rx_queue_id) static __rte_always_inline void ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do, - void *service_cb_arg) + struct ionic_rx_service *rx_svc) { struct ionic_cq *cq = &rxq->qcq.cq; struct ionic_queue *q = &rxq->qcq.q; @@ -1088,7 +1086,7 @@ ionic_rxq_service(struct ionic_rx_qcq *rxq, uint32_t work_to_do, rte_prefetch0(&q->info[q->tail_idx]); ionic_rx_clean(rxq, curr_q_tail_idx, curr_cq_tail_idx, - service_cb_arg); + rx_svc); } while (more); @@ -1127,15 +1125,15 @@ ionic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) { struct ionic_rx_qcq *rxq = rx_queue; - struct ionic_rx_service service_cb_arg; + struct ionic_rx_service rx_svc; - service_cb_arg.rx_pkts = rx_pkts; - service_cb_arg.nb_pkts = nb_pkts; - service_cb_arg.nb_rx = 0; + rx_svc.rx_pkts = rx_pkts; + rx_svc.nb_pkts = nb_pkts; + rx_svc.nb_rx = 0; - ionic_rxq_service(rxq, nb_pkts, &service_cb_arg); + ionic_rxq_service(rxq, nb_pkts, &rx_svc); ionic_rx_fill(rxq); - return service_cb_arg.nb_rx; + return rx_svc.nb_rx; } -- 2.17.1