From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 281FF42DFC;
	Fri,  7 Jul 2023 22:39:49 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 8B6DC42D1D;
	Fri,  7 Jul 2023 22:39:21 +0200 (CEST)
Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com
 [209.85.214.173])
 by mails.dpdk.org (Postfix) with ESMTP id 330884014F
 for <dev@dpdk.org>; Fri,  7 Jul 2023 22:39:18 +0200 (CEST)
Received: by mail-pl1-f173.google.com with SMTP id
 d9443c01a7336-1b89e10d356so13725605ad.3
 for <dev@dpdk.org>; Fri, 07 Jul 2023 13:39:18 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688762357;
 x=1691354357; 
 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=NiQ2/UbcUn7iVszTHB7gbAqxzzP+TGnmFbwQRb5uaB0=;
 b=XJZz7bEn3dLb5tKI8yKWSTg0cC9G0sr2GifhF1CI17+9zljCCi6iqtmX7yfNfXR+Iq
 aU5qHuu0ZT+HUrm40bTDF4NF10Nz6L7W4rGrFd31l87jDtwj9IS0CyW9KuY4xbUHAVDB
 +WqVPl1Ww0JleaNq0fjgs2SdL32qBaFIZpi56G5Y3woHg2gSfaleTPSOmwfNvq/j+Pgm
 TFFDa7yQWJ/ag7zC8jI596F1fWfjz1WohZRJASnGeItknLYNpZwPN9HOyPfv0Rdr8eIY
 LIcSSC2xTu79gwVlDNDHRg+PW31qPtAh0ZiP9/BEJSFNS0CWVxKSB39mWH+wwJFX2pkA
 v7Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1688762357; x=1691354357;
 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=NiQ2/UbcUn7iVszTHB7gbAqxzzP+TGnmFbwQRb5uaB0=;
 b=jOdTOhdgN25Tf+sYFgN8LPb2jYrKwkwIn3HVkOehv7zhgq4cfnba88FfrfmPZ19bqR
 KuhFFU6ofgAFJ0qpNQxIi9F/ZGxGHaCX0vURD0QhYJUFkW9dnorXUR6fCeUbCKTb+ZMR
 C3zZjwkR+5HC35lQ6uafjEfoKfAgZALch31/QorUzQ+ydph1rAEWnv0fTJls2bZT98Mg
 JX7lQ/UqMHaBb6maTV1V/+ouEyLVjvhuEZcF66DaoZ9Go2jrI39TQRqt59baa7SVPEnr
 4mcfiPqLlETNhWWjqlz79VN7dzJCEx0017HYuehDFoow5iyRe4tc2+8RkE/N05vwqgTp
 Rwgw==
X-Gm-Message-State: ABy/qLayfJkEoPQIEgRpJ4ldtsj7AXrK1PpB6OjLFytEY3pJJpQm7E+E
 cWHnSXJyYRBvyRXhmogR0sbFBKszTxi7RXTBB+XJlY75
X-Google-Smtp-Source: APBJJlGdb60TimXK+dp9u6WZkKG9fkVq9H55NvNsmH2CoDOir1o+54QqwOKH0eERzVbyDKhndqCrgg==
X-Received: by 2002:a17:902:9895:b0:1b6:89bf:4db7 with SMTP id
 s21-20020a170902989500b001b689bf4db7mr4704236plp.69.1688762357185; 
 Fri, 07 Jul 2023 13:39:17 -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.16
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 07 Jul 2023 13:39:16 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v4 06/11] net/tap: use rte_pktmbuf_motd_offset
Date: Fri,  7 Jul 2023 13:39:03 -0700
Message-Id: <20230707203908.64371-7-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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

Replace explicit packet offset computations with rte_pktmbuf_mtod_offset().

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/tap/rte_eth_tap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index bf98f7555990..968a1b6b45df 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -672,8 +672,8 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs,
 			if (seg_len > l234_hlen) {
 				iovecs[k].iov_len = seg_len - l234_hlen;
 				iovecs[k].iov_base =
-					rte_pktmbuf_mtod(seg, char *) +
-						l234_hlen;
+					rte_pktmbuf_mtod_offset(seg, char *,
+								l234_hlen);
 				tap_tx_l4_add_rcksum(iovecs[k].iov_base,
 					iovecs[k].iov_len, l4_cksum,
 					&l4_raw_cksum);
-- 
2.39.2