linux/drivers/infiniband/ulp
Bart Van Assche 63ce626d98 RDMA/srpt: Make slab cache names unique
[ Upstream commit 4d784c042d ]

Since commit 4c39529663 ("slab: Warn on duplicate cache names when
DEBUG_VM=y"), slab complains about duplicate cache names. Hence this
patch. The approach is as follows:
- Maintain an xarray with the slab size as index and a reference count
  and a kmem_cache pointer as contents. Use srpt-${slab_size} as kmem
  cache name.
- Use 512-byte alignment for all slabs instead of only for some of the
  slabs.
- Increment the reference count instead of calling kmem_cache_create().
- Decrement the reference count instead of calling kmem_cache_destroy().

Fixes: 5dabcd0456 ("RDMA/srpt: Add support for immediate data")
Link: https://patch.msgid.link/r/20241009210048.4122518-1-bvanassche@acm.org
Reported-by: Shinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Closes: https://lore.kernel.org/linux-block/xpe6bea7rakpyoyfvspvin2dsozjmjtjktpph7rep3h25tv7fb@ooz4cu5z6bq6/
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Tested-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-11-01 01:55:58 +01:00
..
ipoib RDMA/IPoIB: Fix format truncation compilation errors 2024-06-12 11:03:31 +02:00
iser IB/iser: Prevent invalidating wrong MR 2024-01-25 15:27:38 -08:00
isert Revert "IB/isert: Fix incorrect release of isert connection" 2023-09-13 09:42:57 +02:00
opa_vnic IB: move from strlcpy with unused retval to strscpy 2022-08-21 14:18:02 +03:00
rtrs RDMA/rtrs-srv: Avoid null pointer deref during path establishment 2024-10-17 15:22:14 +02:00
srp RDMA/srp: Do not call scsi_done() from srp_abort() 2023-10-10 22:00:45 +02:00
srpt RDMA/srpt: Make slab cache names unique 2024-11-01 01:55:58 +01:00
Makefile RDMA/rtrs: include client and server modules into kernel compilation 2020-05-17 18:57:15 -03:00