Thread (46 messages) 46 messages, 7 authors, 2024-02-12

Re: [dpdk-dev] [PATCH v2 4/8] emu/iavf: add vfio-user device register and unregister

From: Xia, Chenbo <hidden>
Date: 2021-01-05 01:26:34

Hi Jingjing,
-----Original Message-----
From: Wu, Jingjing <redacted>
Sent: Monday, January 4, 2021 2:45 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]
Subject: RE: [PATCH v2 4/8] emu/iavf: add vfio-user device register and
unregister
quoted
+static inline struct iavf_emu_sock_list * iavf_emu_find_sock_list(char
+*sock_addr) {
+	struct iavf_emu_sock_list *list;
+	struct iavf_emudev *dev;
+	int list_exist;
Initialize list_exist to 0?
Yes, will fix in next version.
quoted
+
+	if (!sock_addr)
+		return NULL;
+
+	pthread_mutex_lock(&sock_list_lock);
+
+	TAILQ_FOREACH(list, &sock_list, next) {
+		dev = (struct iavf_emudev *)list->emu_dev->priv_data;
+
+		if (!strcmp(dev->sock_addr, sock_addr)) {
+			list_exist = 1;
+			break;
+		}
+		break;
This "break" need to be removed.
Yes, will fix in next version.

Thanks,
Chenbo
quoted
+	}
+
+	pthread_mutex_unlock(&sock_list_lock);
+
+	if (!list_exist)
+		return NULL;
+
+	return list;
+}
+
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help