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 300C246060; Sun, 12 Jan 2025 19:59:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E9DB24064C; Sun, 12 Jan 2025 19:59:10 +0100 (CET) Received: from mail-ed1-f100.google.com (mail-ed1-f100.google.com [209.85.208.100]) by mails.dpdk.org (Postfix) with ESMTP id 2B2C840612 for ; Sun, 12 Jan 2025 19:59:08 +0100 (CET) Received: by mail-ed1-f100.google.com with SMTP id 4fb4d7f45d1cf-5d0ac27b412so4701183a12.1 for ; Sun, 12 Jan 2025 10:59:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736708348; x=1737313148; 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=g8/a3j2zsSDBFisQ92BECykY57UEyo98aF20CPJ0Gbr+nHCzK4+tpYHmnpVikcN1Wv qXZrIAOxQTMwvDNr64YXaaBWQU2g4YRv0FohGe0rZphmdsP2GCChveX9ueezuL9TZFhO vayBPP8udpPBe7ocb50MBNNryio5rss7bF4s04q2pYS0pslV3ZzXatmRYu6Gy95SWbIO xWZ6IPUrG2ugKoVAeWpyuxcJJksLTq92C0XUaF6gvN732T4YbUVWiNp4hGQ7okovQE+f VJFYf6txX+hjLDPjsxbgaMmLb8u9WxTOXXzNrUa10idc7VPCbsUzXVAJv1xsP58V+Nlj EnWw== X-Gm-Message-State: AOJu0YxrAYtCN6BPBR3pDk0c/xpKgMVnyJ+xOpOUVO84h7QvjmsA6mb9 Q/B8RPqsmk+TKojROGPiUApdlqoUl3g9gnPdd7IIlwE2dY64fJ+VdW92Ha45si26HGPsItHtxlz EKSlMwdRJ3yqjEM1Bd14tDV9KbqvjPX9PUNAs+0GE X-Gm-Gg: ASbGncuD4c0MpBNh2sb2sWSgiN06liyEyGfh4gm0FO6RKx1fvfptkqm/6gThw2YiDDA W3pzG0op+KAbtsbXrBJNtCzU7BsOpZT37z1FX1zzRstU9ba5b9ucAe4WAI2sw7gQzJHqMpEAr+d qex3nixIoQFb39TqDRW5uU3VsEGgqQfxgI4HEXWGXcSlPK5TqTLZRIec4Yc7J97v+d4Mj+l/ZXv vaMSkLJkGc/TkG+JIGg3VnSv45xk7d/7FlYtA5NdFVpBH7gXU5fqS0ZXOLln9wTf7PB1dFmp/QA JpZGbEbyVZTcLa1ojW8Ef5Q55Q== X-Google-Smtp-Source: AGHT+IHFBI/6+KwBS1KomI1yvZV/4mjVWYXdMHwMAZkUuvhO4G3RceBrgod7rhEGcC2yyBvKutj2NjvF6O5H X-Received: by 2002:a17:907:6d29:b0:ab2:f8e9:5f57 with SMTP id a640c23a62f3a-ab2f8e9652bmr508857366b.21.1736708347758; Sun, 12 Jan 2025 10:59:07 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id a640c23a62f3a-ab2c90638f9sm33693866b.13.2025.01.12.10.59.07; Sun, 12 Jan 2025 10:59:07 -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 9716313D7B; Sun, 12 Jan 2025 19:59:07 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili Subject: [PATCH 6/6] lib/vhost: remove check around pthread_mutex_init() Date: Sun, 12 Jan 2025 19:58:42 +0100 Message-Id: <20250112185842.9752-7-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250112185842.9752-1-otilibil@eurecom.fr> References: <20250112185842.9752-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