Commit 4b105f4a authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma

Pull rdma fixes from Jason Gunthorpe:
 "I don't usually send a second PR in the merge window, but the fix to
  mlx5 is significant enough that it should start going through the
  process ASAP. Along with it comes some of the usual -rc stuff that
  would normally wait for a -rc2 or so.

  Summary:

  Important error case regression fixes in mlx5:

   - Wrong size used when computing the error path smaller allocation
     request leads to corruption

   - Confusing but ultimately harmless alignment mis-calculation

  Static checker warning fixes:

   - NULL pointer subtraction in qib

   - kcalloc in bnxt_re

   - Missing static on global variable in hfi1"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
  IB/hfi1: make hist static
  RDMA/bnxt_re: Prefer kcalloc over open coded arithmetic
  IB/qib: Fix null pointer subtraction compiler warning
  RDMA/mlx5: Fix xlt_chunk_align calculation
  RDMA/mlx5: Fix number of allocated XLT entries
parents 0aa25160 2169b908
...@@ -1309,7 +1309,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, ...@@ -1309,7 +1309,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd,
static int bnxt_re_create_shadow_gsi(struct bnxt_re_qp *qp, static int bnxt_re_create_shadow_gsi(struct bnxt_re_qp *qp,
struct bnxt_re_pd *pd) struct bnxt_re_pd *pd)
{ {
struct bnxt_re_sqp_entries *sqp_tbl = NULL; struct bnxt_re_sqp_entries *sqp_tbl;
struct bnxt_re_dev *rdev; struct bnxt_re_dev *rdev;
struct bnxt_re_qp *sqp; struct bnxt_re_qp *sqp;
struct bnxt_re_ah *sah; struct bnxt_re_ah *sah;
...@@ -1317,7 +1317,7 @@ static int bnxt_re_create_shadow_gsi(struct bnxt_re_qp *qp, ...@@ -1317,7 +1317,7 @@ static int bnxt_re_create_shadow_gsi(struct bnxt_re_qp *qp,
rdev = qp->rdev; rdev = qp->rdev;
/* Create a shadow QP to handle the QP1 traffic */ /* Create a shadow QP to handle the QP1 traffic */
sqp_tbl = kzalloc(sizeof(*sqp_tbl) * BNXT_RE_MAX_GSI_SQP_ENTRIES, sqp_tbl = kcalloc(BNXT_RE_MAX_GSI_SQP_ENTRIES, sizeof(*sqp_tbl),
GFP_KERNEL); GFP_KERNEL);
if (!sqp_tbl) if (!sqp_tbl)
return -ENOMEM; return -ENOMEM;
......
...@@ -488,7 +488,7 @@ struct hfi1_ctxt_hist { ...@@ -488,7 +488,7 @@ struct hfi1_ctxt_hist {
atomic_t data[255]; atomic_t data[255];
}; };
struct hfi1_ctxt_hist hist = { static struct hfi1_ctxt_hist hist = {
.count = ATOMIC_INIT(0) .count = ATOMIC_INIT(0)
}; };
......
...@@ -995,7 +995,7 @@ static struct mlx5_ib_mr *alloc_cacheable_mr(struct ib_pd *pd, ...@@ -995,7 +995,7 @@ static struct mlx5_ib_mr *alloc_cacheable_mr(struct ib_pd *pd,
static void *mlx5_ib_alloc_xlt(size_t *nents, size_t ent_size, gfp_t gfp_mask) static void *mlx5_ib_alloc_xlt(size_t *nents, size_t ent_size, gfp_t gfp_mask)
{ {
const size_t xlt_chunk_align = const size_t xlt_chunk_align =
MLX5_UMR_MTT_ALIGNMENT / sizeof(ent_size); MLX5_UMR_MTT_ALIGNMENT / ent_size;
size_t size; size_t size;
void *res = NULL; void *res = NULL;
...@@ -1024,7 +1024,7 @@ static void *mlx5_ib_alloc_xlt(size_t *nents, size_t ent_size, gfp_t gfp_mask) ...@@ -1024,7 +1024,7 @@ static void *mlx5_ib_alloc_xlt(size_t *nents, size_t ent_size, gfp_t gfp_mask)
if (size > MLX5_SPARE_UMR_CHUNK) { if (size > MLX5_SPARE_UMR_CHUNK) {
size = MLX5_SPARE_UMR_CHUNK; size = MLX5_SPARE_UMR_CHUNK;
*nents = get_order(size) / ent_size; *nents = size / ent_size;
res = (void *)__get_free_pages(gfp_mask | __GFP_NOWARN, res = (void *)__get_free_pages(gfp_mask | __GFP_NOWARN,
get_order(size)); get_order(size));
if (res) if (res)
......
...@@ -403,9 +403,11 @@ static ssize_t diagc_attr_store(struct ib_device *ibdev, u32 port_num, ...@@ -403,9 +403,11 @@ static ssize_t diagc_attr_store(struct ib_device *ibdev, u32 port_num,
} }
#define QIB_DIAGC_ATTR(N) \ #define QIB_DIAGC_ATTR(N) \
static_assert(&((struct qib_ibport *)0)->rvp.n_##N != (u64 *)NULL); \
static struct qib_diagc_attr qib_diagc_attr_##N = { \ static struct qib_diagc_attr qib_diagc_attr_##N = { \
.attr = __ATTR(N, 0664, diagc_attr_show, diagc_attr_store), \ .attr = __ATTR(N, 0664, diagc_attr_show, diagc_attr_store), \
.counter = &((struct qib_ibport *)0)->rvp.n_##N - (u64 *)0, \ .counter = \
offsetof(struct qib_ibport, rvp.n_##N) / sizeof(u64) \
} }
QIB_DIAGC_ATTR(rc_resends); QIB_DIAGC_ATTR(rc_resends);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment