[PATCH v3] vhost: avoid potential null pointer access

2023-09-12 Thread Li Feng
If the user calls rte_vhost_vring_call() on a ring that has been invalidated, we will encounter SEGV. We should check the pointer firstly before accessing it. Signed-off-by: Li Feng --- v2 -> v3: - Also fix the rte_vhost_vring_call_nonblock. v1 -> v2: - Fix rebase error. lib/vhost/v

[PATCH v2] vhost: avoid potential null pointer access

2023-08-30 Thread Li Feng
If the user calls rte_vhost_vring_call() on a ring that has been invalidated, we will encounter SEGV. We should check the pointer firstly before accessing it. Signed-off-by: Li Feng --- lib/vhost/vhost.c | 7 --- lib/vhost/vhost.h | 12 ++-- 2 files changed, 14 insertions(+), 5

Re: [PATCH] vhost: avoid potential null pointer access

2023-08-30 Thread Li Feng
Sorry, ignore this patch, there is a rebase error. I will fix it in V2. > On 30 Aug 2023, at 4:47 PM, Li Feng wrote: > > If the user calls rte_vhost_vring_call() on a ring that has been > invalidated, we will encounter SEGV. > > We should check the pointer firstly b

[PATCH] vhost: avoid potential null pointer access

2023-08-30 Thread Li Feng
If the user calls rte_vhost_vring_call() on a ring that has been invalidated, we will encounter SEGV. We should check the pointer firstly before accessing it. Signed-off-by: Li Feng --- lib/vhost/vhost.c | 7 --- lib/vhost/vhost.h | 12 ++-- 2 files changed, 14 insertions(+), 5

Re: [PATCH v2] eal/linux: enable the hugepage mem dump

2022-04-05 Thread Li Feng
On Wed, Apr 6, 2022 at 6:46 AM Stephen Hemminger wrote: > > On Fri, 1 Apr 2022 17:10:04 +0800 > Li Feng wrote: > > > These hugepages include important structures. we should dump these > > hugepages into a coredump file for debugging when generating a coredump. > &

[PATCH v2] eal/linux: enable the hugepage mem dump

2022-04-01 Thread Li Feng
These hugepages include important structures. we should dump these hugepages into a coredump file for debugging when generating a coredump. Signed-off-by: Li Feng --- lib/eal/linux/eal_memalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux

Re: [PATCH] eal/linux: enable the hugepage mem dump

2022-04-01 Thread Li Feng
On Thu, Mar 31, 2022 at 10:47 PM Burakov, Anatoly wrote: > > On 08-Mar-22 9:41 AM, Li Feng wrote: > > These hugepages include important structures. We should dump these > > hugepages into a coredump file for debugging when generating a coredump. > > > > Signed-off-

[PATCH] eal/linux: enable the hugepage mem dump

2022-03-08 Thread Li Feng
These hugepages include important structures. We should dump these hugepages into a coredump file for debugging when generating a coredump. Signed-off-by: Li Feng --- lib/eal/linux/eal_memalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/linux/eal_memalloc.c b/lib/eal/linux

Re: [dpdk-dev] [PATCH v2] vhost: call destroy_device always in vhost_destroy_device_notify

2021-11-04 Thread Li Feng
ried that long time ago. I suggest you to submit a SPDK issue so that we > can take a look too. > Thanks, I think just changing spdk may not solve this problem. OK, I have submit a issue here: https://github.com/spdk/spdk/issues/2228 > > -----Original Message- > > From: Li

Re: [dpdk-dev] [PATCH v2] vhost: call destroy_device always in vhost_destroy_device_notify

2021-11-04 Thread Li Feng
Add Liu Changpeng. On Thu, Oct 14, 2021 at 8:49 PM Li Feng wrote: > > Thanks, > Feng Li > > On Thu, Oct 14, 2021 at 8:28 PM Maxime Coquelin > wrote: > > > > > > > > On 10/14/21 14:12, Li Feng wrote: > > > On Thu, Oct 14, 2021 at 8:01 P

Re: [dpdk-dev] [PATCH v2] vhost: add sanity check when operating the split ring

