From patchwork Tue Jan 14 07:50:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Otilibili-Anieli X-Patchwork-Id: 150061 X-Patchwork-Delegate: stephen@networkplumber.org 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 4282946080; Tue, 14 Jan 2025 08:50:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2BD81402E8; Tue, 14 Jan 2025 08:50:50 +0100 (CET) Received: from mail-lf1-f99.google.com (mail-lf1-f99.google.com [209.85.167.99]) by mails.dpdk.org (Postfix) with ESMTP id 18156400EF for ; Tue, 14 Jan 2025 08:50:49 +0100 (CET) Received: by mail-lf1-f99.google.com with SMTP id 2adb3069b0e04-540218726d5so4899068e87.2 for ; Mon, 13 Jan 2025 23:50:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841048; x=1737445848; 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=uK0Uf2qYllPisv8EGw/xqG9pwEZ/Uv2plGZ431rbrLg=; b=sw3+AnXPP4BLrGvYr34c3BP4IDCvQImIFKdJbd+fuNxaljbHge++NvMldTwovs9kzH s3icFqOwgM7ItaRDG03MvQovEDkPUTBbc4WTTU+PF7D1UwCKbB1alElpqybU7GrAQqIP JONsakBCprEBjoJc/Mmp5MUXS2aevTwGXFTTFjkv6RF/YSfcsqSlsfvXQTP7BMlNXqAD ueeKmuTPrd/HSEJal//VodAKswKVCDKIxIn3pJ2wLcsv66nBkNhrwBXCwmynrRa8mR0B NPP7KDEb2dWIAp0aTicsFT3inLH+UpDWosO8fqYx9cNvnsDrH48q5X1g+Xvg1l9/FfDb dx8A== X-Gm-Message-State: AOJu0Ywj8zXRUWXHEDVTXooDJTo4Foo9yPBsQzIreFs67RIKUl4aey0i bgCo8AIy9wulZJsfxIMmZsxOxzrWFBOURJCxXgAWqUCcAdRZcCm7UFna+6A4WBu/5q1H9SkR8nP OWPJELe3QvpVaX3OpgN6HLGJPbl+8NGRJ1G06/MVR X-Gm-Gg: ASbGncshwe5ZW1a528CXEJYkSyt7SrEKBt0ARrB6RJaGzaA7/yGdM/zrlb1ePFaXCj6 AZraS+0pjgpIpXYsh+km/k5I+XGPJFuCqhymEub4HUzYsFWL3UBhWTSR1guHse+0woSmn6H9arP 0PGduJc6hAtrlL6UCLrW+YlTke7pCAbXPttdz0LSop2VPVU9wUPe2QVVyPdCEQvI7deDde+Ktz4 34lmEFB1ke3sTfVydS+VEWvTEqw+fYTm9OtILd0vqHA2cERzZMFLAyVADteDkjSCf/sRH9x44b6 SXXXnuud+GiDCC/zLRCdH/0HUA== X-Google-Smtp-Source: AGHT+IFLgIWVIk7NOLI3Z4MQXmPCNoPftXREpmifX4mnJ062pAV9OIMoxyaWVWEqREs7B8vy0U2LodTKfZ4Q X-Received: by 2002:a05:6512:3c8a:b0:540:2022:e3c8 with SMTP id 2adb3069b0e04-54284810aabmr7167596e87.41.1736841048462; Mon, 13 Jan 2025 23:50:48 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id 2adb3069b0e04-5428be90e27sm521726e87.96.2025.01.13.23.50.48; Mon, 13 Jan 2025 23:50:48 -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 1908D1027A; Tue, 14 Jan 2025 08:50:48 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Rosen Xu Subject: [PATCH v4 1/6] raw/ifpga: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:28 +0100 Message-Id: <20250114075033.2027286-2-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-1-otilibil@eurecom.fr> MIME-Version: 1.0 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 Cc: Rosen Xu Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- drivers/raw/ifpga/base/opae_intel_max10.c | 5 +---- drivers/raw/ifpga/base/opae_spi_transaction.c | 7 +------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/raw/ifpga/base/opae_intel_max10.c b/drivers/raw/ifpga/base/opae_intel_max10.c index d5a9ceb6e355..58c884a8d8e1 100644 --- a/drivers/raw/ifpga/base/opae_intel_max10.c +++ b/drivers/raw/ifpga/base/opae_intel_max10.c @@ -1486,10 +1486,7 @@ intel_max10_device_init(struct intel_max10_device *dev) if (ret) return ret; - ret = pthread_mutex_init(&dev->bmc_ops.lock, NULL); - if (ret) - return ret; - + pthread_mutex_init(&dev->bmc_ops.lock, NULL); if (!dev->bmc_ops.mutex) dev->bmc_ops.mutex = &dev->bmc_ops.lock; } diff --git a/drivers/raw/ifpga/base/opae_spi_transaction.c b/drivers/raw/ifpga/base/opae_spi_transaction.c index 21015eb95ef5..14ea93cb43df 100644 --- a/drivers/raw/ifpga/base/opae_spi_transaction.c +++ b/drivers/raw/ifpga/base/opae_spi_transaction.c @@ -494,7 +494,6 @@ struct spi_transaction_dev *spi_transaction_init(struct altera_spi_device *dev, int chipselect) { struct spi_transaction_dev *spi_tran_dev; - int ret; spi_tran_dev = opae_malloc(sizeof(struct spi_transaction_dev)); if (!spi_tran_dev) @@ -507,11 +506,7 @@ struct spi_transaction_dev *spi_transaction_init(struct altera_spi_device *dev, if (!spi_tran_dev->buffer) goto err; - ret = pthread_mutex_init(&spi_tran_dev->lock, NULL); - if (ret) { - dev_err(spi_tran_dev, "fail to init mutex lock\n"); - goto err; - } + pthread_mutex_init(&spi_tran_dev->lock, NULL); if (dev->mutex) { dev_info(NULL, "use multi-process mutex in spi\n"); spi_tran_dev->mutex = dev->mutex; From patchwork Tue Jan 14 07:50:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Otilibili-Anieli X-Patchwork-Id: 150062 X-Patchwork-Delegate: stephen@networkplumber.org 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 8282146080; Tue, 14 Jan 2025 08:50:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 56901402F0; Tue, 14 Jan 2025 08:50:54 +0100 (CET) Received: from mail-ed1-f98.google.com (mail-ed1-f98.google.com [209.85.208.98]) by mails.dpdk.org (Postfix) with ESMTP id BC23A402F0 for ; Tue, 14 Jan 2025 08:50:52 +0100 (CET) Received: by mail-ed1-f98.google.com with SMTP id 4fb4d7f45d1cf-5d96944401dso8737832a12.0 for ; Mon, 13 Jan 2025 23:50:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841052; x=1737445852; 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=EylGfJqz3JK26KRiJ6nmLsUWnFBt+LWSPGJyFf5V4qU=; b=uf5TeM2/n07MnV7/TJCHdLEuc7xianTw7aTISxVuFEdz9W+rilaX8bRFW/AvWEjZuG CiuHmtvfQwyns6+Oz5xSOKS5aBEb8YrJ5Qyqf0MwmMlwT5NULVE3JmA/HeRJU5qmvPcV QlG20ztGXqZIWvtpE6Pntuyw6T0QTZsdBtTKRWPy2n24ZtjemIU+IhCegQ70o/hBuRLP W4TAqZdrzaqkh6Xlu4z6G5KaiBI74xSorx4cuF2nHFGdlOJi9kyxmyb/dNcED2qFljbs 3m/elrXlGjT2l4/MUKlydMuEF+1CgKlyXbW5l3WEvj63HC0ZP7H4WTx+Oa6ZSG5RqlZQ QwEg== X-Gm-Message-State: AOJu0YzC8oQDc9sYBtnE97kVqbPo1omGPKqnGatljByB1qoQ2Gu3z9Jy A97GVuRkPlreFDk96j4WHlTnby5YZkIX7/l33stusSf1l/r7y8ofE1bVgbExd3BgWU4l5/VEEv3 cIbxD/bWuBJM0+laBSdYX7n+xuZ/na79e X-Gm-Gg: ASbGncvY2SKsNf5OZ/zdCnrJwFEFe+zTkg45sTOrNeNn0EjVNvKls8MxrOlPBYB/OI7 HDwjvwTkkv2XEWF6tvTjZ1EEFv0fJw1xD5/PcBNejvd04rKwKWsSEMbGsPjCAyAIEfWEqNf1+TE EpHLD1igFFVqRHAAywFKuOrf/0vrF0Qaasu6IGx4fasdyV4HoTMXVr8Jtmm/UOJXkHqLtY9zKYh klWy/wMYelTDtm669oDsbVuVkMEuI+RmatYYjJDEivadBkDPazwr90rAG/SvZkepdMbvaEDdm+p C2RAKMgsNfQwZ/JjfncGNXZtsQ== X-Google-Smtp-Source: AGHT+IFoHCv0bbPbO8IAjtl6nxApp3KodQGCAIstOos6NnMmDO97jvDo2lqgDpkmvO8fl+bqed1XHJrRqga/ X-Received: by 2002:a05:6402:2690:b0:5d2:7199:ae5 with SMTP id 4fb4d7f45d1cf-5d972dfbe9amr22981256a12.5.1736841052225; Mon, 13 Jan 2025 23:50:52 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id 4fb4d7f45d1cf-5d99ef3bf80sm577570a12.22.2025.01.13.23.50.52; Mon, 13 Jan 2025 23:50:52 -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 115291027B; Tue, 14 Jan 2025 08:50:52 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Ajit Khaparde , Somnath Kotur Subject: [PATCH v4 2/6] net/bnxt: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:29 +0100 Message-Id: <20250114075033.2027286-3-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-1-otilibil@eurecom.fr> MIME-Version: 1.0 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 Cc: Ajit Khaparde Cc: Somnath Kotur Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- drivers/net/bnxt/bnxt_ethdev.c | 40 +++++--------------------- drivers/net/bnxt/bnxt_txq.c | 7 +---- drivers/net/bnxt/tf_ulp/bnxt_ulp.c | 8 +----- drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c | 6 +--- drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c | 6 +--- drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c | 6 +--- drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c | 6 +--- 7 files changed, 13 insertions(+), 66 deletions(-) diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index ef8a928c9170..21e9aa902c68 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -5821,31 +5821,12 @@ static int bnxt_get_config(struct bnxt *bp) static int bnxt_init_locks(struct bnxt *bp) { - int err; + pthread_mutex_init(&bp->flow_lock, NULL); + pthread_mutex_init(&bp->def_cp_lock, NULL); + pthread_mutex_init(&bp->health_check_lock, NULL); + pthread_mutex_init(&bp->err_recovery_lock, NULL); - err = pthread_mutex_init(&bp->flow_lock, NULL); - if (err) { - PMD_DRV_LOG_LINE(ERR, "Unable to initialize flow_lock"); - return err; - } - - err = pthread_mutex_init(&bp->def_cp_lock, NULL); - if (err) { - PMD_DRV_LOG_LINE(ERR, "Unable to initialize def_cp_lock"); - return err; - } - - err = pthread_mutex_init(&bp->health_check_lock, NULL); - if (err) { - PMD_DRV_LOG_LINE(ERR, "Unable to initialize health_check_lock"); - return err; - } - - err = pthread_mutex_init(&bp->err_recovery_lock, NULL); - if (err) - PMD_DRV_LOG_LINE(ERR, "Unable to initialize err_recovery_lock"); - - return err; + return 0; } /* This should be called after we have queried trusted VF cap */ @@ -6746,7 +6727,7 @@ static void bnxt_free_rep_info(struct bnxt *bp) static int bnxt_init_rep_info(struct bnxt *bp) { - int i = 0, rc; + int i = 0; if (bp->rep_info) return 0; @@ -6770,14 +6751,7 @@ static int bnxt_init_rep_info(struct bnxt *bp) for (i = 0; i < BNXT_MAX_CFA_CODE; i++) bp->cfa_code_map[i] = BNXT_VF_IDX_INVALID; - rc = pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL); - if (rc) { - PMD_DRV_LOG_LINE(ERR, "Unable to initialize vfr_start_lock"); - bnxt_free_rep_info(bp); - return rc; - } - - return rc; + return pthread_mutex_init(&bp->rep_info->vfr_start_lock, NULL); } static int bnxt_rep_port_probe(struct rte_pci_device *pci_dev, diff --git a/drivers/net/bnxt/bnxt_txq.c b/drivers/net/bnxt/bnxt_txq.c index c8649359923f..3938ebc7091d 100644 --- a/drivers/net/bnxt/bnxt_txq.c +++ b/drivers/net/bnxt/bnxt_txq.c @@ -198,12 +198,7 @@ int bnxt_tx_queue_setup_op(struct rte_eth_dev *eth_dev, goto err; } - rc = pthread_mutex_init(&txq->txq_lock, NULL); - if (rc != 0) { - PMD_DRV_LOG_LINE(ERR, "TxQ mutex init failed!"); - goto err; - } - return 0; + return pthread_mutex_init(&txq->txq_lock, NULL); err: bnxt_tx_queue_release_op(eth_dev, queue_idx); return rc; diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c index 1bfc88cf79ef..0c03ae7a8349 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c @@ -188,7 +188,6 @@ ulp_session_init(struct bnxt *bp, struct rte_pci_device *pci_dev; struct rte_pci_addr *pci_addr; struct bnxt_ulp_session_state *session; - int rc = 0; if (!bp) return NULL; @@ -215,12 +214,7 @@ ulp_session_init(struct bnxt *bp, session->pci_info.domain = pci_addr->domain; session->pci_info.bus = pci_addr->bus; memcpy(session->dsn, bp->dsn, sizeof(session->dsn)); - rc = pthread_mutex_init(&session->bnxt_ulp_mutex, NULL); - if (rc) { - BNXT_DRV_DBG(ERR, "mutex create failed\n"); - pthread_mutex_unlock(&bnxt_ulp_global_mutex); - return NULL; - } + pthread_mutex_init(&session->bnxt_ulp_mutex, NULL); STAILQ_INSERT_TAIL(&bnxt_ulp_session_list, session, next); } diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c index fa7e8fe00077..4a1ccfa2a36d 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tf.c @@ -1472,11 +1472,7 @@ ulp_tf_init(struct bnxt *bp, goto jump_to_error; } - rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL); - if (rc) { - BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n"); - goto jump_to_error; - } + pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL); /* Initialize ulp dparms with values devargs passed */ rc = ulp_tf_dparms_init(bp, bp->ulp_ctx); diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c index 6d7ec0ffec79..508c194d0490 100644 --- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c +++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_tfc.c @@ -993,11 +993,7 @@ ulp_tfc_init(struct bnxt *bp, goto jump_to_error; } - rc = pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL); - if (rc) { - BNXT_DRV_DBG(ERR, "Unable to initialize flow db lock\n"); - goto jump_to_error; - } + pthread_mutex_init(&bp->ulp_ctx->cfg_data->flow_db_lock, NULL); rc = ulp_tfc_dparms_init(bp, bp->ulp_ctx, ulp_dev_id); if (rc) { diff --git a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c index 67489b76f390..f9d069f4e17e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c @@ -129,11 +129,7 @@ ulp_fc_mgr_init(struct bnxt_ulp_context *ctxt) ulp_fc_info->fc_ops = fc_ops; ulp_fc_info->flags = flags; - rc = pthread_mutex_init(&ulp_fc_info->fc_lock, NULL); - if (rc) { - BNXT_DRV_DBG(ERR, "Failed to initialize fc mutex\n"); - goto error; - } + pthread_mutex_init(&ulp_fc_info->fc_lock, NULL); /* Add the FC info tbl to the ulp context. */ bnxt_ulp_cntxt_ptr2_fc_info_set(ctxt, ulp_fc_info); diff --git a/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c b/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c index 3c75a6b43721..7b7c10d3602e 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c +++ b/drivers/net/bnxt/tf_ulp/ulp_ha_mgr.c @@ -412,11 +412,7 @@ ulp_ha_mgr_init(struct bnxt_ulp_context *ulp_ctx) /* Add the HA info tbl to the ulp context. */ bnxt_ulp_cntxt_ptr2_ha_info_set(ulp_ctx, ha_info); - rc = pthread_mutex_init(&ha_info->ha_lock, NULL); - if (rc) { - PMD_DRV_LOG_LINE(ERR, "Failed to initialize ha mutex"); - goto cleanup; - } + pthread_mutex_init(&ha_info->ha_lock, NULL); rc = ulp_ha_mgr_timer_start(ulp_ctx->cfg_data); if (rc) { PMD_DRV_LOG_LINE(ERR, "Unable to start timer CB"); From patchwork Tue Jan 14 07:50:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Otilibili-Anieli X-Patchwork-Id: 150063 X-Patchwork-Delegate: stephen@networkplumber.org 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 9456346080; Tue, 14 Jan 2025 08:51:01 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8309F4060C; Tue, 14 Jan 2025 08:50:56 +0100 (CET) Received: from mail-wr1-f100.google.com (mail-wr1-f100.google.com [209.85.221.100]) by mails.dpdk.org (Postfix) with ESMTP id C4F8F4042E for ; Tue, 14 Jan 2025 08:50:54 +0100 (CET) Received: by mail-wr1-f100.google.com with SMTP id ffacd0b85a97d-38633b5dbcfso5248218f8f.2 for ; Mon, 13 Jan 2025 23:50:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841054; x=1737445854; 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=9am+HkQeGBb9UjPWWQrW6Z58kLUlD1+81bw/aqXAvjI=; b=v2erqmE7UTcNKhAUPIhbg9D9tCij7gBGMK5rMZSqtSkcapigG1tapFyqoBz748p4uN bFRB76c5/FD5rBxpuc2vDStszmbUloEFZkBpbAqlI+Hj69JgsAHFGNY3txIiAktLbpMO 65r1w8EhmJ4XopCQv8kdZ+Pu6nmsxAHQnLOZOGVUUWvrii8WgBVv17to6HmyQUtnmQ1M vMv3Z6dh2TVIMwXyFuMqdDjbFz447dBCQ4EnfNiHkcXKX6cOj/pOFfijO5CNs+mQyaZv WHKADnXFOdznSpaAUoUrsnrPeARZcuC9sZRhfdKc8cyJq9++/9/GNLFZex7O0yk6poUo tflw== X-Gm-Message-State: AOJu0Yz6jZ4IMzOF17FjgsXH3TNXmizj+b4ql+heKWWP9ogfU8j9/ybQ BY4tcd0DUfsgOeWZqTJq/153PkrEkC7+DD40JgU5ZQGxWC8cGSTZWrq2UXy+FV9yXQ3bX8mR45p Nha9PCGQwVgXkfRnd2gJsKkMBubHb632HKJkEvvPD X-Gm-Gg: ASbGncsy4S5DHOwnPWLtLTubXjrbWGYqgWSp86MDIKfT35mEMfN8X3gxeB/cbsIJhoD EuiMmV+b9ANwAOU37WfmD5Wv12orsUxcQlRVotQ1uKVukKdtqybWAGzqGSYAnbgk8vfaDd9pYCx 9i4xmf7jgv/63mB/KMwsQFzu+69Fl/3PwcG+7j9MeSVSSvGcH8tDCmKv9jB4sdAAEI8x3nve3L+ 5IpCLDW5yyXVcOGiYQnRpffdoVXZZf+2iyvKClnwRGUjtOymBCaCPNPki3jZsYXRgZJ17U1dIyl xi5X3TYbslkp8b+dhKRSeXFCag== X-Google-Smtp-Source: AGHT+IHZgUsIGyf5m3QNhNEAIW22Z+wNtBlreXN7b/v+gbqqaIu5Npd+ESLU8zkwIji9/00YZMfAq7MzQWCE X-Received: by 2002:a05:6000:184e:b0:382:46ea:113f with SMTP id ffacd0b85a97d-38a872fc1b3mr21671711f8f.10.1736841054292; Mon, 13 Jan 2025 23:50:54 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id 5b1f17b1804b1-436e736b40bsm11483755e9.36.2025.01.13.23.50.54; Mon, 13 Jan 2025 23:50:54 -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 2E8731027C; Tue, 14 Jan 2025 08:50:54 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Harman Kalra Subject: [PATCH v4 3/6] common/cnxk: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:30 +0100 Message-Id: <20250114075033.2027286-4-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-1-otilibil@eurecom.fr> MIME-Version: 1.0 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 Cc: Nithin Dabilpuram Cc: Kiran Kumar K Cc: Sunil Kumar Kori Cc: Satha Rao Cc: Harman Kalra Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- drivers/common/cnxk/roc_bphy_cgx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/common/cnxk/roc_bphy_cgx.c b/drivers/common/cnxk/roc_bphy_cgx.c index 4f43605e1031..882cf654743b 100644 --- a/drivers/common/cnxk/roc_bphy_cgx.c +++ b/drivers/common/cnxk/roc_bphy_cgx.c @@ -189,14 +189,11 @@ int roc_bphy_cgx_dev_init(struct roc_bphy_cgx *roc_cgx) { uint64_t val; - int ret; if (!roc_cgx || !roc_cgx->bar0_va || !roc_cgx->bar0_pa) return -EINVAL; - ret = pthread_mutex_init(&roc_cgx->lock, NULL); - if (ret) - return ret; + pthread_mutex_init(&roc_cgx->lock, NULL); val = roc_bphy_cgx_read(roc_cgx, 0, CGX_CMRX_RX_LMACS); val = FIELD_GET(CGX_CMRX_RX_LMACS_LMACS, val); From patchwork Tue Jan 14 07:50:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Otilibili-Anieli X-Patchwork-Id: 150064 X-Patchwork-Delegate: stephen@networkplumber.org 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 6154B46080; Tue, 14 Jan 2025 08:51:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9DF1340647; Tue, 14 Jan 2025 08:50:58 +0100 (CET) Received: from mail-ej1-f98.google.com (mail-ej1-f98.google.com [209.85.218.98]) by mails.dpdk.org (Postfix) with ESMTP id B5428402EF for ; Tue, 14 Jan 2025 08:50:56 +0100 (CET) Received: by mail-ej1-f98.google.com with SMTP id a640c23a62f3a-aa6a92f863cso972983866b.1 for ; Mon, 13 Jan 2025 23:50:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841056; x=1737445856; 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=T0wJx4SWyL+QZwk5JCM/EVD1DPax3rzq90Rme/s3DhI=; b=FHqZjc6qAh3U7ApX+EOvjNTLvbLV1TbaCvd96wxiFRhGQYUSuX4xthnyjMl/q9JEpW 9T8YggciV872oA0XgxzLhWA1MiUZuynzZoADmrVg3HgUKmeeO1hVTxOzXMrCjpH+IhCR wEnpAhw/lNDBHkl/H36kTO2pjr5h5dZZ5TYUZY28CMGzWbFT1BSDO4jdP3WD0MbNE+8G jtgbtzo6q6BbISOrRLpnGfxEpGom423WaKnSLIAb3aeoT5Sx6yL6u3j87+2UKbDwUhBS ad5gcdpN6ixLkqqtqYwXrpx+K5Rog8yRBt8QilxQbyqMEb8izPVGlOWdOLHWViiTJS+V 1RCw== X-Gm-Message-State: AOJu0Yym/N2oscHVUC4SSdxQO4XRACWpwMokNmeEz9dTSj6KzDNwC9rZ M9YrauBgeRue5TOKTgygYXcAk03O5YaTjBe5c6FNBeZ0iCLioGt40MEuJHImrNsaZKt1KWaKsey vG0AGcBAZWjlrO5m0/M6UBnNm9h+TDnieIVmWdOS1 X-Gm-Gg: ASbGnctv/VDkGQo+hZukNdLJy5eebutH62XIV8eDM3a5tsftHF+ARsbAjIFeGodUMbh M3bqMwC9qnkaPLz3XCr1gXVcZircvBlaiRdcldhod520nPPxHtSjPeSMkHWQDKeVga7y+ZjwMW1 Non7NQk6mzFC5xCCns0ASp9RkDR6w60SBCdNNFiWpttovI71pM3DlCT81o88usUSFC0atQTWDxx 9UBiPO+BsBEhpVIpgfEKh5+4TZ64fF4UDOhWAfiCnbCoEfEDq2jMGkN3iYdoooHN7lANEnzSS07 9C6NBLp82TBuCnxRkMDo+O9fDQ== X-Google-Smtp-Source: AGHT+IFXyzsG+XLKkJRjjV4cqIW8CYcvF8xcylh12OCZ4vyzl9DiuvANTCnfXBCFNCu5JG2aDmOwkvQF8qHI X-Received: by 2002:a17:907:2d8f:b0:aa6:a87e:f2df with SMTP id a640c23a62f3a-ab2ab73b672mr2177641966b.25.1736841056116; Mon, 13 Jan 2025 23:50:56 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id a640c23a62f3a-ab2c90dc1f1sm48981366b.94.2025.01.13.23.50.56; Mon, 13 Jan 2025 23:50:56 -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 F08581027D; Tue, 14 Jan 2025 08:50:55 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Gaetan Rivet Subject: [PATCH v4 4/6] net/failsafe: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:31 +0100 Message-Id: <20250114075033.2027286-5-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-1-otilibil@eurecom.fr> MIME-Version: 1.0 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 Cc: Gaetan Rivet Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- drivers/net/failsafe/failsafe.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 32811403b4c8..3e590d38f71a 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -147,12 +147,8 @@ fs_mutex_init(struct fs_priv *priv) ERROR("Cannot set mutex type - %s", strerror(ret)); return ret; } - ret = pthread_mutex_init(&priv->hotplug_mutex, &attr); - if (ret) { - ERROR("Cannot initiate mutex - %s", strerror(ret)); - return ret; - } - return 0; + + return pthread_mutex_init(&priv->hotplug_mutex, &attr); } static int From patchwork Tue Jan 14 07:50:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Otilibili-Anieli X-Patchwork-Id: 150065 X-Patchwork-Delegate: stephen@networkplumber.org 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 85A7746080; Tue, 14 Jan 2025 08:51:16 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2544F40663; Tue, 14 Jan 2025 08:51:00 +0100 (CET) Received: from mail-ed1-f98.google.com (mail-ed1-f98.google.com [209.85.208.98]) by mails.dpdk.org (Postfix) with ESMTP id 7D9DA40616 for ; Tue, 14 Jan 2025 08:50:58 +0100 (CET) Received: by mail-ed1-f98.google.com with SMTP id 4fb4d7f45d1cf-5d647d5df90so8659639a12.2 for ; Mon, 13 Jan 2025 23:50:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841058; x=1737445858; 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=TKHkps7Z1z/ewbCs4bJ7Gt3eUPrrWSaPbwZTzTfX8bM=; b=wygb4yfj0uTbnD/lJvXepmb5t/y50YZ3fxiaHUidLoypAzpmaFg6DzniyLpzZlSRaI oQad0HAhTZr11Y56220Di4sRLpqDRuGRD1siHrSreOIhJo4+eUvA22Yg4mfyYocbEO+1 6MYQ6a9iUXVxfE1ASvpifkH+0C3B2NrLBu0MjryUm8rB9ucF3S711XDHYX8QtbPTSXGZ YAFLDY/id7ZZtPiSJ5SiTk11V5HijKupZXwtlfCoSqsLsOE8hfTCV3Cmj4stlQJTtvgb 5PxFqvfHmV2bxB+04A0Gr9PFMTGN4LUkKDLvOm0V5AAwq/3q7a8NVe3VPv2EueSWOlwA wfag== X-Gm-Message-State: AOJu0YyxVtgrylLtpKVAXOxfCNxoPkSdv6UcpF+pwvmGN7EzxJkFBb+Q xSwXlLsUW0reBO1zUJPkhAt9PgvnaDvvWqbGnwVHuDUz7TEwiLP44n6NGg8WpboSBMnD6OL4sj0 KwJLbLsN6s6z2yi3j5DaZvFWs1BENt/QhI9nUfKfd X-Gm-Gg: ASbGncsyJo5i74KdTlrdARn307+NbC5FQtNos4EzW8yIQOx3jhzeWmGoye55KihfYuE r4TEJ6bzdmY+yPPoyKTFKIqNwfsuOW1nkWnE1saa2xiBbFcNA4iHECrVKcwqvxrB5O9hMCPy3Ka Uya4HmLc1a3SfCi9g1FdLgjf1D1DkB9dchRfEVq4LFYy2FeupCZJsn9JlRUCH3zDG6yMQvZFyhb wQez6rSH9q1HQQqyiWHIvetSWPAUxEqoTU5C15vif/HS6tJ0ZmP5/66IUBPLqVxkDqa6lGRvL6N NHPaxhJOhSgCmaV3WCcM54YQyw== X-Google-Smtp-Source: AGHT+IHBZ1uIhFy4n/bTUZcognbnorPGLqPuNZdeinVHVwto23ihh1XZhhPh3JDWa2A9BlzRb5dmE9dU8Mad X-Received: by 2002:a17:907:2d8f:b0:aaf:8f8e:6bf4 with SMTP id a640c23a62f3a-ab2ab740899mr1658900766b.26.1736841058100; Mon, 13 Jan 2025 23:50:58 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id a640c23a62f3a-ab33b93a053sm4277166b.17.2025.01.13.23.50.58; Mon, 13 Jan 2025 23:50:58 -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 E4AE61027E; Tue, 14 Jan 2025 08:50:57 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Ziyang Xuan , Xiaoyun Wang Subject: [PATCH v4 5/6] net/hinic: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:32 +0100 Message-Id: <20250114075033.2027286-6-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-1-otilibil@eurecom.fr> MIME-Version: 1.0 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 Cc: Ziyang Xuan Cc: Xiaoyun Wang Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger --- drivers/net/hinic/base/hinic_compat.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/hinic/base/hinic_compat.h b/drivers/net/hinic/base/hinic_compat.h index ab9d1b9a0214..d3994c50e939 100644 --- a/drivers/net/hinic/base/hinic_compat.h +++ b/drivers/net/hinic/base/hinic_compat.h @@ -200,13 +200,7 @@ static inline u16 ilog2(u32 n) static inline int hinic_mutex_init(pthread_mutex_t *pthreadmutex, const pthread_mutexattr_t *mattr) { - int err; - - err = pthread_mutex_init(pthreadmutex, mattr); - if (unlikely(err)) - PMD_DRV_LOG(ERR, "Fail to initialize mutex, error: %d", err); - - return err; + return pthread_mutex_init(pthreadmutex, mattr); } static inline int hinic_mutex_destroy(pthread_mutex_t *pthreadmutex) From patchwork Tue Jan 14 07:50:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ariel Otilibili-Anieli X-Patchwork-Id: 150066 X-Patchwork-Delegate: stephen@networkplumber.org 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 63D8346080; Tue, 14 Jan 2025 08:51:22 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3B8C140657; Tue, 14 Jan 2025 08:51:02 +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 1664140651 for ; Tue, 14 Jan 2025 08:51:01 +0100 (CET) Received: by mail-ed1-f100.google.com with SMTP id 4fb4d7f45d1cf-5d3bbb0f09dso9351583a12.2 for ; Mon, 13 Jan 2025 23:51:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736841061; x=1737445861; 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=sy0GHqqw65KlPdUTnWKa/3Ahnc4Y/VfBkM0eB9xRyHo=; b=V/HpD4W9+ODnFkSYxF+E15V3JeBg6cNM6jx5oPFdBIUQv1hJnX9mLDWcguOHJAlXxv e/avW8uKIDP8mNVgFTn3HQj7lZWE7bDJy3Y4TmL4xfV1kgrpdrTdAcdc1KujN0zjDn8S YlO8mCQ6zoQMTjaJXWsUVvCqIqVn2WRneX21i+8xA/HO/2ywz2Y1JHHmw1JJNnl6fR2s 1d0aH1yq5RDp3lQvilScNhKmatd+3bWSIfgwCoAMQ0XZs1BZdsZCp1XTYBVp6lRKxNJF sRBDzvqLx4aCPI/Uk7Ii6KMmQ/WmapSQhwCvK9Nqq7qN8OzXX1Ou1b4SxPAww4d+5E+j oAfg== X-Gm-Message-State: AOJu0YzFpALp5IF1ZBBEM3WhNCFe9CMJCK6bqoM6/Irx4Ywhoq2TEQrN seZYk2Ka8J/sz7RMbduL5x+fVuRztUy54naqJrfKohH1gcF2sWQvgVSI3g9GKvhiY+veLV2R8aT b5xp4Xms7eQyXJp/L49TW1G2ZpMEQ7D00zV2/IVcj X-Gm-Gg: ASbGnctiory6pauViPAoiaWlWEwb8wL15wl8Z0UFehLuLFJVqkG2DHFXTl3E83fy198 fSI7G7YuzLE6wFRK2kxXJ2zVxJ1IZoA5KXwnuLfkS+8nwXUtN37miwYFD5r1S8CoYti1GjtCjN2 TGwKd+1ZWfLmiSnbHK3H8gz7HcETpb42MJYgaGPqu5ZEEnEVbr1wT2loTbHNY76AUAiH+EaZ1l0 KUH6sqrasNF3T+9AkTUbxjToFuwL0Gjx+ak9A7UB7bK5bcoTQ6ZYWiFp7huuJmkpiI0Hydz2SHH KogxQ/QMhajxO3w6EXBgJQocYQ== X-Google-Smtp-Source: AGHT+IHSjzYY0z6QHPDU0P3MEIRVNXTkqSZQ5GpqZezuEt+DRU747wpF1+ndUzjJ1a71+kl4miyS/5n8mg1C X-Received: by 2002:a17:907:940d:b0:aa6:6fa5:65b3 with SMTP id a640c23a62f3a-ab2abca94b4mr1948206266b.47.1736841060715; Mon, 13 Jan 2025 23:51:00 -0800 (PST) Received: from smtpservice.6wind.com ([185.13.181.2]) by smtp-relay.gmail.com with ESMTP id a640c23a62f3a-ab2c955ec76sm51839466b.145.2025.01.13.23.51.00; Mon, 13 Jan 2025 23:51:00 -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 90D4D1027F; Tue, 14 Jan 2025 08:51:00 +0100 (CET) From: Ariel Otilibili To: dev@dpdk.org Cc: Stephen Hemminger , Thomas Monjalon , David Marchand , Ariel Otilibili , Maxime Coquelin , Chenbo Xia Subject: [PATCH v4 6/6] lib/vhost: remove check around pthread_mutex_init() Date: Tue, 14 Jan 2025 08:50:33 +0100 Message-Id: <20250114075033.2027286-7-otilibil@eurecom.fr> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250114075033.2027286-1-otilibil@eurecom.fr> References: <20250112185842.9752-1-otilibil@eurecom.fr> <20250114075033.2027286-1-otilibil@eurecom.fr> MIME-Version: 1.0 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 Cc: Maxime Coquelin Cc: Chenbo Xia Signed-off-by: Ariel Otilibili Acked-by: Stephen Hemminger Reviewed-by: Maxime Coquelin --- 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);