Skip to content

Commit 3341713

Browse files
committed
Merge tags 'for-linus' and 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma
Pull more rdma updates from Doug Ledford: "As mentioned in my first pull request, this is the subsequent pull requests I had. This is all I have, and in fact this cleans out the RDMA subsystem's entire patchworks queue of kernel changes that are ready to go (well, it did for the weekend anyway, a few new patches are in, but they'll be coming during the -rc cycle). The first tag contains a single patch that would have conflicted if taken from my tree or DaveM's tree as it needed our trees merged to come cleanly. The second tag contains the patch series from Intel plus three other stragllers that came in late last week. I took them because it allowed me to legitimately claim that the RDMA patchworks queue was, for a short time, 100% cleared of all waiting kernel patches, woohoo! :-). I have it under my for-next tag, so it did get 0day and linux- next over the end of last week, and linux-next did show one minor conflict. Summary: 'for-linus' tag: - mlx5/IPoIB fixup patch 'for-next' tag: - the hfi1 15 patch set that landed late - IPoIB get_link_ksettings which landed late because I asked for a respin - one late rxe change - one -rc worthy fix that's in early" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: IB/mlx5: Enable IPoIB acceleration * tag 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: rxe: expose num_possible_cpus() cnum_comp_vectors IB/rxe: Update caller's CRC for RXE_MEM_TYPE_DMA memory type IB/hfi1: Clean up on context initialization failure IB/hfi1: Fix an assign/ordering issue with shared context IDs IB/hfi1: Clean up context initialization IB/hfi1: Correctly clear the pkey IB/hfi1: Search shared contexts on the opened device, not all devices IB/hfi1: Remove atomic operations for SDMA_REQ_HAVE_AHG bit IB/hfi1: Use filedata rather than filepointer IB/hfi1: Name function prototype parameters IB/hfi1: Fix a subcontext memory leak IB/hfi1: Return an error on memory allocation failure IB/hfi1: Adjust default eager_buffer_size to 8MB IB/hfi1: Get rid of divide when setting the tx request header IB/hfi1: Fix yield logic in send engine IB/hfi1, IB/rdmavt: Move r_adefered to r_lock cache line IB/hfi1: Fix checks for Offline transient state IB/ipoib: add get_link_ksettings in ethtool
3 parents 857f864 + 693dfd5 + 67cf362 commit 3341713

File tree

29 files changed

+764
-623
lines changed

29 files changed

+764
-623
lines changed

drivers/infiniband/hw/hfi1/chip.c

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ static void handle_pio_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
10551055
static void handle_sdma_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
10561056
static void handle_egress_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
10571057
static void handle_txe_err(struct hfi1_devdata *dd, u32 unused, u64 reg);
1058-
static void set_partition_keys(struct hfi1_pportdata *);
1058+
static void set_partition_keys(struct hfi1_pportdata *ppd);
10591059
static const char *link_state_name(u32 state);
10601060
static const char *link_state_reason_name(struct hfi1_pportdata *ppd,
10611061
u32 state);
@@ -1068,9 +1068,9 @@ static int wait_logical_linkstate(struct hfi1_pportdata *ppd, u32 state,
10681068
int msecs);
10691069
static void read_planned_down_reason_code(struct hfi1_devdata *dd, u8 *pdrrc);
10701070
static void read_link_down_reason(struct hfi1_devdata *dd, u8 *ldr);
1071-
static void handle_temp_err(struct hfi1_devdata *);
1072-
static void dc_shutdown(struct hfi1_devdata *);
1073-
static void dc_start(struct hfi1_devdata *);
1071+
static void handle_temp_err(struct hfi1_devdata *dd);
1072+
static void dc_shutdown(struct hfi1_devdata *dd);
1073+
static void dc_start(struct hfi1_devdata *dd);
10741074
static int qos_rmt_entries(struct hfi1_devdata *dd, unsigned int *mp,
10751075
unsigned int *np);
10761076
static void clear_full_mgmt_pkey(struct hfi1_pportdata *ppd);
@@ -10233,7 +10233,7 @@ static int goto_offline(struct hfi1_pportdata *ppd, u8 rem_reason)
1023310233
if (pstate == PLS_OFFLINE) {
1023410234
do_transition = 0; /* in right state */
1023510235
do_wait = 0; /* ...no need to wait */
10236-
} else if ((pstate & 0xff) == PLS_OFFLINE) {
10236+
} else if ((pstate & 0xf0) == PLS_OFFLINE) {
1023710237
do_transition = 0; /* in an offline transient state */
1023810238
do_wait = 1; /* ...wait for it to settle */
1023910239
} else {
@@ -12662,7 +12662,7 @@ u8 hfi1_ibphys_portstate(struct hfi1_pportdata *ppd)
1266212662
#define SET_STATIC_RATE_CONTROL_SMASK(r) \
1266312663
(r |= SEND_CTXT_CHECK_ENABLE_DISALLOW_PBC_STATIC_RATE_CONTROL_SMASK)
1266412664

12665-
int hfi1_init_ctxt(struct send_context *sc)
12665+
void hfi1_init_ctxt(struct send_context *sc)
1266612666
{
1266712667
if (sc) {
1266812668
struct hfi1_devdata *dd = sc->dd;
@@ -12679,7 +12679,6 @@ int hfi1_init_ctxt(struct send_context *sc)
1267912679
write_kctxt_csr(dd, sc->hw_context,
1268012680
SEND_CTXT_CHECK_ENABLE, reg);
1268112681
}
12682-
return 0;
1268312682
}
1268412683

1268512684
int hfi1_tempsense_rd(struct hfi1_devdata *dd, struct hfi1_temp *temp)
@@ -14528,30 +14527,24 @@ int hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt, u16 pkey)
1452814527
return ret;
1452914528
}
1453014529

