From: "Wei Hu (Xavier)" <xavier_huwei@163.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>,
"Wei Hu (Xavier)" <huwei013@chinasoftinc.com>,
dev@dpdk.org
Cc: stable@dpdk.org, thomas@monjalon.net, ferruh.yigit@intel.com
Subject: Re: [dpdk-dev] [PATCH v2] ethdev: fix updating device data when ops pointer is NULL
Date: Fri, 17 Jan 2020 19:45:54 +0800 [thread overview]
Message-ID: <1adaf1bc-c917-1c1d-baeb-9827248ce9f0@163.com> (raw)
In-Reply-To: <d89e5d2c-b460-d640-8f7f-1af749ce4410@solarflare.com>
Hi,Andrew Rybchenko
On 2020/1/17 15:57, Andrew Rybchenko wrote:
> On 1/17/20 9:23 AM, Wei Hu (Xavier) wrote:
>> From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
>
> I think summary is misleading. It is too generic and does not
> mention VLAN offloads. Consider something like:
> ethdev: fix VLAN offloads set if no driver callback
>
>> Currently, there is a potential problem that changing the content of
>> dev->data->dev_conf.rxmode.offloads even when the pointer named
>> dev->dev_ops->vlan_offload_set is NULL in the API function named
>> rte_eth_dev_set_vlan_offload.
>
> Consider to change
> "when the pointer named dev->dev_ops->vlan_offload_set is NULL in the
> API function named rte_eth_dev_set_vlan_offload." to "when there is no
> vlan_offload_set driver callback."
>
>> It is a good idea that prevent the side effect and make the API return
>> success if no change requested. This patch fixes the problem, the detail
>> information as below:
>> - Update a local 'dev_offloads' variable, instead of directly updating the
>> device config data
>> - if no change requested, "mask == 0", return success
>> - if change requested, check the 'vlan_offload_set' dev_ops in this stage
>> - assign the local 'dev_offloads' to 'dev->data->dev_conf.rxmode.offloads'
>> and call the dev_ops
>> - On error recover the 'dev->data->dev_conf.rxmode.offloads' to
>> 'orig_offloads'
>
> I see no point to repeat in description what the code does.
> IMHO it is sufficient to mention main ideas:
> - keep possibility to do dummy set even if there is no driver
> callback
> - do not touch Rx mode offloads in device data before
> checking the driver callback availability
> - ensure that Rx mode offloads are rolled back correctly if
> driver callback returns error
>
>> Fixes: 01eb53eefeb4 ("ethdev: rename folder to library name")
>
> I think it is wrong Fixes. Rename just moves the code, it is
> not the changeset which introduces the bug.
>
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
>> Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
>> Signed-off-by: Min Wang (Jushui) <wangmin3@huawei.com>
>> Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
>
> with above notes processed
>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>
Thanks for your comments, I will update it and send V3.
Regards
Xavier
prev parent reply other threads:[~2020-01-17 11:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 6:23 Wei Hu (Xavier)
2020-01-17 7:57 ` Andrew Rybchenko
2020-01-17 11:45 ` Wei Hu (Xavier) [this message]
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=1adaf1bc-c917-1c1d-baeb-9827248ce9f0@163.com \
--to=xavier_huwei@163.com \
--cc=arybchenko@solarflare.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=huwei013@chinasoftinc.com \
--cc=stable@dpdk.org \
--cc=thomas@monjalon.net \
/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).