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 EBB93A04F9; Fri, 10 Jan 2020 16:32:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 75A4A1EB40; Fri, 10 Jan 2020 16:32:26 +0100 (CET) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id 94E2A1EB3C for ; Fri, 10 Jan 2020 16:32:24 +0100 (CET) Received: by mail-pj1-f68.google.com with SMTP id a6so1112279pjh.2 for ; Fri, 10 Jan 2020 07:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=p56T31Ih0shL0Y7NYq3LYQ8p9PK0zIqwDlZhTQUXI1A=; b=Q9T5KZ7cEvGVLRMDTOIv6Pw0Ox3gFTwRS/OCOZRmbQCAnqR5KxkOpcA4RlX2aToDke dPRsddZucS20GzCZX25AqIcFr4nAkpZt8wvaBYUP/cS6oDCXc/KfhRco3FNz4EFgEBXR nl9qlQp8e8qGgqPIA6GJvT6+Hn5RAVqrLtwDxsFA0vwOkXp9kUNuAdQPAzljZ7wtkI5i SjgYYzJ2mJkZ6dNGLYkVvP8RFZVb2kOyCf4h9AOHQqrxSpqcng9tvXYF2xfxrJb3ibPq X70ZnX+KosphGzV+2/34j0YL/Gbhxfz2QQBeYNepNEJ8hkJMkJI1TGthL3l+c1ho9kLL qYBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=p56T31Ih0shL0Y7NYq3LYQ8p9PK0zIqwDlZhTQUXI1A=; b=elwAxnShwxk5x7IiMBj25NrcJ4uOkl0OEfpaymJPNovJGcXy7pkQ+bgHry9qfZAQOk wFZWslDBbCQ98+LnwZfLWFBUIbG+EYzJT+vmP1P67t9t4XiB9/gv0Srah9QRudvK/9Gm 9dE4mL7ZKuNlishA+7zgekDKtJgh1qVWZD8D99+aJHRnDE2WwVzl+4Y2uXbrs6Cj3Iiv c6BNAOcM9n5xLGISRc7eAylhjcyOv5xMhMSe69qbEAj70AFAiGyVQWmndjJeE/KPSC5R yE5ruO2QVX2J0hY5kCSmPUDCZ+nj2AU7uliOy7MVodSxN476Hj40VMnw9LDZ6vdugl+W 2Nig== X-Gm-Message-State: APjAAAWEl9Ze7c16DvEVhR/St53p+2VwrR6/bD0uz/5vTmbykidk10Td ZjAG832Xk4yy8LyTjrGAunC/lw== X-Google-Smtp-Source: APXvYqyJwG/cbxDo0+1e2138dZ3VJ3tr5kHYXupFEpErR+PDXy0Uc2PlWHU1U4bEZ9OSKWr1uCk/Fg== X-Received: by 2002:a17:902:b210:: with SMTP id t16mr4902991plr.65.1578670343712; Fri, 10 Jan 2020 07:32:23 -0800 (PST) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y6sm3321288pgc.10.2020.01.10.07.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 07:32:23 -0800 (PST) Date: Fri, 10 Jan 2020 07:32:15 -0800 From: Stephen Hemminger To: Fang TongHao Cc: thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, dev@dpdk.org, stable@dpdk.org, cunming.liang@intel.com, jia.guo@intel.com Message-ID: <20200110073215.09ad9a6f@hermes.lan> In-Reply-To: <20200109031425.1338-1-fangtonghao@sangfor.com.cn> References: <20200109031425.1338-1-fangtonghao@sangfor.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [dpdk-dev] [PATCH] ethdev: fix secondary process change share memory 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thu, 9 Jan 2020 11:14:25 +0800 Fang TongHao wrote: > Hi all=EF=BC=8CI am from Sangfor Tech.I found a bug when using DPDK in > multiprocess scenario.The secondary process enters > "rte_eth_dev_pci_copy_info" function when initializing.Then it > sets the value of struct "rte_eth_dev_data.dev_flags" to zero, > but this struct is shared by primary process and secondary > process, and the value change is unexpected by primary process. > This may cause very serious damage.I think > the secondary process should not enter "rte_eth_dev_pci_copy_info" > function or changes the value of struct "rte_eth_dev_data.dev_flags" > in shared memory. > I fixed this bug by adding an if-statement to forbid the secondary > process changing the above-mentioned value. > Thansk, All. >=20 > Signed-off-by: Fang TongHao Most of the drivers avoid calling rte_eth_dev_pci_copy_info in the secondary process, which one are you using?