14531-
int hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt)
14530+
int hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, struct hfi1_ctxtdata *ctxt)
1453214531
{
14533-
struct hfi1_ctxtdata *rcd;
14534-
unsigned sctxt;
14535-
int ret = 0;
14532+
u8 hw_ctxt;
1453614533
u64 reg;
1453714534

14538-
if (ctxt < dd->num_rcv_contexts) {
14539-
rcd = dd->rcd[ctxt];
14540-
} else {
14541-
ret = -EINVAL;
14542-
goto done;
14543-
}
14544-
if (!rcd || !rcd->sc) {
14545-
ret = -EINVAL;
14546-
goto done;
14547-
}
14548-
sctxt = rcd->sc->hw_context;
14549-
reg = read_kctxt_csr(dd, sctxt, SEND_CTXT_CHECK_ENABLE);
14535+
if (!ctxt || !ctxt->sc)
14536+
return -EINVAL;
14537+
14538+
if (ctxt->ctxt >= dd->num_rcv_contexts)
14539+
return -EINVAL;
14540+
14541+
hw_ctxt = ctxt->sc->hw_context;
14542+
reg = read_kctxt_csr(dd, hw_ctxt, SEND_CTXT_CHECK_ENABLE);
1455014543
reg &= ~SEND_CTXT_CHECK_ENABLE_CHECK_PARTITION_KEY_SMASK;
14551-
write_kctxt_csr(dd, sctxt, SEND_CTXT_CHECK_ENABLE, reg);
14552-
write_kctxt_csr(dd, sctxt, SEND_CTXT_CHECK_PARTITION_KEY, 0);
14553-
done:
14554-
return ret;
14544+
write_kctxt_csr(dd, hw_ctxt, SEND_CTXT_CHECK_ENABLE, reg);
14545+
write_kctxt_csr(dd, hw_ctxt, SEND_CTXT_CHECK_PARTITION_KEY, 0);
14546+
14547+
return 0;
1455514548
}
1455614549

