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 32E7843FA7; Mon, 6 May 2024 12:43:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EC7C0402C2; Mon, 6 May 2024 12:43:41 +0200 (CEST) Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) by mails.dpdk.org (Postfix) with ESMTP id 3F588402B9 for ; Mon, 6 May 2024 12:43:40 +0200 (CEST) Received: by mail-oi1-f175.google.com with SMTP id 5614622812f47-3c96bf898bdso541357b6e.2 for ; Mon, 06 May 2024 03:43:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714992219; x=1715597019; darn=dpdk.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sIqUcjWyjg4ZCbMd8rdyy7NfE9WQ4AKA7bxCctfncl0=; b=TkSLo6nPC4dCuRjwUG+hDYSA0zR6BJrSlP0DjQPy6JsA0jPs73xrU7aW1wvJqr59wz omtj7/jzLuJBSiT2AiX2DnsF7vKl8jtcrx/djqjqdbq7xcMrsoM7ud9tDNDNI4DqIIe7 aT8Aei7t8A9IUyx8gJYTxp8j1ZF09KhMcPodNXWz03mEdQ677nAJcO/Ls4QG5aLFviug A6oZipHHNi9WCnQ73QIxgYaJO5/j9LPhAsWcQxBy6hkkIkE6cZt2hnfPGcoxz1y82iSr wN6smB9pZRIhueEDmjwyZwZl+QSKK6AdkfMNhCTqxaExFmdsH4D/LW80RPDWTugYLhCJ is5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714992219; x=1715597019; h=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=sIqUcjWyjg4ZCbMd8rdyy7NfE9WQ4AKA7bxCctfncl0=; b=eQ8JNDz8jYj+Sm2yNwNqyUE3HTtOKEsNPteN4q3t9zX5BloXRxrg5ImLKFZ6nY2gIK TxaYkvqg7wXj2C3A02lgCDyX9e3uryKaOL4rx4JGXht3cT/7GcBcQjnc4XlNoDHH9WVd lJrGsoKJeF7ckM7jDYLGEzJc/MmPlj2wWqfWt/vGrgWCQKGZjepYZYgue+C0fC0TGskb mgVe17qHigtE/fHitg3yi3AnjehE2EoC2azt29t0KRgwSC7XLn4KvoAPhGXXUUWkRSlb iTyKD0INg0D/38FhWY3nLezAcDmqvrBqmkMTzdB9eUrhChZyDcwVHhbwzssUfipxLpgM iCHQ== X-Gm-Message-State: AOJu0Yzc5HlvlA1yvRdAHs4oZ4nxN7o7skrSfFLpNmHQhLx/AmCRKJ51 i88Zy78NDjnvTz0ObxHqmripZL24KuSXwJS7iKLtBKJkDrlQ26Et43iIeQRWez7XDlGuMabWyOP PR89Z3KQ1o3XXaD1tvynMPrLpww8= X-Google-Smtp-Source: AGHT+IHDZ/dZeTMyfw4uwXKSON3Bqhu8OMrHPn+xvURKccSEbhtmzuCozKUOzo8rKcFav4bVlsqpi/RWS99zvftPxrw= X-Received: by 2002:a05:6870:c78e:b0:22e:b354:f5ee with SMTP id dy14-20020a056870c78e00b0022eb354f5eemr8383435oab.15.1714992219115; Mon, 06 May 2024 03:43:39 -0700 (PDT) MIME-Version: 1.0 References: <20240504191837.1096185-1-aomeryamac@gmail.com> <20240505092059.69486f4e@hermes.local> <20240505133836.4711bad3@hermes.local> In-Reply-To: <20240505133836.4711bad3@hermes.local> From: =?UTF-8?B?QWJkdWxsYWggw5ZtZXIgWWFtYcOn?= Date: Mon, 6 May 2024 13:43:31 +0300 Message-ID: Subject: Re: [PATCH v3] devtools: add .clang-format file To: Stephen Hemminger Cc: dev@dpdk.org Content-Type: multipart/alternative; boundary="000000000000035c9f0617c6bea1" 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 --000000000000035c9f0617c6bea1 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, May 5, 2024 at 11:38=E2=80=AFPM Stephen Hemminger < stephen@networkplumber.org> wrote: > On Sun, 5 May 2024 22:42:57 +0300 > Abdullah =C3=96mer Yama=C3=A7 wrote: > > > > Also, this looks wrong. The initialized arrays looked better before. > > > > > > > > > -static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] =3D { > > > - "UNKNOWN", "TUN", "TAP" > > > -}; > > > +static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] =3D {"UNKNOWN", > "TUN", > > > "TAP"}; > > > > > > -static const char *valid_arguments[] =3D { > > > - ETH_TAP_IFACE_ARG, > > > - ETH_TAP_REMOTE_ARG, > > > - ETH_TAP_MAC_ARG, > > > - ETH_TAP_PERSIST_ARG, > > > - NULL > > > -}; > > > +static const char *valid_arguments[] =3D {ETH_TAP_IFACE_ARG, > > > ETH_TAP_REMOTE_ARG, ETH_TAP_MAC_ARG, > > > + ETH_TAP_PERSIST_ARG, NULL}; > > > > > > > I am confused about these variables. tuntap_types list values in a > single > > line, but valid_arguments' values are listed separately. > > So, it is getting more complex to handle both of them. What should we d= o, > > do you have any idea? > > Ignore the initialized lists for now. It should be possible to have it > generate something > like > > static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] =3D { > "UNKNOWN", "TUN", "TAP" > }; > > With the following changes result looks better. You got the format wrong > for the ForEach list. > > diff --git a/.clang-format b/.clang-format > index 16164ef1de..d16185c049 100644 > --- a/.clang-format > +++ b/.clang-format > @@ -1,12 +1,20 @@ > --- > BasedOnStyle: LLVM > > +AttributeMacros: > + - __rte_aligned > + - __rte_packed > + - __rte_may_alias > + - __rte_deprecated > + - __rte_weak > + - __rte_unused > + - __rte_restrict > + > # Place opening and closing parentheses on the same line for control > statements > BreakBeforeBraces: Custom > BraceWrapping: > - AfterFunction: false > + AfterFunction: true > AfterControlStatement: false > - AfterEnum: false > > These are ok for me. > # Set maximum line length to 100 characters > ColumnLimit: 100 > @@ -41,98 +49,117 @@ AlwaysBreakAfterReturnType: TopLevelDefinitions > # Always break before multiline string literals > AlignEscapedNewlines: Left > > -# Foreach macros > In the clang documentation, it says "ForEachMacros (List of Strings)" and gives an example: "ForEachMacros: ['RANGES_FOR', 'FOREACH']" > ... > +ObjCSpaceAfterProperty: true > +IndentGotoLabels: false > These are also ok for me. If you agree on the for-each part, then I will send the new patch. Thanks --000000000000035c9f0617c6bea1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, May 5, 2024 at 11:38=E2=80=AF= PM Stephen Hemminger <step= hen@networkplumber.org> wrote:
On Sun, 5 May 2024 22:42:57 +0300
Abdullah =C3=96mer Yama=C3=A7 <aomeryamac@gmail.com> wrote:

