From patchwork Thu Feb 29 12:24:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 137481 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A458243C36; Thu, 29 Feb 2024 13:25:20 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60825427E5; Thu, 29 Feb 2024 13:25:14 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 7F313411F3 for ; Thu, 29 Feb 2024 13:25:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709209512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AbKRMTcvqci7XHWdD+4oMUp5pT+Nkfptl//SiN1Jdlc=; b=dzrHXMc7WmCFVdowcp5zplXDtRuM8BavgINKi1UWM2J5e/BysBAgSGAK3GepQbWYKokbIM 6XFrxB0um/H517430MD0m8xhV9/n+RZGimgFp2DYuUhnQNFk77tZ+cad7ufFbN4br2bMwH oMopLKSSax4mQ0pWFExIdR9Guhf6zCM= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-341-VX4ArW1gMtyWSnZBhg_xtg-1; Thu, 29 Feb 2024 07:25:09 -0500 X-MC-Unique: VX4ArW1gMtyWSnZBhg_xtg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BE6B6280A9AE; Thu, 29 Feb 2024 12:25:08 +0000 (UTC) Received: from max-p1.redhat.com (unknown [10.39.208.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7B9B4111D3DE; Thu, 29 Feb 2024 12:25:07 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, david.marchand@redhat.com, chenbox@nvidia.com Cc: Maxime Coquelin Subject: [PATCH 2/7] vhost: rename polling mutex Date: Thu, 29 Feb 2024 13:24:57 +0100 Message-ID: <20240229122502.2572343-3-maxime.coquelin@redhat.com> In-Reply-To: <20240229122502.2572343-1-maxime.coquelin@redhat.com> References: <20240229122502.2572343-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com 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 This trivial patch fixes a typo in fd's manager polling mutex name. Signed-off-by: Maxime Coquelin Reviewed-by: David Marchand --- lib/vhost/fd_man.c | 8 ++++---- lib/vhost/fd_man.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/vhost/fd_man.c b/lib/vhost/fd_man.c index 42ce059039..5dde40e51a 100644 --- a/lib/vhost/fd_man.c +++ b/lib/vhost/fd_man.c @@ -125,9 +125,9 @@ fdset_add(struct fdset *pfdset, int fd, fd_cb rcb, fd_cb wcb, void *dat) pthread_mutex_lock(&pfdset->fd_mutex); i = pfdset->num < MAX_FDS ? pfdset->num++ : -1; if (i == -1) { - pthread_mutex_lock(&pfdset->fd_pooling_mutex); + pthread_mutex_lock(&pfdset->fd_polling_mutex); fdset_shrink_nolock(pfdset); - pthread_mutex_unlock(&pfdset->fd_pooling_mutex); + pthread_mutex_unlock(&pfdset->fd_polling_mutex); i = pfdset->num < MAX_FDS ? pfdset->num++ : -1; if (i == -1) { pthread_mutex_unlock(&pfdset->fd_mutex); @@ -244,9 +244,9 @@ fdset_event_dispatch(void *arg) numfds = pfdset->num; pthread_mutex_unlock(&pfdset->fd_mutex); - pthread_mutex_lock(&pfdset->fd_pooling_mutex); + pthread_mutex_lock(&pfdset->fd_polling_mutex); val = poll(pfdset->rwfds, numfds, 1000 /* millisecs */); - pthread_mutex_unlock(&pfdset->fd_pooling_mutex); + pthread_mutex_unlock(&pfdset->fd_polling_mutex); if (val < 0) continue; diff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h index cc19937612..2517ae5a9b 100644 --- a/lib/vhost/fd_man.h +++ b/lib/vhost/fd_man.h @@ -24,7 +24,7 @@ struct fdset { struct pollfd rwfds[MAX_FDS]; struct fdentry fd[MAX_FDS]; pthread_mutex_t fd_mutex; - pthread_mutex_t fd_pooling_mutex; + pthread_mutex_t fd_polling_mutex; int num; /* current fd number of this fdset */ union pipefds {