1455714550
/*

drivers/infiniband/hw/hfi1/chip.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,8 @@ static inline void write_uctxt_csr(struct hfi1_devdata *dd, int ctxt,
636636
write_csr(dd, offset0 + (0x1000 * ctxt), value);
637637
}
638638

639-
u64 create_pbc(struct hfi1_pportdata *ppd, u64, int, u32, u32);
639+
u64 create_pbc(struct hfi1_pportdata *ppd, u64 flags, int srate_mbs, u32 vl,
640+
u32 dw_len);
640641

641642
/* firmware.c */
642643
#define SBUS_MASTER_BROADCAST 0xfd
@@ -728,7 +729,8 @@ int bringup_serdes(struct hfi1_pportdata *ppd);
728729
void set_intr_state(struct hfi1_devdata *dd, u32 enable);
729730
void apply_link_downgrade_policy(struct hfi1_pportdata *ppd,
730731
int refresh_widths);
731-
void update_usrhead(struct hfi1_ctxtdata *, u32, u32, u32, u32, u32);
732+
void update_usrhead(struct hfi1_ctxtdata *rcd, u32 hd, u32 updegr, u32 egrhd,
733+
u32 intr_adjust, u32 npkts);
732734
int stop_drain_data_vls(struct hfi1_devdata *dd);
733735
int open_fill_data_vls(struct hfi1_devdata *dd);
734736
u32 ns_to_cclock(struct hfi1_devdata *dd, u32 ns);
@@ -1347,7 +1349,7 @@ void hfi1_start_cleanup(struct hfi1_devdata *dd);
13471349
void hfi1_clear_tids(struct hfi1_ctxtdata *rcd);
13481350
struct ib_header *hfi1_get_msgheader(
13491351
struct hfi1_devdata *dd, __le32 *rhf_addr);
1350-
int hfi1_init_ctxt(struct send_context *sc);
1352+
void hfi1_init_ctxt(struct send_context *sc);
13511353
void hfi1_put_tid(struct hfi1_devdata *dd, u32 index,
13521354
u32 type, unsigned long pa, u16 order);
13531355
void hfi1_quiet_serdes(struct hfi1_pportdata *ppd);
@@ -1360,7 +1362,7 @@ int hfi1_set_ib_cfg(struct hfi1_pportdata *ppd, int which, u32 val);
13601362
int hfi1_set_ctxt_jkey(struct hfi1_devdata *dd, unsigned ctxt, u16 jkey);
13611363
int hfi1_clear_ctxt_jkey(struct hfi1_devdata *dd, unsigned ctxt);
13621364
int hfi1_set_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt, u16 pkey);
1363-
int hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, unsigned ctxt);
1365+
int hfi1_clear_ctxt_pkey(struct hfi1_devdata *dd, struct hfi1_ctxtdata *ctxt);
13641366
void hfi1_read_link_quality(struct hfi1_devdata *dd, u8 *link_quality);
13651367
void hfi1_init_vnic_rsm(struct hfi1_devdata *dd);
13661368
void hfi1_deinit_vnic_rsm(struct hfi1_devdata *dd);

drivers/infiniband/hw/hfi1/driver.c

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ module_param_named(cu, hfi1_cu, uint, S_IRUGO);
8585
MODULE_PARM_DESC(cu, "Credit return units");
8686

8787
unsigned long hfi1_cap_mask = HFI1_CAP_MASK_DEFAULT;
88-
static int hfi1_caps_set(const char *, const struct kernel_param *);
89-
static int hfi1_caps_get(char *, const struct kernel_param *);
88+
static int hfi1_caps_set(const char *val, const struct kernel_param *kp);
89+
static int hfi1_caps_get(char *buffer, const struct kernel_param *kp);
9090
static const struct kernel_param_ops cap_ops = {
9191
.set = hfi1_caps_set,
9292
.get = hfi1_caps_get
@@ -210,42 +210,6 @@ int hfi1_count_active_units(void)
210210
return nunits_active;
211211
}
212212

213-
/*
214-
* Return count of all units, optionally return in arguments
215-
* the number of usable (present) units, and the number of
216-
* ports that are up.
217-
*/
218-
int hfi1_count_units(int *npresentp, int *nupp)
219-
{
220-
int nunits = 0, npresent = 0, nup = 0;
221-
struct hfi1_devdata *dd;
222-
unsigned long flags;
223-
int pidx;
224-
struct hfi1_pportdata *ppd;
225-
226-
spin_lock_irqsave(&hfi1_devs_lock, flags);
227-
228-
list_for_each_entry(dd, &hfi1_dev_list, list) {
229-
nunits++;
230-
if ((dd->flags & HFI1_PRESENT) && dd->kregbase)
231-
npresent++;
232-
for (pidx = 0; pidx < dd->num_pports; ++pidx) {
233-
ppd = dd->pport + pidx;
234-
if (ppd->lid && ppd->linkup)
235-
nup++;
236-
}
237-
}
238-
239-
spin_unlock_irqrestore(&hfi1_devs_lock, flags);
240-
241-
if (npresentp)
242-
*npresentp = npresent;
243-
if (nupp)
244-
*nupp = nup;
245-
246-
return nunits;
247-
}
248-
249213
/*
250214
* Get address of eager buffer from it's index (allocated in chunks, not
251215
* contiguous).
@@ -1325,7 +1289,7 @@ int hfi1_reset_device(int unit)
13251289
if (dd->rcd)
13261290
for (i = dd->first_dyn_alloc_ctxt;
13271291
i < dd->num_rcv_contexts; i++) {
1328-
if (!dd->rcd[i] || !dd->rcd[i]->cnt)
1292+
if (!dd->rcd[i])
13291293
continue;
13301294
spin_unlock_irqrestore(&dd->uctxt_lock, flags);
13311295
ret = -EBUSY;

0 commit comments

Comments
 (0)