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 AAB9B426CF; Fri, 6 Oct 2023 12:24:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 368CB402F2; Fri, 6 Oct 2023 12:24:55 +0200 (CEST) Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by mails.dpdk.org (Postfix) with ESMTP id 65497402A8 for ; Fri, 6 Oct 2023 12:24:53 +0200 (CEST) Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-419c16a4209so20606031cf.0 for ; Fri, 06 Oct 2023 03:24:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696587892; x=1697192692; 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=R7afF3Cwa6OjNSwDRwpTKhPIfFI/o9zhBQ4fRGeT4eM=; b=b7SJ5Zg7rbWZHKFVAB5PWM4o9/UwKdBFRmJU/+WVSdc8haAR3lgU8zuGX2EOMvYPan SJ7n2gUZUmPPL5V7Qp1Gss0g9TLixLAdeZbtEIqMsXSEqAhVFvdcylqtBnAM2kq0QPLJ gCYgykNZaBiPG5UegQ9MvW4eTNV9Bom4q++c36i0HIzSIf7U10nJmgOjKEkBY6/Fs5X8 1JoIo7rbZyqHCdUnqhXYWrFMtsqr/DwQZvlODFd0jJ9ObDMAqHCl40pMkOMjzvlRC+eQ TW2rCTWXkk9l7BnWSqX2Lh0I++nnOgBwzjo+sPELQBE1D61hyj+im0/kf20HKH8zL+Ly 0s7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696587892; x=1697192692; 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=R7afF3Cwa6OjNSwDRwpTKhPIfFI/o9zhBQ4fRGeT4eM=; b=ajvcav+6sIJJIpF8DzuR5g2S2ZMLRitfwS7RANH80bm8NXDI2NxePPO0jZKMTgarrL rpuLgAc58IMVdANXoM81QdzLxzjXAIvM8VhsmxAZbC3HzKi8Bps4DRmx+tg9ViFds6sG NgPTt223PAfaXkNNi6Hd8kj8LRqgAYB0Kw9O7RjKLHegsRkELAP09sE5pJk4Mo4TIeWV A4AX1lYcAh/8FqqPVt4VxOkbk+6kA2o8tH7IaFV4a5BdyyusvCRvR+JvMhmop8V3UNIS szxT7s1B4zKtubYdM8zlc5hEoVB1Wqclqscp7/sctje7acXfK7qyTbIIE3D53GvuuT5w EQCA== X-Gm-Message-State: AOJu0YwJeYBHuipZ0NXCZuSSSPDSjUUMLi/UsMs13fbX/3AH0/FEKVYH 5a3WDtudGILdxPLmdqk409tqCgpozagLX5LtvbE= X-Google-Smtp-Source: AGHT+IE7bwZZhJZ3QcrUHgfwzwc2x3ghvgUBpumQeA8uciAh3bzMNAzseNL/Q1VVgu3CG2Lut1QitAf7TzdRPCScBAo= X-Received: by 2002:a05:622a:1314:b0:417:f666:b780 with SMTP id v20-20020a05622a131400b00417f666b780mr6991792qtk.19.1696587892627; Fri, 06 Oct 2023 03:24:52 -0700 (PDT) MIME-Version: 1.0 References: <20231005115101.12276-1-bruce.richardson@intel.com> <20231006094527.73867-1-bruce.richardson@intel.com> <98CBD80474FA8B44BF855DF32C47DC35E9EF03@smartserver.smartshare.dk> In-Reply-To: From: Jerin Jacob Date: Fri, 6 Oct 2023 15:54:26 +0530 Message-ID: Subject: Re: [PATCH v3] eventdev: ensure 16-byte alignment for events To: Bruce Richardson Cc: =?UTF-8?Q?Morten_Br=C3=B8rup?= , dev@dpdk.org, Jerin Jacob 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 Fri, Oct 6, 2023 at 3:49=E2=80=AFPM Bruce Richardson wrote: > > On Fri, Oct 06, 2023 at 03:46:21PM +0530, Jerin Jacob wrote: > > On Fri, Oct 6, 2023 at 3:44=E2=80=AFPM Morten Br=C3=B8rup wrote: > > > > > > > From: Bruce Richardson [mailto:bruce.richardson@intel.com] > > > > Sent: Friday, 6 October 2023 11.45 > > > > > > > > The event structure in DPDK is 16-bytes in size, and events are > > > > regularly passed as parameters directly rather than being passed as > > > > pointers. To help compiler optimize correctly, we can explicitly re= quest > > > > 16-byte alignment for events, which means that we should be able > > > > to do aligned vector loads/stores (e.g. with SSE or Neon) when work= ing > > > > with those events. > > > > > > > > Signed-off-by: Bruce Richardson > > > > Acked-by: Morten Br=C3=B8rup > > > > Acked-by: Jerin Jacob > > > > > > > > --- > > > > > > [...] > > > > > > > +_Static_assert(sizeof(struct rte_event) =3D=3D 16, "Event structur= e size is not 16-bytes in size"); > > > > > > Thank you for adding this extra check. We should have more of these. > > > > Use existing RTE_BUILD_BUG_ON this on .c file instead of header file. > > > > Ok to move to a C file, but I think using static_asserts are better than > using the old macro tricks of negatively sized arrays. No strong opinion on the API. I just told because compatibility discussions came in. Key is to move to .c file. > > > > > > > NB: _Static_assert is deprecated in C23 [1], so for forward compatibi= lity, you could use static_assert (which is available in ) instea= d. Nice to have; feel free to ignore this comment. > > > > > > [1]: https://en.cppreference.com/w/c/language/_Static_assert > > >