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 8D2F64613A; Mon, 27 Jan 2025 19:08:54 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5FBC340698; Mon, 27 Jan 2025 19:08:54 +0100 (CET) Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) by mails.dpdk.org (Postfix) with ESMTP id 45D3B4027D for ; Mon, 27 Jan 2025 19:08:53 +0100 (CET) Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-21669fd5c7cso84524895ad.3 for ; Mon, 27 Jan 2025 10:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1738001332; x=1738606132; 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=pmVyilP9nuNp+92ycHjn6+cuR4NxwMyxksWELIWou8A=; b=Gmc7Z3Tbnln7KpG3UwtlSUlnn9rV1a5oOcP42x0NnblU2E890aOlbKsBdbR4lctk5j nVUoGERfSjAo7GWGppmSRl7IXXvhILHDUtMS8MppVfvSI6iKZXzd1btbp9dmLApCieGu FJqdtjNEPUE/doGL1qrD/PR3DLVarBQZm1OqG9UWWzzt3OQQutI2leu5ztQRTp7uEzPi yRlzN7GHIt5uQ2DJwRNorK1GFbJOZKBdb0lJCgtAh6/BXgg14g5jFsCQI1nKQ58f3E5s 4+dKJDi6NPe9nbPLD9j7iHhCdq8KQkn1sVCzUk9+H8b3mxhw7Cunqp1f6NpqRPOTM6us KmLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738001332; x=1738606132; 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=pmVyilP9nuNp+92ycHjn6+cuR4NxwMyxksWELIWou8A=; b=ldTiv8WnhlPo6B/N60/wByf8fT+mx4H81g3Rpb1YY2K0SdeNnBQccZbRfO8CRSliqO e+9j7tBqASi2lHA5mFiLsME81f/QrFRFEaDqQ7l1/kWheZSQyJjKtNZqQqdxShhv1IHc 5ZGleDfllkwdFikC/ZSheLc8QoODaEXach8/q2FpimP0ELcl8D4u88DKlMblMJnb6xoi ORbqV1m/TqovXsNKaiBq5cDIIjPKLPN8vaky8eG/W/eMkEoaujRcTbokS/06LufOp4QC Ioy+oxkS9zZkO6qikGnABdKI3BTkKA1oMhQTCuRDmiCyfvidkLvtDgtKFVySm1M8kMkD 6w1A== X-Gm-Message-State: AOJu0YyXXQyz+IZBGcYQEKaziMMdHh2V0BAQ+a5dIPXgdPKNaUymCAR/ XbKV/9vlPV+GmuHbibnvXmdh6Le8MLjwRNrE7R9lEIDG7ZnEzgJzr/4lntnIWjG3fpMW2/kQZF/ I X-Gm-Gg: ASbGncskrhx1MtKKbBmfBfpM5KYs5XkFhTolWAT9VqUsy7wKDmtld/o7ZzK/Xn5TzFr KhhMf9zcjtEd+qgCrx9xEGes8pIIUrLMf+9oWD/7Ef5qlJYKiNP12XtyfFqMRAGHc0szn9T98wf p37an9RzsP3Ht3Pr6KDy/SqyhSDmUDtyeW/q/WBXI8Xg6IRtGlKyxUHly5e5iYMcA0iat8XoKmi MIkziABurhhSMivTN2d535HF6jB+zp/PxsH94EOhixmZAU8rPOhuF8DVXJ+5HlPzEZbt9zQkkMj 2taFcBZ8LtAyHJIUsIMHe1JS3K0KFbFTdbSZ7GHS6z0eYFP+Ir39Q3wFMg== X-Google-Smtp-Source: AGHT+IGUIPpMB3UQoV/3p60b2VRyTswt2zvxgmxGtkvVE8EVEh6gVCgWxARfPQHXirgn2xCA+7RzTA== X-Received: by 2002:a17:902:d491:b0:216:2bd7:1c2f with SMTP id d9443c01a7336-21c355042e2mr526915125ad.18.1738001332251; Mon, 27 Jan 2025 10:08:52 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21da41413absm66166665ad.123.2025.01.27.10.08.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 10:08:51 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [RFC 0/7] Introduce FreeBSD macros for SAFE iteration Date: Mon, 27 Jan 2025 10:03:54 -0800 Message-ID: <20250127180842.97907-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 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 This series adds common macros for safe iteration over lists. It is a subset copy of the macros from FreeBSD that are missing from the Linux header sys/queue.h Chose this over several other options: - let each driver define their own as needed. One Intel driver got it wrong, others will as well. - rename all the queue macros to RTE_XXX variants. Seems like useless renaming and confusion. - Several distros have libbsd package with the correct macros. But adding yet another dependency to DPDK would be annoying for something this basic. There are more macros in FreeBSD header that could be useful, but we can add those later as needed here. Stephen Hemminger (7): eal: add queue macro extensions from FreeBSD net/qede: fix use after free bus/fslmc: fix use after free net/bnxt: fix use after free net/iavf: replace local version of TAILQ_FOREACH_SAFE vhost: replace open coded TAILQ_FOREACH_SAFE raw/ifpga: use EAL version of TAILQ_FOREACH_SAFE drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 5 +- drivers/net/bnxt/bnxt_filter.c | 8 +- drivers/net/iavf/iavf_vchnl.c | 8 +- drivers/net/qede/qede_ethdev.h | 3 +- drivers/net/qede/qede_filter.c | 13 +- drivers/raw/ifpga/base/opae_osdep.h | 1 + lib/eal/include/meson.build | 3 +- lib/eal/include/rte_queue.h | 174 +++++++++++++++++++++++ lib/vhost/socket.c | 11 +- 9 files changed, 193 insertions(+), 33 deletions(-) create mode 100644 lib/eal/include/rte_queue.h -- 2.45.2