#1 backport fix from devel branch
Closed 2 months ago by teknoraver. Opened 3 months ago by teknoraver.
rpms/ teknoraver/mstflint c10s-sig-hyperscale  into  c10s-sig-hyperscale

file added
+60
@@ -0,0 +1,60 @@ 

+ From 963895584a99f3fc8a506a6ab65b9a0ffad6477c Mon Sep 17 00:00:00 2001

+ From: oburstein <oburstein@nvidia.com>

+ Date: Wed, 29 Jan 2025 16:33:52 +0200

+ Subject: [PATCH] [mtcr_ul] Remove flock() usage from READ4_PCI() WRITE4_PCI()

+  macros no need for this semaphore as we rely on the VSC's semaphore.

+ 

+ ---

+  mtcr_ul/mtcr_ul_com.c | 28 ----------------------------

+  1 file changed, 28 deletions(-)

+ 

+ diff --git a/mtcr_ul/mtcr_ul_com.c b/mtcr_ul/mtcr_ul_com.c

+ index d37b64f7..77d2f19a 100644

+ --- a/mtcr_ul/mtcr_ul_com.c

+ +++ b/mtcr_ul/mtcr_ul_com.c

+ @@ -712,21 +712,7 @@ enum {

+      do                                                               \

+      {                                                                \

+          int       rc;                                                \

+ -        int       lock_rc;                                           \

+ -        ul_ctx_t* pci_ctx = mf->ul_ctx;                              \

+ -        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);              \

+ -        if (lock_rc)                                                 \

+ -        {                                                            \

+ -            perror(err_prefix);                                      \

+ -            action_on_fail;                                          \

+ -        }                                                            \

+          rc = pread(mf->fd, val_ptr, 4, pci_offs);                    \

+ -        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);              \

+ -        if (lock_rc)                                                 \

+ -        {                                                            \

+ -            perror(err_prefix);                                      \

+ -            action_on_fail;                                          \

+ -        }                                                            \

+          if (rc != 4)                                                 \

+          {                                                            \

+              if (rc < 0)                                              \

+ @@ -742,23 +728,9 @@ enum {

+      do                                                            \

+      {                                                             \

+          int       rc;                                             \

+ -        int       lock_rc;                                        \

+          u_int32_t val_le;                                         \

+ -        ul_ctx_t* pci_ctx = mf->ul_ctx;                           \

+          val_le = __cpu_to_le32(val);                              \

+ -        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_EX);           \

+ -        if (lock_rc)                                              \

+ -        {                                                         \

+ -            perror(err_prefix);                                   \

+ -            action_on_fail;                                       \

+ -        }                                                         \

+          rc = pwrite(mf->fd, &val_le, 4, pci_offs);                \

+ -        lock_rc = _flock_int(pci_ctx->fdlock, LOCK_UN);           \

+ -        if (lock_rc)                                              \

+ -        {                                                         \

+ -            perror(err_prefix);                                   \

+ -            action_on_fail;                                       \

+ -        }                                                         \

+          if (rc != 4)                                              \

+          {                                                         \

+              if (rc < 0)                                           \

file modified
+2
@@ -15,6 +15,7 @@ 

  

  Patch1:		0001-Fix-bind-now-test.patch

  Patch4: 	add-default-link-flags-for-shared-libraries.patch

+ Patch5:		https://github.com/Mellanox/mstflint/commit/963895584a99f3fc8a506a6ab65b9a0ffad6477c.patch#/flock.patch

  

  BuildRequires:	make

  BuildRequires:	libstdc++-devel, zlib-devel, libibmad-devel, gcc-c++, gcc
@@ -36,6 +37,7 @@ 

  

  %patch -P1 -p1

  %patch -P4 -p1

+ %patch -P5 -p1

  

  find . -type f -iname '*.[ch]' -exec chmod a-x '{}' ';'

  find . -type f -iname '*.cpp' -exec chmod a-x '{}' ';'