Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/108693/?format=api
http://patches.dpdk.org/api/patches/108693/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220311200523.1020050-6-bruce.richardson@intel.com/", "project": { "id": 1, "url": "http://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20220311200523.1020050-6-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220311200523.1020050-6-bruce.richardson@intel.com", "date": "2022-03-11T20:05:23", "name": "[5/5] eventdev: fix compilation with clang C++ builds", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "d0c7e910442ed7ce73afc0067046b33459384882", "submitter": { "id": 20, "url": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20220311200523.1020050-6-bruce.richardson@intel.com/mbox/", "series": [ { "id": 22123, "url": "http://patches.dpdk.org/api/series/22123/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=22123", "date": "2022-03-11T20:05:18", "name": "build fixes on FreeBSD", "version": 1, "mbox": "http://patches.dpdk.org/series/22123/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/108693/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/108693/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "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])\n\tby inbox.dpdk.org (Postfix) with ESMTP id A8F71A00C2;\n\tFri, 11 Mar 2022 21:06:01 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B59F84115E;\n\tFri, 11 Mar 2022 21:05:36 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id D86E24114A\n for <dev@dpdk.org>; Fri, 11 Mar 2022 21:05:34 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Mar 2022 12:05:33 -0800", "from silpixa00399126.ir.intel.com ([10.237.223.34])\n by orsmga008.jf.intel.com with ESMTP; 11 Mar 2022 12:05:32 -0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1647029135; x=1678565135;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=rkEOuJ9bQgqhm/yaulgivKJr9q8nJf+LnBHWGoYzgqY=;\n b=gEm3OmjoJHkOvMMZHAXyd0SKF9fhNvnNfFGuDD21ccU8ycrQG6H+SidF\n N0AdLxFxW41La3Ui/QUhuUT/rzk2VI3c1eaWFXRkmkBZj/0ttZZw+5A7h\n VRD/hYCNWxSmJhA/3Ck4KD8dwRo2WBK4T4zdJThHMG1Jc+usYRtprTdbf\n n9OLFyw0fFeXXEaehUsX0t0YJ4KcWuwK4+jow7j2fZldUxBwb1nF0fjOB\n ir21ZQ1oeTRCkEzesYltJIihrtD29Md3614jph15L6t5ZjwLH2sintcRx\n DIP1g/E8Ngjlf4AyiyTz+wjTleNa7OijTb0iXtqwHJeVl+M89w4kw9toO A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10283\"; a=\"253207394\"", "E=Sophos;i=\"5.90,174,1643702400\"; d=\"scan'208\";a=\"253207394\"", "E=Sophos;i=\"5.90,174,1643702400\"; d=\"scan'208\";a=\"555444806\"" ], "X-ExtLoop1": "1", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "dev@dpdk.org", "Cc": "Bruce Richardson <bruce.richardson@intel.com>,\n\tpbhagavatula@marvell.com", "Subject": "[PATCH 5/5] eventdev: fix compilation with clang C++ builds", "Date": "Fri, 11 Mar 2022 20:05:23 +0000", "Message-Id": "<20220311200523.1020050-6-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.32.0", "In-Reply-To": "<20220311200523.1020050-1-bruce.richardson@intel.com>", "References": "<20220311200523.1020050-1-bruce.richardson@intel.com>", "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 <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "When compiling on FreeBSD with clang and include checking enabled,\nerrors are emitted due to differences in how empty structs/unions are\nhandled in C and C++, as C++ structs cannot have zero size.\n\n../lib/eventdev/rte_eventdev.h:992:2: error: union has size 0 in C, non-zero size in C++\n\nSince the contents of the union are all themselves of zero size,\nthe actual union wrapper is unnecessary. We therefore remove it for C++\nbuilds - though keep it for C builds for safety and clarity of\nunderstanding the code. The alignment constraint on the union is\nunnecessary in the case where the whole struct is aligned on a 16-byte\nboundary, so we add that constraint to the overall structure to ensure\nit applies for C++ code as well as C.\n\nFixes: 1cc44d409271 (\"eventdev: introduce event vector capability\")\nCc: pbhagavatula@marvell.com\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/eventdev/rte_eventdev.h | 12 +++++++++++-\n 1 file changed, 11 insertions(+), 1 deletion(-)", "diff": "diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h\nindex 67c4a5e036..42a5660169 100644\n--- a/lib/eventdev/rte_eventdev.h\n+++ b/lib/eventdev/rte_eventdev.h\n@@ -984,21 +984,31 @@ struct rte_event_vector {\n \t};\n \t/**< Union to hold common attributes of the vector array. */\n \tuint64_t impl_opaque;\n+\n+/* empty structures do not have zero size in C++ leading to compilation errors\n+ * with clang about structure having different sizes in C and C++.\n+ * Since these are all zero-sized arrays, we can omit the \"union\" wrapper for\n+ * C++ builds, removing the warning.\n+ */\n+#ifndef __cplusplus\n \t/**< Implementation specific opaque value.\n \t * An implementation may use this field to hold implementation specific\n \t * value to share between dequeue and enqueue operation.\n \t * The application should not modify this field.\n \t */\n \tunion {\n+#endif\n \t\tstruct rte_mbuf *mbufs[0];\n \t\tvoid *ptrs[0];\n \t\tuint64_t *u64s[0];\n+#ifndef __cplusplus\n \t} __rte_aligned(16);\n+#endif\n \t/**< Start of the vector array union. Depending upon the event type the\n \t * vector array can be an array of mbufs or pointers or opaque u64\n \t * values.\n \t */\n-};\n+} __rte_aligned(16);\n \n /* Scheduler type definitions */\n #define RTE_SCHED_TYPE_ORDERED 0\n", "prefixes": [ "5/5" ] }{ "id": 108693, "url": "