From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55E2EA04C3 for ; Thu, 14 Nov 2019 12:42:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB06C2BF9; Thu, 14 Nov 2019 12:42:39 +0100 (CET) Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by dpdk.org (Postfix) with ESMTP id B9FD4374; Thu, 14 Nov 2019 12:42:35 +0100 (CET) Received: by mail-pf1-f196.google.com with SMTP id q13so4069498pff.2; Thu, 14 Nov 2019 03:42:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tmZRe7LpVICFhneKMB6kPsgyr1XK8GjyniMFEBtrMfw=; b=pqNtkzAjSXdPv1H1hPIaB3GrzmXla+GBcCj2Tx8KK9zDqxb/hosacC0gc1Vir6+1bl fxqBY9476Rk0qct4GbqxKrzpw628s8GNa6YLM766JucvQVb2WBbZ79CzdX94XEBlt5PJ HUk+KgSMpT7nXHiYci8B4+nVaM9rB3CMC+Lak55EePQh1Ol1TAxY5LYWZE3zmPs2d9yD btM+HJF1UzWSF6Ydl7GM24vEcY+Rk/5RfDCMGuWkVmvqZwt8GYhIQ25KbM7288NsC8/y BoMX4BdxkklIyuUsrj70hp/AHIATtW9LkYSiqMPXVQiLBrZa4y/Xmk+1f4YDQBd3if2m +oQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tmZRe7LpVICFhneKMB6kPsgyr1XK8GjyniMFEBtrMfw=; b=hlN/O1IwCCRkg0AEa7sBpWH5SMxypT3BcKP0zKLcyEmeiRQacedaDVUIC3O1OM0ERg I2PXMm4S2rcB9JB2Mv6xouPSYB5+/BcbUUDRk5EhfNtT+Y3pB7wfeyxOStNa9j1pQ3ei hcfSUybck6ZANOJCmcRI/SUErywclremII990pmibXCmvbQhEG0rSICNRjGqtG4fxhKZ n+uXu+oFwn72dt2ycU6zJJwJ8bNuntpEeO5sVT+gxshAIt3n17cF3oXS/bvYiGPHMa0L elGvP3fvBSuUqdyg5UV0KIKciT92dj4zVlpdRR3J9FsG6U3n04z+6f7Wfjnlj/QYEvIT MRIQ== X-Gm-Message-State: APjAAAXZul7ca7UYQ1UkF0Oy/ptgTN/WB3DZ6ailFiXWG9G9bR3VLTsx dzChY550o1xAOQj9wb69V/0= X-Google-Smtp-Source: APXvYqx/hVzLuZoYVuNQXUJNraTMWAph3suXyF+7WuotgE/7BYe2Oxt6JIjsZ6sbIGeeCqcOdzA7BA== X-Received: by 2002:a63:d0a:: with SMTP id c10mr9963153pgl.203.1573731754875; Thu, 14 Nov 2019 03:42:34 -0800 (PST) Received: from mugwort.local ([209.136.236.94]) by smtp.gmail.com with ESMTPSA id u65sm6478067pfb.35.2019.11.14.03.42.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2019 03:42:34 -0800 (PST) To: "Burakov, Anatoly" , david.marchand@redhat.com, konstantin.ananyev@intel.com Cc: dev@dpdk.org, stable@dpdk.org, Yasufumi Ogawa References: <20190724082031.45546-1-yasufum.o@gmail.com> <20191113214346.33749-1-yasufum.o@gmail.com> <20191113214346.33749-2-yasufum.o@gmail.com> <6a6d7228-f22b-9ba5-c288-1701b738b7c4@intel.com> From: Yasufumi Ogawa Message-ID: <61dd1730-3c80-da57-126d-84596b23ff31@gmail.com> Date: Thu, 14 Nov 2019 03:42:33 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: <6a6d7228-f22b-9ba5-c288-1701b738b7c4@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-stable] [PATCH v7 1/1] fbarray: fix duplicated fbarray file in secondary X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On 2019/11/14 2:01, Burakov, Anatoly wrote: > On 13-Nov-19 9:43 PM, yasufum.o@gmail.com wrote: >> From: Yasufumi Ogawa >> >> In secondary_msl_create_walk(), it creates a file for fbarrays with its >> PID for reserving unique name among secondary processes. However, it >> does not work if several secondaries run as app containers because each >> of containerized secondary has PID 1, and failed to reserve unique name >> other than first one. To reserve unique name in each of containers, use >> hostname in addition to PID. >> >> Cc: stable@dpdk.org >> >> Signed-off-by: Yasufumi Ogawa >> --- >>   lib/librte_eal/linux/eal/eal_memalloc.c | 16 +++++++++++++--- >>   1 file changed, 13 insertions(+), 3 deletions(-) >> >> diff --git a/lib/librte_eal/linux/eal/eal_memalloc.c >> b/lib/librte_eal/linux/eal/eal_memalloc.c >> index af6d0d023..11de6d4d6 100644 >> --- a/lib/librte_eal/linux/eal/eal_memalloc.c >> +++ b/lib/librte_eal/linux/eal/eal_memalloc.c >> @@ -1365,6 +1365,12 @@ secondary_msl_create_walk(const struct >> rte_memseg_list *msl, >>       struct rte_memseg_list *primary_msl, *local_msl; >>       char name[PATH_MAX]; >>       int msl_idx, ret; >> +    char hostname[HOST_NAME_MAX+1] = { 0 }; >> +    /* filename of secondary's fbarray is defined such as >> +     * "fbarray_memseg-1048576k-0-0_PID_HOSTNAME" and length of PID >> +     * can be 7 digits maximumly. >> +     */ >> +    int fbarray_sec_name_len = 32 + 7 + 1 + HOST_NAME_MAX + 1; > > What does 32 stand for? Maybe #define both 32 and 7 values? Hi Anatoly, Thank you for your comments! If my understanding is correct, the prefix "fbarray_memseg-1048576k-0-0_" is 28 digits and it could be larger if using the size of hugepage or the number of NUMA nodes are larger possibly. However, I think 32 digits is still enough. > Maybe #define both 32 and 7 values? Yes. I think it should be better to use #define if this values are referred several times. Thanks, Yasufumi > > Other than that, > > Acked-by: Anatoly Burakov >