2021-10-15 Thread Li Feng
On Fri, Oct 15, 2021 at 4:52 PM Maxime Coquelin wrote: > > The title is too vague, I would put something like: > > vhost: add sanity check on inflight last index > > On 10/14/21 14:40, Li Feng wrote: > > The idx in rte_vhost_set_last_inflight_io_split is from the

Re: [dpdk-dev] [PATCH v2] vhost: call destroy_device always in vhost_destroy_device_notify

2021-10-14 Thread Li Feng
Thanks, Feng Li On Thu, Oct 14, 2021 at 8:28 PM Maxime Coquelin wrote: > > > > On 10/14/21 14:12, Li Feng wrote: > > On Thu, Oct 14, 2021 at 8:01 PM Maxime Coquelin > > wrote: > >> > >> Hi Li, > >> > >> The commit message i

[dpdk-dev] [PATCH v2] vhost: add sanity check when operating the split ring

2021-10-14 Thread Li Feng
The idx in rte_vhost_set_last_inflight_io_split is from the frontend driver, check if it's in the virtqueue range. Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring") Cc: sta...@dpdk.org Signed-off-by: Li Feng --- lib/vhost/vhost.c | 3 +++ 1 file changed, 3 inse

Re: [dpdk-dev] [PATCH v2] vhost: call destroy_device always in vhost_destroy_device_notify

2021-10-14 Thread Li Feng
On Thu, Oct 14, 2021 at 8:01 PM Maxime Coquelin wrote: > > Hi Li, > > The commit message is not compliant with the contributors guidelines: > https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-subject-line OK, I got it. > > On 9/3/21 10:02, Li Feng wrote:

Re: [dpdk-dev] [PATCH v1] vhost: add sanity check for resubmiting reqs in split ring

2021-10-14 Thread Li Feng
On Thu, Oct 14, 2021 at 7:38 PM Maxime Coquelin wrote: > > > > On 10/14/21 13:25, Li Feng wrote: > > Thank you for your response. > > > > On Thu, Oct 14, 2021 at 4:17 PM Maxime Coquelin > > wrote: > >> > >> Hi Li, > >> > >>

Re: [dpdk-dev] [PATCH v1] vhost: add sanity check for resubmiting reqs in split ring

2021-10-14 Thread Li Feng
Thank you for your response. On Thu, Oct 14, 2021 at 4:17 PM Maxime Coquelin wrote: > > Hi Li, > > Adding Jin Yu who introduced this function. > > On 8/27/21 07:12, Li Feng wrote: > > When getting reqs from the avail ring, the id may exceed inflight > > queue

[dpdk-dev] [PATCH v2] vhost: call destroy_device always in vhost_destroy_device_notify

2021-09-03 Thread Li Feng
. Mount a ISO to a VM, start the VM, don't install the OS; 3. Restart the spdk_tgt; Another discusstion is in seabiso: https://patchew.org/Seabios/20210831122339.2591585-1-fen...@smartx.com/ Signed-off-by: Li Feng --- v2: Fix the commit msg typo: vas -> virtqueues. -- lib/vhost/vhost.c |

[dpdk-dev] [PATCH] vhost: call destroy_device always in vhost_destroy_device_notify

2021-09-03 Thread Li Feng
a ISO to a VM, start the VM, don't install the OS; 3. Restart the spdk_tgt; Another discusstion is in seabiso: https://patchew.org/Seabios/20210831122339.2591585-1-fen...@smartx.com/ Signed-off-by: Li Feng --- lib/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

Re: [dpdk-dev] [PATCH v1] vhost: add sanity check for resubmiting reqs in split ring

2021-08-31 Thread Li Feng
ping... BTW, how could I retrigger the failure CI? The failure is not about this patch. Thanks, Feng Li Li Feng 于2021年8月27日周五 下午1:16写道: > > When getting reqs from the avail ring, the id may exceed inflight > queue size. Then the dpdk will crash forever. > > Signed-off-by: Li Fen

[dpdk-dev] [PATCH v1] vhost: add sanity check for resubmiting reqs in split ring

2021-08-26 Thread Li Feng
When getting reqs from the avail ring, the id may exceed inflight queue size. Then the dpdk will crash forever. Signed-off-by: Li Feng --- lib/vhost/vhost_user.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/vhost/vhost_user.c b/lib/vhost/vhost_user.c index

