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 5BDB843BAE; Fri, 1 Mar 2024 00:08:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C127043454; Fri, 1 Mar 2024 00:02:08 +0100 (CET) Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by mails.dpdk.org (Postfix) with ESMTP id 3977743322 for ; Fri, 1 Mar 2024 00:00:57 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-29b21dc7a92so121377a91.1 for ; Thu, 29 Feb 2024 15:00:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247656; x=1709852456; 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=gv9vRvLOXFe/kWJwzIAdBGAYsQn+w+tzTmSyPIRXvyBMyhnFT8JDa1k2MxytOFCEtI HoUahbZsq8C2DiBH3fo0qwlppu1PeYUCkqyAfDz6JpZWRGsOeLEREwtAo3SXkVLe9TcX Ajg1Lozm92WKJOXCoFdcaeft998WpyYmdypLRqL02F7rD3BGJ/Eljlj0e/rMB7TG5Tvg RkqnQ6q4xYj9UrZD4teNeJaAilc/QLEca3LmEsCU03HWjt3egkOMPoP3jTpMelUumr6M Qec6oCWsRJ+oe1DSNB0GkJfdnSy44Z6LC4o/VsdyxIvfStPBRgSIOO0Hdo7CEeUQpF8B bl5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247656; x=1709852456; 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=v8mqzOATRH1BTHTUucVY4MCkZRw9qoKUHPrFWv4DregIEJXAzbjaNT4qo095e35XdP BPZXKBdl2qgmmnTqRABOKMmTeX0z/CIscEkc/ctc9Su8v2KHuo53rI1Mu/UCzAhMm/tS XcwCqFprcHOun3jntTC9hc/J6363b/cL3hsiQb/HHQ9QF/qwYLusfqV8HaBRl7pXMSEr 3R6SXGmYqnY39RTQLoKO2t823NZ7ApmLXGybM04+oUDVZRMol3gWSbmzxJfF45C6WWWo 9Vh9WUZ+78Mi6PZf86/xCrxGCWI1HY+4ufPxiRWRGHxBXj2LlseEEtAgK93UVTls8wXc MZPg== X-Gm-Message-State: AOJu0YxCJZe+ddBKVw4jtnrc6IlUR5KSdXF8BRfDCUT2l+GbSpQCKLKx MrOE6hE3nmaqmiOMbX1l5cs7XwnXDYlMyYlmgvxi9CaE3nU84fkIoPMnischZWCtHoneCti6Ppf s+zc= X-Google-Smtp-Source: AGHT+IFLXicHYMSVkzsFgkuc6lxFNarpAa+jSX5F8U6JH0Av+6bvsJ2faFCFQ6hqCs0q0uiwCQ/NoA== X-Received: by 2002:a17:90b:3c1:b0:29a:998a:cdf1 with SMTP id go1-20020a17090b03c100b0029a998acdf1mr27553pjb.35.1709247656422; Thu, 29 Feb 2024 15:00:56 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id l22-20020a17090b079600b0029a8e5355fcsm1965578pjz.53.2024.02.29.15.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:56 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou Subject: [PATCH 65/71] net/hinic: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:52 -0800 Message-ID: <20240229225936.483472-66-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229225936.483472-1-stephen@networkplumber.org> References: <20240229225936.483472-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