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 E26E743D47; Mon, 25 Mar 2024 16:52:00 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 857AD40695; Mon, 25 Mar 2024 16:52:00 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 1975940298 for ; Mon, 25 Mar 2024 16:51:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711381917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H3hevJNOrN6xHeJObOYx5TCUjRyxuuifeHUeiQcdYHc=; b=QDRv61fKK1Pcg6zOfHE4e26EHfAke4690G4xuiCzBfkvAfVpeMNJIJPGY/6ZHXJ7BHJb0l XzekKWGB9UBThfpJVBgCsR1EdcsAOpHuXO4vpICxLE8iIJiM2jNkLheOPEweYzZvVljVEE tVXb3QbOWwYeiLEG1gxSiBHjvmjW1ZA= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-385-XemNcFaAMDeKPTO8ZPx_xg-1; Mon, 25 Mar 2024 11:51:54 -0400 X-MC-Unique: XemNcFaAMDeKPTO8ZPx_xg-1 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4148c5f08d3so1162035e9.1 for ; Mon, 25 Mar 2024 08:51:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711381913; x=1711986713; h=in-reply-to:references:user-agent:cc:subject:to:from:message-id :date:content-transfer-encoding:mime-version:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=H3hevJNOrN6xHeJObOYx5TCUjRyxuuifeHUeiQcdYHc=; b=s0pkSvEFk1SJgZxMjvB6ggUDa8D0nfTcsNJ88IjRFrABSowSWqjnyou80EK32YiWR0 3thNoGdOuIXZD5TPHkuRmV7Y0r2i3e8ul1qO9uC6hsYtbuN9U0Sy1N/KKbrA6itfP6eZ b1NeMf/MGfr20RWvdjqH5WTg7rbfkAwLnswvXZmnjV/SQbZAJVLq7lv8AUIIYemdnQlD psTjrMNW4ynusM12+m9ZlNxuGDc6O4+RRRFyKTRBe3JOLo9yTxbGgOIuVJqBWKeD0BQi uDz/G3j/lchN5wWCYErWkRC6xv60hXj0STftR5gCk3XpolvxOrLzEHNGnSI9PQOn//AB nnag== X-Gm-Message-State: AOJu0Ywz3REmZkVWN/ZPzfl579o1mObKrUarcnjdJFYhq61gFjLWr59f uKdZ8jhbOm636X5/e3c4g+UNeBFT5Ow6+56cbUFFFlkLIWpQuTln+LhKwmWnXBU3uLdS9uiyb4m XezV8Rdyx9yMH+SsB2gjhdN2YScRFUun7C7pkuqvy X-Received: by 2002:a05:600c:1986:b0:413:1f65:ec19 with SMTP id t6-20020a05600c198600b004131f65ec19mr5707101wmq.37.1711381913035; Mon, 25 Mar 2024 08:51:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEA6Bgb0b1E/n2Al5HDvBme1bB8BB8AIubv3me7o09RmqfI5qEJPmWQ+A/LfTFAWAALdauc7A== X-Received: by 2002:a05:600c:1986:b0:413:1f65:ec19 with SMTP id t6-20020a05600c198600b004131f65ec19mr5707086wmq.37.1711381912679; Mon, 25 Mar 2024 08:51:52 -0700 (PDT) Received: from localhost (2a01cb000f8b9700598da2e1679e8383.ipv6.abo.wanadoo.fr. [2a01:cb00:f8b:9700:598d:a2e1:679e:8383]) by smtp.gmail.com with ESMTPSA id p34-20020a05600c1da200b004148ab64f29sm2255325wms.18.2024.03.25.08.51.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Mar 2024 08:51:52 -0700 (PDT) Mime-Version: 1.0 Date: Mon, 25 Mar 2024 16:51:51 +0100 Message-Id: From: "Robin Jarry" To: "Jerin Jacob" Subject: Re: [PATCH v3] graph: expose node context as pointers Cc: , "Jerin Jacob" , "Kiran Kumar K" , "Nithin Dabilpuram" , "Zhirun Yan" , "Tyler Retzlaff" User-Agent: aerc/0.17.0-81-gd2764918eb55 References: <20240325100500.694748-2-rjarry@redhat.com> In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8; format=Flowed 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 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=20 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] =3D p; } static inline void rte_node_ctx_ptr2_set(struct rte_node *n, void *p) { ((void **)node->ctx)[1] =3D p; } I don't have a strong opinion. I'll go either way.