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 5800B43C12; Fri, 1 Mar 2024 18:24:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 935A3434FC; Fri, 1 Mar 2024 18:18:42 +0100 (CET) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id 5B31F43476 for ; Fri, 1 Mar 2024 18:18:09 +0100 (CET) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1d911c2103aso7700615ad.0 for ; Fri, 01 Mar 2024 09:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709313488; x=1709918288; 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=2gowFFcWhVDEnjsf9+Qas+Ht+Lb2Py5p1efUePLeUgw=; b=svfAZBJuz8285lCjgPMRtOXwqcO7T+Qlyy7j3Q4sg6C9IWxP1zExdesFag/DecN7ez 7rjvoQik/S1Wc0/MXSLNqI+aCoP8Y8Ee/lOAxN13JJivrSVLSzNWzmpY5lEIk1CKT+bR iAu9TMZ/X4kOovb3tpuveVpvvYqbJ9HvgzgtqN9eRvOzqIC+PnPzAF2c4e8KM7YTe182 kswNUlPWO7/xO37hpkmKtKaQ26rrFB+J44shJrBA5SaVvveI7uqXJylK+ZCBa3uMn9sF 0/5pqBW2aXYDsydte/wwTPxm80OYs8AFDm1hS+DM+W96fxPAK6ONCrfD0TZJLPyTM5mh 5wDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709313488; x=1709918288; 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=2gowFFcWhVDEnjsf9+Qas+Ht+Lb2Py5p1efUePLeUgw=; b=bOMEFSiFHUjdp7FdrlaGQU436E8X26gunZ1P4xk6v8fcEaocJNmOuukB8oO7O4qYLS rCOItjgtR0zSWAkxMFcyLZnEoj6hsXsDUdA1xvzoQPa7Ua0s1wzE4QNTqCa4UgYEZsOp Z36yGY8iLGFKg2OAFx6XGw4ZHWsM8HZPsTKd+FVaMkORNbKQDju1BMHVwp1OHm00ZfGg 5XibzjYhHs/5xBp6yBYtveSuqVB0yTgsgDVOBZrnZrojP4OibSdk6XK8a/9B6GOnOSPW l6J+vSRSLhKP7l/wkuTZ9eT+pm7Egx/Rxa5TOrRK60cguS3/EZxMR43rQSNyIm+JhjyL TNpQ== X-Gm-Message-State: AOJu0YzbpzFimdR4K0/Oy9ROilIxOlMONk+qfSBhhqabQ1WDcIZu/Xma uPqNCc91VsprOcJS/n28vU7lzFNDEtkrxGTtq4tXMSRiSpYUn8LqWYgXMEX1JiiJj9kizw4OBDw 4FlbbEQ== X-Google-Smtp-Source: AGHT+IGb+llt/sscZ3DRNDkwwJKld1weTFtleB3di7RZiAOmaQmNCnoEWQMcR6GpInjV8tx3Mo0BRg== X-Received: by 2002:a17:902:7846:b0:1dc:db57:d6e2 with SMTP id e6-20020a170902784600b001dcdb57d6e2mr2223855pln.69.1709313488579; Fri, 01 Mar 2024 09:18:08 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id j14-20020a170902da8e00b001dc8d6a9d40sm3695764plx.144.2024.03.01.09.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:18:07 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou Subject: [PATCH v2 65/71] net/hinic: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:16:01 -0800 Message-ID: <20240301171707.95242-66-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240301171707.95242-1-stephen@networkplumber.org> References: <20240229225936.483472-1-stephen@networkplumber.org> <20240301171707.95242-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/net/hinic/hinic_pmd_flow.c | 40 ++++++++++++++---------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/drivers/net/hinic/hinic_pmd_flow.c b/drivers/net/hinic/hinic_pmd_flow.c index d1a564a16303..cb61c989fd36 100644 --- a/drivers/net/hinic/hinic_pmd_flow.c +++ b/drivers/net/hinic/hinic_pmd_flow.c @@ -983,8 +983,7 @@ static int hinic_normal_item_check_ip(const struct rte_flow_item **in_out_item, } ipv6_spec = (const struct rte_flow_item_ipv6 *)item->spec; - rte_memcpy(rule->hinic_fdir.dst_ipv6, - ipv6_spec->hdr.dst_addr, 16); + memcpy(rule->hinic_fdir.dst_ipv6, ipv6_spec->hdr.dst_addr, 16); /* * Check if the next not void item is TCP or UDP or ICMP. @@ -2193,8 +2192,8 @@ static int hinic_add_del_ntuple_filter(struct rte_eth_dev *dev, sizeof(struct hinic_5tuple_filter), 0); if (filter == NULL) return -ENOMEM; - rte_memcpy(&filter->filter_info, &filter_5tuple, - sizeof(struct hinic_5tuple_filter_info)); + memcpy(&filter->filter_info, &filter_5tuple, + sizeof(struct hinic_5tuple_filter_info)); filter->queue = ntuple_filter->queue; filter_info->qid = ntuple_filter->queue; @@ -2912,8 +2911,7 @@ static int hinic_add_del_tcam_fdir_filter(struct rte_eth_dev *dev, sizeof(struct hinic_tcam_filter), 0); if (tcam_filter == NULL) return -ENOMEM; - (void)rte_memcpy(&tcam_filter->tcam_key, - &tcam_key, sizeof(struct tag_tcam_key)); + memcpy(&tcam_filter->tcam_key, &tcam_key, sizeof(struct tag_tcam_key)); tcam_filter->queue = fdir_tcam_rule.data.qid; ret = hinic_add_tcam_filter(dev, tcam_filter, &fdir_tcam_rule); @@ -2990,9 +2988,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev, &ntuple_filter, FALSE); goto out; } - rte_memcpy(&ntuple_filter_ptr->filter_info, - &ntuple_filter, - sizeof(struct rte_eth_ntuple_filter)); + memcpy(&ntuple_filter_ptr->filter_info, + &ntuple_filter, + sizeof(struct rte_eth_ntuple_filter)); TAILQ_INSERT_TAIL(&nic_dev->filter_ntuple_list, ntuple_filter_ptr, entries); flow->rule = ntuple_filter_ptr; @@ -3022,9 +3020,9 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev, ðertype_filter, FALSE); goto out; } - rte_memcpy(ðertype_filter_ptr->filter_info, - ðertype_filter, - sizeof(struct rte_eth_ethertype_filter)); + memcpy(ðertype_filter_ptr->filter_info, + ðertype_filter, + sizeof(struct rte_eth_ethertype_filter)); TAILQ_INSERT_TAIL(&nic_dev->filter_ethertype_list, ethertype_filter_ptr, entries); flow->rule = ethertype_filter_ptr; @@ -3065,8 +3063,8 @@ static struct rte_flow *hinic_flow_create(struct rte_eth_dev *dev, goto out; } - rte_memcpy(&fdir_rule_ptr->filter_info, &fdir_rule, - sizeof(struct hinic_fdir_rule)); + memcpy(&fdir_rule_ptr->filter_info, &fdir_rule, + sizeof(struct hinic_fdir_rule)); TAILQ_INSERT_TAIL(&nic_dev->filter_fdir_rule_list, fdir_rule_ptr, entries); flow->rule = fdir_rule_ptr; @@ -3109,8 +3107,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, case RTE_ETH_FILTER_NTUPLE: ntuple_filter_ptr = (struct hinic_ntuple_filter_ele *) pmd_flow->rule; - rte_memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info, - sizeof(struct rte_eth_ntuple_filter)); + memcpy(&ntuple_filter, &ntuple_filter_ptr->filter_info, + sizeof(struct rte_eth_ntuple_filter)); ret = hinic_add_del_ntuple_filter(dev, &ntuple_filter, FALSE); if (!ret) { TAILQ_REMOVE(&nic_dev->filter_ntuple_list, @@ -3121,9 +3119,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, case RTE_ETH_FILTER_ETHERTYPE: ethertype_filter_ptr = (struct hinic_ethertype_filter_ele *) pmd_flow->rule; - rte_memcpy(ðertype_filter, - ðertype_filter_ptr->filter_info, - sizeof(struct rte_eth_ethertype_filter)); + memcpy(ðertype_filter, ðertype_filter_ptr->filter_info, + sizeof(struct rte_eth_ethertype_filter)); ret = hinic_add_del_ethertype_filter(dev, ðertype_filter, FALSE); if (!ret) { @@ -3134,9 +3131,8 @@ static int hinic_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *flow, break; case RTE_ETH_FILTER_FDIR: fdir_rule_ptr = (struct hinic_fdir_rule_ele *)pmd_flow->rule; - rte_memcpy(&fdir_rule, - &fdir_rule_ptr->filter_info, - sizeof(struct hinic_fdir_rule)); + memcpy(&fdir_rule, &fdir_rule_ptr->filter_info, + sizeof(struct hinic_fdir_rule)); if (fdir_rule.mode == HINIC_FDIR_MODE_NORMAL) { ret = hinic_add_del_fdir_filter(dev, &fdir_rule, FALSE); } else if (fdir_rule.mode == HINIC_FDIR_MODE_TCAM) { -- 2.43.0