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 A1D0345D0B; Fri, 15 Nov 2024 07:08:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56FBA42FB5; Fri, 15 Nov 2024 07:08:03 +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 292F642F83 for ; Fri, 15 Nov 2024 07:07:58 +0100 (CET) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2ea1267707eso703483a91.2 for ; Thu, 14 Nov 2024 22:07:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1731650877; x=1732255677; 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=dBtW4k9RIz6mavCEq8I9+rapLYbr1mpuZNcAJxQ1E+0=; b=c9/oNI0vqcl6LcLgvjswPKse1gDHvNDCAGsmcPnHbg3aMCtJES1VKdqZIaltjUASeL NnPtdE6aPXQMoXNwgDq5+BOxK7tD0XHp7BZZiuo6ZKjmavhSIQwtlCnyt5zf4OcP3tLV Brc0alBoXuToREXwivOQ2xPTPb4FBLhLpZXWXGWuYx2Igkszy97u+8vgEE5DSHeC5pSW P7o+QKrWcwXyZtXPLNt7c5pfczz0pkcxJqyhzST47U7h5YDctdLmZzodXcOzQeF0S+7S HWEsg/OJhch91LfnM1mN//t2sk1QAEW10Qqemee6abbDnf2das0+T7MBp/bBGZapFzYT npuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731650877; x=1732255677; 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=dBtW4k9RIz6mavCEq8I9+rapLYbr1mpuZNcAJxQ1E+0=; b=Risk6Azt3psnRp3g2QaY11MLZ/zLepavvLo8UzmpgnNYRDoGu8W24rwyckjLnigUom 05z+a8QwmY8/J3z8EI5bSa5j02Nw5h0M6DbKh3RNlA31+GSju8LXYBffcumpR+0R1Gdv M94TGDAVJAx0/EREQowYoHyCmbSmXA9r65ZtcdbDdzQRViNsVlUUwJgXvZW9dNgIkhjK GvceOVTwwEKMBmQi9w9V33ilzD4qAtFXk/TFZY1wwfvAm/KsiLJ59c1Qd58ZQccHfB2L GjEkyYBbxSEqeOS3ZsYMq9sGEczCPtKVPHYgRN92Pu/HRKOEathndVKiD7hZuF8wiypr YZJA== X-Gm-Message-State: AOJu0YwELZ6/qh6yHo6CqcxdxevIrem+4hAUhLZ0WYujcrsUcJrQexGr 8AlVG4S7oxS5UnkJz3Ig4CdUTXKG0MkSM7mD3Ssm0+yO/putq1SdkugSIr+9wPoyjxGIxxEk2yf G X-Google-Smtp-Source: AGHT+IHeuRc/vHypEyb4AdZLbzxJMECbJB7A+Ow018MJVANA0HiMjvZSYrDEoSSRwc6Gx7y+eVm28g== X-Received: by 2002:a17:90b:4c07:b0:2e2:d7db:41fa with SMTP id 98e67ed59e1d1-2ea15596d00mr2188603a91.33.1731650877315; Thu, 14 Nov 2024 22:07:57 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2ea06f4856esm2123781a91.23.2024.11.14.22.07.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Nov 2024 22:07:56 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Kirill Rybalchenko Subject: [PATCH 08/16] examples/ptpclient: replace rte_memcpy with assignment Date: Thu, 14 Nov 2024 22:05:45 -0800 Message-ID: <20241115060738.313190-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241115060738.313190-1-stephen@networkplumber.org> References: <20241115060738.313190-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 Don't use rte_memcpy() when not necessary. Structure assignment is as fast and type safe. Signed-off-by: Stephen Hemminger --- examples/ptpclient/ptpclient.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/examples/ptpclient/ptpclient.c b/examples/ptpclient/ptpclient.c index 23fa487081..2ec532d058 100644 --- a/examples/ptpclient/ptpclient.c +++ b/examples/ptpclient/ptpclient.c @@ -415,9 +415,7 @@ parse_sync(struct ptpv2_time_receiver_ordinary *ptp_data, uint16_t rx_tstamp_idx ptp_data->seqID_SYNC = rte_be_to_cpu_16(ptp_hdr->seq_id); if (ptp_data->ptpset == 0) { - rte_memcpy(&ptp_data->transmitter_clock_id, - &ptp_hdr->source_port_id.clock_id, - sizeof(struct clock_id)); + ptp_data->transmitter_clock_id = ptp_hdr->source_port_id.clock_id; ptp_data->ptpset = 1; } @@ -522,9 +520,7 @@ parse_fup(struct ptpv2_time_receiver_ordinary *ptp_data) client_clkid->id[6] = eth_hdr->src_addr.addr_bytes[4]; client_clkid->id[7] = eth_hdr->src_addr.addr_bytes[5]; - rte_memcpy(&ptp_data->client_clock_id, - client_clkid, - sizeof(struct clock_id)); + ptp_data->client_clock_id = *client_clkid; /* Enable flag for hardware timestamping. */ created_pkt->ol_flags |= RTE_MBUF_F_TX_IEEE1588_TMST; -- 2.45.2