From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC5E4A0526; Mon, 20 Jan 2020 21:43:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D066E1C01F; Mon, 20 Jan 2020 21:43:52 +0100 (CET) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id D44261C00D for ; Mon, 20 Jan 2020 21:43:51 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id f20so328025plj.5 for ; Mon, 20 Jan 2020 12:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U0ZefJfpHTUO34my8OB54g4gpmp7kho7W1D9n320r8M=; b=mg+8jel1Og9X2WbEnfbWR0au3eW+ANlyi8W9p76xfdM+WBmjT3E8RTIVcWvygELFZA SkopTCprJy4HenxJFxCy0/IN8nULCnHm5Lr28+EVI2mwPctZiCrgPblHRs4qzXIxQ+wa 9J8foyKx4aC/SVN75B7K8z3/NaT875oRy8LaeCCKtWDHCnvlrxSLNsuGErsmhqmN9QVR rrJq8nUkPouJ82vnZBGQD1iY1Jq+wCeUMaaA4RPkmniOGZBnhOsxNbyJfPrvLE3uhtsj HSoxMrmMB9iYoKTMscIk3rQV2/RNc1NHb1hNRAxPHG/lxM7/Ij7LwkXqaUaQqCVGr2y7 khhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U0ZefJfpHTUO34my8OB54g4gpmp7kho7W1D9n320r8M=; b=ARaRCPFztuY2YXnJ5eSnD1m0p7dY6FtTJ2JDLYKgO0/T1Hlwr/w6r1sghPJek38Fb4 PeCc9Czcn0XMPQv5WeRdb1NrMXjVbTQJRofwNvCnNhn9b9S03nLgA+zdL9tXRdRCivcR OZH4TvwwYMQKmudzGZUjPeAUlZVByLVhZKqbqlf9s+s0gv4z5/2iErnxEd2eoY//izzb fNty5qDvbqjP7pQfmjV0iRwr84yEZnDjxygNMxRkaaZ4VKhHGL6ihxOXD0m0yMqtdN/a d1DAxYWApxJcR+ADHaPmEqKC9hv+1HB6KUKxqKwjweLZlPnYbKfd6gZL5xog9fmMIEx/ HGZw== X-Gm-Message-State: APjAAAVaHevEHXTw7MkGheTKqNmjYkUCmt6xXJgUppagWkH+EZQ98ytX OExkw/t0LSs/oOD8B1hP8j2Uv7lo/vg= X-Google-Smtp-Source: APXvYqwUQBadoY7isurSQ7taNotdqXkUGOyLReuJ+QeEASKz3tnXnyBJeYOPhwdWqDKp4qjaWGnL1Q== X-Received: by 2002:a17:902:bd07:: with SMTP id p7mr1507806pls.120.1579553030904; Mon, 20 Jan 2020 12:43:50 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 12sm40974609pfn.177.2020.01.20.12.43.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 12:43:50 -0800 (PST) Date: Mon, 20 Jan 2020 12:43:42 -0800 From: Stephen Hemminger To: Viacheslav Ovsiienko Cc: dev@dpdk.org, matan@mellanox.com, rasland@mellanox.com, orika@mellanox.com, shahafs@mellanox.com, olivier.matz@6wind.com, thomas@mellanox.net Message-ID: <20200120124342.6b308e18@hermes.lan> In-Reply-To: <1579541003-2399-2-git-send-email-viacheslavo@mellanox.com> References: <20191118094938.192850-1-shahafs@mellanox.com> <1579541003-2399-1-git-send-email-viacheslavo@mellanox.com> <1579541003-2399-2-git-send-email-viacheslavo@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 1/5] mbuf: introduce routine to get private mbuf pool flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Mon, 20 Jan 2020 17:23:19 +0000 Viacheslav Ovsiienko wrote: > The routine rte_pktmbuf_priv_flags is introduced to fetch > the flags from the mbuf memory pool private structure > in unified fashion. > > Signed-off-by: Viacheslav Ovsiienko > Acked-by: Olivier Matz > --- > lib/librte_mbuf/rte_mbuf.h | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h > index 2d4bda2..9b0691d 100644 > --- a/lib/librte_mbuf/rte_mbuf.h > +++ b/lib/librte_mbuf/rte_mbuf.h > @@ -306,6 +306,23 @@ struct rte_pktmbuf_pool_private { > uint32_t flags; /**< reserved for future use. */ > }; > > +/** > + * Return the flags from private data in an mempool structure. > + * > + * @param mp > + * A pointer to the mempool structure. > + * @return > + * The flags from the private data structure. > + */ > +static inline uint32_t > +rte_pktmbuf_priv_flags(struct rte_mempool *mp) > +{ > + struct rte_pktmbuf_pool_private *mbp_priv; > + > + mbp_priv = (struct rte_pktmbuf_pool_private *)rte_mempool_get_priv(mp); > + return mbp_priv->flags; > +} > + > #ifdef RTE_LIBRTE_MBUF_DEBUG > > /** check mbuf type in debug mode */ Looks fine, but a couple of minor suggestions. Since this doesn't modify the mbuf, the arguments should be const. Since rte_mempool_get_priv returns void *, the cast is unnecessary.