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 C628E43E83; Tue, 16 Apr 2024 17:21:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F414140268; Tue, 16 Apr 2024 17:21:29 +0200 (CEST) Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mails.dpdk.org (Postfix) with ESMTP id CE41340262 for ; Tue, 16 Apr 2024 17:21:27 +0200 (CEST) Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-1e2c725e234so39785785ad.1 for ; Tue, 16 Apr 2024 08:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1713280887; x=1713885687; darn=dpdk.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3qErpbUvVdrT6quEqFRnB+8sh6wKxpLRma2bJRNms58=; b=EBddaSeKSXemBfWMaRU2zjADaF57js/MW7F9V7N+YyKNdTbTPFJhKDBq7IfyrAKFyO qLk3grFImJZdkAyAtE98LYkpLhiGWjNWzYhEv+Lk/surrJvna6uQGKNGJDT2cJsE+k/4 Ufq0FgndpqISKHpNjG3dH5VwgCy43Qd2kHH/6g+PDJ3Bb0wi/kQKU8SR7meM2JBBo7xo /rSb6iauyoHJQUPop6G8dJmwR2D19W2MKRaAwlbfKZHRVVQQBAo3KVWooOSSHC5lvECO u3NkCUxpW8HR/XR1pCa6NIA+fEtYt2CwffySoiU6s9hDRsf8Y038E/Cezbz1VS/TF8Uo f9OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713280887; x=1713885687; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3qErpbUvVdrT6quEqFRnB+8sh6wKxpLRma2bJRNms58=; b=kpats+S1WDfp1aWvTSMryM5BN47qx/xhTLEECOd2hZzxdDyW96Z8Sr4XK8oJWFGEe+ CvV+pnxVdOkNPmXmZVW+vK8rVk0i4RiPX1jvnoX2OI4O4Ll2QpEsWeephhiC43UrHtzL NPnKi4WHK39xjQyMvlftdgN0n0AZ00IYtbnnE8DHttpJohDy6VDED3ICBJy7zQUsR3yT 1hcywSJvaXmD6El4JlRgckgNxjr0PyzxQCGbTi3Y9+IUIsDBOm7Sw3RVz4AOJzTWd7Nw 9VTvoviUUO1ol3RrleZSY+g5V+GvUNzCWiUXgoA5EYTlXjxWtJ0hAIAmbT7TvdBJnUTW Is9w== X-Gm-Message-State: AOJu0YwmOwglgHhKKQQ85lBiIexGGBXKwu7J/4q9r6cEL+5q3ZWFLvD9 Q8RBXZaQOrEH39J9ayTMuWJhYAZgGzyH8LySY7D6sq8BW90PsfxonT0+uZmRnP96/pb69P6smzE j X-Google-Smtp-Source: AGHT+IGUxO13beHNeJNMsoVWuBKqxXlO0A/09G9b6ccx52bt16KtQdHrIc7NuWkiH7psz8u2SnJ7zg== X-Received: by 2002:a17:902:c943:b0:1e2:7734:63dd with SMTP id i3-20020a170902c94300b001e2773463ddmr5018855pla.30.1713280886751; Tue, 16 Apr 2024 08:21:26 -0700 (PDT) Received: from hermes.lan (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id l17-20020a170903245100b001e80154a400sm213348pls.126.2024.04.16.08.21.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 08:21:26 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH 0/5] use RTE_DIM where possible Date: Tue, 16 Apr 2024 08:19:26 -0700 Message-ID: <20240416152124.69590-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 There is macro for computing the number of elements in an array RTE_DIM. But it is not used in many places where it could be. Based on similar coccinelle script in Linux. Stephen Hemminger (5): cocci: add script to use RTE_DIM app: use RTE_DIM lib: use RTE_DIM examples _use RTE_DIM drivers/net: use RTE_DIM app/test-flow-perf/main.c | 4 +-- app/test/test_ethdev_link.c | 3 +- app/test/test_security_inline_macsec.c | 47 +++++++++++++------------- devtools/cocci/rte-dim.cocci | 23 +++++++++++++ drivers/net/ark/ark_pktchkr.c | 2 +- drivers/net/ark/ark_pktgen.c | 2 +- drivers/net/bnxt/bnxt_hwrm.c | 12 +++---- drivers/net/e1000/em_rxtx.c | 3 +- drivers/net/iavf/iavf_ipsec_crypto.c | 3 +- drivers/net/igc/igc_ethdev.c | 3 +- drivers/net/ipn3ke/ipn3ke_tm.c | 3 +- drivers/net/ngbe/ngbe_ethdev.c | 6 ++-- drivers/net/octeontx/octeontx_stats.h | 3 +- drivers/net/txgbe/txgbe_ethdev.c | 9 ++--- drivers/net/txgbe/txgbe_ethdev_vf.c | 3 +- examples/l3fwd/main.c | 3 +- examples/qos_sched/init.c | 3 +- lib/cmdline/cmdline_vt100.c | 4 ++- lib/latencystats/rte_latencystats.c | 3 +- 19 files changed, 73 insertions(+), 66 deletions(-) create mode 100644 devtools/cocci/rte-dim.cocci -- 2.43.0