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 126DB42A49; Fri, 5 May 2023 19:49:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4970D42D5C; Fri, 5 May 2023 19:48:27 +0200 (CEST) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 67DCF42D4B for ; Fri, 5 May 2023 19:48:25 +0200 (CEST) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-643a1656b79so763835b3a.3 for ; Fri, 05 May 2023 10:48:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683308904; x=1685900904; 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=tB0yBAZF1F4TQ+br375LdFfj7TlXtW6aZGw/PgHkuyXUBU3tXsut83Q6j1qAYxrvBx ZeuQrMZKV6DAff+jvLi5toIsAWLO0qgNBGFxJgkqZKi18ZC7DKVOVGjK7DU7DraBYH9/ QuWrWytk6DrZxXbyTUwAvc1Ty1LH/b3KeTnV39nz56TTyzsigYxr7hsSWr2DlWBZJvko O7DfKkp2dTejLJGT3MbtQFYoIFBtbqMYPvP1NAOEyhAkdAerUwmDvskE/fTS6U5hfjC4 m8qHFVXYZX+1sQf6nM43h1NCx9Z9h0flqmAE9W2Yq4PEygLOiWIgABiZyriP80GDOify rfnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683308904; x=1685900904; 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=XR4dGnw6BhtpidnkReKmsXDyVgF57DbsZE+IBf7AowS3nv/88dHz4Cb+I1GZzyPBfS QnIVsUMhwTGwgXERNMcW9fyru4dscCMOip1faxz3yyJxTWTmmfQB+usnLh238vjy/V52 +C7H8Gcfg5f5wZ1fj2IpDWL8ysMd42HPNPgPyGIXMmJ6Pdw9DxXFjZlRh7OEggXLpoj7 piYICKKCjBc+eExj4sdpFWCkj7n+rYeeRgcqMlrQwIN11J7iAxI7Gy47Tz5RVdXtcipy eoaXPyCOJ4NeEd1VXtJmkvlCgcqLUFTFoPUX4RcWVJtzZdUpvOI9pzMOB0o+keqEty1u gvYg== X-Gm-Message-State: AC+VfDwTs4J99KKrEzVRga1abqT9aX2Np72/Iv1/emKu2SF327+w5TYU l3Ks33HOi0wG9ZKbnfKKQoWZ6M+mktw25AuducJc1w== X-Google-Smtp-Source: ACHHUZ4tuaX/MsRF8fkiVCn6xq4nXydCchwIpjwPmTbTPBo3tvu1b30BIzFwQqh4iT0N8ziXicVKCg== X-Received: by 2002:a05:6a00:179b:b0:63b:62d1:d868 with SMTP id s27-20020a056a00179b00b0063b62d1d868mr3573558pfg.8.1683308904417; Fri, 05 May 2023 10:48:24 -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.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 10:48:23 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Chaoyong He , =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH 07/14] net/nfp: use rte_pktmbuf_mtod_offset Date: Fri, 5 May 2023 10:48:06 -0700 Message-Id: <20230505174813.133894-8-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 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