DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: Fang TongHao <fangtonghao@sangfor.com.cn>, dev@dpdk.org
Cc: stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix secondary process change share memory
Date: Wed, 15 Jan 2020 10:30:03 +0000	[thread overview]
Message-ID: <26ad1d8b-b63c-ca40-b4cc-865e128336b8@intel.com> (raw)
In-Reply-To: <20200109023529.1285-1-fangtonghao@sangfor.com.cn>

On 09-Jan-20 2:35 AM, Fang TongHao wrote:
> Hi all,I 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.

Hi,

Thanks for your contribution! However, your patch could use some 
improvements, as it currently doesn't meet the standards expected by the 
DPDK community.

First of all, the commit log shouldn't read like an email :) Suggested 
rewording:

----
When secondary process enters `rte_eth_copy_pci_info`, it resets the 
rte_eth_dev_data.dev_flags to zero. This may cause unintended 
consequences because this is a structure that is shared between primary 
and secondary processes. Fix it by only overwriting the flags if the 
process is primary.
---

Your commit message has also incorrectly called out the offending 
function as `rte_eth_dev_copy_pci_info`, while it is actually named 
`rte_eth_copy_pci_info`.

Also, a Fixes: tag is missing. Please use git blame to find the commit 
that introduced the issue, and use the 'fixline' formatting. Please see 
Contribution Guidelines[1] on how to properly format fixline.

You will find instructions on how to submit a version 2 of the patch in 
the same document[2].

[1] 
https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-body

[2] 
https://doc.dpdk.org/guides/contributing/patches.html#steps-to-getting-your-patch-merged

-- 
Thanks,
Anatoly

  reply	other threads:[~2020-01-15 10:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09  2:35 Fang TongHao
2020-01-15 10:30 ` Burakov, Anatoly [this message]
2020-01-09  3:14 Fang TongHao
2020-01-10 15:32 ` Stephen Hemminger
2020-01-13  3:02   ` 方统浩50450
2020-01-09 12:27 Fang TongHao
2020-01-10  7:30 ` Jeff Guo
2020-01-10  7:53   ` 方统浩50450

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=26ad1d8b-b63c-ca40-b4cc-865e128336b8@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=fangtonghao@sangfor.com.cn \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).