aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Pawlak <jakub.pawlak@intel.com>2016-10-25 16:12:17 -0400
committerDoug Ledford <dledford@redhat.com>2016-11-15 16:16:45 -0500
commit505efe3e46d5eaab726295cd023fb86d5b789d00 (patch)
treed9fa0bec1b5c74324b3db29c0dce6d835d446755
parent11501ab9df687c6f0852719a5165e16cd3eb3c10 (diff)
IB/hfi1: Fix status error code for unsupported packets
Set the status code BAD_L2 when unsupported type of packet is received and dropped. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Jakub Pawlak <jakub.pawlak@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r--drivers/infiniband/hw/hfi1/chip.h3
-rw-r--r--drivers/infiniband/hw/hfi1/driver.c17
2 files changed, 18 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/hfi1/chip.h b/drivers/infiniband/hw/hfi1/chip.h
index 92345259a8f4..043fd21dc5f3 100644
--- a/drivers/infiniband/hw/hfi1/chip.h
+++ b/drivers/infiniband/hw/hfi1/chip.h
@@ -320,6 +320,9 @@
320/* DC_DC8051_CFG_MODE.GENERAL bits */ 320/* DC_DC8051_CFG_MODE.GENERAL bits */
321#define DISABLE_SELF_GUID_CHECK 0x2 321#define DISABLE_SELF_GUID_CHECK 0x2
322 322
323/* Bad L2 frame error code */
324#define BAD_L2_ERR 0x6
325
323/* 326/*
324 * Eager buffer minimum and maximum sizes supported by the hardware. 327 * Eager buffer minimum and maximum sizes supported by the hardware.
325 * All power-of-two sizes in between are supported as well. 328 * All power-of-two sizes in between are supported as well.
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c
index 6563e4d38b80..dadd35eedc01 100644
--- a/drivers/infiniband/hw/hfi1/driver.c
+++ b/drivers/infiniband/hw/hfi1/driver.c
@@ -1360,12 +1360,25 @@ int process_receive_ib(struct hfi1_packet *packet)
1360 1360
1361int process_receive_bypass(struct hfi1_packet *packet) 1361int process_receive_bypass(struct hfi1_packet *packet)
1362{ 1362{
1363 struct hfi1_devdata *dd = packet->rcd->dd;
1364
1363 if (unlikely(rhf_err_flags(packet->rhf))) 1365 if (unlikely(rhf_err_flags(packet->rhf)))
1364 handle_eflags(packet); 1366 handle_eflags(packet);
1365 1367
1366 dd_dev_err(packet->rcd->dd, 1368 dd_dev_err(dd,
1367 "Bypass packets are not supported in normal operation. Dropping\n"); 1369 "Bypass packets are not supported in normal operation. Dropping\n");
1368 incr_cntr64(&packet->rcd->dd->sw_rcv_bypass_packet_errors); 1370 incr_cntr64(&dd->sw_rcv_bypass_packet_errors);
1371 if (!(dd->err_info_rcvport.status_and_code & OPA_EI_STATUS_SMASK)) {
1372 u64 *flits = packet->ebuf;
1373
1374 if (flits && !(packet->rhf & RHF_LEN_ERR)) {
1375 dd->err_info_rcvport.packet_flit1 = flits[0];
1376 dd->err_info_rcvport.packet_flit2 =
1377 packet->tlen > sizeof(flits[0]) ? flits[1] : 0;
1378 }
1379 dd->err_info_rcvport.status_and_code |=
1380 (OPA_EI_STATUS_SMASK | BAD_L2_ERR);
1381 }
1369 return RHF_RCV_CONTINUE; 1382 return RHF_RCV_CONTINUE;
1370} 1383}
1371 1384