]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/siw: Remove unused siw_mem_add
authorDr. David Alan Gilbert <linux@treblig.org>
Mon, 5 May 2025 21:02:26 +0000 (22:02 +0100)
committerJason Gunthorpe <jgg@nvidia.com>
Tue, 6 May 2025 17:30:13 +0000 (14:30 -0300)
siw_mem_add() was added in 2019 by commit 2251334dcac9 ("rdma/siw:
application buffer management") but has remained unused.

Remove it.

Link: https://patch.msgid.link/r/20250505210226.88994-1-linux@treblig.org
Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/sw/siw/siw_mem.c
drivers/infiniband/sw/siw/siw_mem.h

index b17156995595c20397c4628a22b3584ae183222c..d5ddeb17bd22c14629ab693e43cee75db95faef5 100644 (file)
 /* Stag lookup is based on its index part only (24 bits). */
 #define SIW_STAG_MAX_INDEX     0x00ffffff
 
-/*
- * The code avoids special Stag of zero and tries to randomize
- * STag values between 1 and SIW_STAG_MAX_INDEX.
- */
-int siw_mem_add(struct siw_device *sdev, struct siw_mem *m)
-{
-       struct xa_limit limit = XA_LIMIT(1, SIW_STAG_MAX_INDEX);
-       u32 id, next;
-
-       get_random_bytes(&next, 4);
-       next &= SIW_STAG_MAX_INDEX;
-
-       if (xa_alloc_cyclic(&sdev->mem_xa, &id, m, limit, &next,
-           GFP_KERNEL) < 0)
-               return -ENOMEM;
-
-       /* Set the STag index part */
-       m->stag = id << 8;
-
-       siw_dbg_mem(m, "new MEM object\n");
-
-       return 0;
-}
-
 /*
  * siw_mem_id2obj()
  *
index e74cfcd6dbc1ef7abadc9b67eb40d170848c4cc4..8e769d30e2acd085477a6ed0063e8259879c4180 100644 (file)
@@ -12,7 +12,6 @@ void siw_umem_release(struct siw_umem *umem);
 struct siw_pbl *siw_pbl_alloc(u32 num_buf);
 dma_addr_t siw_pbl_get_buffer(struct siw_pbl *pbl, u64 off, int *len, int *idx);
 struct siw_mem *siw_mem_id2obj(struct siw_device *sdev, int stag_index);
-int siw_mem_add(struct siw_device *sdev, struct siw_mem *m);
 int siw_invalidate_stag(struct ib_pd *pd, u32 stag);
 int siw_check_mem(struct ib_pd *pd, struct siw_mem *mem, u64 addr,
                  enum ib_access_flags perms, int len);