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 4215745B13; Fri, 11 Oct 2024 16:45:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3534140651; Fri, 11 Oct 2024 16:45:36 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 275354060F for ; Fri, 11 Oct 2024 16:45:34 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728657933; 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=0rrcQ7S7cSJAg+XVSySPnzA8iKmSLpzuP+NcL4q6B54=; b=LkAj08CHaKea5yipwRNXbJZxswQzLWCwzPejvllxFsAvTT7NTslDvWAF6se6o6B4z1iO53 Dy4RtIkbR8UNh9fBN0lKBwSFnSkyCsq9uvSt56hjrQKn1FKe8J4dV9rK6HQzyRxwo8MbB9 OGAnmbdx8U2eOrFTj6BL665vHpo0ou4= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-446-zBLXTphTPsGtA87U02lxbQ-1; Fri, 11 Oct 2024 10:45:32 -0400 X-MC-Unique: zBLXTphTPsGtA87U02lxbQ-1 Received: by mail-lj1-f199.google.com with SMTP id 38308e7fff4ca-2f75cf9472dso18896931fa.3 for ; Fri, 11 Oct 2024 07:45:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728657931; x=1729262731; 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=0rrcQ7S7cSJAg+XVSySPnzA8iKmSLpzuP+NcL4q6B54=; b=eRsKjcgNoUXiUvIjTX9Rm2BNfWAP9h4tU1tD0ct0b9/bfhypzFdDA4aYgHHaBNHrSG EEHCUuHOR6gz8Z/iL1ycbArhVophb4kwlAz2MsYJnj/+In4EMkEz7dE9bUPzLlem6lDn ol7gVZ9EPPAbwuovUF2Ze7W+HDGDIChzKjqyOrmlPCyrQuX5XiM+y2WPf+npeQG7HY9i ZxgOTPUlmNUlE7iuqO5I2A2uLjFImsBRtA64JxFw9rY8wdoKperIkUfOmdEUpJsBXI8Z v66czbE/P4B9h2wazOOyNHG9KIRF7I1kIAEodan88C5y5DOwARUpuW4mo3HWKZ6QEdHW nnxg== X-Gm-Message-State: AOJu0Yw3M607ywWBC28Meg3pOpVLYzsBs9kBhaQAPGXmFJj/qhMORWfZ 7I6w2Odw/ALwUjb30C5Kowy65efSdOoePXqPB9js+zNvgayqTnKtb4OSQQPOKuuhKYpVYy+zy6B vz6F9A9SKg8UTAzNaIr8XDk2PrpoLbskW5urmmW6vXYd2Ly2hhwz8MFVd0hofB0W96ZSdTkKGym +I+kOvoqm1E6FACpPd2UQCECB9LQ== X-Received: by 2002:a2e:b8cb:0:b0:2f7:7ef7:7434 with SMTP id 38308e7fff4ca-2fb32b00b14mr14266971fa.37.1728657930920; Fri, 11 Oct 2024 07:45:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE4wMO6Kcxs4FRYNFmJod3mEGkFcZ7nOf45MX+WxtnVs8YUlqhl0juMFl3oKE2r1M6EklWdjaqUwPHbv389Qlw= X-Received: by 2002:a2e:b8cb:0:b0:2f7:7ef7:7434 with SMTP id 38308e7fff4ca-2fb32b00b14mr14266801fa.37.1728657930451; Fri, 11 Oct 2024 07:45:30 -0700 (PDT) MIME-Version: 1.0 References: <20240930092750.168280-2-rjarry@redhat.com> In-Reply-To: <20240930092750.168280-2-rjarry@redhat.com> From: David Marchand Date: Fri, 11 Oct 2024 16:45:19 +0200 Message-ID: Subject: Re: [PATCH dpdk v7] graph: expose node context as pointers To: Robin Jarry Cc: dev@dpdk.org, Jerin Jacob , Kiran Kumar K , Nithin Dabilpuram , Zhirun Yan X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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, Sep 30, 2024 at 11:28=E2=80=AFAM Robin Jarry wr= ote: > > In some cases, the node context data is used to store two pointers > because the data is larger than the reserved 16 bytes. Having to define > intermediate structures just to be able to cast is tedious. And without > intermediate structures, casting to opaque pointers is hard without > violating strict aliasing rules. > > Add an unnamed union to allow storing opaque pointers in the node > context. Unfortunately, aligning an unnamed union that contains an array > produces inconsistent results between C and C++. To preserve ABI/API > compatibility in both C and C++, move all fast-path area fields into an > unnamed struct which is itself cache aligned. Use __rte_cache_aligned to > preserve existing alignment on architectures where cache lines are 128 > bytes. > > Add a static assert to ensure that the fast path area does not grow > beyond a 64 bytes cache line. > > Signed-off-by: Robin Jarry > Acked-by: Kiran Kumar Kokkilagadda Applied, thanks. --=20 David Marchand