aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_driver.c
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@pathscale.com>2007-03-15 17:44:55 -0400
committerRoland Dreier <rolandd@cisco.com>2007-04-18 23:20:55 -0400
commit8ec1077b35359c973f4b1de7c516be570a6df495 (patch)
tree21ba8b8099034a35a1fb4f8bf301223b1be4af73 /drivers/infiniband/hw/ipath/ipath_driver.c
parent6f5c407460bba332d6bee52e19f2305539395511 (diff)
IB/ipath: Change packet problems vs chip errors handling and reporting
Some types of packet errors are moderately common with longer IB cables and large clusters, and are not reported with prints by other IB HCA drivers. This suppresses those messages unless the new __IPATH_ERRPKTDBG bit is set in ipath_debug. Reporting of temporarily disabled frequent error interrupts was also made clearer We also distinguish between chip errors, and bad packets sent or received in the wording of the messages. Signed-off-by: Dave Olson <dave.olson@qlogic.com> Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_driver.c')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_driver.c53
1 files changed, 38 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c
index 53eb4550bcd3..cf40cf2d1fbb 100644
--- a/drivers/infiniband/hw/ipath/ipath_driver.c
+++ b/drivers/infiniband/hw/ipath/ipath_driver.c
@@ -754,9 +754,42 @@ static int ipath_wait_linkstate(struct ipath_devdata *dd, u32 state,
754 return (dd->ipath_flags & state) ? 0 : -ETIMEDOUT; 754 return (dd->ipath_flags & state) ? 0 : -ETIMEDOUT;
755} 755}
756 756
757void ipath_decode_err(char *buf, size_t blen, ipath_err_t err) 757/*
758 * Decode the error status into strings, deciding whether to always
759 * print * it or not depending on "normal packet errors" vs everything
760 * else. Return 1 if "real" errors, otherwise 0 if only packet
761 * errors, so caller can decide what to print with the string.
762 */
763int ipath_decode_err(char *buf, size_t blen, ipath_err_t err)
758{ 764{
765 int iserr = 1;
759 *buf = '\0'; 766 *buf = '\0';
767 if (err & INFINIPATH_E_PKTERRS) {
768 if (!(err & ~INFINIPATH_E_PKTERRS))
769 iserr = 0; // if only packet errors.
770 if (ipath_debug & __IPATH_ERRPKTDBG) {
771 if (err & INFINIPATH_E_REBP)
772 strlcat(buf, "EBP ", blen);
773 if (err & INFINIPATH_E_RVCRC)
774 strlcat(buf, "VCRC ", blen);
775 if (err & INFINIPATH_E_RICRC) {
776 strlcat(buf, "CRC ", blen);
777 // clear for check below, so only once
778 err &= INFINIPATH_E_RICRC;
779 }
780 if (err & INFINIPATH_E_RSHORTPKTLEN)
781 strlcat(buf, "rshortpktlen ", blen);
782 if (err & INFINIPATH_E_SDROPPEDDATAPKT)
783 strlcat(buf, "sdroppeddatapkt ", blen);
784 if (err & INFINIPATH_E_SPKTLEN)
785 strlcat(buf, "spktlen ", blen);
786 }
787 if ((err & INFINIPATH_E_RICRC) &&
788 !(err&(INFINIPATH_E_RVCRC|INFINIPATH_E_REBP)))
789 strlcat(buf, "CRC ", blen);
790 if (!iserr)
791 goto done;
792 }
760 if (err & INFINIPATH_E_RHDRLEN) 793 if (err & INFINIPATH_E_RHDRLEN)
761 strlcat(buf, "rhdrlen ", blen); 794 strlcat(buf, "rhdrlen ", blen);
762 if (err & INFINIPATH_E_RBADTID) 795 if (err & INFINIPATH_E_RBADTID)
@@ -767,12 +800,12 @@ void ipath_decode_err(char *buf, size_t blen, ipath_err_t err)
767 strlcat(buf, "rhdr ", blen); 800 strlcat(buf, "rhdr ", blen);
768 if (err & INFINIPATH_E_RLONGPKTLEN) 801 if (err & INFINIPATH_E_RLONGPKTLEN)
769 strlcat(buf, "rlongpktlen ", blen); 802 strlcat(buf, "rlongpktlen ", blen);
770 if (err & INFINIPATH_E_RSHORTPKTLEN)
771 strlcat(buf, "rshortpktlen ", blen);
772 if (err & INFINIPATH_E_RMAXPKTLEN) 803 if (err & INFINIPATH_E_RMAXPKTLEN)
773 strlcat(buf, "rmaxpktlen ", blen); 804 strlcat(buf, "rmaxpktlen ", blen);
774 if (err & INFINIPATH_E_RMINPKTLEN) 805 if (err & INFINIPATH_E_RMINPKTLEN)
775 strlcat(buf, "rminpktlen ", blen); 806 strlcat(buf, "rminpktlen ", blen);
807 if (err & INFINIPATH_E_SMINPKTLEN)
808 strlcat(buf, "sminpktlen ", blen);
776 if (err & INFINIPATH_E_RFORMATERR) 809 if (err & INFINIPATH_E_RFORMATERR)
777 strlcat(buf, "rformaterr ", blen); 810 strlcat(buf, "rformaterr ", blen);
778 if (err & INFINIPATH_E_RUNSUPVL) 811 if (err & INFINIPATH_E_RUNSUPVL)
@@ -781,32 +814,20 @@ void ipath_decode_err(char *buf, size_t blen, ipath_err_t err)
781 strlcat(buf, "runexpchar ", blen); 814 strlcat(buf, "runexpchar ", blen);
782 if (err & INFINIPATH_E_RIBFLOW) 815 if (err & INFINIPATH_E_RIBFLOW)
783 strlcat(buf, "ribflow ", blen); 816 strlcat(buf, "ribflow ", blen);
784 if (err & INFINIPATH_E_REBP)
785 strlcat(buf, "EBP ", blen);
786 if (err & INFINIPATH_E_SUNDERRUN) 817 if (err & INFINIPATH_E_SUNDERRUN)
787 strlcat(buf, "sunderrun ", blen); 818 strlcat(buf, "sunderrun ", blen);
788 if (err & INFINIPATH_E_SPIOARMLAUNCH) 819 if (err & INFINIPATH_E_SPIOARMLAUNCH)
789 strlcat(buf, "spioarmlaunch ", blen); 820 strlcat(buf, "spioarmlaunch ", blen);
790 if (err & INFINIPATH_E_SUNEXPERRPKTNUM) 821 if (err & INFINIPATH_E_SUNEXPERRPKTNUM)
791 strlcat(buf, "sunexperrpktnum ", blen); 822 strlcat(buf, "sunexperrpktnum ", blen);
792 if (err & INFINIPATH_E_SDROPPEDDATAPKT)
793 strlcat(buf, "sdroppeddatapkt ", blen);
794 if (err & INFINIPATH_E_SDROPPEDSMPPKT) 823 if (err & INFINIPATH_E_SDROPPEDSMPPKT)
795 strlcat(buf, "sdroppedsmppkt ", blen); 824 strlcat(buf, "sdroppedsmppkt ", blen);
796 if (err & INFINIPATH_E_SMAXPKTLEN) 825 if (err & INFINIPATH_E_SMAXPKTLEN)
797 strlcat(buf, "smaxpktlen ", blen); 826 strlcat(buf, "smaxpktlen ", blen);
798 if (err & INFINIPATH_E_SMINPKTLEN)
799 strlcat(buf, "sminpktlen ", blen);
800 if (err & INFINIPATH_E_SUNSUPVL) 827 if (err & INFINIPATH_E_SUNSUPVL)
801 strlcat(buf, "sunsupVL ", blen); 828 strlcat(buf, "sunsupVL ", blen);
802 if (err & INFINIPATH_E_SPKTLEN)
803 strlcat(buf, "spktlen ", blen);
804 if (err & INFINIPATH_E_INVALIDADDR) 829 if (err & INFINIPATH_E_INVALIDADDR)
805 strlcat(buf, "invalidaddr ", blen); 830 strlcat(buf, "invalidaddr ", blen);
806 if (err & INFINIPATH_E_RICRC)
807 strlcat(buf, "CRC ", blen);
808 if (err & INFINIPATH_E_RVCRC)
809 strlcat(buf, "VCRC ", blen);
810 if (err & INFINIPATH_E_RRCVEGRFULL) 831 if (err & INFINIPATH_E_RRCVEGRFULL)
811 strlcat(buf, "rcvegrfull ", blen); 832 strlcat(buf, "rcvegrfull ", blen);
812 if (err & INFINIPATH_E_RRCVHDRFULL) 833 if (err & INFINIPATH_E_RRCVHDRFULL)
@@ -819,6 +840,8 @@ void ipath_decode_err(char *buf, size_t blen, ipath_err_t err)
819 strlcat(buf, "hardware ", blen); 840 strlcat(buf, "hardware ", blen);
820 if (err & INFINIPATH_E_RESET) 841 if (err & INFINIPATH_E_RESET)
821 strlcat(buf, "reset ", blen); 842 strlcat(buf, "reset ", blen);
843done:
844 return iserr;
822} 845}
823 846
824/** 847/**