From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 19E7F4603A; Sun, 12 Jan 2025 20:31:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5AC6440661; Sun, 12 Jan 2025 20:31:08 +0100 (CET) Received: from mail-lf1-f98.google.com (mail-lf1-f98.google.com [209.85.167.98]) by mails.dpdk.org (Postfix) with ESMTP id 27ECF4065C for ; Sun, 12 Jan 2025 20:31:07 +0100 (CET) Received: by mail-lf1-f98.google.com with SMTP id 2adb3069b0e04-5401e6efffcso3799524e87.3 for ; Sun, 12 Jan 2025 11:31:07 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736710266; x=1737315066; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fZzWTeW1iqQUxgUrVGgZuVoB1vhuJNzFLz3ioLqO0f0=; b=aDraCJhu3iCFxYlkFHUkJj0jOfRX4UI2dUWOXhllwhkdFxhkTEbTSICIgF5lnZ3S/Q p/fJDaaonGhCi99SqS1vb6Dz2xe3qSDxHaiWaEMY3Xm3QFt6S0ZT5IMlc2DEYcO4QuRL s4YMj612H+Ze5cghJQ/RSAn0Ybk7CwPJYJN/4x7lHDN/dzVHlDp1XwbVNKw9yesycb0J PfE2n8KOg+p6hXeMX/sk7smMO3gDEV6CRbuUYfp0MipTZF5BP706DVi11QyH9OwNVxC4 lUIWfkODpOEzlDfb+Z5L/OX+lsGTXQ5eBoMcZTlEJCd7FQpfzrM5NlnRZeW16cHp4JsO jMsA== X-Gm-Message-State: AOJu0YxHeCQq4k6sljJ9lC1LBnpa+q3KZdksmq45h4C3vAsxSkKmUpK3 /u4YCG83Pdxyxrf5yoZaImf1XCX+FsbgCqXZz7qGC4k5pVwk/ZMaEQuesitTaDfEKDjtw+kkip8 5QcxI0xKmqgWn/g+Qt8J/6ELvCm9TBByTwUgONqyf X-Gm-Gg: ASbGncvtHfVdTjlkwYElKqX2a4vV4iUKGeLJvLhuxozxuLvD3VSIEzPEpNIITJTXSHg +40BMFSKvzEfN3FYpHZzjwLZIGpNOmqYVBoqid+af0ZRE8uICXP4TE/SQpRj4379jykRKxGfiNA xx8R8upsYNjypoySjYTMrQ7MKJTriomnoNTChN1Geez3quUgnKRbeDCGWzqVHDwYKMcmp9P615n atwacHDAlG+ujCMZvHtK6KfJEQCL87i7S+sraUydUZJeMkThYIjOnoGootA60+ryDtMp4FLXbcl 5ivICe3dffOQ5/005mnWjTem6A== X-Google-Smtp-Source: AGHT+IEglPdVqCy6ntKfDERMrsbVAhkS0oXBYtFKHvH/9U7ZEL/uq09eRlKYKUHZ28d+E9krN9NMJ0pARxLN X-Received: by 2002:a05:6512:2399:b0:540:1ea7:44db with SMTP id 2adb3069b0e04-542845b1aedmr6181082e87.4.1736710266634; Sun, 12 Jan 2025 11:31:06 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id 2adb3069b0e04-5428be37730sm308816e87.37.2025.01.12.11.31.06; Sun, 12 Jan 2025 11:31:06 -0800 (PST) X-Relaying-Domain: 6wind.com Received: from localhost (rainbow.dev.6wind.com [10.17.1.165]) by smtpservice.6wind.com (Postfix) with ESMTP id 45A9F13DA6; Sun, 12 Jan 2025 20:31:06 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili Subject: [PATCH v2 6/6] lib/vhost: remove check around pthread_mutex_init() Date: Sun, 12 Jan 2025 20:30:43 +0100 Message-Id: <20250112193043.67372-7-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250112193043.67372-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250112193043.67372-1-otilibil@eurecom.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org > pthread_mutex_init always returns 0. The other mutex functions > return 0 on success and a non-zero error code on error. Link: https://man7.org/linux/man-pages/man3/pthread_mutex_lock.3.html Bugzilla ID: 1586 Signed-off-by: Ariel Otilibili --- lib/vhost/socket.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c index d29d15494c8e..531aa8adc06c 100644 --- a/lib/vhost/socket.c +++ b/lib/vhost/socket.c @@ -498,11 +498,7 @@ vhost_user_reconnect_init(void) { int ret; - ret = pthread_mutex_init(&reconn_list.mutex, NULL); - if (ret < 0) { - VHOST_CONFIG_LOG("thread", ERR, "%s: failed to initialize mutex", __func__); - return ret; - } + pthread_mutex_init(&reconn_list.mutex, NULL); TAILQ_INIT(&reconn_list.head); ret = rte_thread_create_internal_control(&reconn_tid, "vhost-reco", @@ -921,11 +917,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags) goto out; } TAILQ_INIT(&vsocket->conn_list); - ret = pthread_mutex_init(&vsocket->conn_mutex, NULL); - if (ret) { - VHOST_CONFIG_LOG(path, ERR, "failed to init connection mutex"); - goto out_free; - } + pthread_mutex_init(&vsocket->conn_mutex, NULL); if (!strncmp("/dev/vduse/", path, strlen("/dev/vduse/"))) vsocket->is_vduse = true; @@ -1034,8 +1026,6 @@ rte_vhost_driver_register(const char *path, uint64_t flags) if (pthread_mutex_destroy(&vsocket->conn_mutex)) { VHOST_CONFIG_LOG(path, ERR, "failed to destroy connection mutex"); } -out_free: - vhost_user_socket_mem_free(vsocket); out: pthread_mutex_unlock(&vhost_user.mutex); -- 2.30.2