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 C728B42A7F; Sat, 6 May 2023 18:04:29 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F420340DFD; Sat, 6 May 2023 18:04:11 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 6597D42D2D for ; Sat, 6 May 2023 18:04:10 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6439bbc93b6so1660987b3a.1 for ; Sat, 06 May 2023 09:04:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683389049; x=1685981049; 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=aedscfCbmPzx3Lu1G1eN9fqAHaQkapvwXdXunHPn+Nc=; b=OGsUgjcneHcaBEykD+x4w1mKkFlzFct/3A5qqVIY13Ij/7kUS8F9Iv0rhTKe+qDDPS y8W2ZaTAjV991p39IG/LUHME/snPY8kCxhYDAm1+4Nkke95ROcAVJp/4XaYkiMM4CG0S xcq0UMVTdIITjzpIAWEN7Xppjw/NQS/F+O9RjywVFp38G3IpV43SS9vMTx47COyR+iP+ mRGzY3yqdrpT6hTo1KIcZts4oKXU3DOkTncu4DXAilGwL7hiLP2CvyLClSg8JjezfhZJ FluZ7jPh5LbFpktmmFByRDXDQuNtb4I64UsrwBmoQuXayAyTn6XirnEsnyceAcRbf0hX 0vag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683389049; x=1685981049; 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=aedscfCbmPzx3Lu1G1eN9fqAHaQkapvwXdXunHPn+Nc=; b=C+gGirudg4kw0SRlG4UgcQKSdYQZxlydHFYRPiwPK/fakAHxL0Edl86wanfbzn3PXH TH7guZvrxL/2RGitfoZ3QUH5Ve/FbpCbDGK4iGzq0+aOUli0b9VBWoir8XzDAITtUxPr KroqJLOE+b+I8KpNkwBuD4B6Ir3w8cafgFmQjTxX/lFcf/VKtirXVTPWUZpBG6L6TWFI BWam6Olv7oTAmWIlXknnbTFeTypgaQILozXkbrzMrSTO+P0Oiql0J/GpaCyTgQxtkQF+ RONp8cMvi9u7s49+T1OtqF9NS9iOjbEYNIsfKdvafEkVcuJ4KwSDOS0m7VDfl309TM+p ekcw== X-Gm-Message-State: AC+VfDzswCIvzIWpGmFnZAv8M4vJzHJPEHVYkvNuXf8BW6mV/7Psztdt dn89wIOfVc/QqetK9xt0mB+ZnkOIibRhNOm8vUzJPw== X-Google-Smtp-Source: ACHHUZ5Y98ZPWfr28Avc7+cba7xbR4P5o4hD8hgvjT2oqcuq5ZmmEq+ctPddXhVAHWpUcZIeiVaKTA== X-Received: by 2002:a05:6a00:1414:b0:63a:8533:d6a7 with SMTP id l20-20020a056a00141400b0063a8533d6a7mr7405329pfu.9.1683389049322; Sat, 06 May 2023 09:04:09 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e14-20020a62ee0e000000b006436ffa3dc4sm3369890pfi.24.2023.05.06.09.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 09:04:08 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang Subject: [PATCH v2 03/14] testpmd: use rte_pktmbuf_mtod_offset Date: Sat, 6 May 2023 09:03:52 -0700 Message-Id: <20230506160404.7423-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230506160404.7423-1-stephen@networkplumber.org> References: <20230505174813.133894-1-stephen@networkplumber.org> <20230506160404.7423-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 Use helper macro. Signed-off-by: Stephen Hemminger --- app/test-pmd/ieee1588fwd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/ieee1588fwd.c b/app/test-pmd/ieee1588fwd.c index 386d9f10e642..3371771751dd 100644 --- a/app/test-pmd/ieee1588fwd.c +++ b/app/test-pmd/ieee1588fwd.c @@ -138,8 +138,8 @@ ieee1588_packet_fwd(struct fwd_stream *fs) * Check that the received PTP packet is a PTP V2 packet of type * PTP_SYNC_MESSAGE. */ - ptp_hdr = (struct ptpv2_msg *) (rte_pktmbuf_mtod(mb, char *) + - sizeof(struct rte_ether_hdr)); + ptp_hdr = rte_pktmbuf_mtod_offset(mb, struct ptpv2_msg *, + sizeof(struct rte_ether_hdr)); if (ptp_hdr->version != 0x02) { printf("Port %u Received PTP V2 Ethernet frame with wrong PTP" " protocol version 0x%x (should be 0x02)\n", -- 2.39.2