From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C3121A0C41; Fri, 16 Apr 2021 10:19:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9EF6141726; Fri, 16 Apr 2021 10:19:23 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 4FD9D141643 for ; Fri, 16 Apr 2021 10:19:22 +0200 (CEST) IronPort-SDR: VrMalSs+4SKZBNKlrxhbGvrF+Hlm4QigK+1D0ahu/vvCupAzdST4abjU3TOtA8agEAud91JaXm 3SNdrN/gCG+Q== X-IronPort-AV: E=McAfee;i="6200,9189,9955"; a="258965740" X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="258965740" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2021 01:19:21 -0700 IronPort-SDR: ZfyBKKFsFcsOw7STVg95qLcPZmiuoxg7QO2ttrtL/6zCmDDO+E/QT0my1WEeyaS84hG6ICCTdp z0Sy+54XOM4g== X-IronPort-AV: E=Sophos;i="5.82,226,1613462400"; d="scan'208";a="425510405" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.207.150]) ([10.213.207.150]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2021 01:19:19 -0700 From: Ferruh Yigit To: Gaetan Rivet , matan@mellanox.com Cc: dev@dpdk.org, Stephen Hemminger References: <20210315192722.35490-1-stephen@networkplumber.org> <20210315192722.35490-3-stephen@networkplumber.org> <0def4a36-e5e2-1a41-df84-2b237efc7758@intel.com> X-User: ferruhy Message-ID: Date: Fri, 16 Apr 2021 09:19:18 +0100 MIME-Version: 1.0 In-Reply-To: <0def4a36-e5e2-1a41-df84-2b237efc7758@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 2/2] net/failsafe: fix primary/secondary mutex 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 Sender: "dev" On 4/14/2021 2:10 PM, Ferruh Yigit wrote: > On 3/15/2021 7:27 PM, Stephen Hemminger wrote: >> Set mutex used in failsafe driver to protect when used by >> both primary and secondary process. Without this fix, the failsafe >> lock is not really locking when there are multiple secondary processes. >> >> Bugzilla ID: 662 >> Signed-off-by: Stephen Hemminger >> Fixes: 655fcd68c7d2 ("net/failsafe: fix hotplug races") >> Cc: matan@mellanox.com >> --- >>   drivers/net/failsafe/failsafe.c | 5 +++++ >>   1 file changed, 5 insertions(+) >> >> diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c >> index e3bda0df2bf9..5b7e560dbc08 100644 >> --- a/drivers/net/failsafe/failsafe.c >> +++ b/drivers/net/failsafe/failsafe.c >> @@ -140,6 +140,11 @@ fs_mutex_init(struct fs_priv *priv) >>           ERROR("Cannot initiate mutex attributes - %s", strerror(ret)); >>           return ret; >>       } >> +    /* Allow mutex to protect primary/secondary */ >> +    ret = pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED); >> +    if (ret) >> +        ERROR("Cannot set mutex shared - %s", strerror(ret)); >> + >>       /* Allow mutex relocks for the thread holding the mutex. */ >>       ret = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); >>       if (ret) { >> > > Overall looks good to me. > > Gaetan, Matan, > > Can you please test the patch? To be sure it is not causing any unexpected > functional/performance issues. > Ping.