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 78C04A0A0A; Thu, 13 May 2021 20:40:57 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 650B3410FD; Thu, 13 May 2021 20:40:57 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id B7E3A410FD for ; Thu, 13 May 2021 20:40:55 +0200 (CEST) IronPort-SDR: upwOhzfJEy45U7CsWl/hWvjnDwydoiRrQmkUAjAgE3ZfTpMroUtuWH2TaQkcfS7k/lXcJ+ivq2 +ShtbivGRySA== X-IronPort-AV: E=McAfee;i="6200,9189,9983"; a="221020117" X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="221020117" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 11:40:36 -0700 IronPort-SDR: RnsbFCxt0iCVsOekk2KPOD2+STNjZDqh8dl+DNpKrVeTJNIyLVXQYaXwOyW8Fwlxi2fSvVKe6S XGCTy0uOYTPQ== X-IronPort-AV: E=Sophos;i="5.82,296,1613462400"; d="scan'208";a="431386219" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.242.51]) ([10.213.242.51]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2021 11:40:35 -0700 To: Thomas Monjalon , dev@dpdk.org Cc: andrew.rybchenko@oktetlabs.ru References: <1612458325-13508-1-git-send-email-asafp@nvidia.com> <20210407223320.2952469-1-thomas@monjalon.net> <20210407223320.2952469-4-thomas@monjalon.net> From: Ferruh Yigit X-User: ferruhy Message-ID: <4f9eadeb-a0eb-4eb1-a443-141a3fb6ae0d@intel.com> Date: Thu, 13 May 2021 19:40:31 +0100 MIME-Version: 1.0 In-Reply-To: <20210407223320.2952469-4-thomas@monjalon.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v5 3/3] devtools: check flow API doc tables 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 Sender: "dev" On 4/7/2021 11:33 PM, Thomas Monjalon wrote: > The script check-doc-vs-code.sh may be used to add > some automatic checks of the doc. > > If run without any argument, a complete check is done. > The optional argument is a git history reference point > to check faster only what has changed since this commit. > > In this commit, the only check is for rte_flow tables, > achieved through the script parse-flow-support.sh. > If run without a .ini reference, it prints rte_flow tables. > Note: detected features are marked with the value Y, > while the real .ini file could have special values like I. > The script allow parsing exceptions (exclude or include), > like for bnxt code which lists unsupported items and actions. > Thanks for the scripts. > Signed-off-by: Thomas Monjalon > --- > devtools/check-doc-vs-code.sh | 79 ++++++++++++++++++++++++++++++++++ > devtools/parse-flow-support.sh | 76 ++++++++++++++++++++++++++++++++ > 2 files changed, 155 insertions(+) > create mode 100755 devtools/check-doc-vs-code.sh > create mode 100755 devtools/parse-flow-support.sh > > diff --git a/devtools/check-doc-vs-code.sh b/devtools/check-doc-vs-code.sh > new file mode 100755 > index 0000000000..6e53d66899 > --- /dev/null > +++ b/devtools/check-doc-vs-code.sh > @@ -0,0 +1,79 @@ > +#! /bin/sh -e > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright 2021 Mellanox Technologies, Ltd > + > +# Check whether doc & code are in sync. > +# Optional argument: check only what changed since a commit. > +trusted_commit=$1 # example: origin/main > + > +selfdir=$(dirname $(readlink -f $0)) > +rootdir=$(readlink -f $selfdir/..) > + > +result=0 > + > +# speed up by ignoring Unicode details > +export LC_COLLATE=C > + > +changed_files() > +{ > + [ -n "$files" ] || > + files=$(git diff-tree --name-only -r $trusted_commit..) > + echo "$files" > +} > + > +has_code_change() # > +{ > + test -n "$(git log --format='%h' -S"$1" $trusted_commit..)" > +} > + > +has_file_change() # > +{ > + changed_files | grep -q "$1" > +} > + > +changed_net_drivers() > +{ > + net_paths='drivers/net/|doc/guides/nics/features/' > + [ -n "$drivers" ] || > + drivers=$(changed_files | > + sed -rn "s,^($net_paths)([^./]*).*,\2,p") > + echo "$drivers" > +} I will not reviewed in details yet, but first observation, when 'trusted_commit' argument is used, the drivers list has many duplicated entries which makes the output redundant and makes script take too much time. Getting only unique list may help on it.