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 5775B43DC8; Tue, 2 Apr 2024 23:57:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45BD740DF8; Tue, 2 Apr 2024 23:56:04 +0200 (CEST) Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by mails.dpdk.org (Postfix) with ESMTP id 277C140A67 for ; Tue, 2 Apr 2024 23:55:56 +0200 (CEST) Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1e0f0398553so50932235ad.3 for ; Tue, 02 Apr 2024 14:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1712094955; x=1712699755; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Grk2cJIzxC80uwuX8qnelePHUG7TGKeD7z+sdRwYR2M=; b=fn+buJspGgVtPky6/IkoWkdC9tv2y0GkVq1mFPmhu9A+gWENy20376sB7P3vct1ufj WEsvOfy0K91+o9ZTj4E8STolIl1fuFX02Slv+toz0g+B9m8Zvmu5GHFg7fXEwsfcHB+f hKSX7+bAZao5A/+oPiyku8/SS0icZIiEFCkh7zMoQrh6m+DrcfkmBtaCQtXEJwnvsq1u f8+cGArglXy+rZHK0ZEHMZxmx3hUOJjOJYZ+BZOXAQW039/Ri1Zy5Kq01RZA7KSbX4+p oms//g1xLHfHrDg8Bq+lx1puzV4fJCbpSp6i79J70csGgsLijCIrUhFrAzXFDu7GbCRA nGzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712094955; x=1712699755; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Grk2cJIzxC80uwuX8qnelePHUG7TGKeD7z+sdRwYR2M=; b=ulK30LaNwLH7wjLNAaBdg4b2ZEQkYA29pHDrmgzdrvTkHjhY7YCW2idb/NBB5PUhi+ E/yb0erasUp+WpeuAMy3gCPDGccWPrqnqkUlXovZpmN2AbmR4pMYqjsfLztpyebWEN01 XVi0Ml/mCdF7TDzH1m5bXRqnZfsodsseJdy0q6ZP1Y0Mh7VQqEive4vOh2X6uzSQN9xZ ebtOryaAA91i7Ir5LUPl1mDz49DcKKNIEAOXg3AhnnnoZDhEZJkZ6dJhdCiay11Sp5yL pLLcaQsGMe3lqbVIsBMFJ+1DUpXp91hmzsBXjjUlhkD9iJda90McFkhQYegq+5Elfshr /7OQ== X-Gm-Message-State: AOJu0Yyul2LqK+/4QBKFSAYKM3+TRTKDCHE9MbEFpnMpgXIwK3lk7CAk 2oLz1RDZD0KPkUZRVtxMOlLGeuY2BUgYd9BJbXM7fZVgy09epJ8MO4y6g7XJAxBmgrprzB1FxgP lpc4= X-Google-Smtp-Source: AGHT+IFvl9u2f1jMWFUeEJppkICwtkBVj8QxM75h2b0CGHRyX7wIemXL7TctgdjO67CtppJdJrE6Hw== X-Received: by 2002:a17:902:9342:b0:1e0:96c3:2fe7 with SMTP id g2-20020a170902934200b001e096c32fe7mr12703689plp.50.1712094955369; Tue, 02 Apr 2024 14:55:55 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id x15-20020a170902820f00b001dddf29b6e8sm11609381pln.299.2024.04.02.14.55.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 14:55:55 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Rosen Xu , Sachin Saxena , Hemant Agrawal Subject: [PATCH v3 16/30] raw: replace use of fixed size rte_memcpy Date: Tue, 2 Apr 2024 14:50:32 -0700 Message-ID: <20240402215502.278838-17-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240402215502.278838-1-stephen@networkplumber.org> References: <20240229225936.483472-1-stephen@networkplumber.org> <20240402215502.278838-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Automatically generated by devtools/cocci/rte_memcpy.cocci Signed-off-by: Stephen Hemminger --- drivers/raw/ifpga/afu_pmd_he_hssi.c | 3 +-- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 3 +-- drivers/raw/ifpga/afu_pmd_he_mem.c | 3 +-- drivers/raw/ifpga/afu_pmd_n3000.c | 8 ++++---- drivers/raw/ifpga/ifpga_rawdev.c | 11 +++++------ drivers/raw/skeleton/skeleton_rawdev.c | 8 +++----- drivers/raw/skeleton/skeleton_rawdev_test.c | 1 - 7 files changed, 15 insertions(+), 22 deletions(-) diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c b/drivers/raw/ifpga/afu_pmd_he_hssi.c index 859f28dcc1..c2aaed9203 100644 --- a/drivers/raw/ifpga/afu_pmd_he_hssi.c +++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -314,7 +313,7 @@ static int he_hssi_config(struct afu_rawdev *dev, void *config, if (cfg->port >= NUM_HE_HSSI_PORTS) return -EINVAL; - rte_memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg)); + memcpy(&priv->he_hssi_cfg, cfg, sizeof(priv->he_hssi_cfg)); return 0; } diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c b/drivers/raw/ifpga/afu_pmd_he_lpbk.c index c7c5cda48c..ffb7075c84 100644 --- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c +++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c @@ -15,7 +15,6 @@ #include #include -#include #include #include #include @@ -363,7 +362,7 @@ static int he_lpbk_config(struct afu_rawdev *dev, void *config, if ((cfg->end < cfg->begin) || (cfg->end > MAX_CACHE_LINES)) return -EINVAL; - rte_memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg)); + memcpy(&priv->he_lpbk_cfg, cfg, sizeof(priv->he_lpbk_cfg)); return 0; } diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c b/drivers/raw/ifpga/afu_pmd_he_mem.c index a1db533eeb..b799e40d2d 100644 --- a/drivers/raw/ifpga/afu_pmd_he_mem.c +++ b/drivers/raw/ifpga/afu_pmd_he_mem.c @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -126,7 +125,7 @@ static int he_mem_tg_config(struct afu_rawdev *dev, void *config, if (config_size != sizeof(struct rte_pmd_afu_he_mem_tg_cfg)) return -EINVAL; - rte_memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg)); + memcpy(&priv->he_mem_tg_cfg, config, sizeof(priv->he_mem_tg_cfg)); return 0; } diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c b/drivers/raw/ifpga/afu_pmd_n3000.c index 67b3941265..9236c0b153 100644 --- a/drivers/raw/ifpga/afu_pmd_n3000.c +++ b/drivers/raw/ifpga/afu_pmd_n3000.c @@ -1867,8 +1867,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config, if ((cfg->nlb_cfg.end < cfg->nlb_cfg.begin) || (cfg->nlb_cfg.end > MAX_CACHE_LINES)) return -EINVAL; - rte_memcpy(&priv->nlb_cfg, &cfg->nlb_cfg, - sizeof(struct rte_pmd_afu_nlb_cfg)); + memcpy(&priv->nlb_cfg, &cfg->nlb_cfg, + sizeof(struct rte_pmd_afu_nlb_cfg)); } else if (cfg->type == RTE_PMD_AFU_N3000_DMA) { if (cfg->dma_cfg.index >= NUM_N3000_DMA) return -EINVAL; @@ -1887,8 +1887,8 @@ static int n3000_afu_config(struct afu_rawdev *dev, void *config, cfg->dma_cfg.length); } } - rte_memcpy(&priv->dma_cfg, &cfg->dma_cfg, - sizeof(struct rte_pmd_afu_dma_cfg)); + memcpy(&priv->dma_cfg, &cfg->dma_cfg, + sizeof(struct rte_pmd_afu_dma_cfg)); } else { IFPGA_RAWDEV_PMD_ERR("Invalid type of N3000 AFU"); return -EINVAL; diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index f89bd3f9e2..d5d47e14dd 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -258,7 +257,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev *ifpga_dev) if (point < 12) return -1; point -= 12; - rte_memcpy(ifpga_dev->parent_bdf, &link[point], 12); + memcpy(ifpga_dev->parent_bdf, &link[point], 12); point = strlen(link1); if (point < 26) @@ -948,10 +947,10 @@ ifpga_rawdev_pr(struct rte_rawdev *dev, if (ret) return ret; - rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, - sizeof(u64)); - rte_memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8, - sizeof(u64)); + memcpy(&afu_pr_conf->afu_id.uuid.uuid_low, uuid.b, + sizeof(u64)); + memcpy(&afu_pr_conf->afu_id.uuid.uuid_high, uuid.b + 8, + sizeof(u64)); IFPGA_RAWDEV_PMD_INFO("%s: uuid_l=0x%lx, uuid_h=0x%lx\n", __func__, diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c index 6e99d35536..256f45cb5d 100644 --- a/drivers/raw/skeleton/skeleton_rawdev.c +++ b/drivers/raw/skeleton/skeleton_rawdev.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include @@ -245,8 +244,8 @@ static int skeleton_rawdev_queue_def_conf(struct rte_rawdev *dev, skelq = &skeldev->queues[queue_id]; if (queue_id < SKELETON_MAX_QUEUES) - rte_memcpy(queue_conf, skelq, - sizeof(struct skeleton_rawdev_queue)); + memcpy(queue_conf, skelq, + sizeof(struct skeleton_rawdev_queue)); return 0; } @@ -281,8 +280,7 @@ static int skeleton_rawdev_queue_setup(struct rte_rawdev *dev, if (skeldev->num_queues > queue_id && q->depth < SKELETON_QUEUE_MAX_DEPTH) { - rte_memcpy(q, queue_conf, - sizeof(struct skeleton_rawdev_queue)); + memcpy(q, queue_conf, sizeof(struct skeleton_rawdev_queue)); clear_queue_bufs(queue_id); } else { SKELETON_PMD_ERR("Invalid queue configuration"); diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c index b7a7f623aa..dc32c4e29b 100644 --- a/drivers/raw/skeleton/skeleton_rawdev_test.c +++ b/drivers/raw/skeleton/skeleton_rawdev_test.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include -- 2.43.0