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

Commit fba75200 authored by Bryan O'Sullivan's avatar Bryan O'Sullivan Committed by Linus Torvalds
Browse files

[PATCH] IB/ipath: fixes to performance get counters for IB compliance



This patch fixes some problems uncovered during IB compliance testing to
return the right values for error counters returned by the Performance Get
Counters packet.

Signed-off-by: default avatarRalph Campbell <ralph.campbell@qlogic.com>
Signed-off-by: default avatarBryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 85322947
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -460,6 +460,8 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
	 * by ipath_setup_htconfig.
	 */
	dd->ipath_flags = 0;
	dd->ipath_lli_counter = 0;
	dd->ipath_lli_errors = 0;

	if (dd->ipath_f_bus(dd, pdev))
		ipath_dev_err(dd, "Failed to setup config space; "
@@ -942,6 +944,18 @@ void ipath_kreceive(struct ipath_devdata *dd)
				   "tlen=%x opcode=%x egridx=%x: %s\n",
				   eflags, l, etype, tlen, bthbytes[0],
				   ips_get_index((__le32 *) rc), emsg);
			/* Count local link integrity errors. */
			if (eflags & (INFINIPATH_RHF_H_ICRCERR |
				      INFINIPATH_RHF_H_VCRCERR)) {
				u8 n = (dd->ipath_ibcctrl >>
					INFINIPATH_IBCC_PHYERRTHRESHOLD_SHIFT) &
					INFINIPATH_IBCC_PHYERRTHRESHOLD_MASK;

				if (++dd->ipath_lli_counter > n) {
					dd->ipath_lli_counter = 0;
					dd->ipath_lli_errors++;
				}
			}
		} else if (etype == RCVHQ_RCV_TYPE_NON_KD) {
				int ret = __ipath_verbs_rcv(dd, rc + 1,
							    ebuf, tlen);
@@ -949,6 +963,9 @@ void ipath_kreceive(struct ipath_devdata *dd)
					ipath_cdbg(VERBOSE,
						   "received IB packet, "
						   "not SMA (QP=%x)\n", qp);
				if (dd->ipath_lli_counter)
					dd->ipath_lli_counter--;

		} else if (etype == RCVHQ_RCV_TYPE_EAGER) {
			if (qp == IPATH_KD_QP &&
			    bthbytes[0] == ipath_layer_rcv_opcode &&
+1 −0
Original line number Diff line number Diff line
@@ -262,6 +262,7 @@ static void handle_e_ibstatuschanged(struct ipath_devdata *dd,
				     | IPATH_LINKACTIVE |
				     IPATH_LINKARMED);
		*dd->ipath_statusp &= ~IPATH_STATUS_IB_READY;
		dd->ipath_lli_counter = 0;
		if (!noprint) {
			if (((dd->ipath_lastibcstat >>
			      INFINIPATH_IBCS_LINKSTATE_SHIFT) &
+5 −0
Original line number Diff line number Diff line
@@ -507,6 +507,11 @@ struct ipath_devdata {
	u8 ipath_pci_cacheline;
	/* LID mask control */
	u8 ipath_lmc;

	/* local link integrity counter */
	u32 ipath_lli_counter;
	/* local link integrity errors */
	u32 ipath_lli_errors;
};

extern struct list_head ipath_dev_list;
+7 −2
Original line number Diff line number Diff line
@@ -1032,19 +1032,22 @@ int ipath_layer_get_counters(struct ipath_devdata *dd,
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_ibsymbolerrcnt);
	cntrs->link_error_recovery_counter =
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_iblinkerrrecovcnt);
	/*
	 * The link downed counter counts when the other side downs the
	 * connection.  We add in the number of times we downed the link
	 * due to local link integrity errors to compensate.
	 */
	cntrs->link_downed_counter =
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_iblinkdowncnt);
	cntrs->port_rcv_errors =
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_rxdroppktcnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvovflcnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_portovflcnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_errrcvflowctrlcnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_err_rlencnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_invalidrlencnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_erricrccnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_errvcrccnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlpcrccnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_errlinkcnt) +
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_badformatcnt);
	cntrs->port_rcv_remphys_errors =
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_rcvebpcnt);
@@ -1058,6 +1061,8 @@ int ipath_layer_get_counters(struct ipath_devdata *dd,
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktsendcnt);
	cntrs->port_rcv_packets =
		ipath_snap_cntr(dd, dd->ipath_cregs->cr_pktrcvcnt);
	cntrs->local_link_integrity_errors = dd->ipath_lli_errors;
	cntrs->excessive_buffer_overrun_errors = 0; /* XXX */

	ret = 0;

+2 −0
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@ struct ipath_layer_counters {
	u64 port_rcv_data;
	u64 port_xmit_packets;
	u64 port_rcv_packets;
	u32 local_link_integrity_errors;
	u32 excessive_buffer_overrun_errors;
};

/*
Loading