> > Also, this looks wrong.=C2=A0 The initialized arrays looked bette= r before.
> >
> >
> > -static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] =3D {
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0"UNKNOWN", "TUN",= "TAP"
> > -};
> > +static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] =3D {"= UNKNOWN", "TUN",
> > "TAP"};
> >
> > -static const char *valid_arguments[] =3D {
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0ETH_TAP_IFACE_ARG,
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0ETH_TAP_REMOTE_ARG,
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0ETH_TAP_MAC_ARG,
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0ETH_TAP_PERSIST_ARG,
> > -=C2=A0 =C2=A0 =C2=A0 =C2=A0NULL
> > -};
> > +static const char *valid_arguments[] =3D {ETH_TAP_IFACE_ARG,
> > ETH_TAP_REMOTE_ARG, ETH_TAP_MAC_ARG,
> > +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0ETH_TAP_PERSIST_ARG, NULL};
> >=C2=A0
>
> I am confused about these variables.=C2=A0 tuntap_types list values in= a single
> line, but valid_arguments' values are listed separately.
> So, it is getting more complex to handle both of them. What should we = do,
> do you have any idea?

Ignore the initialized lists for now. It should be possible to have it gene= rate something
like

static const char *tuntap_types[ETH_TUNTAP_TYPE_MAX] =3D {
=C2=A0 =C2=A0 =C2=A0 "UNKNOWN", "TUN", "TAP"<= br> };

With the following changes result looks better. You got the format wrong fo= r the ForEach list.

diff --git a/.clang-format b/.clang-format
index 16164ef1de..d16185c049 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,12 +1,20 @@
=C2=A0---
=C2=A0BasedOnStyle: LLVM

+AttributeMacros:
+=C2=A0 - __rte_aligned
+=C2=A0 - __rte_packed
+=C2=A0 - __rte_may_alias
+=C2=A0 - __rte_deprecated
+=C2=A0 - __rte_weak
+=C2=A0 - __rte_unused
+=C2=A0 - __rte_restrict
+
=C2=A0# Place opening and closing parentheses on the same line for control = statements
=C2=A0BreakBeforeBraces: Custom
=C2=A0BraceWrapping:
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 AfterFunction: false
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 AfterFunction: true
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0AfterControlStatement: false
-=C2=A0 =C2=A0 =C2=A0 =C2=A0 AfterEnum: false

These are ok for me.=C2=A0
=C2=A0# Set maximum line length to 100 characters
=C2=A0ColumnLimit: 100
@@ -41,98 +49,117 @@ AlwaysBreakAfterReturnType: TopLevelDefinitions
=C2=A0# Always break before multiline string literals
=C2=A0AlignEscapedNewlines: Left

-# Foreach macros
In the clang documentation, it says = "ForEachMacros (List of Strings)" and gives an example: "For= EachMacros: ['RANGES_FOR', 'FOREACH']"
...
+ObjCSpaceAfterProperty: true
+IndentGotoLabels: false
These are also ok for me.
=
If you agree on the for-each part, then I will send the new patch.=C2= =A0
Thanks
--000000000000035c9f0617c6bea1--