From patchwork Wed Nov 29 02:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134681 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 A7692433F5; Wed, 29 Nov 2023 03:42:41 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7620E42E2B; Wed, 29 Nov 2023 03:42:35 +0100 (CET) Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) by mails.dpdk.org (Postfix) with ESMTP id A5CAF42E26 for ; Wed, 29 Nov 2023 03:42:33 +0100 (CET) Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-1f9decb7446so3163297fac.2 for ; Tue, 28 Nov 2023 18:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225752; x=1701830552; 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=7wQZbESJu/aOiKTzB65D8K/+oyOwJE56LxYKD2atUAk=; b=C+y5iBXCxeqKxb2/yG1MByAGGvZn7JG4rWZS6Ln0WU/7DvK+XM9L9uxWKRjCQXgJd4 n4y3oh0NGp9DeFvrJN5ay2BWRgseM+Rr+8HeEd/b865DJLqfQ4smEId6lgZ+4xIyoCnA uv+TlpYE4JUawmc7bK1yIb1b/9fSHeprnpd676IRDijYNI50cFVh8drIElvor499opzz K9Tbtl3Vqxtx7ep7j4EYLGP4KlA9lpnQavxeWQzPu/2ZS1Sgojd+vI6IkNrfEL1Htf90 1PMblXw7SSfXPQELokOXzagz/qrkaIfWLNN6pxYUmcqjltRiIzy6HYG8EBB2ijfhDW+v fx7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225752; x=1701830552; 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=7wQZbESJu/aOiKTzB65D8K/+oyOwJE56LxYKD2atUAk=; b=Q3V14ZqvXlvmo/fa3057qbnwfJ62oE4r6E6iGD3EK8pSgzX7ErDWwXSSi6gBQmsc1X WP/ndAwTuwqRlk6vk3Obm91S/leyxvk9REZsLS1fBIsTzQO5PDGxn6c3PXAas6NOSFd0 MS7MGol0zt9wqvuZvBzvJw/NFHHCudXkjy0rIOFmJJEcdBI+SvAZYP0IvNTrhRAgbzY3 WyCNtO3/zYU54Mg6ngWSOTdLDHPIENZiy1eFoFV+zi8ihup248sG0eBszYFFrJLb4W9t wkGcOlLrrP6cPwZUXURlBx0+DqbbpWntXXG+SzkvnLVDO30jTdFh35FFQyj5aD0dJFx4 0U2g== X-Gm-Message-State: AOJu0Yy9gFvkXlzbEM9efRxNhOV+fINiTMXiNBoOWaN1m59wIMiISrVs E18kM4C9yZBxtnvk/HxW/q8DxKME8A9+zdGSSmY= X-Google-Smtp-Source: AGHT+IEtpAmFqW+8VowEV/XzoGMa19oCQwc6AH4I4jIcAzRDXpVvWbC4M17aNrZXC0UHZzhm5oP1dg== X-Received: by 2002:a05:6870:418c:b0:1fa:135e:f140 with SMTP id y12-20020a056870418c00b001fa135ef140mr17522577oac.34.1701225752571; Tue, 28 Nov 2023 18:42:32 -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.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:31 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Yipeng Wang , Sameh Gobriel Subject: [PATCH v5 01/10] member: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:08 -0800 Message-ID: <20231129024221.57653-2-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 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 --- lib/member/rte_member_heap.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/member/rte_member_heap.h b/lib/member/rte_member_heap.h index 9c4a01aebe95..ab6319bc2de4 100644 --- a/lib/member/rte_member_heap.h +++ b/lib/member/rte_member_heap.h @@ -26,7 +26,7 @@ struct hash { uint16_t bkt_cnt; uint16_t num_item; uint32_t seed; - struct hash_bkt buckets[0]; + struct hash_bkt buckets[]; }; struct node { From patchwork Wed Nov 29 02:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134682 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 A2151433F5; Wed, 29 Nov 2023 03:42:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CF2242E30; Wed, 29 Nov 2023 03:42:36 +0100 (CET) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) by mails.dpdk.org (Postfix) with ESMTP id 788FC42E2A for ; Wed, 29 Nov 2023 03:42:34 +0100 (CET) Received: by mail-oi1-f178.google.com with SMTP id 5614622812f47-3b845ba9ba9so3845694b6e.3 for ; Tue, 28 Nov 2023 18:42:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225753; x=1701830553; 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=Ju7X2QfAhM5SsBieA9kM/vF7mFDfPOg1lyktmO3Sowk=; b=GrcTBdoSmqzIohCUfXF7jFqgCgMWpC2d5jHRtVUxz1FT9vqcmu8iXqWddMQttVMEOy EplhCTcBxUOaMASHvODgmlZm9lINDyYfrCd3S6oTs38qwnni/fHWSwZ3xrpF6xbSvH9c VR2CPWiqa5ny5E//e0I+WDWGFG4tS4Y7rD6xMTPrT07PgGsVCHPMrzberMrzpIgVmgWG n8FSYDXKUpH+Nh1aAlJsvrs/Kdyuav83J0dGzTsIOrJ2kDBV+Uky2kkGnK5X2tcgGJbL W3tjzhBtgtVPjuRdfYROKaiYiRgx36RFdduoACl9dyWPDD5VHogqpsyWvF6MJjmMR4Iv MVRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225753; x=1701830553; 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=Ju7X2QfAhM5SsBieA9kM/vF7mFDfPOg1lyktmO3Sowk=; b=AEgrFuePIh0f4uiah4U5mGoms4mYkAqMvcGQdPsjmd89jKNh1sDywNBJe0t8bxeKYS hry5iWZp99zEO6NvNMkt7iqAXGOiQX3zqGLiUI87XszAaxmONxjkejw2RkVratZGJBWU QpEl2WIfsZsyqrWfO3VoaHlZde2q7qQDq2rGlAqYNfobEZa8la1XMbKMmBu9d4Kpae5R RHYiz/9Ycfn/shra9zhN88NZDt3gp2uaXtmElFJGaXV8rYIqLbPHMi0DwWWv6tRdfP4G 7w3i47i2mwrVCPA85GKKk9L3kCPMpoTnJGyuCKCLhw60OBhLE19MCFdFXrN8/7uMtH/V S6cg== X-Gm-Message-State: AOJu0YyO6Dr41GhA5dyzfQ3nj1fcqb9GVc4uHMm5d2pp9999imc2QknQ mkgd/hQbSejpj6p2SRMC0pn2t3wxn28KU7f4yPE= X-Google-Smtp-Source: AGHT+IFpYYvCT1lUmoRgyxvK/r+dlnsrOq3zR5cPm+ZzxIOmcA8YaykXEshyVKZAh73GOIylqJLU3Q== X-Received: by 2002:a05:6808:1290:b0:3b8:4d54:3b51 with SMTP id a16-20020a056808129000b003b84d543b51mr24725774oiw.7.1701225753646; Tue, 28 Nov 2023 18:42:33 -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.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:33 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Anoob Joseph , Ankur Dwivedi , Tejasree Kondoj , Akhil Goyal , Fan Zhang Subject: [PATCH v5 02/10] cryptodev: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:09 -0800 Message-ID: <20231129024221.57653-3-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 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/cnxk_se.h | 5 ++++- lib/cryptodev/cryptodev_pmd.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index c2a807fa9428..f86b859a08a4 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -29,8 +29,11 @@ enum cpt_dp_thread_type { CPT_DP_THREAD_TYPE_PT, }; +#define SYM_SESS_SIZE sizeof(struct rte_cryptodev_sym_session) + struct cnxk_se_sess { - struct rte_cryptodev_sym_session rte_sess; + uint8_t rte_sess[SYM_SESS_SIZE]; + uint8_t aes_gcm : 1; uint8_t aes_ccm : 1; uint8_t aes_ctr : 1; diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h index 3bb3d95c1338..0732b356883c 100644 --- a/lib/cryptodev/cryptodev_pmd.h +++ b/lib/cryptodev/cryptodev_pmd.h @@ -153,7 +153,7 @@ struct rte_cryptodev_sym_session { RTE_MARKER cacheline1 __rte_cache_min_aligned; /**< Second cache line - start of the driver session data */ - uint8_t driver_priv_data[0]; + uint8_t driver_priv_data[]; /**< Driver specific session data, variable size */ }; From patchwork Wed Nov 29 02:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134683 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 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 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) */ }; From patchwork Wed Nov 29 02:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134684 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 F10F8433F5; Wed, 29 Nov 2023 03:43:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5612842E41; Wed, 29 Nov 2023 03:42:39 +0100 (CET) Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by mails.dpdk.org (Postfix) with ESMTP id BDEFB42E32 for ; Wed, 29 Nov 2023 03:42:36 +0100 (CET) Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-6cc2027f7a2so3333097b3a.2 for ; Tue, 28 Nov 2023 18:42:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225755; x=1701830555; 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=+RIkijSvF4hNTPNUihSrigAotEHCXmQgjpgfk7u1xlE=; b=dagRMJHaVRMpvaEkyqNvCxeMWieIiMUhix5RMHuTCqoCy4X/94pw4h4hUqo7Q0AxXr 0SKDR4RTI9SEG1Yl8GzReJvUu/V54Eov51gj60qZKGXXHD1Tgz2UxBycVbufR2gZq0bd V+c0lOr/y3/qKmwq0ovY4/muWE+Pi283C31XTq6UNHR/+f0nRItw5O0CqfFFw85ofQSK FXjPYFlawzsu+iLxpYBANVB9itk1BFCqvhr63hdpve8CD2+b5uATBY55Uo/sEJjSK3p3 GKu3zpuUgfyiCpSoc5zTJ9OJDpTNZLzWDlpHZwOII33NLdgEOk8x0F1kcfMNbLptIare nbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225755; x=1701830555; 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=+RIkijSvF4hNTPNUihSrigAotEHCXmQgjpgfk7u1xlE=; b=oss3b6W7t7E11lY1XtytQYze9fktgm5ucEaS8yKYLLfFXn28zba+1SgcZQO876OE7c uc48K9E7El1IKgXVcFY+hQeg0B2SWY2ez9CWBx3rySNEs+mb5TqHbA9CJSkoDhgGRYR5 Djs7pbgcDotqLpeHhQ+tR5PvkWAzeH2P1jnHAAjLftKYyTctKj5xbI1ovXARwJjiQ/NG erS7sirUR0xb+/3aJD6iXNPRD0llmmsSV15TIP713aU+brqBUtA3v5nJZYvMtxVjOQf3 ZSrzusOXqNIoMoeFxVdfawT870r8iCacxgxq4La+hzKuC9PbPibbCXO725oj9m7+sx19 rZng== X-Gm-Message-State: AOJu0YyAHw9By5c3kjhy/9m93SLAfWKydfTzWLT3+sCxOtyxD1aIgsam pmgtf30x8AViPshKmnkUzI8sPagpoQICzkUvC2I= X-Google-Smtp-Source: AGHT+IGYmLuOsnMjLMT0lMGSaXs74Q9Eu2EdXn45PbltCwcJlR4ggjhzBC+kC0JGU7KVPUz0jD4GTg== X-Received: by 2002:a05:6a00:813:b0:6cb:42de:24e0 with SMTP id m19-20020a056a00081300b006cb42de24e0mr18122595pfk.28.1701225755643; Tue, 28 Nov 2023 18:42:35 -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.34 (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 , Cristian Dumitrescu Subject: [PATCH v5 04/10] pipeline: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:11 -0800 Message-ID: <20231129024221.57653-5-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 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 --- lib/pipeline/rte_swx_pipeline_internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h index a67b6e965de7..8ec12263b989 100644 --- a/lib/pipeline/rte_swx_pipeline_internal.h +++ b/lib/pipeline/rte_swx_pipeline_internal.h @@ -213,7 +213,7 @@ TAILQ_HEAD(rss_tailq, rss); struct rss_runtime { uint32_t key_size; /* key size in bytes. */ - uint8_t key[0]; /* key. */ + uint8_t key[]; /* key. */ }; /* From patchwork Wed Nov 29 02:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134685 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 A8409433F5; Wed, 29 Nov 2023 03:43:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8E44D42E36; Wed, 29 Nov 2023 03:42:41 +0100 (CET) Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) by mails.dpdk.org (Postfix) with ESMTP id C186842E37 for ; Wed, 29 Nov 2023 03:42:37 +0100 (CET) Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-6d811615efeso2232819a34.1 for ; Tue, 28 Nov 2023 18:42:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225757; x=1701830557; 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=LrRVZmGfqz9WzFvP5pfxqXxOiJp5Ex6HHWCKxCQUlHE=; b=Sc1tEubdk9qNI1oZPLRjadON+aqm+7F68GpQ42ilUS4TIpY1jDeDe+lw2fzhUSMy1p qhe065Bad5Nws+koub1laMg1I8XE95jNoMA/KjpO8wJG4wa44jaKJFMTvsazce6sV20n bs+RiQ6pipRxzuhqqmTH0CfnicCpab9FOlK9Lq8cVU1/fZIp+FuA1ix1h9uBC5ZK1OM0 XhMyimZoj+gC4QWdsBlDk76K/r2M0MES+o/UEyFH2zWaRp7GrA7C/y1VbxhWWwv8j03t B5kXHhLhAjNTlPzOYyJQJrbAnwfmRrdRGxQLl8GIkJAhPwHLnDd+XjwIE3xHmjl+2tP/ Fl1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225757; x=1701830557; 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=LrRVZmGfqz9WzFvP5pfxqXxOiJp5Ex6HHWCKxCQUlHE=; b=UXZ+hIHB0GH74s21lTEYZ/Cy5sn2tpasW3IoWiYKOwaMrm56EvopCcvBev7ZHQCZ6G I4i8sFBxRXcEjB9ahcx1C0eTxVq36hiFm1reF/HjvvIdQl36s6Kkc1AYjNt8/KbvEq2Z v71+W5D29D13HIDJyci2lbkAHGDlL9GT0fotGSyWBTmA88UOGJ0LHmpUpGdq6ssp4AXB 5khad70okqw7CbHFnipbE4PahuW5v1QAHxaRSsnVw2JsxQWUnxiCG5i5l1pyy6PlLsfR qI2dfMi36WQn7zU6KsnldG+XQMfs6uBwBoxHsn0NmVaeklAvymkUpEhlJQe2BCCfWtcA 3oNA== X-Gm-Message-State: AOJu0YyV5oVdHgXbK8aMjXPWFbeoAgKutDR/poVaN4z0q6v5y9fz6Bp9 zpQpdZgtIEgnNImuzTM8Zfy5dOTyvrfsC/0apyc= X-Google-Smtp-Source: AGHT+IFF/aiYbCkFpMqIddLv8B+irQQ+RpVz1EWUgQ2nL4Vdk9337PzwfVEdgnRVo8BVIgcqLjguXg== X-Received: by 2002:a05:6870:1d2:b0:1fa:136b:9f40 with SMTP id n18-20020a05687001d200b001fa136b9f40mr17029065oad.1.1701225756809; Tue, 28 Nov 2023 18:42:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:36 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , =?utf-8?q?Niklas_S=C3=B6?= =?utf-8?q?derlund?= , Tyler Retzlaff , Chaoyong He Subject: [PATCH v5 05/10] net/nfp: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:12 -0800 Message-ID: <20231129024221.57653-6-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 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 Acked-by: Niklas Söderlund Reviewed-by: Tyler Retzlaff Acked-by: Chaoyong He Acked-by: Chaoyong He --- drivers/net/nfp/flower/nfp_flower_cmsg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/nfp/flower/nfp_flower_cmsg.h b/drivers/net/nfp/flower/nfp_flower_cmsg.h index c2938fb6f63c..f00d2e838d8f 100644 --- a/drivers/net/nfp/flower/nfp_flower_cmsg.h +++ b/drivers/net/nfp/flower/nfp_flower_cmsg.h @@ -73,7 +73,7 @@ struct nfp_flower_cmsg_mac_repr { uint8_t info; uint8_t nbi_port; uint8_t phys_port; - } ports[0]; + } ports[]; }; /* From patchwork Wed Nov 29 02:39:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134686 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 25FBB433F5; Wed, 29 Nov 2023 03:43:25 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C54FD42E48; Wed, 29 Nov 2023 03:42:42 +0100 (CET) Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.175]) by mails.dpdk.org (Postfix) with ESMTP id D68F842E3F for ; Wed, 29 Nov 2023 03:42:38 +0100 (CET) Received: by mail-il1-f175.google.com with SMTP id e9e14a558f8ab-35d01ac2877so6637255ab.3 for ; Tue, 28 Nov 2023 18:42:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225758; x=1701830558; 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=YrPST0zegRM2YtsnMA4HnQPP7UNQ+ucxN8O78SuzEwQ=; b=AnEBFDr58WcpwffKk/jPYDsTvgO+1HLxCPQW8gr3FhS/GPldpUqbi3HCny0z+HWii9 R9WwmsoJ2sPniC22iMqrDZInVdkHp1eKdgtGhJRhdRvi9SZ+pSuyvIbO75u9l5ldv2vQ i1AzrGuhHK0u9B2ClD4QrtIm4O+2xSUxDrv5kAlqDuLwpcV39cPrx5VxbqOA6M/o1+Xi jaM1V+fhuvZODuo6JZy+pDYAHIX+azYtemFunXys88nAaSvxk2ykqeYK+6u66tT2Hllw BY1sJUoFm0rjAhTbkGwyJtNodL0r1NJAquBHDwNyyC9LGFNGqRqdzETnkoz0kXgHJJa4 w4Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225758; x=1701830558; 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=YrPST0zegRM2YtsnMA4HnQPP7UNQ+ucxN8O78SuzEwQ=; b=vgTfHepJpQPr1sm3A2Z8kFM8vDUnyd5XUmPa/6c+jM6jbxC4FfvgKCchoO8yL4Tj73 fa0fvHpchEPF1bM8OZmvvstYnSS12pG3x/A1HC54WNYIF+XKHRwu8+vk567AXjr0S+sm WFDadXlCYgboi5bMWyORRMQpBHJtbrLtcf77Sics8G0XL1stN/dw7vk/HYSgkluf/g5x jj+QHtzyd9q8yzTadRJZ3oD9QU2B1xTOkvU3yUBF8SW6EFFayQVbWy1OnatejVw8zXbd zeeeUDQ8aPyu0rsJyP113hfopigkFLfySoQcWvtWZmOKd3GFdjL0hjoS84IZNnuBNLgU TGig== X-Gm-Message-State: AOJu0YxSuicjUTDW+4/H9zIqxXpIg9/z2x/Q6p4wpxhVu3dJ3sMin7wk LGv0QScwI6cTDd4PpC1octEQmKmWH5JlB8p1VcI= X-Google-Smtp-Source: AGHT+IFTsJIi5DX/2d7+0dyRLR9ZwKC0XiguDrs8QryUs6H/MUSJ+keRKot6hSnLZkxrSrEIg+8HIg== X-Received: by 2002:a05:6e02:1747:b0:35c:bef1:879a with SMTP id y7-20020a056e02174700b0035cbef1879amr14132026ill.10.1701225757909; Tue, 28 Nov 2023 18:42:37 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:37 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , John Daley , Tyler Retzlaff , Hyong Youb Kim Subject: [PATCH v5 06/10] net/enic: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:13 -0800 Message-ID: <20231129024221.57653-7-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 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 Acked-by: John Daley Reviewed-by: Tyler Retzlaff --- drivers/net/enic/base/vnic_devcmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/enic/base/vnic_devcmd.h b/drivers/net/enic/base/vnic_devcmd.h index 253a791c3f65..f91cc3078d63 100644 --- a/drivers/net/enic/base/vnic_devcmd.h +++ b/drivers/net/enic/base/vnic_devcmd.h @@ -765,7 +765,7 @@ struct vnic_devcmd_notify { struct vnic_devcmd_provinfo { uint8_t oui[3]; uint8_t type; - uint8_t data[0]; + uint8_t data[]; }; /* From patchwork Wed Nov 29 02:39:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134687 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 23B45433F5; Wed, 29 Nov 2023 03:43:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02DB642E4B; Wed, 29 Nov 2023 03:42:44 +0100 (CET) Received: from mail-oo1-f52.google.com (mail-oo1-f52.google.com [209.85.161.52]) by mails.dpdk.org (Postfix) with ESMTP id BDF8E42E34 for ; Wed, 29 Nov 2023 03:42:39 +0100 (CET) Received: by mail-oo1-f52.google.com with SMTP id 006d021491bc7-58d9a4e9464so1275367eaf.0 for ; Tue, 28 Nov 2023 18:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225759; x=1701830559; 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=kz6jR3luzdfQNhneqUZRKTLzQfZ85YzHOc0mB47rLgs=; b=julYxWtVCyiQ04LOZiBgqAiZ0NnQQqzwmy9EdkE7EbmaTEpug1Pc1CXh+vLqhsl2G2 IkSIoR3uOMZAaTTEZkHAWbd9wxY1cPCJccPRNPboqxGHYIokxM2XvEBvtfHSr2qVlNjr wSY3/tVepRJho9wV+o5WN3eED3VBSHrDdvTiOiNgukJoeMjh+43TdNmJkX2jdlf4BLCL StlPxenG9Wc2BFUgPYKd7iKaVnCyc3Fvyg5hFnbfA3rYui8hqUUUUOglgRWbC1CT1Zt0 TMW38qguqlWTTz6m3KF1WFLNoQWP6NIT2l/NUBCsWtOlzpVY+OZyGdlue7s6ylq71S6e QesA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225759; x=1701830559; 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=kz6jR3luzdfQNhneqUZRKTLzQfZ85YzHOc0mB47rLgs=; b=BR+OaJg6OMPCa/rDcU2dCFP7XuPMZsaXZ5lVFEQpZWMQX5ymWBAK/5woAhMC7ATul7 HF376NK1Lv+fPCIkOLiEZZFfkrIRyc8GaovA4dPZKloPHPCP+gltlAZOtlUfeU7t6OQc qNhJXBK2N6w/6w4KCy81SFTfJ0b/9JKL8BIhCJIJD+noyFdRPYyvbxO9ccppOq5hYNXf CBxJHcbACyOJK6Si3cVLRWUnwWBT3dnMPR8S2IFxTyUDiIbRBQxf0Nu/leQenMAJ/+mP eyDGEM3joLQ7mdAuANQxJd5kixUAtblSNjsrDYdMpWGoBf2b2lUAfEPEYPFy1Ew5VIqZ 4j0Q== X-Gm-Message-State: AOJu0YymbgnLqA1vIxAZdZBd4jwnCI0aoohj988Aco0FXGo/jxTjluFa q08Ed7upRPbwyc5fherpC+0JWp3HdrszgYvrzT0= X-Google-Smtp-Source: AGHT+IHLXeyLEjN/wjSjy3LwiCWh1cLF58Qo9beLnOwTA8sdM7Ev6A7j01mnXYbZzEdpLcKSHKbrzA== X-Received: by 2002:a05:6870:6707:b0:1fa:30cc:7d48 with SMTP id gb7-20020a056870670700b001fa30cc7d48mr13102181oab.37.1701225758930; Tue, 28 Nov 2023 18:42:38 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:38 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Dariusz Sosnowski , Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad Subject: [PATCH v5 07/10] net/mlx5: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:14 -0800 Message-ID: <20231129024221.57653-8-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 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: Dariusz Sosnowski --- drivers/common/mlx5/mlx5_prm.h | 2 +- drivers/net/mlx5/mlx5.h | 4 ++-- drivers/net/mlx5/mlx5_flow.h | 2 +- drivers/net/mlx5/mlx5_tx.h | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 9e22dce6da13..932b89bd79d3 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -5181,7 +5181,7 @@ struct mlx5_ifc_flow_context_bits { u8 reserved_at_e0[0x40]; u8 encrypt_decrypt_obj_id[0x20]; u8 reserved_at_140[0x16c0]; - union mlx5_ifc_dest_format_flow_counter_list_auto_bits destination[0]; + union mlx5_ifc_dest_format_flow_counter_list_auto_bits destination[]; }; struct mlx5_ifc_set_fte_in_bits { diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h index 263ebead7f29..f2e2e04429d1 100644 --- a/drivers/net/mlx5/mlx5.h +++ b/drivers/net/mlx5/mlx5.h @@ -1314,7 +1314,7 @@ struct mlx5_aso_ct_pool { }; struct mlx5_aso_sq *sq; /* Async ASO SQ. */ struct mlx5_aso_sq *shared_sq; /* Shared ASO SQ. */ - struct mlx5_aso_ct_action actions[0]; + struct mlx5_aso_ct_action actions[]; /* CT action structures bulk. */ }; @@ -1331,7 +1331,7 @@ struct mlx5_aso_ct_pools_mng { rte_spinlock_t ct_sl; /* The ASO CT free list lock. */ rte_rwlock_t resize_rwl; /* The ASO CT pool resize lock. */ struct aso_ct_list free_cts; /* Free ASO CT objects list. */ - struct mlx5_aso_sq aso_sqs[0]; /* ASO queue objects. */ + struct mlx5_aso_sq aso_sqs[]; /* ASO queue objects. */ }; #ifdef PEDANTIC diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index 6dde9de688b9..b35079b30a6e 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1257,7 +1257,7 @@ struct rte_flow_hw { cnt_id_t cnt_id; uint32_t mtr_id; uint32_t rule_idx; - uint8_t rule[0]; /* HWS layer data struct. */ + uint8_t rule[]; /* HWS layer data struct. */ } __rte_packed; #ifdef PEDANTIC diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h index e59ce37667ba..b1e8ea19a2a1 100644 --- a/drivers/net/mlx5/mlx5_tx.h +++ b/drivers/net/mlx5/mlx5_tx.h @@ -171,11 +171,12 @@ struct mlx5_txq_data { struct mlx5_txq_stats stats; /* TX queue counters. */ struct mlx5_txq_stats stats_reset; /* stats on last reset. */ struct mlx5_uar_data uar_data; - struct rte_mbuf *elts[0]; + struct rte_mbuf *elts[]; /* Storage for queued packets, must be the last field. */ } __rte_cache_aligned; /* TX queue control descriptor. */ +__extension__ struct mlx5_txq_ctrl { LIST_ENTRY(mlx5_txq_ctrl) next; /* Pointer to the next element. */ uint32_t refcnt; /* Reference counter. */ From patchwork Wed Nov 29 02:39:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134688 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 C3863433F5; Wed, 29 Nov 2023 03:43:40 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 26B9F42E3B; Wed, 29 Nov 2023 03:42:45 +0100 (CET) Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) by mails.dpdk.org (Postfix) with ESMTP id 4F29842E38 for ; Wed, 29 Nov 2023 03:42:41 +0100 (CET) Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-6cdd4aab5f5so31965b3a.3 for ; Tue, 28 Nov 2023 18:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225760; x=1701830560; 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=bSeCFlweWgH8tAjxZSpXDWR9DNnF/IzvsHutYS5fvtA=; b=pbNkqjQe5GS4Pm7W2kRnm3baWxFVG9p1jtCtMez2i3l714JGZJYIkBrz6GAfv7IjUw o82TGpqNklxYpcCl1jYRx940rtf5HISnNT5+8HuCvp/u+2jiaTz1E5fmx+yj5Ba6fWCT KPQSvSP5A9fkrT5PsCJ932i2CH7vri82xa0A2DHrK+0gSRjEtHiCik7k1dYCGHvd5vuW JjhUDf4b5gU1mIA7uLEIvSx1TKGD9WymnVm3q9ELmtWqAAmtcnOp2qfGEtfCkfqNR9Ha RVJ46dHpWbo0vK5ol7AfB3cV35wFLbv0IwAt6CQiVmelLNovrZgYszKgegG9ybtfpfWs YKlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225760; x=1701830560; 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=bSeCFlweWgH8tAjxZSpXDWR9DNnF/IzvsHutYS5fvtA=; b=F+yqIJeBTHQqTYPfWkiDAbcy14KoR1F5ij/F4uwPyBCLYvTs/tBzdxTraL0gw9jy7e uKvVDcf4T58rU0Jw1Rtm/piFfel3OIeK2pHaEyrb6lV5yCd7KTyhbzzKN3FZUasLMu7j YFZBovUGL0X5bvo2cMT8JndmjYTUs8XIWKjhiQsjULkbosYVE6TCOLL+s8NB57nIwnch XumeV1XRTg/2Ic98XFyEd6coNKiStpk7L+DKPyUsi+zWNOP5VooeazNaNHGJzInWToYN A7PHKxEZoJ0fzwQenqnvpkD1L+BuyQkOrgnoKQiuDmxQMecly0x405htlopilV1mwUI7 E4Hw== X-Gm-Message-State: AOJu0YzAU7HG8vmILSIuxUItb8xdMLItbaLgti1HW8ydom9XAWVz/EYz z6gKkIWatXbfmzy1tJOPu3rKWl20F2yvp7BrJ5I= X-Google-Smtp-Source: AGHT+IECJL7588bGjTZlXVoiQ10JHCQcX8I6z1uvZam6dEHwLjsH3wEQ5V9VuRmrDBsDBWdJNafHfg== X-Received: by 2002:a05:6a00:a22:b0:6cb:d24c:4a9f with SMTP id p34-20020a056a000a2200b006cbd24c4a9fmr25068596pfh.29.1701225760205; Tue, 28 Nov 2023 18:42:40 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:39 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Anoob Joseph , Volodymyr Fialko Subject: [PATCH v5 08/10] pdcp: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:15 -0800 Message-ID: <20231129024221.57653-9-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 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 --- lib/pdcp/pdcp_entity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pdcp/pdcp_entity.h b/lib/pdcp/pdcp_entity.h index 4fc6342a5ced..f854192e98dc 100644 --- a/lib/pdcp/pdcp_entity.h +++ b/lib/pdcp/pdcp_entity.h @@ -185,7 +185,7 @@ struct entity_priv_dl_part { /** Reorder packet buffer */ struct pdcp_reorder reorder; /** Bitmap memory region */ - uint8_t bitmap_mem[0]; + uint8_t bitmap_mem[]; }; struct entity_priv_ul_part { From patchwork Wed Nov 29 02:39:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134689 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 6D92A433F5; Wed, 29 Nov 2023 03:43:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4481542E55; Wed, 29 Nov 2023 03:42:46 +0100 (CET) Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) by mails.dpdk.org (Postfix) with ESMTP id 5D52442E46 for ; Wed, 29 Nov 2023 03:42:42 +0100 (CET) Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-6cb74a527ceso5070975b3a.2 for ; Tue, 28 Nov 2023 18:42:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225761; x=1701830561; 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=jDFAqvxBPyvNv6pRUBvjIzCBTh/F97bZyBYTdlZs4SU=; b=M5CR3zIDCcGvCorkT+EHyYJhq0Ow5c74Wbwerb3znadrY/aeiXytoQR8r0umz4s6D0 RqZnaWNFTMbnAsXgpqJBcOnj5MuhFUH27TghMKwe9sP1UX8P30LgiSeo6SdN2oCUT3MH tsrsDgHn6q5FF9iNBRVLIJTN6/SWB7F6/dd0HozH5lB+SiLfuqP6k9TQTPAxomLLHeUg nsHrkmOOQOuFhc5MxVi7bYkADU9YGyyx5jffD17r1rSBS7xlhLsBr3aOwwCP4pj432pM 3e7vWhSwbWOkOIwzw933WLR9BnjtNe3pcDY2dMyKYPIAR0Q1kM+adSQlWnvj+5v6Y3PJ gwQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225761; x=1701830561; 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=jDFAqvxBPyvNv6pRUBvjIzCBTh/F97bZyBYTdlZs4SU=; b=hRkB69B7F7zgC6E5klFCtuxtj2rRSiWyIq4clwJt3/TwkzJER1BDaidG+/sEzS1KvJ LUgQVsYqJlYin/jVaN2huIUXYo5unrzRvwRriMHjGKcwnJOWOE01EwggbVyEbprM+8Ck dpAZcfiXiKuGvyw3SRtARK968Uum7ixtQk5L7HXVfSxtyGE86QKQE6ozvM2cda0KFZ90 Lj+kdS0eTrbsIgdzPCNJo9sfmQmSi3ihPcdt6nl82em4U3eEabMF94hFOQWdCgPSTj46 wEVSl5KZTFxnaYyxnGIa3bo2mu5y0pBKAo0XvrDti9z3KTB0wao6ksBSLTjg890n6jRK ft6A== X-Gm-Message-State: AOJu0YzAbYav88Y5VKWgGljJtiPxNOGjLFDW0CepmtLeetB84fgc/TzG L3y7NGgiSQNJQAJHgt/KFbwd2OUDJiXASRQ8F8Y= X-Google-Smtp-Source: AGHT+IGBWUQeEbPn3pUOLDnDTqJXbli7a/g/gSE33sEB7jA0c3X5mmdOvdr7UrdzAKjQbb5RMbLJjw== X-Received: by 2002:a05:6a00:1ca3:b0:692:b6e8:ce88 with SMTP id y35-20020a056a001ca300b00692b6e8ce88mr18718693pfw.17.1701225761381; Tue, 28 Nov 2023 18:42:41 -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.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:40 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Tyler Retzlaff , Yuying Zhang , Beilei Xing Subject: [PATCH v5 09/10] net/cpfl: replace zero length array with flex array Date: Tue, 28 Nov 2023 18:39:16 -0800 Message-ID: <20231129024221.57653-10-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 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 --- drivers/net/cpfl/cpfl_flow_engine_fxp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/cpfl/cpfl_flow_engine_fxp.c index 8a4e1419b4db..39a281fa61ee 100644 --- a/drivers/net/cpfl/cpfl_flow_engine_fxp.c +++ b/drivers/net/cpfl/cpfl_flow_engine_fxp.c @@ -53,7 +53,7 @@ struct cpfl_rule_info_meta { uint32_t pr_num; /* number of pattern rules */ uint32_t mr_num; /* number of modification rules */ uint32_t rule_num; /* number of all rules */ - struct cpfl_rule_info rules[0]; + struct cpfl_rule_info rules[]; }; static uint32_t cpfl_fxp_mod_idx_alloc(struct cpfl_adapter_ext *ad); From patchwork Wed Nov 29 02:39:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 134690 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 E218D433F5; Wed, 29 Nov 2023 03:43:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5325942E59; Wed, 29 Nov 2023 03:42:47 +0100 (CET) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by mails.dpdk.org (Postfix) with ESMTP id 3C78442E35 for ; Wed, 29 Nov 2023 03:42:43 +0100 (CET) Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-3b85dcecc62so2307271b6e.2 for ; Tue, 28 Nov 2023 18:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1701225762; x=1701830562; 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=5PaHYNcOwezwar+iyevsLsJ0uFN1l62vmsHlZdUG6s4=; b=Gz3UZudUpYznjqxPpi2h24GuRoQs+1fvmhpmLhvJs9NRwIKRbEpdcpX5dGPf2RuM6k /z584bK6mi2aOlQrwnw5CYu8MsiDtQ9pSGjSSA914I+PXYk4sx1+HftcUmPsxaZGNW5K uqaOIX7gPEf+GjUmDx8b3qxQEVxuP6ydLQoL3Mvo/Ef/JWrlgAENMRQEzGZgVuSL2Rfb d/QpQkxPwMNZj4RFErWqt0NlxzS7ze6ZTEbiUSwZd67pp8wSkJiMTlzVpaGZfp+qzu7l JR84q1ItquGdYvpibatgzpW73t41ZehH92YAEgZWBWGEv5j7kixWpybII6ZivE4rf5Dt 9ESw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701225762; x=1701830562; 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=5PaHYNcOwezwar+iyevsLsJ0uFN1l62vmsHlZdUG6s4=; b=TzZQA6TrZ+hBhH1uE81HFTA9SV4P5MlIBIS7LJ5F0WIStv8aBZ8nleRauzWVKv0l5/ 8tZAbI/LLb81zYy0m6kU3WCkR2kgGQQ6iD54mAgCQfqg57OUsyDA2T1s4qWTTMbxzdl4 i6jNpQMcxrVEg4ubpDwFalXpR6IVof6rAPTdIQsX8z5w/rn8l+O72vKh9jpR95xOYsfE OlAe0bmRQGd0IEJ57K/Wc8XIQCf9Mkq8WH+DcNqy+e4HzHbhRIhKwUcW98wNyqlgJt6i hkVZ+HLzFDX9B4CegvB0DCnWB5DPFdIWm/BbFkqPN/orL1B4hPoT2V9x0b34N7/6PDMk 46jw== X-Gm-Message-State: AOJu0YxsSMTIuABv9HnI3jwbRod+AMqoUZpl/GE1lkZROAXa4UetkhSO dCvQW/dwUDTDLl3NXAgzugAt4wA1jDGygjpdV7M= X-Google-Smtp-Source: AGHT+IGXMVXIGkaMqSO/tvzRcAUaNoDu/9hVcIWcjXiVLcB5oWhrG2jP3u7DKVpcpC5QOzTvqqbgzw== X-Received: by 2002:a05:6808:320d:b0:3b8:93dd:18a4 with SMTP id cb13-20020a056808320d00b003b893dd18a4mr2109117oib.19.1701225762332; Tue, 28 Nov 2023 18:42:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 18:42:41 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Hemant Agrawal , Sachin Saxena Subject: [PATCH v5 10/10] common/dpaxx: replace zero length array Date: Tue, 28 Nov 2023 18:39:17 -0800 Message-ID: <20231129024221.57653-11-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 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 The zero length ip_header is used as an overlay to the encap IP header. Since the code is already assuming the layout of the structure, replace the array with direct access. Signed-off-by: Stephen Hemminger Acked-by: Hemant Agrawal --- drivers/common/dpaax/caamflib/desc/ipsec.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/drivers/common/dpaax/caamflib/desc/ipsec.h b/drivers/common/dpaax/caamflib/desc/ipsec.h index 95fc3ea5ba3b..d1411cc6aab4 100644 --- a/drivers/common/dpaax/caamflib/desc/ipsec.h +++ b/drivers/common/dpaax/caamflib/desc/ipsec.h @@ -334,9 +334,7 @@ struct ipsec_encap_gcm { * @seq_num: IPsec sequence number * @spi: IPsec SPI (Security Parameters Index) * @ip_hdr_len: optional IP Header length (in bytes) - * reserved - 16b - * Opt. IP Hdr Len - 16b - * @ip_hdr: optional IP Header content (only for IPsec legacy mode) + * Ip header must follow directly after ipsec_encap_pdb */ struct ipsec_encap_pdb { uint32_t options; @@ -350,7 +348,6 @@ struct ipsec_encap_pdb { }; uint32_t spi; uint32_t ip_hdr_len; - uint8_t ip_hdr[0]; }; static inline unsigned int @@ -776,7 +773,12 @@ cnstr_shdsc_ipsec_encap(uint32_t *descbuf, bool ps, bool swap, PROGRAM_SET_36BIT_ADDR(p); phdr = SHR_HDR(p, share, hdr, 0); __rta_copy_ipsec_encap_pdb(p, pdb, cipherdata->algtype); - COPY_DATA(p, pdb->ip_hdr, pdb->ip_hdr_len); + + /* ip header if any follows the encap_pdb */ + if (pdb->ip_hdr_len > 0) { + void *ip_hdr = pdb + 1; + COPY_DATA(p, ip_hdr, pdb->ip_hdr_len); + } SET_LABEL(p, hdr); pkeyjmp = JUMP(p, keyjmp, LOCAL_JUMP, ALL_TRUE, BOTH|SHRD); if (authdata->keylen) @@ -913,7 +915,13 @@ cnstr_shdsc_ipsec_encap_des_aes_xcbc(uint32_t *descbuf, PROGRAM_CNTXT_INIT(p, descbuf, 0); phdr = SHR_HDR(p, share, hdr, 0); __rta_copy_ipsec_encap_pdb(p, pdb, cipherdata->algtype); - COPY_DATA(p, pdb->ip_hdr, pdb->ip_hdr_len); + + /* ip header if any follows the encap_pdb */ + if (pdb->ip_hdr_len > 0) { + void *ip_hdr = pdb + 1; + COPY_DATA(p, ip_hdr, pdb->ip_hdr_len); + } + SET_LABEL(p, hdr); pkeyjump = JUMP(p, keyjump, LOCAL_JUMP, ALL_TRUE, SHRD | SELF); /*