From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mta-us-central-02.viasat.com (mta-us-central-02.viasat.com [8.37.103.59]) by dpdk.org (Postfix) with ESMTP id E32821D7 for ; Tue, 13 Nov 2018 00:33:03 +0100 (CET) Received: from pps.filterd (wdc1mta01.viasat.com [127.0.0.1]) by wdc1mta01.viasat.com (8.16.0.22/8.16.0.22) with SMTP id wACNUx5e022702 for ; Mon, 12 Nov 2018 23:33:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=viasat.com; h=from : to : subject : date : message-id : content-type : mime-version; s=pp1; bh=7lnmTqKQtATQyh+4cQ5L76UdpvQFPWE7gPKDArLHf54=; b=eHXKdve0JGOtdr0ltlrYUg5HgDMOF5rB5gOi/IDdPhxzVbMK9jBsbY5HQQWThCWA6HNX D60qfz8fBaOQ74Ij8Rm3KoN4DaA0UJjGP0sLTulunWhN6fUlQtqa+ZRAVKqZim8i7KjA V990+Q3KZKydwScgLkFP0N4rDa9Gh5UB7zJQaOcgT8sGbLlgY4rV8WP0vUKcbje7AwgK E1AU5hVHnmwO61df4Ck60OtD/DwezgHyF6U5BCutPZUu4XoWtltlZAe4It+Ih3OGEjdv NGK1PieCLyxFTDjMTcegz0Y4btOuYwGOSp9xs9BaMnjJ9j3iZEXasYVbhPoEJQWQKTtM Ow== From: "Burdick, Cliff" To: "dev@dpdk.org" Thread-Topic: [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs Thread-Index: AdR632/vnvJ3U124TOeqdBTRFJxhhA== Date: Mon, 12 Nov 2018 23:33:01 +0000 Message-ID: <03A7D9A58FAFB54FBB01FEE199D7308A0134B8EE1F@wdc1exchmbxp02.hq.corp.viasat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-11-12_15:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1811120202 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2018 23:33:04 -0000 This patch was submitted by Jean Tourrilhes over two years ago, but didn't = receive any responses. I hit the same issue recently when trying to use cgo= (Golang) as a primary process linked to libdpdk.a against a C++ applicatio= n linked against the same library. The history of the patch is here: https://dev.dpdk.narkive.com/ZM3a7QD1/dpdk-dev-bug-static-constructors-cons= idered-evil and the original patch is here: http://mails.dpdk.org/archives/dev/2016-September/047332.html Can someone please give this another look? I don't see any other way to do = a workaround short of applying this patch. Signed-off-by: Cliff Burdick cliff.burdick@viasat.com --- lib/librte_eal/common/eal_common_tailqs.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/librte_eal/common/eal_common_tailqs.c b/lib/librte_eal/com= mon/eal_common_tailqs.c index bb08ec8..6960d06 100644 --- a/lib/librte_eal/common/eal_common_tailqs.c +++ b/lib/librte_eal/common/eal_common_tailqs.c @@ -143,6 +143,8 @@ rte_eal_tailq_update(struct rte_tailq_elem *t) t->head =3D rte_eal_tailq_create(t->name); } else { t->head =3D rte_eal_tailq_lookup(t->name); + if (t->head !=3D NULL) + rte_tailqs_count++; } } @@ -188,9 +190,16 @@ rte_eal_tailqs_init(void) if (t->head =3D=3D NULL) { RTE_LOG(ERR, EAL, "Cannot initialize tailq: %s\n", t->name); - /* no need to TAILQ_REMOVE, we are going to panic in - * rte_eal_init() */ - goto fail; + if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) = { + /* no need to TAILQ_REMOVE, we are going + * to panic in rte_eal_init() */ + goto fail; + } else { + /* This means our list of constructor is + * no the same as primary. Just remove + * that missing tailq and continue */ + TAILQ_REMOVE(&rte_tailq_elem_head, t, next); + } } }