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 50C5F433F5; Wed, 29 Nov 2023 03:43:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 227AB42E3C; Wed, 29 Nov 2023 03:42:38 +0100 (CET) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id AF02C42E2E for ; Wed, 29 Nov 2023 03:42:35 +0100 (CET) Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-517ab9a4a13so4840761a12.1 for ; Tue, 28 Nov 2023 18:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225754; x=1701830554; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ARA2poogH0HPZpD7i+Z0Q5ENednLtJT50YV0Z4Mkg2k=; b=2VIUBfKYu1osJlhI26L4DhICuaOPP/PQT+2nI1wPkm9NIXpg3NoHHuCJA/lT1ki6lS 43qVf1UXtm84764cYhPNsWOyR45nq3eJzH6BCgNNxQNBLEP9wHyw+oGMNnKQB1kHVzE8 7W9yNMo1p1TNvDfMTHkYMg02t64x2XbvGw4QtNNQ1r2y8vcTTE3QYRvyhaShjdLzU/mJ SyDhp25P+rKHnjAxnQlxJhSvafpdf9zqiP7HuW+KXUR8xsmDj7PC5Ct9GVynuAa27oJ0 sY8gL+BwABqsefEssBaxj0o3fgMXGws9iC2rgtBuXB+Y+Ngo0gAjvfTGYVvo/L38vI6/ I9zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225754; x=1701830554; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ARA2poogH0HPZpD7i+Z0Q5ENednLtJT50YV0Z4Mkg2k=; b=Cs76p7U3LV1m9tEbtU0q+jMohhB+MFPKZrGNzSANt4Tb7F5Y/t31AcYM80Ma++pe3o BGoEMtiVaaq+2+IG8KAjTASkqXnY8Ka8aGWx/mAv6x4XNA19APuYFiD9ke5uwFs0UeGb wOZy8RoO3ub19F0GJEMXm44i/MZzGixpYKvxd2v9j81j0jfNAyklHgm/o7HSk3kKR0aB qBc7XQBP+hAclWsMG8hWIogiKk94EHS5HddSRr386s2qo6KzlcXYRI7tvOuM56PObY6M 0mGeQYCJq0XEZq0ELJarSygFL0ecPtpGwcRdEbUMKesI75TI7iFkKwIvpImaXdPmXKcE gpaA== X-Gm-Message-State: AOJu0Ywu8trdZvQyEuN8XgyzJkCT8wJdHFedfgJ4chgvw20dQC6vhB9p YiYC1znlH4MuZqe5LDqBl15nMcLMSHgAtNkmhRo= X-Google-Smtp-Source: AGHT+IFxCzIQsYpf4tnfqgtGTtDRpw/kqBqYRlntyPQ9X37yghfGkgimuZUDYZ9BjrqaWIFRHhpSOA== X-Received: by 2002:a05:6a20:3d13:b0:18c:b081:4c32 with SMTP id y19-20020a056a203d1300b0018cb0814c32mr7493779pzi.4.1701225754549; Tue, 28 Nov 2023 18:42:34 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id j17-20020aa78011000000b006cb95f6aa0fsm9674900pfi.150.2023.11.28.18.42.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:34 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Anoob Joseph , Ankur Dwivedi , Tejasree Kondoj , Akhil Goyal Subject: [PATCH v5 03/10] security: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:10 -0800 Message-ID: <20231129024221.57653-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231129024221.57653-1-stephen@networkplumber.org> References: <20230113215205.125767-1-stephen@networkplumber.org> <20231129024221.57653-1-stephen@networkplumber.org> 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 Zero length arrays are GNU extension. Replace with standard flex array. Signed-off-by: Stephen Hemminger Reviewed-by: Tyler Retzlaff Acked-by: Anoob Joseph --- drivers/crypto/cnxk/cn10k_ipsec.h | 4 +++- drivers/crypto/cnxk/cn9k_ipsec.h | 4 +++- lib/security/rte_security_driver.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/cnxk/cn10k_ipsec.h b/drivers/crypto/cnxk/cn10k_ipsec.h index 8a93d7406204..144bc8319dea 100644 --- a/drivers/crypto/cnxk/cn10k_ipsec.h +++ b/drivers/crypto/cnxk/cn10k_ipsec.h @@ -24,8 +24,10 @@ struct cn10k_ipsec_sa { }; } __rte_aligned(ROC_ALIGN); +#define SEC_SESS_SIZE sizeof(struct rte_security_session) + struct cn10k_sec_session { - struct rte_security_session rte_sess; + uint8_t rte_sess[SEC_SESS_SIZE]; /** PMD private space */ diff --git a/drivers/crypto/cnxk/cn9k_ipsec.h b/drivers/crypto/cnxk/cn9k_ipsec.h index 1ea946afd8a9..d28642e3a627 100644 --- a/drivers/crypto/cnxk/cn9k_ipsec.h +++ b/drivers/crypto/cnxk/cn9k_ipsec.h @@ -20,8 +20,10 @@ struct cn9k_ipsec_sa { }; } __rte_aligned(8); +#define SEC_SESS_SIZE sizeof(struct rte_security_session) + struct cn9k_sec_session { - struct rte_security_session rte_sess; + uint8_t rte_sess[SEC_SESS_SIZE]; /** PMD private space */ diff --git a/lib/security/rte_security_driver.h b/lib/security/rte_security_driver.h index 62664dacdbb4..faa4074f1965 100644 --- a/lib/security/rte_security_driver.h +++ b/lib/security/rte_security_driver.h @@ -33,7 +33,7 @@ struct rte_security_session { /**< session private data IOVA address */ RTE_MARKER cacheline1 __rte_cache_min_aligned; - uint8_t driver_priv_data[0]; + uint8_t driver_priv_data[]; /**< Private session material, variable size (depends on driver) */ }; -- 2.42.0