Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.

2020-03-04 Thread 腾讯网关团队
So in my patch it was changed to only one memory access. 发件人: Stephen Hemminger 发送时间: 2020年3月5日 1:37 收件人: tgw_team(腾讯网关团队) 抄送: Tencent TGW team; Thomas Monjalon; Ferruh Yigit; Andrew Rybchenko; dev@dpdk.org 主题: Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe

Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.(Internet mail)

2020-03-04 Thread Stephen Hemminger
On Wed, 4 Mar 2020 16:38:13 + tgw_team(腾讯网关团队) wrote: > Sorry, I`ll use a real name in patch v2. > > I don't think this is a TOCTOU question. > The original code works fine when compiled with the -O3 option. > At this point the compiler will optimize to one memory access. > But when compiled

Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.(Internet mail)

2020-03-04 Thread 腾讯网关团队
Sorry, I`ll use a real name in patch v2. I don't think this is a TOCTOU question. The original code works fine when compiled with the -O3 option. At this point the compiler will optimize to one memory access. But when compiled with -O0, there will be two memory accesses, which is wrong. This chang

Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.

2020-03-04 Thread 腾讯网关团队
As a newcomer, I'm sorry for my mistakes. I will try to do better in the future. >On 3/4/20 5:05 PM, Tencent TGW team wrote: >> When compiling with -O0, >> the compiler does not optimize two memory accesses into one. >> Leads to accessing a null pointer when calling the RX callback. >> The way to

Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.

2020-03-04 Thread Stephen Hemminger
On Wed, 4 Mar 2020 22:05:43 +0800 Tencent TGW team wrote: > When compiling with -O0, > the compiler does not optimize two memory accesses into one. > Leads to accessing a null pointer when calling the RX callback. > The way to access the TX callback is correct. > > Signed-off-by: Tencent TGW te

Re: [dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.

2020-03-04 Thread Andrew Rybchenko
On 3/4/20 5:05 PM, Tencent TGW team wrote: > When compiling with -O0, > the compiler does not optimize two memory accesses into one. > Leads to accessing a null pointer when calling the RX callback. > The way to access the TX callback is correct. It looks like the patch is not passed through check

[dpdk-dev] [PATCH] rte_ethdev: fix unsafe memory access by calling RX callback.

2020-03-04 Thread Tencent TGW team
When compiling with -O0, the compiler does not optimize two memory accesses into one. Leads to accessing a null pointer when calling the RX callback. The way to access the TX callback is correct. Signed-off-by: Tencent TGW team --- lib/librte_ethdev/rte_ethdev.h | 6 ++ 1 file changed, 2 ins