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 C5B9443BAE; Fri, 1 Mar 2024 00:07:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65C3F4342C; Fri, 1 Mar 2024 00:01:49 +0100 (CET) Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by mails.dpdk.org (Postfix) with ESMTP id EAFA8432F6 for ; Fri, 1 Mar 2024 00:00:46 +0100 (CET) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-5d3912c9a83so1051044a12.3 for ; Thu, 29 Feb 2024 15:00:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709247646; x=1709852446; 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=cjxhR4csAsqJ0aUw/Iixg8P9RLtulDrA5Ua4mBysleI=; b=AAnukQF4k0mnej/6QlFOe9+ORzynMRC+oP7ULH7heL8mL5m0kBB7jJx62iaZxZsZMZ jOIDpTm9Vps3p41fXO+aKOZeuxKYvqSIHj1H7vp+6koec1gP9PLwJgF6L3sFtcTk521X hj9qU3LBsE29Z0Uh1qU5Sj8/afybqE9lvxdBTx8gSKz93UCfxWRAvURfRmV6n49cUT8r gkrAta5bAsgKY/ZdYCd1lwpg8tBAPqdnwlK70RLu8/MrQ3M6/E2Es3moKrL/3oSoI0Cy onGnpd2TawOld5iHF+uUKj6CbU2waTX+Jndr13pFz4G4lm8suDzXtrmvYAXegtwwAW5L q3QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709247646; x=1709852446; 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=cjxhR4csAsqJ0aUw/Iixg8P9RLtulDrA5Ua4mBysleI=; b=LeByNTr56Wftnt2TmXtSLkCEpNMDPuDm02DJhgd6LwitR/PT6eErZXO5ASQMT2SG3i p7vw86o7R23Zs2ED+EA284aEy4o0u/NpRtiKgCgAZ0WWbW2P+MHFyYqSANCAZeJKoAip MWR0bUgdqijOfgc33NDbCxvAytvybFW9QzZ6Dy21wbdmVsOLeNSVpr9Ds3xecRoI3T0U 1Z+rHifzScvi2inq4nIckAxMhdpY6Ig3/G6VQXheQYaEOQoTmR864XUb31n9apFg9RuO u3lkDvRniS6sgq8xY6XtXLWTK8SW/UXl96q9sWI23eOrV/Ik76akWqpziY2mtM+FR9b1 aspQ== X-Gm-Message-State: AOJu0YzWo4M497CkEd25xTNeYc3G/n/mX7FJvh6RQE2WYptnUD0NZQ7H wsubmLQRm71vACVK/xhKYYVVFnLBFWp0OxQ+37NQADtIPyX/cs1oeFQDotRNVJ6XLb05saSEZZn w X-Google-Smtp-Source: AGHT+IE/EWnuMTX8c9dWH7uiT8u31FQtpQ+ivPulxEt0wXNuc6ZRxu+wXgwDjxyj7/lqxfL+zgFo7g== X-Received: by 2002:a17:90a:de18:b0:29a:97f5:9970 with SMTP id m24-20020a17090ade1800b0029a97f59970mr15052pjv.45.1709247645953; Thu, 29 Feb 2024 15:00:45 -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.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 15:00:45 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Julien Aube Subject: [PATCH 54/71] net/bnx2x: replace use of fixed size rte_memcpy Date: Thu, 29 Feb 2024 14:58:41 -0800 Message-ID: <20240229225936.483472-55-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. Note: the indentation in this file does not follow the coding standard of DPDK, so it will get some checkpatch warnings. Signed-off-by: Stephen Hemminger --- drivers/net/bnx2x/bnx2x.c | 32 +++++++++++++++----------------- drivers/net/bnx2x/bnx2x_stats.c | 10 +++++----- drivers/net/bnx2x/bnx2x_vfpf.c | 19 ++++++++++--------- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index 597ee4335977..16a9ff7f8c06 100644 --- a/drivers/net/bnx2x/bnx2x.c +++ b/drivers/net/bnx2x/bnx2x.c @@ -2242,18 +2242,18 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) tx_parse_bd->parsing_data = (mac_type << ETH_TX_PARSE_BD_E2_ETH_ADDR_TYPE_SHIFT); - rte_memcpy(&tx_parse_bd->data.mac_addr.dst_hi, - &eh->dst_addr.addr_bytes[0], 2); - rte_memcpy(&tx_parse_bd->data.mac_addr.dst_mid, - &eh->dst_addr.addr_bytes[2], 2); - rte_memcpy(&tx_parse_bd->data.mac_addr.dst_lo, - &eh->dst_addr.addr_bytes[4], 2); - rte_memcpy(&tx_parse_bd->data.mac_addr.src_hi, - &eh->src_addr.addr_bytes[0], 2); - rte_memcpy(&tx_parse_bd->data.mac_addr.src_mid, - &eh->src_addr.addr_bytes[2], 2); - rte_memcpy(&tx_parse_bd->data.mac_addr.src_lo, - &eh->src_addr.addr_bytes[4], 2); + memcpy(&tx_parse_bd->data.mac_addr.dst_hi, + &eh->dst_addr.addr_bytes[0], 2); + memcpy(&tx_parse_bd->data.mac_addr.dst_mid, + &eh->dst_addr.addr_bytes[2], 2); + memcpy(&tx_parse_bd->data.mac_addr.dst_lo, + &eh->dst_addr.addr_bytes[4], 2); + memcpy(&tx_parse_bd->data.mac_addr.src_hi, + &eh->src_addr.addr_bytes[0], 2); + memcpy(&tx_parse_bd->data.mac_addr.src_mid, + &eh->src_addr.addr_bytes[2], 2); + memcpy(&tx_parse_bd->data.mac_addr.src_lo, + &eh->src_addr.addr_bytes[4], 2); tx_parse_bd->data.mac_addr.dst_hi = rte_cpu_to_be_16(tx_parse_bd->data.mac_addr.dst_hi); @@ -6675,8 +6675,7 @@ bnx2x_config_rss_pf(struct bnx2x_softc *sc, struct ecore_rss_config_obj *rss_obj /* Hash bits */ params.rss_result_mask = MULTI_MASK; - rte_memcpy(params.ind_table, rss_obj->ind_table, - sizeof(params.ind_table)); + memcpy(params.ind_table, rss_obj->ind_table, sizeof(params.ind_table)); if (config_hash) { /* RSS keys */ @@ -6742,8 +6741,7 @@ bnx2x_set_mac_one(struct bnx2x_softc *sc, uint8_t * mac, /* fill a user request section if needed */ if (!rte_bit_relaxed_get32(RAMROD_CONT, ramrod_flags)) { - rte_memcpy(ramrod_param.user_req.u.mac.mac, mac, - ETH_ALEN); + memcpy(ramrod_param.user_req.u.mac.mac, mac, ETH_ALEN); rte_bit_relaxed_set32(mac_type, &ramrod_param.user_req.vlan_mac_flags); @@ -6958,7 +6956,7 @@ static void bnx2x_link_report_locked(struct bnx2x_softc *sc) ELINK_DEBUG_P1(sc, "link status change count = %x", sc->link_cnt); /* report new link params and remember the state for the next time */ - rte_memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data)); + memcpy(&sc->last_reported_link, &cur_data, sizeof(cur_data)); if (rte_bit_relaxed_get32(BNX2X_LINK_REPORT_LINK_DOWN, &cur_data.link_report_flags)) { diff --git a/drivers/net/bnx2x/bnx2x_stats.c b/drivers/net/bnx2x/bnx2x_stats.c index c07b01510a06..23c74c21c635 100644 --- a/drivers/net/bnx2x/bnx2x_stats.c +++ b/drivers/net/bnx2x/bnx2x_stats.c @@ -114,8 +114,8 @@ bnx2x_hw_stats_post(struct bnx2x_softc *sc) /* Update MCP's statistics if possible */ if (sc->func_stx) { - rte_memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats, - sizeof(sc->func_stats)); + memcpy(BNX2X_SP(sc, func_stats), &sc->func_stats, + sizeof(sc->func_stats)); } /* loader */ @@ -817,10 +817,10 @@ bnx2x_hw_stats_update(struct bnx2x_softc *sc) etherstatspktsover1522octets); } - rte_memcpy(old, new, sizeof(struct nig_stats)); + memcpy(old, new, sizeof(struct nig_stats)); - rte_memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]), - sizeof(struct mac_stx)); + memcpy(&(estats->rx_stat_ifhcinbadoctets_hi), &(pstats->mac_stx[1]), + sizeof(struct mac_stx)); estats->brb_drop_hi = pstats->brb_drop_hi; estats->brb_drop_lo = pstats->brb_drop_lo; diff --git a/drivers/net/bnx2x/bnx2x_vfpf.c b/drivers/net/bnx2x/bnx2x_vfpf.c index 63953c2979ce..678c9e7d7d7c 100644 --- a/drivers/net/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/bnx2x/bnx2x_vfpf.c @@ -52,9 +52,9 @@ bnx2x_check_bull(struct bnx2x_softc *sc) /* check the mac address and VLAN and allocate memory if valid */ if (valid_bitmap & (1 << MAC_ADDR_VALID) && memcmp(bull->mac, sc->old_bulletin.mac, ETH_ALEN)) - rte_memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN); + memcpy(&sc->link_params.mac_addr, bull->mac, ETH_ALEN); if (valid_bitmap & (1 << VLAN_VALID)) - rte_memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN); + memcpy(&bull->vlan, &sc->old_bulletin.vlan, RTE_VLAN_HLEN); sc->old_bulletin = *bull; @@ -569,7 +569,7 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set) bnx2x_check_bull(sc); - rte_memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN); + memcpy(query->filters[0].mac, sc->link_params.mac_addr, ETH_ALEN); bnx2x_add_tlv(sc, query, query->first_tlv.tl.length, BNX2X_VF_TLV_LIST_END, @@ -583,10 +583,10 @@ bnx2x_vf_set_mac(struct bnx2x_softc *sc, int set) while (BNX2X_VF_STATUS_FAILURE == reply->status && bnx2x_check_bull(sc)) { /* A new mac was configured by PF for us */ - rte_memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac, - ETH_ALEN); - rte_memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac, - ETH_ALEN); + memcpy(sc->link_params.mac_addr, sc->pf2vf_bulletin->mac, + ETH_ALEN); + memcpy(query->filters[0].mac, sc->pf2vf_bulletin->mac, + ETH_ALEN); rc = bnx2x_do_req4pf(sc, sc->vf2pf_mbox_mapping.paddr); if (rc) @@ -622,10 +622,11 @@ bnx2x_vf_config_rss(struct bnx2x_softc *sc, BNX2X_VF_TLV_LIST_END, sizeof(struct channel_list_end_tlv)); - rte_memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key)); + memcpy(query->rss_key, params->rss_key, sizeof(params->rss_key)); query->rss_key_size = T_ETH_RSS_KEY; - rte_memcpy(query->ind_table, params->ind_table, T_ETH_INDIRECTION_TABLE_SIZE); + memcpy(query->ind_table, params->ind_table, + T_ETH_INDIRECTION_TABLE_SIZE); query->ind_table_size = T_ETH_INDIRECTION_TABLE_SIZE; query->rss_result_mask = params->rss_result_mask; -- 2.43.0