Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 505efe3e authored by Jakub Pawlak's avatar Jakub Pawlak Committed by Doug Ledford
Browse files

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: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarJakub Pawlak <jakub.pawlak@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent 11501ab9
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -320,6 +320,9 @@
/* DC_DC8051_CFG_MODE.GENERAL bits */
/* DC_DC8051_CFG_MODE.GENERAL bits */
#define DISABLE_SELF_GUID_CHECK 0x2
#define DISABLE_SELF_GUID_CHECK 0x2


/* Bad L2 frame error code */
#define BAD_L2_ERR      0x6

/*
/*
 * Eager buffer minimum and maximum sizes supported by the hardware.
 * Eager buffer minimum and maximum sizes supported by the hardware.
 * All power-of-two sizes in between are supported as well.
 * All power-of-two sizes in between are supported as well.
+15 −2
Original line number Original line Diff line number Diff line
@@ -1360,12 +1360,25 @@ int process_receive_ib(struct hfi1_packet *packet)


int process_receive_bypass(struct hfi1_packet *packet)
int process_receive_bypass(struct hfi1_packet *packet)
{
{
	struct hfi1_devdata *dd = packet->rcd->dd;

	if (unlikely(rhf_err_flags(packet->rhf)))
	if (unlikely(rhf_err_flags(packet->rhf)))
		handle_eflags(packet);
		handle_eflags(packet);


	dd_dev_err(packet->rcd->dd,
	dd_dev_err(dd,
		   "Bypass packets are not supported in normal operation. Dropping\n");
		   "Bypass packets are not supported in normal operation. Dropping\n");
	incr_cntr64(&packet->rcd->dd->sw_rcv_bypass_packet_errors);
	incr_cntr64(&dd->sw_rcv_bypass_packet_errors);
	if (!(dd->err_info_rcvport.status_and_code & OPA_EI_STATUS_SMASK)) {
		u64 *flits = packet->ebuf;

		if (flits && !(packet->rhf & RHF_LEN_ERR)) {
			dd->err_info_rcvport.packet_flit1 = flits[0];
			dd->err_info_rcvport.packet_flit2 =
				packet->tlen > sizeof(flits[0]) ? flits[1] : 0;
		}
		dd->err_info_rcvport.status_and_code |=
			(OPA_EI_STATUS_SMASK | BAD_L2_ERR);
	}
	return RHF_RCV_CONTINUE;
	return RHF_RCV_CONTINUE;
}
}