From patchwork Mon Nov 20 17:06:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134489 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 68D6143381; Mon, 20 Nov 2023 18:10:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E32C042E3E; Mon, 20 Nov 2023 18:09:59 +0100 (CET) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id BA3E542E33 for ; Mon, 20 Nov 2023 18:09:56 +0100 (CET) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6cb7951d713so1030686b3a.1 for ; Mon, 20 Nov 2023 09:09:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1700500195; x=1701104995; 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=yEKzKRIIaWE9lNV1/rByD+w1Et4DAJ7x0JPVtmPYzJo=; b=eCawuYGh4R+xVPNBxgF4m8od2sYdLdYqbwBFxoi/yOVGOrkVYocR6No7mXQFb7663H 77fdDvNgmx7Z2qgVB8R1OVFLJrkkg2aaphm9JEe7tQzPUxL40Yrzdpf9tzRgerDUTR39 7C9s3j7OfQqHHE6e0pc/aC0TJhpBb/h4cxXnMwsLKYTQ3MXDsuo3GJZuNmUKGThiH3vr ljSjh6tfPhFMFZUiw2L9KOUs+oYkXAUIXTAyb2K2i/H7LoRfigiOcQ3IkVj4pJMoL6NF 0dkMl8aE4rd1nHo3LI7DWPTiA+0GTByVcMACDyxGQaT+LWIbcm5i6LA7RfeFA9osP/ek VaXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700500195; x=1701104995; 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=yEKzKRIIaWE9lNV1/rByD+w1Et4DAJ7x0JPVtmPYzJo=; b=gKy3KVRnXm6ygx5V31U079hBjDqRtwji83sBVii2W/lOZsJLFtiroVN/sJv/vY1tW1 hybYvbIJ74D2iRvqj3QrNbjg01sTptzcJAwnS6Wya1mFGMFziozpmEwECxVejGAwWOzw 4Q1DiR+CasnSqXCMDTzSccw8ngJg/JLyYfJBrJMF8CFAXZZmB2Nbltk3eWcw2jlvCN9z fzMniTydK/dl7fh765YoaDF3rQqRfjhu9EqIrD3KLHOKfbuPmJ7rAORZsBC9XsZYTFDg H14/JxjCPlTuEdyDnfu8x5F1BXX6nM+YPekQYkvRNaZ3Nv/DgyaUUJi79vTm7KRdk719 s83A== X-Gm-Message-State: AOJu0YznKA/z3QBpO+/Sex4Y6twwzQnKFNzTsEOab7tpfYoz3GRlfBy1 8GyBKHrtGKBYvql0u9hrhhGQHq3rKfcwnZyRxk4= X-Google-Smtp-Source: AGHT+IF7lQRpvwD78twJ9ewAJLOtZNIxIB3vodhTNTc5f37SLqXGO0uGLWYtVwwvnGQRqMP8M7AUSA== X-Received: by 2002:a05:6a00:4502:b0:690:f877:aa1e with SMTP id cw2-20020a056a00450200b00690f877aa1emr121954pfb.12.1700500195497; Mon, 20 Nov 2023 09:09:55 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id p18-20020a62ab12000000b006cb7f9da229sm2894681pff.202.2023.11.20.09.09.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Nov 2023 09:09:54 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj , Akhil Goyal Subject: [PATCH v4 03/10] security: replace zero length array with flex array Date: Mon, 20 Nov 2023 09:06:58 -0800 Message-ID: <20231120170942.197172-4-stephen@networkplumber.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231120170942.197172-1-stephen@networkplumber.org> References: <20230113215205.125767-1-stephen@networkplumber.org> <20231120170942.197172-1-stephen@networkplumber.org> MIME-Version: 1.0 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) */ };