From: Jerin Jacob <jerinjacobk@gmail.com>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org, Jerin Jacob <jerinj@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Zhirun Yan <yanzhirun_163@163.com>,
Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: Re: [PATCH v3] graph: expose node context as pointers
Date: Mon, 25 Mar 2024 21:26:12 +0530 [thread overview]
Message-ID: <CALBAE1Pm9=z5pBEsU49_TLC3RcNzWmBWt4dSo1ww55vYBzFBsw@mail.gmail.com> (raw)
In-Reply-To: <D02Y98QXA9AZ.1IN1LPJK1B99D@redhat.com>
On Mon, Mar 25, 2024 at 9:21 PM Robin Jarry <rjarry@redhat.com> wrote:
>
> Jerin Jacob, Mar 25, 2024 at 16:47:
> > > #define RTE_NODE_CTX_PTR1(n) ((void **)(n)->ctx)[0]
> > > #define RTE_NODE_CTX_PTR2(n) ((void **)(n)->ctx)[1]
> >
> > Works for me. No strong opinion about the name, RTE_NODE_CTX_AS_PTR1
> > may be more reflecting the intent.
>
> I also thought about adding inline getter/setter functions but that's
> more code. It may be cleaner:
>
> static inline void *rte_node_ctx_ptr1_get(struct rte_node *n) {
> return ((void **)node->ctx)[0];
> }
> static inline void *rte_node_ctx_ptr2_get(struct rte_node *n) {
> return ((void **)node->ctx)[1];
> }
> static inline void rte_node_ctx_ptr1_set(struct rte_node *n, void *p) {
> ((void **)node->ctx)[0] = p;
> }
> static inline void rte_node_ctx_ptr2_set(struct rte_node *n, void *p) {
> ((void **)node->ctx)[1] = p;
> }
>
> I don't have a strong opinion. I'll go either way.
Inline is better.
>
next prev parent reply other threads:[~2024-03-25 15:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 10:05 Robin Jarry
2024-03-25 10:59 ` Jerin Jacob
2024-03-25 11:02 ` Robin Jarry
2024-03-25 11:08 ` Jerin Jacob
2024-03-25 11:15 ` Robin Jarry
2024-03-25 11:35 ` Jerin Jacob
2024-03-25 12:07 ` Bruce Richardson
2024-03-25 12:08 ` David Marchand
2024-03-25 15:20 ` Robin Jarry
2024-03-25 15:47 ` Jerin Jacob
2024-03-25 15:51 ` Robin Jarry
2024-03-25 15:56 ` Jerin Jacob [this message]
2024-03-25 16:31 ` [PATCH v4] " Robin Jarry
2024-03-25 16:50 ` Jerin Jacob
2024-03-27 9:14 ` [PATCH v5] " Robin Jarry
2024-05-29 17:54 ` Nithin Dabilpuram
2024-06-18 12:33 ` David Marchand
2024-06-25 15:22 ` Robin Jarry
2024-06-26 11:30 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CALBAE1Pm9=z5pBEsU49_TLC3RcNzWmBWt4dSo1ww55vYBzFBsw@mail.gmail.com' \
--to=jerinjacobk@gmail.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=rjarry@redhat.com \
--cc=roretzla@linux.microsoft.com \
--cc=yanzhirun_163@163.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).