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 BB10C43D47; Mon, 25 Mar 2024 16:56:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C85B402AF; Mon, 25 Mar 2024 16:56:40 +0100 (CET) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) by mails.dpdk.org (Postfix) with ESMTP id 0AF6A40298 for ; Mon, 25 Mar 2024 16:56:39 +0100 (CET) Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-4316101ed5eso2050411cf.2 for ; Mon, 25 Mar 2024 08:56:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711382198; x=1711986998; darn=dpdk.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=G4nf4i6DmuA6Cbf1FvAwF7Mibi6W+So/CmE4WloW3F8=; b=J/CS3GgSA3UTz4N0kzx3lt3e6QQultWzmkkRgPSc1ynmtnry9XtbuSHw4A4lwpG3K4 RySJQxiIXVtkZlPCOWJc092uUqaxc6K8HxTrPBHpTKWY/JhNDZM6oCyKsiiD5PHp9WWy uV2Iottg4WFxW7WHl6PjanQlltyx6pzVDb30XehSN7riYedxSCd1sInsuW9f0AvMOZ9i pf0uGqs3vRjUUzBS2QHe64f10vFtY6i5x/rAXtyx3sOKUs3b1g5e3bB+r9dBHP7ohs1J VlbG1ozpYYsDEeI/qZcIV5GTV1MYOoMpk3VGPigQqnMBybpzKtsR02f9662h3IY7R5RP 4JCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711382198; x=1711986998; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G4nf4i6DmuA6Cbf1FvAwF7Mibi6W+So/CmE4WloW3F8=; b=MTznMZI46tXCDVd0oLahZX3rN9XURSlgDFx0dvPoC3HZlG1WT4zj1/Exj5MItPWjaT 2WtHcKjkTN3JKlmvz/EMHUCHGtc1fyqPZJ8lY/t5/HMwuldR0bOdpf9Uq7ppTV8LKdAc HlX/XXfV20pxxjMo2nWvpjYZnnDSmxmMxwPTDUXkYcURD52S3dDr10+XlQRFfA8mSoJV lL+BActZeL1wlExunHvruUjcwSd5CZGEz/Cu3OPDHxVqqyDIqjJNzpoIESqtBAO2vMrI Gzu3nvfmY5Sd6jqLD1osi0ghImcNi6EmSAfKgvDPg7GGsDGt4M416tW8uuh9HS6wwwqL bZWQ== X-Gm-Message-State: AOJu0YyTnHQHIJ7T9WRm9o4wPJO3ppb1WVw0NT5Lyz7QFbObQ3zuTXIz Gwbna/++OPNT0tJnXat+VWgSZ7sEBww40V9i8pep7U2x0Lsox6hmOxnFv+sctf5bhhbVt6L70zj Fqhq4dMuVtmfk3TsUVTMaTx/mp5M= X-Google-Smtp-Source: AGHT+IFmxDqPAflnC6BuaE6MtrYpcSTL/HZuguqY2ovJAP1Bq9ISAPkM6eFGmO93Jgc1k7X4YyNUBCeaZ4HeWK9X08w= X-Received: by 2002:ac8:7d82:0:b0:431:4570:b18c with SMTP id c2-20020ac87d82000000b004314570b18cmr7606311qtd.43.1711382198309; Mon, 25 Mar 2024 08:56:38 -0700 (PDT) MIME-Version: 1.0 References: <20240325100500.694748-2-rjarry@redhat.com> In-Reply-To: From: Jerin Jacob Date: Mon, 25 Mar 2024 21:26:12 +0530 Message-ID: Subject: Re: [PATCH v3] graph: expose node context as pointers To: Robin Jarry Cc: dev@dpdk.org, Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan , Tyler Retzlaff Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 On Mon, Mar 25, 2024 at 9:21=E2=80=AFPM Robin Jarry wro= te: > > 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] =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. Inline is better. >