Re: [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related APIs
From: Xia, Chenbo <hidden>
Date: 2021-01-05 09:58:21
Hi Beilei,
-----Original Message----- From: Xing, Beilei <redacted> Sent: Tuesday, January 5, 2021 4:35 PM To: Xia, Chenbo <redacted>; dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com Cc: stephen@networkplumber.org; Liang, Cunming <redacted>; Lu, Xiuchun [off-list ref]; Li, Miao [off-list ref]; Wu, Jingjing [off-list ref] Subject: RE: [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related APIsquoted
-----Original Message----- From: dev <redacted> On Behalf Of Chenbo Xia Sent: Friday, December 18, 2020 3:39 PM To: dev@dpdk.org; thomas@monjalon.net; david.marchand@redhat.com Cc: stephen@networkplumber.org; Liang, Cunming [off-list ref]; Lu, Xiuchun [off-list ref]; Li, Miao [off-list ref]; Wu, Jingjing [off-list ref] Subject: [dpdk-dev] [PATCH 2/9] vfio_user: implement lifecycle related APIs This patch implements three lifecycle related APIs for vfio-user server,whichquoted
are rte_vfio_user_register(), rte_vfio_user_unregister() and rte_vfio_user_start(). Socket an device management is implemented along with the API introduction. Signed-off-by: Chenbo Xia <redacted> Signed-off-by: Xiuchun Lu <redacted> --- lib/librte_vfio_user/meson.build | 3 +- lib/librte_vfio_user/rte_vfio_user.h | 51 ++ lib/librte_vfio_user/version.map | 6 + lib/librte_vfio_user/vfio_user_base.h | 4 + lib/librte_vfio_user/vfio_user_server.c | 690 ++++++++++++++++++++++++ lib/librte_vfio_user/vfio_user_server.h | 55 ++ 6 files changed, 808 insertions(+), 1 deletion(-) create mode 100644 lib/librte_vfio_user/rte_vfio_user.h create mode 100644 lib/librte_vfio_user/vfio_user_server.c create mode 100644 lib/librte_vfio_user/vfio_user_server.h<...>quoted
+static struct vfio_user_server_socket * find_vfio_user_socket(const1. How about vfio_user_find_socket which is consistent with other function name?
Good! Will fix in v2.
2. According to the coding style, I think it's better to use such format:
static struct vfio_user_server_socket *
vfio_user_find_socket() {
}
And please also check all other functions.OK. Will fix the format and check. Thanks! Chenbo
quoted
+char *sock_addr) { + uint32_t i; + + if (sock_addr == NULL) + return NULL; + + for (i = 0; i < vfio_ep_sock.sock_num; i++) { + struct vfio_user_server_socket *s = vfio_ep_sock.sock[i]; + + if (!strcmp(s->sock.sock_addr, sock_addr)) + return s; + } + + return NULL; +} +<...>quoted
-- 2.17.1