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 E0262A0547; Tue, 15 Nov 2022 09:16:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 96DB040DFD; Tue, 15 Nov 2022 09:16:52 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 13FB340150 for ; Tue, 15 Nov 2022 09:16:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668500210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=9i5ZIF9sZ68ZC9zCchYvqRKxgX6e3hddvNdW43NbyTo=; b=gs4MG3XZ1I9TRWvvzTHd2cMVqsjpu5SF1LkgXKW7taLHfxYrKge73HNdsu8nauq8MCoZ01 ho5aXT1uK4mKGBQ+z3vrd1STVk/JzGsopN5TPyuZvyNso/eRuSAJB3lbp4uYKpTdDlnEUZ Dhj8Db2ZoKjrfSHvpWG2fktyQMUkqQo= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-21-pIi-EY1SMy2g0xUtZsQufQ-1; Tue, 15 Nov 2022 03:16:49 -0500 X-MC-Unique: pIi-EY1SMy2g0xUtZsQufQ-1 Received: by mail-pj1-f70.google.com with SMTP id b1-20020a17090a10c100b0020da29fa5e5so7162754pje.2 for ; Tue, 15 Nov 2022 00:16:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=9i5ZIF9sZ68ZC9zCchYvqRKxgX6e3hddvNdW43NbyTo=; b=trQSmT0l7SQbJttIjsHOBczqKP8srXzg4NbySVTT2UmDCx7aJEQyy1tfEu+bKWFDkV LwQIvPjA00fQC+qUqmprNq8zHlZkhxAKI1MGPV3han+Sptq5lSxm4IcSNuy9WRSEE5m+ D/knvsKK7d6nZO8ygH3MvNRzBDPbVtJIKIaHpUjfIsEsHMQ+1Erj/Qlewhh9Hj2fyaFn SDB7ZSfDim+FJkEJ6+p7Mg0Yu18djfjXc4YFUhDMUXGOWsmC5R+IbcgS+uBr9QpFRBlF IM3tVwF3aFirS2a+vyg9G/Mbq1pXqeDbCY3+a2acvK2dNwOHrMujEg09In39NV84RvLP As3w== X-Gm-Message-State: ANoB5pniRqd2Wz+lDc1ipCy76I+26ST4HzE2IZeQBPf9fD0fg2a4LCMB B8SidV7gpIf16cBEvYyjHhIqMNjJenW8Yrjwj0ZkqRCXHCnIv4yGt/ewzfCCd7eeq3p/5ypZ9lR abWjzFT4PmBIrkIAk4Q4= X-Received: by 2002:a17:903:2d2:b0:188:4f86:e4d5 with SMTP id s18-20020a17090302d200b001884f86e4d5mr3067854plk.16.1668500208300; Tue, 15 Nov 2022 00:16:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf7CXTnN6nOXCkbm045lXp8UhI9zedgi9rAFtnuW91q2ZwJMZOz+NUOaEWdSUK5XVLhbh1yfBxXfq9LJa6k2Rx0= X-Received: by 2002:a17:903:2d2:b0:188:4f86:e4d5 with SMTP id s18-20020a17090302d200b001884f86e4d5mr3067835plk.16.1668500208042; Tue, 15 Nov 2022 00:16:48 -0800 (PST) MIME-Version: 1.0 References: <20221102150828.2161307-1-david.marchand@redhat.com> <20221103140047.11750-1-david.marchand@redhat.com> <8b9c3daa-de71-6d23-2f40-8a047f30e412@oktetlabs.ru> In-Reply-To: <8b9c3daa-de71-6d23-2f40-8a047f30e412@oktetlabs.ru> From: David Marchand Date: Tue, 15 Nov 2022 09:16:36 +0100 Message-ID: Subject: Re: [PATCH v2] cleanup compat header inclusions To: David Marchand Cc: dev@dpdk.org, thomas@monjalon.net, gakhil@marvell.com, ferruh.yigit@amd.com, jerinj@marvell.com, bruce.richardson@intel.com, Andrew Rybchenko X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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, Nov 6, 2022 at 9:36 AM Andrew Rybchenko wrote: > On 11/3/22 17:00, David Marchand wrote: > > With symbols going though experimental/stable stages, we accumulated > > a lot of discrepancies about inclusion of the rte_compat.h header. > > > > Some headers are including it where unneeded, while others rely on > > implicit inclusion. > > > > Fix unneeded inclusions: > > $ git grep -l include..rte_compat.h | > > xargs grep -LE '__rte_(internal|experimental)' | > > xargs sed -i -e '/#include..rte_compat.h/d' > > > > Fix missing inclusion, by inserting rte_compat.h before the first > > inclusion of a DPDK header: > > $ git grep -lE '__rte_(internal|experimental)' | > > xargs grep -L include..rte_compat.h | > > xargs sed -i -e \ > > '0,/#include..\(rte_\|.*pmd.h.$\)/{ > > s/\(#include..\(rte_\|.*pmd.h.$\)\)/#include \n\1/ > > }' > > > > Fix missing inclusion, by inserting rte_compat.h after the last > > inclusion of a non DPDK header: > > $ for file in $(git grep -lE '__rte_(internal|experimental)' | > > xargs grep -L include..rte_compat.h); do > > tac $file > $file.$$ > > sed -i -e \ > > '0,/#include../{ > > s/\(#include..*$\)/#include \n\n\1/ > > }' $file.$$ > > tac $file.$$ > $file > > rm $file.$$ > > done > > > > Fix missing inclusion, by inserting rte_compat.h after the header guard: > > $ git grep -lE '__rte_(internal|experimental)' | > > xargs grep -L include..rte_compat.h | > > xargs sed -i -e \ > > '0,/#define/{ > > s/\(#define .*$\)/\1\n\n#include / > > }' > > > > And finally, exclude rte_compat.h itself. > > $ git checkout lib/eal/include/rte_compat.h > > > > At the end of all this, we have a clean tree: > > $ git grep -lE '__rte_(internal|experimental)' | > > xargs grep -L include..rte_compat.h > > buildtools/check-symbols.sh > > devtools/checkpatches.sh > > doc/guides/contributing/abi_policy.rst > > doc/guides/rel_notes/release_20_11.rst > > lib/eal/include/rte_compat.h > > > > Signed-off-by: David Marchand > > Acked-by: Bruce Richardson > Acked-by: Andrew Rybchenko Applied, thanks. -- David Marchand