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 D320842A7F; Sat, 6 May 2023 18:05:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBACA42D51; Sat, 6 May 2023 18:04:16 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 2129D42D46 for ; Sat, 6 May 2023 18:04:14 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6439b410679so1577560b3a.0 for ; Sat, 06 May 2023 09:04:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683389053; x=1685981053; 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=f30oB7hKdjlkAy9sB1je40tEolfEvq0+c5JesXfei3Q=; b=BYu1ac4+n+3q/eaIYDFlazWZAXx0xLVJiPEbhgF1KW2/Vj+dP7yoWiIcsL1Ikg8dTG 2FZWf3XD1Y1qiJU44lzXOiMAiKOnI7An24C/0QzIlBFqHUQT0mc7WUbXI1lwgswpsGKY Lh49uk/lMVYEVLdYP0N/rcmjccjQ5r6xleg0FvzLH70DjUifzxuP7Eqh3D538jRfMqMy R4pCtO+DZcPtuh4WlzJ+YthlcaFf5/gNu3wfJZOb+N/SUkIhsNioUAaIC/s/IwcnyBN9 2JW2i4sxro1S6cw2jEe0OYFrKbTZm3EjpM/Czb6BlIv6ZUMl+HdRsNKBbe1Zgn4HtWVX eMKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683389053; x=1685981053; 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=f30oB7hKdjlkAy9sB1je40tEolfEvq0+c5JesXfei3Q=; b=PFdyn1oKhx7Dc6SY6h+7l+PPbMQWSiWa2t/5qnkBtc40ovK3L9RLuQU+aQyVaSw8K0 VFNaO/DCYOSD/OArT0JreYk7FI3f1iV/RNmrvBOQLwKjcgbKSLatBcJVXScmdDKXKWvJ MrYwjlFE42sjfi9VyiIt4F2AFTX/dEbEYIajX+GnI6kVXlyHFunZnytipSyPnnKwqLm8 27ZtCguCbAf7JOzZ9yE00ov3RwxQZuR/zgeQhimdOPFI1J6XDyloo9B75Dm0RspYVvMs +0ldtPHDgLXbbpGLRmGgQsa2uWfoTZPH0uKPxutORz2Qx/M7it7tzy4K/Ga31lVZI2TM MI3g== X-Gm-Message-State: AC+VfDy0z5hyKF5PxDlrPcCNx/xRRNYEwbBDU6k+UndmmHrKDgsAH6jY e/2SUxDWFjrmYaKTiugt32Z7dzLm1ME6OyyNkJ8sVg== X-Google-Smtp-Source: ACHHUZ5l/J1PV1Cwb60W1nrAuGNnxTF99HRLeWZufLu1NgVeFeSnS6DeGy+GYtSXC75yd7/7sWVX2A== X-Received: by 2002:a05:6a20:938b:b0:d9:6650:ef14 with SMTP id x11-20020a056a20938b00b000d96650ef14mr6559414pzh.31.1683389053128; Sat, 06 May 2023 09:04:13 -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.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 09:04:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Chaoyong He , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v2 07/14] net/nfp: use rte_pktmbuf_mtod_offset Date: Sat, 6 May 2023 09:03:56 -0700 Message-Id: <20230506160404.7423-8-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 Automatically generated by cocci/mtod-offset.cocci. Signed-off-by: Stephen Hemminger --- drivers/net/nfp/flower/nfp_flower_cmsg.h | 3 ++- drivers/net/nfp/flower/nfp_flower_ctrl.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index 96e080a8e956..5ae0e8be1d67 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -380,7 +380,8 @@ enum nfp_flower_cmsg_port_vnic_type { static inline char* nfp_flower_cmsg_get_data(struct rte_mbuf *m) { - return rte_pktmbuf_mtod(m, char *) + 4 + 4 + NFP_FLOWER_CMSG_HLEN; + return rte_pktmbuf_mtod_offset(m, char *, + 4 + 4 + NFP_FLOWER_CMSG_HLEN); } /* diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index 3e083d948edf..9a8e464a1d18 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -234,7 +234,7 @@ nfp_flower_cmsg_rx_stats(struct nfp_flow_priv *flow_priv, uint32_t ctx_id; struct nfp_flower_stats_frame *stats; - msg = rte_pktmbuf_mtod(mbuf, char *) + NFP_FLOWER_CMSG_HLEN; + msg = rte_pktmbuf_mtod_offset(mbuf, char *, NFP_FLOWER_CMSG_HLEN); msg_len = mbuf->data_len - NFP_FLOWER_CMSG_HLEN; count = msg_len / sizeof(struct nfp_flower_stats_frame); @@ -257,7 +257,7 @@ nfp_flower_cmsg_rx_qos_stats(struct nfp_mtr_priv *mtr_priv, struct nfp_mtr *mtr; struct nfp_mtr_stats_reply *mtr_stats; - msg = rte_pktmbuf_mtod(mbuf, char *) + NFP_FLOWER_CMSG_HLEN; + msg = rte_pktmbuf_mtod_offset(mbuf, char *, NFP_FLOWER_CMSG_HLEN); mtr_stats = (struct nfp_mtr_stats_reply *)msg; profile_id = rte_be_to_cpu_32(mtr_stats->head.profile_id); -- 2.39.2