aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_driver.c
diff options
context:
space:
mode:
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/**