From patchwork Thu Jun 2 11:04:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yi He X-Patchwork-Id: 69148 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp53649qgf; Thu, 2 Jun 2016 04:05:03 -0700 (PDT) X-Received: by 10.140.32.37 with SMTP id g34mr41073535qgg.31.1464865503407; Thu, 02 Jun 2016 04:05:03 -0700 (PDT) Return-Path: Received: from lists.linaro.org (lists.linaro.org. [54.225.227.206]) by mx.google.com with ESMTP id x14si11359334qkb.231.2016.06.02.04.05.03; Thu, 02 Jun 2016 04:05:03 -0700 (PDT) Received-SPF: pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) client-ip=54.225.227.206; Authentication-Results: mx.google.com; spf=pass (google.com: domain of lng-odp-bounces@lists.linaro.org designates 54.225.227.206 as permitted sender) smtp.mailfrom=lng-odp-bounces@lists.linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id 08C5E61775; Thu, 2 Jun 2016 11:05:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on ip-10-142-244-252 X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by lists.linaro.org (Postfix) with ESMTP id 05DD061714; Thu, 2 Jun 2016 11:04:59 +0000 (UTC) X-Original-To: lng-odp@lists.linaro.org Delivered-To: lng-odp@lists.linaro.org Received: by lists.linaro.org (Postfix, from userid 109) id E648D6170A; Thu, 2 Jun 2016 11:04:56 +0000 (UTC) Received: from mail-pf0-f181.google.com (mail-pf0-f181.google.com [209.85.192.181]) by lists.linaro.org (Postfix) with ESMTPS id D50DA6170A for ; Thu, 2 Jun 2016 11:04:38 +0000 (UTC) Received: by mail-pf0-f181.google.com with SMTP id b124so30308518pfb.0 for ; Thu, 02 Jun 2016 04:04:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4S9duDeRNHmSbOVinAnGLGW2svU+g3jE2SJFGArLzVE=; b=O33UOckBhnGpmGBfFz74H574x+Rj5biqUElC2teodZ2FHDgFM+EA6LOX/X1Vf/v8Ta eQdJX3hbV1AlGudAgz4H6eeYuAMKaMEjBdE2tnPawAbrDmdJMCWpG968ahyFXWqiYmsS 7LuQUEQ95RvS2Xrkh9VMRsLe8Xce8FjO7cEXT058OZdt72IwWHx/mFAZa5iGIy0Z3n+e B5xgoISdR8iyvDqXpxOoHvH5Ywo1QO6Lb6zfYYWnM+s/v+XL97UF6JQtLi1LSK5ubZ0X rtPmvezxkA5WgeSxM9JsAd9em12Cpxj5SJndid8qDSX+USrfzzAjSZ/ycY2TSoe9VVO1 0MVQ== X-Gm-Message-State: ALyK8tKF5Y9grNucYk3ZAMc6h1hfCdwuvee2z+wwp37MxmTkRTw5ZO/ANoKs+9CXGCL0Otfu2HM= X-Received: by 10.98.5.196 with SMTP id 187mr3285995pff.133.1464865478090; Thu, 02 Jun 2016 04:04:38 -0700 (PDT) Received: from ubuntu.heyii.co (ubuntu.heyii.co. [45.32.66.203]) by smtp.googlemail.com with ESMTPSA id lg17sm69402351pab.36.2016.06.02.04.04.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 02 Jun 2016 04:04:37 -0700 (PDT) From: Yi He To: lng-odp@lists.linaro.org Date: Thu, 2 Jun 2016 11:04:15 +0000 Message-Id: <1464865456-29702-2-git-send-email-yi.he@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1464865456-29702-1-git-send-email-yi.he@linaro.org> References: <1464865456-29702-1-git-send-email-yi.he@linaro.org> X-Topics: patch Subject: [lng-odp] [PATCH 2/3] linux-generic: pktio: ipc: _ring_tailq_init() at global init X-BeenThere: lng-odp@lists.linaro.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: "The OpenDataPlane \(ODP\) List" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: lng-odp-bounces@lists.linaro.org Sender: "lng-odp" Fix the uninitialized Q and RW lock which may cause occasional segmentation fault in _ring_create() etc. Signed-off-by: Yi He --- platform/linux-generic/pktio/ipc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 8508824..e11da86 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -737,10 +737,16 @@ static int ipc_close(pktio_entry_t *pktio_entry) return 0; } +static int ipc_pktio_init_global(void) +{ + _ring_tailq_init(); + return 0; +} + const pktio_if_ops_t ipc_pktio_ops = { .name = "ipc", .print = NULL, - .init_global = NULL, + .init_global = ipc_pktio_init_global, .init_local = NULL, .term = NULL, .open = ipc_pktio_open,