All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Burdick, Cliff" <Cliff.Burdick@viasat.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Subject: [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs
Date: Mon, 12 Nov 2018 23:33:01 +0000	[thread overview]
Message-ID: <03A7D9A58FAFB54FBB01FEE199D7308A0134B8EE1F@wdc1exchmbxp02.hq.corp.viasat.com> (raw)

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++ application linked against the same library. The history of the patch is here:

https://dev.dpdk.narkive.com/ZM3a7QD1/dpdk-dev-bug-static-constructors-considered-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<mailto: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/common/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 = rte_eal_tailq_create(t->name);
       } else {
              t->head = rte_eal_tailq_lookup(t->name);
+              if (t->head != NULL)
+                      rte_tailqs_count++;
       }
}
@@ -188,9 +190,16 @@ rte_eal_tailqs_init(void)
              if (t->head == 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() == 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);
+                      }
              }
       }

             reply	other threads:[~2018-11-12 23:33 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-12 23:33 Burdick, Cliff [this message]
2018-11-13  9:21 ` [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs Thomas Monjalon
2018-11-13  9:39   ` Burakov, Anatoly
2018-11-13 15:45     ` Burdick, Cliff
2018-11-13 16:06       ` Thomas Monjalon
2018-11-13 16:38         ` Burdick, Cliff
2018-11-13 16:44           ` Thomas Monjalon
2018-11-13 22:08             ` Burdick, Cliff
2018-11-13 22:18               ` Thomas Monjalon
2018-11-13 23:42                 ` Burdick, Cliff
2018-11-14 11:47                   ` Bruce Richardson
2018-11-14 17:40                     ` Burdick, Cliff
2018-11-14 18:15                       ` Luca Boccassi
2018-11-14 18:24                         ` Burdick, Cliff
2018-11-15  9:33                           ` Luca Boccassi
2018-11-15 16:15                             ` Burdick, Cliff
2018-11-15 16:41                               ` Bruce Richardson
2018-11-15 16:55                                 ` Burdick, Cliff
2018-11-15 17:01                                   ` Richardson, Bruce
2018-11-15 17:05                                     ` Luca Boccassi
2018-11-15 17:17                                       ` Bruce Richardson
2018-11-15 17:36                                         ` Burdick, Cliff
2018-11-16 10:22                                           ` Bruce Richardson
2018-11-15 18:22                                         ` Luca Boccassi
2018-11-16 10:23                                           ` Bruce Richardson
  -- strict thread matches above, loose matches on Subject: below --
2016-09-22 20:46 [Bug] Static constructors considered evil Jean Tourrilhes
2016-09-22 21:17 ` [PATCH 1/1] eal: Don't fail secondary if primary is missing tailqs Jean Tourrilhes
2016-10-04 13:11   ` Sergio Gonzalez Monroy
2016-10-04 16:59     ` Jean Tourrilhes
2016-10-05  7:58       ` David Marchand
2016-10-05 16:49         ` Jean Tourrilhes
2016-10-05 17:09           ` Thomas Monjalon
2016-10-05 17:34             ` Jean Tourrilhes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03A7D9A58FAFB54FBB01FEE199D7308A0134B8EE1F@wdc1exchmbxp02.hq.corp.viasat.com \
    --to=cliff.burdick@viasat.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.