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 2FF7142AE5; Fri, 12 May 2023 14:00:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C82A042D1A; Fri, 12 May 2023 14:00:16 +0200 (CEST) Received: from mail-vk1-f181.google.com (mail-vk1-f181.google.com [209.85.221.181]) by mails.dpdk.org (Postfix) with ESMTP id 420F440041 for ; Fri, 12 May 2023 14:00:15 +0200 (CEST) Received: by mail-vk1-f181.google.com with SMTP id 71dfb90a1353d-44faec9af51so3169624e0c.1 for ; Fri, 12 May 2023 05:00:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683892814; x=1686484814; 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=JO2iKVr1kvlnTprHRjkLyDihQmxPcfGlJsWneVSe1FA=; b=QE7zqcAMkAF6/wgQJRhN/jyr2Mh0OHb14qhELYn25Zn0b64waA3+iouyhwPJmRSz1c +DnOGfqqO7HgamW0Jx/pvgRuUHXdEpoVVilJA985+qz2yhzy18rcUEldKyw8OPs9hpL4 KVjXOm9Oeh2SYQ44lg8lQkyhEeC8ZhlzmLtFsODdVGAASMun6W9/0Ayj/3tJLyVwalij oWIttQzfsBFrNQ+42nBjHxIS75AL/LV/sftOSasrKW9VmtwCHqHsUR9gAazRvCAw18jb GxWshYx14O06ZrEhmY4A+EFRQ1neuntDF7FFWqAcofdKew/VrNGxXOCM+XpZpv5e6HDE i1gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683892814; x=1686484814; 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=JO2iKVr1kvlnTprHRjkLyDihQmxPcfGlJsWneVSe1FA=; b=DeJPUHboOQd2+TyEPAZ7O32BJsyLIQGnBtYmhTqNYGmHwziJaVVv9c66D31UlKNu59 z1xoLpMfuNod2Mwnbt033D6qUBckwlLk3yHz4LNiyQOoM0AvejQeFgLjVKLFuJmgd02o 7hDaeZvAanxqgl7aeN6QbNRbveFMkhMKHD/TEUPDeYs/dtXgzpWQ71MWKpVeOpFS8oWp DcdwpWMj+opFbwTyUuNRHx/Q7PwPbKVyrmivYhmL1K4uj432ozGFf1+MqdskDbM7XGlp Kcdx5ajsowP/u8Mhjz0Wyna12ygURQY2U7N5Pvp7/ZIof/Aewi7j91WeIyGIL8w+wHvy +4GQ== X-Gm-Message-State: AC+VfDwyFxX70G9w4HD+PZF7wF7lalM2rApC94tKiwDC0rOPTt4swuU/ naVfxoraz0PcRx5SIku1ULxr5g3z6lAfXiDLF7E= X-Google-Smtp-Source: ACHHUZ7uHp7BQtu+ZKee3xyfP8AH/+3P1VSq9rukAT+M+lZ9rKqo0zYviZsp6GpMF/SXHBw+itfRDSJ9NGge/YZ9l8s= X-Received: by 2002:a1f:5284:0:b0:453:8a02:8d9 with SMTP id g126-20020a1f5284000000b004538a0208d9mr1616335vkb.11.1683892814426; Fri, 12 May 2023 05:00:14 -0700 (PDT) MIME-Version: 1.0 References: <20230511081641.6693-1-mattias.ronnblom@ericsson.com> <20230511082415.6720-1-mattias.ronnblom@ericsson.com> In-Reply-To: <20230511082415.6720-1-mattias.ronnblom@ericsson.com> From: Jerin Jacob Date: Fri, 12 May 2023 17:29:48 +0530 Message-ID: Subject: Re: [PATCH v3] eventdev: avoid non-burst shortcut for variable-size bursts To: =?UTF-8?Q?Mattias_R=C3=B6nnblom?= Cc: jerinj@marvell.com, hofors@lysator.liu.se, dev@dpdk.org, =?UTF-8?Q?Morten_Br=C3=B8rup?= 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 Thu, May 11, 2023 at 2:00=E2=80=AFPM Mattias R=C3=B6nnblom wrote: > > Use non-burst event enqueue and dequeue calls from burst enqueue and > dequeue only when the burst size is compile-time constant (and equal > to one). > > Signed-off-by: Mattias R=C3=B6nnblom > > --- > > v3: Actually include the change v2 claimed to contain. > v2: Wrap builtin call in __extension__, to avoid compiler warnings if > application is compiled with -pedantic. (Morten Br=C3=B8rup) > --- > lib/eventdev/rte_eventdev.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h > index a90e23ac8b..a471caeb6d 100644 > --- a/lib/eventdev/rte_eventdev.h > +++ b/lib/eventdev/rte_eventdev.h > @@ -1944,7 +1944,7 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t p= ort_id, > * Allow zero cost non burst mode routine invocation if applicati= on > * requests nb_events as const one > */ > - if (nb_events =3D=3D 1) > + if (__extension__(__builtin_constant_p(nb_events)) && nb_events = =3D=3D 1) "Why" part is not clear from the commit message. Is this to avoid nb_events read if it is built-in const. If so, check should be following. Right? if (__extension__((__builtin_constant_p(nb_events)) && nb_events =3D=3D 1) || nb_events =3D=3D 1) At least, It was my original intention in the code. > return (fp_ops->enqueue)(port, ev); > else > return fn(port, ev, nb_events); > @@ -2200,7 +2200,7 @@ rte_event_dequeue_burst(uint8_t dev_id, uint8_t por= t_id, struct rte_event ev[], > * Allow zero cost non burst mode routine invocation if applicati= on > * requests nb_events as const one > */ > - if (nb_events =3D=3D 1) > + if (__extension__(__builtin_constant_p(nb_events)) && nb_events = =3D=3D 1) > return (fp_ops->dequeue)(port, ev, timeout_ticks); > else > return (fp_ops->dequeue_burst)(port, ev, nb_events, > -- > 2.34.1 >