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 8909543C12; Fri, 1 Mar 2024 18:23:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9E1D434C2; Fri, 1 Mar 2024 18:18:28 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 21CF643441 for ; Fri, 1 Mar 2024 18:18:00 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-1d7232dcb3eso18704455ad.2 for ; Fri, 01 Mar 2024 09:18:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709313479; x=1709918279; 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=P1A/lRdHUk8b+njW4Kc/wp5wrEGQSVW3TIOrqS+yY1hRTU+5wQwvdV5oDOb6ElfVUC N21DBNL9KgTZTVgZVh6XrQUEpSYmE/J4jmK8C8YUOj2DrCaCAzQquLyACH6+uFNm3NQ6 T0eJPrGkG/0QuKhyaifHd2p+FA/wlHk9WcrFiL3DGPQMCDKEMpcjQwguxhV3vYzGDgGT awZjFnlaXI+tEG63M2V+ZvvsCNtqvmZzVqLYv6tCdWaEMWuvifhUd6NBaHpVhSFGyWhz w4p+AOiksVmWQ3EOBWozVT4JKtGvd/O+V+vDQCTJCCQ+KE9rOgYjSsPs04xyS5wvVB9i 3KtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709313479; x=1709918279; 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=QnlK4YCCtpH/B8h54UxCJl6STG4Iz36MWMz1D3R90Wn0bDnjnue0L4thkJ4+XhC/DS uEYzmur5MlBVn+vinbU0w+ebRQN3iRAncsK9p77yg5V+7oBcE7+x5Bg2kbSRR81gdpO5 GgVuXjspKxRhhJA1ewxki3dxueDCc35aeQ/VUTcwS+22xgg8ZlYvchrIRRJVDNByOX3Q xRR7b2TVaiT1Uht4KThH56DNPjV/jV7tVsaGqtGDRt7zBkfgHg4jVSpos4w5IX2Q23IS uYF9FTevp+zKuHYjVOG/3tOqnAhZx2802ui+gtJaIo0Pt6NYV2YEoo7c5xGOZKpWxGbm xDBA== X-Gm-Message-State: AOJu0YzSLsJsLT+uwDiFkueUFjR4sa9dm++hRFjL3jFpbUOSM2ub4l/A UsRxqKJOJUt3xUCD5ABTB14whSRjZbHEXBszGvKxmpsXg2dMzkzjfhtCkU2yR/NXNFvkG/p9BGo S8ati3Q== X-Google-Smtp-Source: AGHT+IH+ojb7fcWDQoG+sAI4NSDufkFBN5k1PZS8ZS6rXrDVEC3jucfOvc8zrBtdvd8uN0B40qkupQ== X-Received: by 2002:a17:902:8c93:b0:1dc:b3a3:ca73 with SMTP id t19-20020a1709028c9300b001dcb3a3ca73mr2026742plo.38.1709313479320; Fri, 01 Mar 2024 09:17:59 -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.17.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 09:17:58 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Julien Aube Subject: [PATCH v2 54/71] net/bnx2x: replace use of fixed size rte_memcpy Date: Fri, 1 Mar 2024 09:15:50 -0800 Message-ID: <20240301171707.95242-55-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. 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