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 20F4943FBA; Sun, 5 May 2024 22:38:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AD91400EF; Sun, 5 May 2024 22:38:41 +0200 (CEST) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by mails.dpdk.org (Postfix) with ESMTP id 44E4B40041 for ; Sun, 5 May 2024 22:38:40 +0200 (CEST) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6f467fb2e66so799883b3a.1 for ; Sun, 05 May 2024 13:38:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714941519; x=1715546319; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=seFawjV2JmTyAqNPsH2Aj9Oz1AjytwxgSBHJ5703wFo=; b=FX8fn4fRF1w0ShNC4bUeeVAqJ2Utnzh//L2UUEZhiH5bjE20QXqVUnI4CKnZXbN+iI J/lRztiGkiJAbj9FWFS+wsQZg/AdXaE33ZRJFzQeaoWDDFJgHzkniz9yofoz7tcfcqg6 WIGcp5fN55N8qhSIgbsTxXOKukSWsroX8XtebMwSmG2JNFgUP4gqLq6ovmRLxiWNiwDv f1l3GrsF5P5pCHkw2OjCT8CQUj53JFOgfw9cn4UyM4akiYfccU5AoCseA4w9pDrk1uFd oq6mE/kEdQOcH3xAX2D8I73tLf4ofHZmQxAX6a5z3MNfqGBSDM6LswpacF/IQHGGracJ ySzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714941519; x=1715546319; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=seFawjV2JmTyAqNPsH2Aj9Oz1AjytwxgSBHJ5703wFo=; b=cnyAuKTI/9Lbpc5bPBOnVxd/imuw48MUxFjVWRRlmF455O7ZDEE8oAkkPruR2vCcaA yWtCrtheXCTmyhzXteCZRh+WGBs0yJ+yoPx9LWhER/KN3En8M9mcmW9dibCyvuW41EW4 QHNNOW5gHaQCCqKpOG9GZUbLsFhRu5L3xlaTN66hnvmq6Sq1yLyHWcG5wJFOpMbiGZxq HYNmLpznz2sSjrVzTFXdpvHN2/Ot1mKQbEOzr4PYRMam1CO9nGYBZHdtWnK/kGCn1Iaw g+8sdbby8IocbFWytzIRtcAAyliEcL3EapiVVyOeXQkS24536jUoty2f9KUdiMvIi2Yh x42A== X-Gm-Message-State: AOJu0Yz9AzJQ9xJD8rMfjNux9MkXLmcaG2U2rI1Fz6CjVbo+U1KBJa/l F5VHFusGIIvXocYQOKdjhaqPs3ZU4pYD44SQt1HGQStXGsQ+jUaw117JsRgcBM4= X-Google-Smtp-Source: AGHT+IFB92xT41FljNG1lrZIzePzbiOBmLjK/zPaGHWl6/XzoY6a2OkFSkecMjVDyOZJnrTRrnc1Cw== X-Received: by 2002:a05:6a20:9497:b0:1af:ac50:75fa with SMTP id hs23-20020a056a20949700b001afac5075famr3335452pzb.54.1714941518991; Sun, 05 May 2024 13:38:38 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id f5-20020a17090a654500b002b2a7c89970sm6568158pjs.35.2024.05.05.13.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 13:38:38 -0700 (PDT) Date: Sun, 5 May 2024 13:38:36 -0700 From: Stephen Hemminger To: Abdullah =?UTF-8?B?w5ZtZXIgWWFtYcOn?= Cc: dev@dpdk.org Subject: Re: [PATCH v3] devtools: add .clang-format file Message-ID: <20240505133836.4711bad3@hermes.local> In-Reply-To: References: <20240504191837.1096185-1-aomeryamac@gmail.com> <20240505092059.69486f4e@hermes.local> MIME-Version: 1.0 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 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}; > > =20 >=20 > 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 do, > do you have any idea? Ignore the initialized lists for now. It should be possible to have it gene= rate something like=20 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 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 @@ --- BasedOnStyle: LLVM =20 +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 state= ments BreakBeforeBraces: Custom BraceWrapping: - AfterFunction: false + AfterFunction: true AfterControlStatement: false - AfterEnum: false =20 # Set maximum line length to 100 characters ColumnLimit: 100 @@ -41,98 +49,117 @@ AlwaysBreakAfterReturnType: TopLevelDefinitions # Always break before multiline string literals AlignEscapedNewlines: Left =20 -# Foreach macros -ForEachMacros: [ - "CIRBUF_FOREACH", - "DLB2_LIST_FOR_EACH", - "DLB2_LIST_FOR_EACH_SAFE", - "ECORE_LIST_FOR_EACH_ENTRY", - "ECORE_LIST_FOR_EACH_ENTRY_SAFE", - "FOR_EACH", - "FOR_EACH_BUCKET", - "FOR_EACH_CNIC_QUEUE", - "FOR_EACH_COS_IN_TX_QUEUE", - "FOR_EACH_ETH_QUEUE", - "FOR_EACH_MEMBER", - "FOR_EACH_NONDEFAULT_ETH_QUEUE", - "FOR_EACH_NONDEFAULT_QUEUE", - "FOR_EACH_PORT", - "FOR_EACH_PORT_IF", - "FOR_EACH_QUEUE", - "FOR_EACH_SUITE_TESTCASE", - "FOR_EACH_SUITE_TESTSUITE", - "FOREACH_ABS_FUNC_IN_PORT", - "FOREACH_DEVICE_ON_AUXILIARY_BUS", - "FOREACH_DEVICE_ON_CDXBUS", - "FOREACH_DEVICE_ON_PCIBUS", - "FOREACH_DEVICE_ON_PLATFORM_BUS", - "FOREACH_DEVICE_ON_UACCEBUS", - "FOREACH_DEVICE_ON_VMBUS", - "FOREACH_DRIVER_ON_AUXILIARY_BUS", - "FOREACH_DRIVER_ON_CDXBUS", - "FOREACH_DRIVER_ON_PCIBUS", - "FOREACH_DRIVER_ON_PLATFORM_BUS", - "FOREACH_DRIVER_ON_UACCEBUS", - "FOREACH_DRIVER_ON_VMBUS", - "FOREACH_SUBDEV", - "FOREACH_SUBDEV_STATE", - "HLIST_FOR_EACH_ENTRY", - "ILIST_FOREACH", - "LIST_FOR_EACH_ENTRY", - "LIST_FOR_EACH_ENTRY_SAFE", - "LIST_FOREACH", - "LIST_FOREACH_FROM", - "LIST_FOREACH_FROM_SAFE", - "LIST_FOREACH_SAFE", - "ML_AVG_FOREACH_QP", - "ML_AVG_FOREACH_QP_MVTVM", - "ML_AVG_RESET_FOREACH_QP", - "ML_MAX_FOREACH_QP", - "ML_MAX_FOREACH_QP_MVTVM", - "ML_MAX_RESET_FOREACH_QP", - "ML_MIN_FOREACH_QP", - "ML_MIN_FOREACH_QP_MVTVM", - "ML_MIN_RESET_FOREACH_QP", - "MLX5_ETH_FOREACH_DEV", - "MLX5_IPOOL_FOREACH", - "MLX5_L3T_FOREACH", - "OSAL_LIST_FOR_EACH_ENTRY", - "OSAL_LIST_FOR_EACH_ENTRY_SAFE", - "PLT_TAILQ_FOREACH_SAFE", - "RTE_BBDEV_FOREACH", - "RTE_DEV_FOREACH", - "RTE_DMA_FOREACH_DEV", - "RTE_EAL_DEVARGS_FOREACH", - "RTE_ETH_FOREACH_DEV", - "RTE_ETH_FOREACH_DEV_OF", - "RTE_ETH_FOREACH_DEV_OWNED_BY", - "RTE_ETH_FOREACH_DEV_SIBLING", - "RTE_ETH_FOREACH_MATCHING_DEV", - "RTE_ETH_FOREACH_VALID_DEV", - "RTE_GPU_FOREACH", - "RTE_GPU_FOREACH_CHILD", - "RTE_GPU_FOREACH_PARENT", - "RTE_LCORE_FOREACH", - "RTE_LCORE_FOREACH_WORKER", - "RTE_TAILQ_FOREACH", - "RTE_TAILQ_FOREACH_SAFE", - "SILIST_FOREACH", - "SLIST_FOREACH", - "SLIST_FOREACH_FROM", - "SLIST_FOREACH_FROM_SAFE", - "SLIST_FOREACH_PREVPTR", - "SLIST_FOREACH_SAFE", - "STAILQ_FOREACH", - "STAILQ_FOREACH_FROM", - "STAILQ_FOREACH_FROM_SAFE", - "STAILQ_FOREACH_SAFE", - "TAILQ_FOREACH", - "TAILQ_FOREACH_ENTRY", - "TAILQ_FOREACH_ENTRY_SAFE", - "TAILQ_FOREACH_FROM", - "TAILQ_FOREACH_FROM_SAFE", - "TAILQ_FOREACH_REVERSE", - "TAILQ_FOREACH_REVERSE_FROM", - "TAILQ_FOREACH_REVERSE_FROM_SAFE", - "TAILQ_FOREACH_REVERSE_SAFE", - "TAILQ_FOREACH_SAFE", ] +ForEachMacros: + - CIRBUF_FOREACH + - DLB2_LIST_FOR_EACH + - DLB2_LIST_FOR_EACH_SAFE + - ECORE_LIST_FOR_EACH_ENTRY + - ECORE_LIST_FOR_EACH_ENTRY_SAFE + - FOREACH_ABS_FUNC_IN_PORT + - FOREACH_DEVICE_ON_AUXILIARY_BUS + - FOREACH_DEVICE_ON_CDXBUS + - FOREACH_DEVICE_ON_PCIBUS + - FOREACH_DEVICE_ON_PLATFORM_BUS + - FOREACH_DEVICE_ON_UACCEBUS + - FOREACH_DEVICE_ON_VMBUS + - FOREACH_DRIVER_ON_AUXILIARY_BUS + - FOREACH_DRIVER_ON_CDXBUS + - FOREACH_DRIVER_ON_PCIBUS + - FOREACH_DRIVER_ON_PLATFORM_BUS + - FOREACH_DRIVER_ON_UACCEBUS + - FOREACH_DRIVER_ON_VMBUS + - FOREACH_SUBDEV + - FOREACH_SUBDEV_STATE + - FOR_EACH + - FOR_EACH_BUCKET + - FOR_EACH_CNIC_QUEUE + - FOR_EACH_COS_IN_TX_QUEUE + - FOR_EACH_ETH_QUEUE + - FOR_EACH_MEMBER + - FOR_EACH_NONDEFAULT_ETH_QUEUE + - FOR_EACH_NONDEFAULT_QUEUE + - FOR_EACH_PORT + - FOR_EACH_PORT_IF + - FOR_EACH_QUEUE + - FOR_EACH_SUITE_TESTCASE + - FOR_EACH_SUITE_TESTSUITE + - HLIST_FOR_EACH_ENTRY + - ILIST_FOREACH + - LIST_FOREACH + - LIST_FOREACH_FROM + - LIST_FOREACH_FROM_SAFE + - LIST_FOREACH_SAFE + - LIST_FOR_EACH_ENTRY + - LIST_FOR_EACH_ENTRY_SAFE + - MLX5_ETH_FOREACH_DEV + - MLX5_IPOOL_FOREACH + - MLX5_L3T_FOREACH + - ML_AVG_FOREACH_QP + - ML_AVG_FOREACH_QP_MVTVM + - ML_AVG_RESET_FOREACH_QP + - ML_MAX_FOREACH_QP + - ML_MAX_FOREACH_QP_MVTVM + - ML_MAX_RESET_FOREACH_QP + - ML_MIN_FOREACH_QP + - ML_MIN_FOREACH_QP_MVTVM + - ML_MIN_RESET_FOREACH_QP + - OSAL_LIST_FOR_EACH_ENTRY + - OSAL_LIST_FOR_EACH_ENTRY_SAFE + - PLT_TAILQ_FOREACH_SAFE + - RTE_BBDEV_FOREACH + - RTE_BBDEV_FOREACH + - RTE_DEV_FOREACH + - RTE_DEV_FOREACH + - RTE_DMA_FOREACH_DEV + - RTE_DMA_FOREACH_DEV + - RTE_EAL_DEVARGS_FOREACH + - RTE_EAL_DEVARGS_FOREACH + - RTE_ETH_FOREACH_DEV + - RTE_ETH_FOREACH_DEV + - RTE_ETH_FOREACH_DEV_OF + - RTE_ETH_FOREACH_DEV_OF + - RTE_ETH_FOREACH_DEV_OWNED_BY + - RTE_ETH_FOREACH_DEV_OWNED_BY + - RTE_ETH_FOREACH_DEV_SIBLING + - RTE_ETH_FOREACH_DEV_SIBLING + - RTE_ETH_FOREACH_MATCHING_DEV + - RTE_ETH_FOREACH_MATCHING_DEV + - RTE_ETH_FOREACH_VALID_DEV + - RTE_ETH_FOREACH_VALID_DEV + - RTE_GPU_FOREACH + - RTE_GPU_FOREACH + - RTE_GPU_FOREACH_CHILD + - RTE_GPU_FOREACH_CHILD + - RTE_GPU_FOREACH_PARENT + - RTE_GPU_FOREACH_PARENT + - RTE_LCORE_FOREACH + - RTE_LCORE_FOREACH + - RTE_LCORE_FOREACH_WORKER + - RTE_LCORE_FOREACH_WORKER + - RTE_TAILQ_FOREACH + - RTE_TAILQ_FOREACH + - RTE_TAILQ_FOREACH_SAFE + - RTE_TAILQ_FOREACH_SAFE + - SILIST_FOREACH + - SLIST_FOREACH + - SLIST_FOREACH_FROM + - SLIST_FOREACH_FROM_SAFE + - SLIST_FOREACH_PREVPTR + - SLIST_FOREACH_SAFE + - STAILQ_FOREACH + - STAILQ_FOREACH_FROM + - STAILQ_FOREACH_FROM_SAFE + - STAILQ_FOREACH_SAFE + - TAILQ_FOREACH + - TAILQ_FOREACH_ENTRY + - TAILQ_FOREACH_ENTRY_SAFE + - TAILQ_FOREACH_FROM + - TAILQ_FOREACH_FROM_SAFE + - TAILQ_FOREACH_REVERSE + - TAILQ_FOREACH_REVERSE_FROM + - TAILQ_FOREACH_REVERSE_FROM_SAFE + - TAILQ_FOREACH_REVERSE_SAFE + - TAILQ_FOREACH_SAFE + +ObjCSpaceAfterProperty: true +IndentGotoLabels: false