[dpdk-dev] [PATCH] librte_eal: add APIs to speedup virt2iova/phys

2021-03-28 Thread Li Feng
Hi david, Sorry for late response. I just see your mail on my trip. I will update this patch, if anyone has interest in this feature. Currently it's in my own repo. 在 2021年3月25日星期四,David Marchand 写道: > Hello, > > On Mon, Apr 20, 2020 at 4:13 PM Li Feng wrote: > > > >

[dpdk-dev] [PATCH v4] log: support custom log function

2021-02-17 Thread Li Feng
nario. Signed-off-by: Li Feng --- v4: Fix the code style. v3: Rename the func, change the comments, add funcs in version.map. v2: Simplify the code. lib/librte_eal/include/rte_log.h | 31 +++ lib/librte_eal/linux/eal_log.c | 23 +++ lib/librte_eal/versio

[dpdk-dev] [PATCH v3] log: support custom log function

2021-02-09 Thread Li Feng
nario. Signed-off-by: Li Feng --- v3: Rename the func, change the comments, add funcs in version.map. v2: Simplify the code. lib/librte_eal/include/rte_log.h | 29 + lib/librte_eal/linux/eal_log.c | 21 + lib/librte_eal/version.map | 2 ++

[dpdk-dev] [PATCH v2] log: support custom log function

2021-02-05 Thread Li Feng
nario. Change-Id: I3b2419cc2fe5256205daa8077fd8862a8e58fb6c Signed-off-by: Li Feng --- v2: simplify the code. lib/librte_eal/include/rte_eal.h | 16 lib/librte_eal/linux/eal_log.c | 10 ++ 2 files changed, 26 insertions(+) diff --git a/lib/librte_eal/include/rte_eal.h

[dpdk-dev] [PATCH] log: support custom log function

2021-02-05 Thread Li Feng
Currently, the dpdk log is out to stdout/stderr and syslog. We should support to output the log to another please, e.g. file or glog. Signed-off-by: Li Feng --- lib/librte_eal/common/eal_private.h | 10 -- lib/librte_eal/include/rte_eal.h| 22 ++ lib/librte_eal

Re: [dpdk-dev] [PATCH] mem: mark pages as not accessed when returning back to memory pool

2020-04-25 Thread Li Feng
Thanks, Feng Li David Marchand 于2020年4月25日周六 上午1:10写道: > > On Fri, Apr 24, 2020 at 12:43 PM Li Feng wrote: > > > > Commit 8a4baf06c17a ("mem: mark pages as not accessed when reserving VA") > > has mapped the initialized memory with PROT_NONE, and when it

[dpdk-dev] [PATCH v6] eal: use madvise to exclude unmapped memory from being dumped

2020-04-24 Thread Li Feng
Use `madvise()` call with MADV_DONTDUMP parameter to exclude the unmapped memory from being dumped. Signed-off-by: Li Feng --- v6: - use RTE_DONTDUMP in right place. v5: - fix a code style. V4: - simplify the code; - remove the undo code in V3; V3: - add support for freebsd. - when free_s

[dpdk-dev] [PATCH v5] eal: use madvise to exclude unmapped memory from being dumped

2020-04-24 Thread Li Feng
Use `madvise()` call with MADV_DONTDUMP parameter to exclude the unmapped memory from being dumped. Signed-off-by: Li Feng --- v5: - fix a code style. V4: - simplify the code; - remove the undo code in V3; V3: - add support for freebsd. - when free_seg is called, mark the memory MADV_DON

[dpdk-dev] [PATCH v4] eal: use madvise to exclude unmapped memory from being dumped

2020-04-24 Thread Li Feng
Use `madvise()` call with MADV_DONTDUMP parameter to exclude the unmapped memory from being dumped. Signed-off-by: Li Feng --- V4: - simplify the code; - remove the undo code in V3; V3: - add support for freebsd. - when free_seg is called, mark the memory MADV_DONTDUMP. - when alloc_seg is c

Re: [dpdk-dev] [PATCH v2] eal: use madvise to exclude unmapped memory from being dumped

