From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 6Lr0MHqVN2V6LAAA9RJhRA:P1 (envelope-from ) for ; Tue, 24 Oct 2023 11:59:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 6Lr0MHqVN2V6LAAA9RJhRA (envelope-from ) for ; Tue, 24 Oct 2023 11:59:22 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 92637337B8 for ; Tue, 24 Oct 2023 11:59:22 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=WFSlJVda; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1698141562; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=i7gIIBQZFx9kbWXMCdgISmq19WiXo/0VnCFLkXJAw1o=; b=D7baLmBBFxfUd3PE8/R2zOVjU+iltWokprS7YqH3Bi8UcsIxez54Bglg85pfGtxGaEYqDm okz5ZQF4HkvU75LxBfmxN4qq+UoHM/AzVoTmUHdTSFfpW378PZZ3gBgslIR/Rig0CI0ZUW CTECJ5GGuYwBm7vEm6l19dfYAUQXfjqXIgehc9ulvgIttPbvAITMxhuCrCrajnHza3puZz 2GE3p8kSaE2bzVhWKdI5QItT+3VhABDZwntJhb1xvp5QSUNmiGhHc2UaI1PZtb0J4R1w6p k94QYqBfVYv7/Xfdt0ym54CHDJOEaqMl8TjkztQyQGZ/pxc4md2UCXPaURA1Xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=WFSlJVda; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1698141562; a=rsa-sha256; cv=none; b=dUkLkgaULAJa8hxJmNWp8r+z79UMD8zcMaTc3tyjWN0cDLkEw+PHU0w9fR00ZuP0JXrD+6 qGpjcWgIHnHUxDT92017o1VoKIV5ZTvYjyiLuT2GuFi4N0+QY824eu5kY+3M0Vi+hmiP4L LlIy03hWjQqutazd/JVinRNK1KLlh0Bx5yTnairjNAmWuP9wvkTA10XCkkRU3tyLYigGL/ XQFTSxf3Y2ADRg/nG4svh16Ru3pfflIf4YNRrLUnANIlBT5a7QQcA8UAdDMGhhSQr8hKAN kNIl8R0rG1qgut9yNQW+kMGEkiJ6HR3s5S9pKBHGEqV1LCyyphSaIVHZ6ssR2g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvEBL-0000Ae-30; Tue, 24 Oct 2023 05:58:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvEBJ-00009r-GT for guix-patches@gnu.org; Tue, 24 Oct 2023 05:58:37 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qvEBJ-0004jg-8B for guix-patches@gnu.org; Tue, 24 Oct 2023 05:58:37 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qvEBm-0002oG-M7 for guix-patches@gnu.org; Tue, 24 Oct 2023 05:59:06 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#66573] [PATCH v2.1 06/11] gnu: ucx: Update to 1.15.0. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 24 Oct 2023 09:59:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66573 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 66573@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 66573-submit@debbugs.gnu.org id=B66573.169814154510772 (code B ref 66573); Tue, 24 Oct 2023 09:59:06 +0000 Received: (at 66573) by debbugs.gnu.org; 24 Oct 2023 09:59:05 +0000 Received: from localhost ([127.0.0.1]:53216 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvEBk-0002nT-HL for submit@debbugs.gnu.org; Tue, 24 Oct 2023 05:59:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qvEBf-0002lB-DX for 66573@debbugs.gnu.org; Tue, 24 Oct 2023 05:59:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qvEB5-0004gp-Qf; Tue, 24 Oct 2023 05:58:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=i7gIIBQZFx9kbWXMCdgISmq19WiXo/0VnCFLkXJAw1o=; b=WFSlJVdaqk2wyUX4fMZj Vq1yNYJFCzEOL/VON19pSr0a2r1W4nd4A5xMTCN2yvNaUfDeSJjtC+ViQObzH4ZiGmRwJNzNXnYZl IHyrhF9hU2MwirtTXq68Q0anjroSqBKUZoSKu3tMBvZduodHIb4se2Klqpt+E5HxkH3NDeXGEKGSB ytaeV8Em7qGPgS2cErpnVzzRLnj1LNk1vlofwG8ZdV8C8ggfoGw12I7/lvuRtwAU1Bggmi7gol0sn Ei7av4MWPxmV7ne7OKJv1XHvVEzR8nHQbtTFtCcE9ePtyjOCKt+n8Pq4eNoNJUlsXJAU0bZ05ITIt LW5R5fjIF+Ju8w==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 24 Oct 2023 11:58:01 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -5.30 X-Spam-Score: -5.30 X-Migadu-Queue-Id: 92637337B8 X-Migadu-Scanner: mx2.migadu.com X-TUID: Zz7zBl8OQqnj * gnu/packages/fabric-management.scm (ucx): Update to 1.15.0. * gnu/packages/patches/ucx-tcp-iface-ioctl.patch: Update for 1.15.0. --- gnu/packages/fabric-management.scm | 4 +- .../patches/ucx-tcp-iface-ioctl.patch | 105 +++++++++++------- 2 files changed, 64 insertions(+), 45 deletions(-) diff --git a/gnu/packages/fabric-management.scm b/gnu/packages/fabric-management.scm index ccdaa0ee0a..f41b4e99ed 100644 --- a/gnu/packages/fabric-management.scm +++ b/gnu/packages/fabric-management.scm @@ -185,7 +185,7 @@ (define-public ibutils (define-public ucx (package (name "ucx") - (version "1.14.0") + (version "1.15.0") (source (origin (method git-fetch) (uri (git-reference @@ -195,7 +195,7 @@ (define-public ucx (patches (search-patches "ucx-tcp-iface-ioctl.patch")) (sha256 (base32 - "0ki2r768wqm92qv06wxrh3kv2nl2yj4ds9fz0s0b5rr2ycjiw9ir")))) + "1mk46vyfp8hsivk88s8gv0nf458jfs59fczpf66wwa3a9yp324jp")))) (build-system gnu-build-system) (arguments (list diff --git a/gnu/packages/patches/ucx-tcp-iface-ioctl.patch b/gnu/packages/patches/ucx-tcp-iface-ioctl.patch index c441a0861a..2a0e4ce138 100644 --- a/gnu/packages/patches/ucx-tcp-iface-ioctl.patch +++ b/gnu/packages/patches/ucx-tcp-iface-ioctl.patch @@ -3,102 +3,121 @@ TCP network interfaces cannot be obtained via /sys/class/net. This patch provides alternative code that uses the SIOCGIFCONF ioctl to get the names of the available TCP network interfaces. +Initially submitted at . + diff --git a/src/uct/tcp/tcp_iface.c b/src/uct/tcp/tcp_iface.c -index cad4a2709..7c1d2c9de 100644 +index 6a6cd34fa..af32bb2e9 100644 --- a/src/uct/tcp/tcp_iface.c +++ b/src/uct/tcp/tcp_iface.c -@@ -17,6 +17,8 @@ - #include +@@ -18,6 +18,8 @@ #include #include + #include +#include +#include + #define UCT_TCP_IFACE_NETDEV_DIR "/sys/class/net" - extern ucs_class_t UCS_CLASS_DECL_NAME(uct_tcp_iface_t); -@@ -586,6 +588,68 @@ static UCS_CLASS_DEFINE_NEW_FUNC(uct_tcp_iface_t, uct_iface_t, uct_md_h, +@@ -875,6 +877,85 @@ static UCS_CLASS_DEFINE_NEW_FUNC(uct_tcp_iface_t, uct_iface_t, uct_md_h, uct_worker_h, const uct_iface_params_t*, const uct_iface_config_t*); +/* Fetch information about available network devices through an ioctl. */ -+static ucs_status_t query_devices_ioctl(uct_md_h md, -+ uct_tl_device_resource_t **tl_devices_p, -+ unsigned *num_tl_devices_p) ++static ucs_status_t uct_tcp_query_devices_ioctl(uct_md_h md, ++ uct_tl_device_resource_t **devices_p, ++ unsigned *num_devices_p) +{ + int sock, err, i; -+ uct_tl_device_resource_t *resources, *tmp; -+ unsigned num_resources; ++ uct_tl_device_resource_t *devices, *tmp; ++ unsigned num_devices; + ucs_status_t status; + struct ifconf conf; -+ struct ifreq reqs[10]; + -+ conf.ifc_len = sizeof reqs; -+ conf.ifc_req = reqs; ++ conf.ifc_len = 0; ++ conf.ifc_req = NULL; + -+ sock = socket(SOCK_STREAM, AF_INET, 0); -+ if (sock < 0) { -+ ucs_error("socket(2) failed: %m"); -+ status = UCS_ERR_IO_ERROR; -+ goto out; ++ status = ucs_socket_create(AF_INET, SOCK_STREAM, &sock); ++ if (status != UCS_OK) { ++ goto out; + } + + err = ioctl(sock, SIOCGIFCONF, &conf); + if (err < 0) { -+ ucs_error("SIOCGIFCONF ioctl failed: %m"); -+ status = UCS_ERR_IO_ERROR; -+ goto out; ++ ucs_error("ioctl(SIOCGIFCONF) failed: %m"); ++ status = UCS_ERR_IO_ERROR; ++ goto out; + } + -+ resources = NULL; -+ num_resources = 0; -+ for (i = 0; i < conf.ifc_len / sizeof(struct ifreq); i++) { -+ const char *name = reqs[i].ifr_name; ++ conf.ifc_req = ucs_calloc(1, conf.ifc_len, "ifreq"); ++ if (conf.ifc_req == NULL) { ++ ucs_error("memory alocation failed"); ++ status = UCS_ERR_NO_MEMORY; ++ goto out; ++ } ++ ++ err = ioctl(sock, SIOCGIFCONF, &conf); ++ if (err < 0) { ++ ucs_error("ioctl(SIOCGIFCONF) failed: %m"); ++ status = UCS_ERR_IO_ERROR; ++ goto out_free; ++ } ++ ++ devices = NULL; ++ num_devices = 0; ++ for (i = 0; i < (conf.ifc_len / sizeof(struct ifreq)); i++) { ++ const char *name = conf.ifc_req[i].ifr_name; ++ sa_family_t family = conf.ifc_req[i].ifr_addr.sa_family; + -+ if (!ucs_netif_is_active(name, AF_INET)) { ++ if (!ucs_netif_is_active(name, family)) { + continue; + } + -+ tmp = ucs_realloc(resources, sizeof(*resources) * (num_resources + 1), -+ "tcp resources"); ++ tmp = ucs_realloc(devices, sizeof(*devices) * (num_devices + 1), ++ "tcp devices"); + if (tmp == NULL) { -+ ucs_free(resources); ++ ucs_free(devices); + status = UCS_ERR_NO_MEMORY; -+ goto out; ++ goto out_free; + } -+ resources = tmp; ++ devices = tmp; + -+ ucs_snprintf_zero(resources[i].name, sizeof(resources[i].name), ++ ucs_snprintf_zero(devices[num_devices].name, ++ sizeof(devices[num_devices].name), + "%s", name); -+ resources[i].type = UCT_DEVICE_TYPE_NET; -+ ++num_resources; ++ devices[num_devices].type = UCT_DEVICE_TYPE_NET; ++ ++num_devices; + } + -+ *num_tl_devices_p = num_resources; -+ *tl_devices_p = resources; -+ status = UCS_OK; ++ *num_devices_p = num_devices; ++ *devices_p = devices; ++ status = UCS_OK; + ++out_free: ++ ucs_free(conf.ifc_req); +out: -+ if (sock >= 0) close(sock); ++ if (sock >= 0) { ++ close(sock); ++ } + return status; +} + ucs_status_t uct_tcp_query_devices(uct_md_h md, uct_tl_device_resource_t **devices_p, unsigned *num_devices_p) -@@ -599,9 +663,9 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md, +@@ -893,9 +974,9 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md, dir = opendir(UCT_TCP_IFACE_NETDEV_DIR); if (dir == NULL) { - ucs_error("opendir(%s) failed: %m", UCT_TCP_IFACE_NETDEV_DIR); - status = UCS_ERR_IO_ERROR; - goto out; -+ /* When /sys is unavailable, as can be the case in a container, -+ * resort to a good old 'ioctl'. */ -+ return query_devices_ioctl(md, devices_p, num_devices_p); ++ /* When /sys is unavailable, as can be the case in a container, ++ * resort to a good old 'ioctl'. */ ++ return uct_tcp_query_devices_ioctl(md, devices_p, num_devices_p); } devices = NULL; -@@ -655,7 +719,6 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md, +@@ -963,7 +1044,6 @@ ucs_status_t uct_tcp_query_devices(uct_md_h md, out_closedir: closedir(dir); -- 2.41.0