From patchwork Thu Jul 6 17:59:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 129353 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0BAE642DEC; Thu, 6 Jul 2023 20:00:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E54540A79; Thu, 6 Jul 2023 19:59:47 +0200 (CEST) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com [209.85.210.54]) by mails.dpdk.org (Postfix) with ESMTP id A9A2C42FF0 for ; Thu, 6 Jul 2023 19:59:44 +0200 (CEST) Received: by mail-ot1-f54.google.com with SMTP id 46e09a7af769-6b8b6f7399aso840518a34.1 for ; Thu, 06 Jul 2023 10:59:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688666383; x=1691258383; 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=ZdNwXcpq1tnyILecyCqAQWQaZKr3yAHsvhFVa5NZVpzXUFhJ2O9UTbK2ZZminK62rG 0Ctw/aWoINpVocqgktT3AlZa5aVkrPuu4PvfEm63fFkiPAOe6Y2J2EJAoYZdRyzL4dPI iaO7DepSaDBx6aY3pXezXwRBMDO/YeRWnka9muu12uQBS2Ks/OVfzK9bf2RMGZXtKNu1 e38YADi+ATOOrAg9IyxCCR8reykGOXT3HNwmCFn16rVGMZ/nDtzYEB/nHHGlHYzwmxEd +1Wb/Sxte+BG6lFnhJmtCUFqNEMEyfVHHMqZGMjfGHdtkrxwrRnoQA0MvfAwZNPxmk9z 2x4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688666383; x=1691258383; 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=jdmfLQzJhlsNPrXQBSEthzum8ipWTFvI6c6KP9/Y57t0NYScZdVNzH+dZtQ65Oh/Co rPtvDc/TMdHEqqN1U4e8+BGnzEM/9MHlO6sH+t5ko7UKxQElk2MxkfJnMuDX18f249Or G96L1PanYeb4EDHSHLg/rSfDoS6R/5k4ccXEiri3L7MEWKLg6AzqrMT3WOAwQ99iT+NB 9DcWIuhGdshT6gKrJBGimot/WNfYEzaFvtybQZh2jyv1+mhk1nE68gVBJ9VEN7TT25ET YEVHAZ+34W50J1vcACaCFYnHYXPw8IU+wy/GW1tIB7ZTW2Akly7VcnK66Gq/5IHy5dvk O/Sw== X-Gm-Message-State: ABy/qLagS1mvZv/xrMzKYzRhRPbql++SwaY2mEGAnml68gDPHP93ExtO RY8OsTZxY/1rNyKfa+MTSKY8bak2viNHq1/RcGM= X-Google-Smtp-Source: APBJJlEHp2MLibcx2PvjlkDl0PHDeibKWwOOD1qIwEjZrOLjnE2/K3MrNs0pvCdgzfJ6FxQ9QLhdWw== X-Received: by 2002:a05:6870:8a06:b0:1b3:e225:7077 with SMTP id p6-20020a0568708a0600b001b3e2257077mr3569310oaq.34.1688666383734; Thu, 06 Jul 2023 10:59:43 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id nh8-20020a17090b364800b00256bbfbabcfsm76464pjb.48.2023.07.06.10.59.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 10:59:43 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang Subject: [PATCH v3 03/14] testpmd: use rte_pktmbuf_mtod_offset Date: Thu, 6 Jul 2023 10:59:27 -0700 Message-Id: <20230706175938.62721-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230706175938.62721-1-stephen@networkplumber.org> References: <20230505174813.133894-1-stephen@networkplumber.org> <20230706175938.62721-1-stephen@networkplumber.org> MIME-Version: 1.0 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",