2020-04-24 Thread Li Feng
Thanks, Feng Li Burakov, Anatoly 于2020年4月24日周五 下午7:23写道: > > On 24-Apr-20 11:50 AM, Li Feng wrote: > > Currently, even though memory is mapped with PROT_NONE, this does not > > cause it to be excluded from core dumps. This is counter-productive, > > because in a lot of

Re: [dpdk-dev] [PATCH v2] eal: add madvise to avoid dump memory

2020-04-24 Thread Li Feng
Thanks, Feng Li Burakov, Anatoly 于2020年4月24日周五 下午7:00写道: > > On 24-Apr-20 10:33 AM, Feng Li wrote: > > Bruce Richardson 于2020年4月24日周五 下午5:14写道: > >> > >> On Fri, Apr 24, 2020 at 10:12:10AM +0100, Burakov, Anatoly wrote: > >>> On 23-Apr-20 9:04 PM, David Marchand wrote: > On Thu, Apr 23, 20

[dpdk-dev] [PATCH v2] eal: use madvise to exclude unmapped memory from being dumped

2020-04-24 Thread Li Feng
Use `madvise()` call with MADV_DONTDUMP parameter to exclude the unmapped memory from being dumped. Signed-off-by: Li Feng --- V2: - add support for freebsd. - when free_seg is called, mark the memory MADV_DONTDUMP. - when alloc_seg is called, mark the memory MADV_DODUMP. lib/librte_eal/c

[dpdk-dev] [PATCH] mem: mark pages as not accessed when returning back to memory pool

2020-04-24 Thread Li Feng
Commit 8a4baf06c17a ("mem: mark pages as not accessed when reserving VA") has mapped the initialized memory with PROT_NONE, and when it's unmapped, eal_memalloc.c should remmap the anonymous memory with PROT_NONE too. Signed-off-by: Li Feng --- lib/librte_eal/linux/eal_memalloc.c

[dpdk-dev] [PATCH v2] eal: add madvise to avoid dump memory

2020-04-23 Thread Li Feng
Avoid dump all mapped memory to a core dump file when crash. Otherwise it will very large and it's hard to analyze with gdb. In my test, it will dump 128GiB memory to a core dump file when integrated to spdk with default configuration. Signed-off-by: Li Feng --- lib/librte_eal/c

Re: [dpdk-dev] [PATCH] eal: add madvise to avoid dump memory

2020-04-21 Thread Li Feng
Really?So weird. I have tested on 4 machines, running CentOS 7. The core dump size is the same as the first argument GiB. Thanks, Feng Li Burakov, Anatoly 于2020年4月22日周三 上午1:02写道: > > On 21-Apr-20 5:38 PM, Feng Li wrote: > > Hi Anatoly, > > > > This program could run like this: > > gcc test_map.

Re: [dpdk-dev] [PATCH] librte_eal: add APIs to speedup virt2iova/phys

2020-04-20 Thread Li Feng
Cool, thank you, Anatoly and Kozlyuk. I haven't found how Windows implements the rte_mem_virt2phy. Using an opaque structure pointer as the first argument is a good idea. Thanks, Feng Li Dmitry Kozlyuk 于2020年4月20日周一 下午9:07写道: > > > On 20-Apr-20 12:09 PM, Li Feng wrote: > &

[dpdk-dev] [PATCH] librte_eal: add APIs to speedup virt2iova/phys

2020-04-20 Thread Li Feng
. Signed-off-by: Li Feng --- lib/librte_eal/freebsd/eal_memory.c | 18 ++ lib/librte_eal/include/rte_memory.h | 36 +++ lib/librte_eal/linux/eal_memory.c | 49 +++-- lib/librte_eal/rte_eal_version.map | 3 +++ 4 files changed, 88

Re: [dpdk-dev] [PATCH] eal: add madvise to avoid dump memory

2020-04-20 Thread Li Feng
Add cc dev@dpdk.org Thanks, Feng Li Li Feng 于2020年4月20日周一 下午3:04写道: > > Avoid dump all mmapped memory to coredump file when crash. > Otherwise it will very large and it's hard to analyze with gdb. > > In my test, it will dump 128GiB memory to coredump file when integ

