From patchwork Fri May 5 17:48:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 126706 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 CBA1B42A49; Fri, 5 May 2023 19:48:41 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92D1142D3E; Fri, 5 May 2023 19:48:22 +0200 (CEST) Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) by mails.dpdk.org (Postfix) with ESMTP id 1803742D30 for ; Fri, 5 May 2023 19:48:21 +0200 (CEST) Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-52c62a71541so1459386a12.3 for ; Fri, 05 May 2023 10:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683308900; x=1685900900; 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=Wl7V025PblxpkCV4EaUhWjwG/0+zMD/aETzxvwBS+6YU4WDtmxwQ4SkCGt4Hvv1f9B rMtbOMG85VNmjgqYiPxqfe6xFY4P46xNgYDgdJWhzPgZCHJ4fJu4bBetB7ylMGp4zrJm w/II+1q0mIbdZonxhQAkF1dlWX9MWezk6yPkPrs4zL9B5IgHhLfDwRJj8zvAbteRIZ/j A5OpUD+EURbOdqiXhx89cBjD8e6bJpUae80dRjriqkHNeFnG+aXeaOTx4v8uOz4gHrNG yt49jRdnbXIuH/YP9KK37HgHwfSFzSS97SAe1Q7Oh0nDuW/eVocB5PzdwOYDZlxgbYKl oK6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683308900; x=1685900900; 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=cxYMVD3QwJLiQw/DTdpi1Wfg0WmPUoxuLGm3lwv5AYG9oGyn3vcBwLSbgZRxJaNFru gqiYYKG/0daTwsQwgu4UOGOnaiGHJaBlGjaRULY3Ix8ghHARMJS7TSDzL+pb6qOzw8tk rSs6/1OZ/eYAGBNbfXh5Jnef69/hyttxBwlgoc5te+X3sdm8ZWTWv7BEro/s2o+BQ/oc wghkydj3Z/GGFLbjfAWgnXonwRyfy7XqZGt/6V8k6aAgwyidUU+8Bv4UfBm0DZEI5EK7 zRrY8JIDY7Iehij2Em4/6BWN8BFWrjeRRRcEs3Q6PSU5kuE/7wB950ryeACpVH3xm47P UK0w== X-Gm-Message-State: AC+VfDwe/v1fFiNFxeBygI3f8zlHPyFW+xuHCMfDC6dvse4W5nxWEtd4 qm2XhgOCsDfYp93xCvNHr6TOufAp7+VAd+FjusHL1g== X-Google-Smtp-Source: ACHHUZ6ZnANwVE0zEVYcLIh3YQU1EsQSMRdaY6uhTP+sMTNh48GtYCxTkqrFM4QWk40BAlPoUbnrRA== X-Received: by 2002:a05:6a20:3d1b:b0:ef:85a6:464b with SMTP id y27-20020a056a203d1b00b000ef85a6464bmr3102709pzi.14.1683308900068; Fri, 05 May 2023 10:48:20 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a15-20020aa780cf000000b0063799398eb9sm1895707pfn.58.2023.05.05.10.48.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 10:48:19 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Aman Singh , Yuying Zhang Subject: [PATCH 03/14] testpmd: use rte_pktmbuf_mtod_offset Date: Fri, 5 May 2023 10:48:02 -0700 Message-Id: <20230505174813.133894-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505174813.133894-1-stephen@networkplumber.org> References: <20230505174813.133894-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",