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 960A2426CF; Fri, 6 Oct 2023 12:16:51 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3A7FB402A8; Fri, 6 Oct 2023 12:16:51 +0200 (CEST) Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) by mails.dpdk.org (Postfix) with ESMTP id 0D4CA4014F for ; Fri, 6 Oct 2023 12:16:50 +0200 (CEST) Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-59f57ad6126so22470477b3.3 for ; Fri, 06 Oct 2023 03:16:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696587409; x=1697192209; 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=GlFYf+pEv9/oC49oXaT9S6QBFsnOVgKaD9HETbtDiRY=; b=Ki1toDqlAijHmZRi1uUczRj3SRAgjAoSzAnR1G8lM/dAcDoyaHY8CY4N/idnUjGq+z bzye6ppfHdcj8Za48s1XK8M8E32gmLKVZ1l4Acmcz4MjWxE9pQzk7HPMdjqjoFdOhvJq 4zZIlyH68Wai6BdVmW1hbRRo/Da3cLrsymJQUIsZCNKPQH0mciU8VZsUaX4PakwIcKzp 7QQ9fjx649TON7Y8mLIJhmAaA/8H8KDy2gYXn1HHD3EAYScKxmM/5T3f/Fz52UWvYzjo sjo9LkI2402kUG5aDKASQlm4FwlaP14Lihwoos0FOIL2lEalg7M2j7aMm/ahAjDqetCS uzwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696587409; x=1697192209; 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=GlFYf+pEv9/oC49oXaT9S6QBFsnOVgKaD9HETbtDiRY=; b=B6J8wOsm0fwymausZoe8u/pHkkdRQ5nHJR68EVHDyGd99MXEyTWtIj/bMr8wXVFpzT fgEMTmM4AyTPUjipSp/xy2Y5ZoKUIAu8eHa37y7HfFwqClT+33BQOxWR+Ja3vwJF4FQV LtpbSuIzUl0hWJs+UeIKRZ9b3lfBWIiWBkCATpQjZ1sknKMWjvb66tlH+tJ52mr3xYUJ Zlu3hiA9HHhCDX8lDEZpHrfnMTqkWxPI5RucdVgL+9jSdw6QAa1/HI7S3cjbuzZZ4C1q jpbJjlFFDWfopks5jRGyF5r0CCFICXYMzy/4xZnbe8fqaCLubKapyV4B1oBQJLCVrC42 OsQQ== X-Gm-Message-State: AOJu0Ywq5uo8obG/KwyU2dUREqnW0rbFRA5Q6UCTv0HAWrcaqb2f3liq DCeRWvyd9/JBnP+FEji58IC0yU0jnOQEePjDsyQ= X-Google-Smtp-Source: AGHT+IHEpxyeqbVglwOEPSYqeabfa6owVU6zLjOAsI5O2ZUasmlmZnBHBrsmB1mqktL6nZAXwnNN2AujlwEG3urNm7w= X-Received: by 2002:a0d:d608:0:b0:5a0:5c65:1d3d with SMTP id y8-20020a0dd608000000b005a05c651d3dmr9029286ywd.19.1696587409317; Fri, 06 Oct 2023 03:16:49 -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: <98CBD80474FA8B44BF855DF32C47DC35E9EF03@smartserver.smartshare.dk> From: Jerin Jacob Date: Fri, 6 Oct 2023 15:46:21 +0530 Message-ID: Subject: Re: [PATCH v3] eventdev: ensure 16-byte alignment for events To: =?UTF-8?Q?Morten_Br=C3=B8rup?= Cc: Bruce Richardson , 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: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 reques= t > > 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 working > > 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 structure si= ze 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. > > NB: _Static_assert is deprecated in C23 [1], so for forward compatibility= , you could use static_assert (which is available in ) instead. N= ice to have; feel free to ignore this comment. > > [1]: https://en.cppreference.com/w/c/language/_Static_assert >