[dpdk-dev] [PATCH v5] vhost: add config change slave msg support

2019-12-20 Thread Li Feng
fetch the configuration, this need an extra thread to process the vhost message. Signed-off-by: Li Feng --- v5: * Fix code style. v4: * Fix type and code style. * Add need_reply support. v3: * Move the declare to rte_vhost.h * Add the symbol in rte_vhost_version.map v2: * Fix a little log typo

[dpdk-dev] [PATCH v4] vhost: add config change slave msg support

2019-12-19 Thread Li Feng
fetch the configuration, this need an extra thread to process the vhost message. Signed-off-by: Li Feng --- v4: * Fix type and code style. * Add need_reply support. v3: * Move the declare to rte_vhost.h * Add the symbol in rte_vhost_version.map v2: * Fix a little log typo. lib/librte_vhost

Re: [dpdk-dev] [PATCH v3] vhost: add config change slave msg support

2019-12-17 Thread Li Feng
Thanks. Tiwei Bie 于2019年12月16日周一 下午1:05写道: > > On Thu, Dec 05, 2019 at 01:38:33PM +0800, Li Feng wrote: > > This msg is used to notify qemu that should get the config of backend. > > > > For example, vhost-user-blk uses this msg to notify guest os the > > co

Re: [dpdk-dev] [PATCH v3] vhost: add config change slave msg support

2019-12-10 Thread Li Feng
ping, any update about this? Thanks, Feng Li Li Feng 于2019年12月5日周四 下午1:38写道: > > This msg is used to notify qemu that should get the config of backend. > > For example, vhost-user-blk uses this msg to notify guest os the > compacity of backend has changed. > > S

[dpdk-dev] [PATCH v3] vhost: add config change slave msg support

2019-12-04 Thread Li Feng
This msg is used to notify qemu that should get the config of backend. For example, vhost-user-blk uses this msg to notify guest os the compacity of backend has changed. Signed-off-by: Li Feng --- v3: * Move the declare to rte_vhost.h * Add the symbol in rte_vhost_version.map v2: * Fix a

Re: [dpdk-dev] [PATCH v2] vhost: add config change slave msg support

2019-12-04 Thread Li Feng
Tiwei Bie 于2019年12月5日周四 上午10:06写道: > > On Wed, Dec 04, 2019 at 05:43:50PM +0800, Li Feng wrote: > > Hi Tiwei, > > Thanks for your reply. > > Yes, this new API currently is for vhost-user-blk in the SPDK project. > > I see. Thanks for the clarification. > In th

Re: [dpdk-dev] [PATCH v2] vhost: add config change slave msg support

2019-12-04 Thread Li Feng
Hi Tiwei, Thanks for your reply. Yes, this new API currently is for vhost-user-blk in the SPDK project. There is a patch in SPDK to use this API. Thanks, Feng Li Tiwei Bie 于2019年12月4日周三 下午5:30写道: > > On Wed, Dec 04, 2019 at 01:13:20PM +0800, Li Feng wrote: > > This msg is used to

[dpdk-dev] [PATCH v2] vhost: add config change slave msg support

2019-12-03 Thread Li Feng
This msg is used to notify qemu that should get the config of backend. For example, vhost-user-blk uses this msg to notify guest os the compacity of backend has changed. Signed-off-by: Li Feng --- v2: * Fix a little log typo. lib/librte_vhost/vhost_user.c | 31

[dpdk-dev] [PATCH v2] vhost: add config change slave msg support

2019-12-03 Thread Li Feng
This msg is used to notify qemu that should get the config of backend. For example, vhost-user-blk uses this msg to notify guest os the compacity of backend has changed. Signed-off-by: Li Feng --- v2: * Fix a little log typo. lib/librte_vhost/vhost_user.c | 31

[dpdk-dev] [PATCH] vhost: add config change slave msg support

2019-12-02 Thread Li Feng
This msg is used to notify qemu that should get the config of backend. For example, vhost-user-blk uses this msg to notify guest os the compacity of backend has changed. Signed-off-by: Li Feng --- lib/librte_vhost/vhost_user.c | 31 +++ lib/librte_vhost/vhost_user.h