From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
"Michael J. Ruhl" <michael.j.ruhl@intel.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Dennis Dalessandro <dennis.dalessandro@intel.com>,
Doug Ledford <dledford@redhat.com>
Subject: [PATCH 4.14 27/43] IB/hfi1: Fix loss of BECN with AHG
Date: Tue, 8 May 2018 10:10:46 +0200 [thread overview]
Message-ID: <20180508074008.296447207@linuxfoundation.org> (raw)
In-Reply-To: <20180508074003.984433784@linuxfoundation.org>
4.14-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mike Marciniszyn <mike.marciniszyn@intel.com>
commit 0a0bcb046b2f0c15b89f8c1b08ad3de601a83c66 upstream.
AHG may be armed to use the stored header, which by design is limited
to edits in the PSN/A 32 bit word (bth2).
When the code is trying to send a BECN, the use of the stored header
will lose the BECN bit.
Fix by avoiding AHG when getting ready to send a BECN. This is
accomplished by always claiming the packet is not a middle packet which
is an AHG precursor. BECNs are not a normal case and this should not
hurt AHG optimizations.
Cc: <stable@vger.kernel.org> # 4.14.x
Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/infiniband/hw/hfi1/ruc.c | 50 +++++++++++++++++++++++++++++++--------
1 file changed, 40 insertions(+), 10 deletions(-)
--- a/drivers/infiniband/hw/hfi1/ruc.c
+++ b/drivers/infiniband/hw/hfi1/ruc.c
@@ -745,6 +745,20 @@ static inline void hfi1_make_ruc_bth(str
ohdr->bth[2] = cpu_to_be32(bth2);
}
+/**
+ * hfi1_make_ruc_header_16B - build a 16B header
+ * @qp: the queue pair
+ * @ohdr: a pointer to the destination header memory
+ * @bth0: bth0 passed in from the RC/UC builder
+ * @bth2: bth2 passed in from the RC/UC builder
+ * @middle: non zero implies indicates ahg "could" be used
+ * @ps: the current packet state
+ *
+ * This routine may disarm ahg under these situations:
+ * - packet needs a GRH
+ * - BECN needed
+ * - migration state not IB_MIG_MIGRATED
+ */
static inline void hfi1_make_ruc_header_16B(struct rvt_qp *qp,
struct ib_other_headers *ohdr,
u32 bth0, u32 bth2, int middle,
@@ -789,6 +803,12 @@ static inline void hfi1_make_ruc_header_
else
middle = 0;
+ if (qp->s_flags & RVT_S_ECN) {
+ qp->s_flags &= ~RVT_S_ECN;
+ /* we recently received a FECN, so return a BECN */
+ becn = true;
+ middle = 0;
+ }
if (middle)
build_ahg(qp, bth2);
else
@@ -796,11 +816,6 @@ static inline void hfi1_make_ruc_header_
bth0 |= pkey;
bth0 |= extra_bytes << 20;
- if (qp->s_flags & RVT_S_ECN) {
- qp->s_flags &= ~RVT_S_ECN;
- /* we recently received a FECN, so return a BECN */
- becn = 1;
- }
hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2);
if (!ppd->lid)
@@ -818,6 +833,20 @@ static inline void hfi1_make_ruc_header_
pkey, becn, 0, l4, priv->s_sc);
}
+/**
+ * hfi1_make_ruc_header_9B - build a 9B header
+ * @qp: the queue pair
+ * @ohdr: a pointer to the destination header memory
+ * @bth0: bth0 passed in from the RC/UC builder
+ * @bth2: bth2 passed in from the RC/UC builder
+ * @middle: non zero implies indicates ahg "could" be used
+ * @ps: the current packet state
+ *
+ * This routine may disarm ahg under these situations:
+ * - packet needs a GRH
+ * - BECN needed
+ * - migration state not IB_MIG_MIGRATED
+ */
static inline void hfi1_make_ruc_header_9B(struct rvt_qp *qp,
struct ib_other_headers *ohdr,
u32 bth0, u32 bth2, int middle,
@@ -853,6 +882,12 @@ static inline void hfi1_make_ruc_header_
else
middle = 0;
+ if (qp->s_flags & RVT_S_ECN) {
+ qp->s_flags &= ~RVT_S_ECN;
+ /* we recently received a FECN, so return a BECN */
+ bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT);
+ middle = 0;
+ }
if (middle)
build_ahg(qp, bth2);
else
@@ -860,11 +895,6 @@ static inline void hfi1_make_ruc_header_
bth0 |= pkey;
bth0 |= extra_bytes << 20;
- if (qp->s_flags & RVT_S_ECN) {
- qp->s_flags &= ~RVT_S_ECN;
- /* we recently received a FECN, so return a BECN */
- bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT);
- }
hfi1_make_ruc_bth(qp, ohdr, bth0, bth1, bth2);
if (!ppd->lid)
next prev parent reply other threads:[~2018-05-08 8:10 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 8:10 [PATCH 4.14 00/43] 4.14.40-stable review Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 01/43] geneve: update skb dst pmtu on tx path Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 02/43] net: dont call update_pmtu unconditionally Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 03/43] percpu: include linux/sched.h for cond_resched() Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 04/43] crypto: talitos - fix IPsec cipher in length Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 05/43] ACPI / button: make module loadable when booted in non-ACPI mode Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 06/43] USB: serial: option: Add support for Quectel EP06 Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 07/43] ALSA: hda - Fix incorrect usage of IS_REACHABLE() Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 08/43] ALSA: pcm: Check PCM state at xfern compat ioctl Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 09/43] ALSA: seq: Fix races at MIDI encoding in snd_virmidi_output_trigger() Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 10/43] ALSA: dice: fix kernel NULL pointer dereference due to invalid calculation for array index Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 11/43] ALSA: aloop: Mark paused device as inactive Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 12/43] ALSA: aloop: Add missing cable lock to ctl API callbacks Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 13/43] tracepoint: Do not warn on ENOMEM Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 14/43] scsi: target: Fix fortify_panic kernel exception Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 15/43] Input: leds - fix out of bound access Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 16/43] Input: atmel_mxt_ts - add touchpad button mapping for Samsung Chromebook Pro Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 17/43] rtlwifi: btcoex: Add power_on_setting routine Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 18/43] rtlwifi: cleanup 8723be ant_sel definition Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 19/43] xfs: prevent creating negative-sized file via INSERT_RANGE Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 20/43] RDMA/cxgb4: release hw resources on device removal Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 21/43] RDMA/ucma: Allow resolving address w/o specifying source address Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 22/43] RDMA/mlx5: Fix multiple NULL-ptr deref errors in rereg_mr flow Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 23/43] RDMA/mlx5: Protect from shift operand overflow Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 24/43] NET: usb: qmi_wwan: add support for ublox R410M PID 0x90b2 Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 25/43] IB/mlx5: Use unlimited rate when static rate is not supported Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 26/43] IB/hfi1: Fix handling of FECN marked multicast packet Greg Kroah-Hartman
2018-05-08 8:10 ` Greg Kroah-Hartman [this message]
2018-05-08 8:10 ` [PATCH 4.14 28/43] IB/hfi1: Fix NULL pointer dereference when invalid num_vls is used Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 29/43] iw_cxgb4: Atomically flush per QP HW CQEs Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 30/43] drm/vmwgfx: Fix a buffer object leak Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 31/43] drm/bridge: vga-dac: Fix edid memory leak Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 32/43] test_firmware: fix setting old custom fw path back on exit, second try Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 33/43] errseq: Always report a writeback error once Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 34/43] USB: serial: visor: handle potential invalid device configuration Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 35/43] usb: dwc3: gadget: Fix list_del corruption in dwc3_ep_dequeue Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 36/43] USB: Accept bulk endpoints with 1024-byte maxpacket Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 37/43] USB: serial: option: reimplement interface masking Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 38/43] USB: serial: option: adding support for ublox R410M Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 39/43] usb: musb: host: fix potential NULL pointer dereference Greg Kroah-Hartman
2018-05-08 8:10 ` [PATCH 4.14 40/43] usb: musb: trace: fix NULL pointer dereference in musb_g_tx() Greg Kroah-Hartman
2018-05-08 8:11 ` [PATCH 4.14 41/43] platform/x86: asus-wireless: Fix NULL pointer dereference Greg Kroah-Hartman
2018-05-08 8:11 ` [PATCH 4.14 42/43] irqchip/qcom: Fix check for spurious interrupts Greg Kroah-Hartman
2018-05-08 8:11 ` [PATCH 4.14 43/43] tracing: Fix bad use of igrab in trace_uprobe.c Greg Kroah-Hartman
2018-05-08 15:05 ` [PATCH 4.14 00/43] 4.14.40-stable review kernelci.org bot
2018-05-08 16:21 ` Guenter Roeck
2018-05-08 18:11 ` Naresh Kamboju
2018-05-08 18:18 ` Naresh Kamboju
2018-05-08 18:15 ` Naresh Kamboju
2018-05-08 22:11 ` Nathan Chancellor
2018-05-09 7:32 ` Greg Kroah-Hartman
2018-05-08 23:54 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180508074008.296447207@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=dennis.dalessandro@intel.com \
--cc=dledford@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michael.j.ruhl@intel.com \
--cc=mike.marciniszyn@intel.com \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox