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 AA2CA42DFC; Fri, 7 Jul 2023 22:40:09 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 471CB42D42; Fri, 7 Jul 2023 22:39:25 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id D330E42D17 for ; Fri, 7 Jul 2023 22:39:20 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1b89d47ffb6so12981115ad.2 for ; Fri, 07 Jul 2023 13:39:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688762360; x=1691354360; 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=78HDkboHxTG/XRmT10zNrGhuzXGadIdppWfUSd5orjE=; b=2LkTg8MJWfcLVs9UFrXwkr2t2QLUCEW8Uj1gzdRBf1r/+A5JIyAkqngFFlj1EBfteq DH51ZUHjB0iipHNsmRqX3TvzlOkPoy4WyN2sqcQ4EX2e/4LSQzoTJKL3lrqmkjFyTmXe xzVkebiXtUPOIh8CJPxgob6hN5blQlUVU0TIFrML3BJtcVX1h08AuJnyv78VG8vb8kYL uXc6/6HIskyagseLMlxTZR39XDrGEfrNiRjdvwV0O1ogBdCDhoyo85GNhD9YHLXrFAyz vuWllO3eLxv48xhjyoEHtHf+6rTTHuHomRgvvlgJGhp97w3DLAYJqNedcKB8qh2o163u bfKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688762360; x=1691354360; 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=78HDkboHxTG/XRmT10zNrGhuzXGadIdppWfUSd5orjE=; b=hD9on37MKN6KbL3af9LjZwlS2hpsUQb1LhRSIU28544UItSHdnzhvquXvWT4EcmmGB apx5+i6naFMaQQtnWYf14xnRaZ4qk+LHFJdQpd290nBz36O/B4mTKfBwSVNLnv8O4doU sPEHPrLqNdMBeq82rQWcQeHZ3N3t70RIrmcMzP3MX7TFY481helUcy5YiX/pDJVfjCk2 oQLXFnOKBoLtOxKdH8wRylPXLBCLgXNayUXaBRa6Ef8LdLbnJH/UXvDJQeKGU9jeXBke AKFuiHlbSaja/k+mvB0faLJ4iupCbGQncUw11safmx2Z+LoSeM3D9Ov8fJSnACDXsDUA tDtA== X-Gm-Message-State: ABy/qLbCCUKp8oVWAwaCFHIthOXRyQ8DQarot91b9yLWesLfTvh/iE7U 53G8MimLvqocWpseunfRL6OOKncmYkCbTAwO20rmMEoz X-Google-Smtp-Source: APBJJlEwWUGLK9O1JskI//qs1R6npCDIYsZW40Um/fjVNlBLqSCibCuoN0K7CymN00yoYgyzWxMbcA== X-Received: by 2002:a17:902:e891:b0:1b8:b3f9:58e5 with SMTP id w17-20020a170902e89100b001b8b3f958e5mr6656781plg.38.1688762359811; Fri, 07 Jul 2023 13:39:19 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id t15-20020a170902b20f00b001b83db0bcf2sm3640493plr.141.2023.07.07.13.39.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 13:39:19 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang Subject: [PATCH v4 09/11] testpmd: use rte_pktmbuf_mtod_offset Date: Fri, 7 Jul 2023 13:39:06 -0700 Message-Id: <20230707203908.64371-10-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230707203908.64371-1-stephen@networkplumber.org> References: <20230505174813.133894-1-stephen@networkplumber.org> <20230707203908.64371-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 Replace explicit packet offset computations with rte_pktmbuf_mtod_offset(). 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