diff options
Diffstat (limited to 'drivers/net/vxge')
-rw-r--r-- | drivers/net/vxge/vxge-traffic.c | 55 | ||||
-rw-r--r-- | drivers/net/vxge/vxge-traffic.h | 2 |
2 files changed, 34 insertions, 23 deletions
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index cf4ebb55273d..506625b180ac 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c | |||
@@ -505,7 +505,7 @@ enum vxge_hw_status vxge_hw_device_begin_irq(struct __vxge_hw_device *hldev, | |||
505 | ret = __vxge_hw_vpath_alarm_process( | 505 | ret = __vxge_hw_vpath_alarm_process( |
506 | &hldev->virtual_paths[i], skip_alarms); | 506 | &hldev->virtual_paths[i], skip_alarms); |
507 | 507 | ||
508 | error_level = max(ret, error_level); | 508 | error_level = VXGE_HW_SET_LEVEL(ret, error_level); |
509 | 509 | ||
510 | if (unlikely((ret == VXGE_HW_ERR_CRITICAL) || | 510 | if (unlikely((ret == VXGE_HW_ERR_CRITICAL) || |
511 | (ret == VXGE_HW_ERR_SLOT_FREEZE))) | 511 | (ret == VXGE_HW_ERR_SLOT_FREEZE))) |
@@ -1921,7 +1921,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1921 | struct vxge_hw_vpath_reg __iomem *vp_reg; | 1921 | struct vxge_hw_vpath_reg __iomem *vp_reg; |
1922 | 1922 | ||
1923 | if (vpath == NULL) { | 1923 | if (vpath == NULL) { |
1924 | alarm_event = max(VXGE_HW_EVENT_UNKNOWN, | 1924 | alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN, |
1925 | alarm_event); | 1925 | alarm_event); |
1926 | goto out2; | 1926 | goto out2; |
1927 | } | 1927 | } |
@@ -1931,7 +1931,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1931 | alarm_status = readq(&vp_reg->vpath_general_int_status); | 1931 | alarm_status = readq(&vp_reg->vpath_general_int_status); |
1932 | 1932 | ||
1933 | if (alarm_status == VXGE_HW_ALL_FOXES) { | 1933 | if (alarm_status == VXGE_HW_ALL_FOXES) { |
1934 | alarm_event = max(VXGE_HW_EVENT_SLOT_FREEZE, | 1934 | alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_SLOT_FREEZE, |
1935 | alarm_event); | 1935 | alarm_event); |
1936 | goto out; | 1936 | goto out; |
1937 | } | 1937 | } |
@@ -1945,7 +1945,7 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1945 | VXGE_HW_VPATH_GENERAL_INT_STATUS_XMAC_INT)) { | 1945 | VXGE_HW_VPATH_GENERAL_INT_STATUS_XMAC_INT)) { |
1946 | sw_stats->error_stats.unknown_alarms++; | 1946 | sw_stats->error_stats.unknown_alarms++; |
1947 | 1947 | ||
1948 | alarm_event = max(VXGE_HW_EVENT_UNKNOWN, | 1948 | alarm_event = VXGE_HW_SET_LEVEL(VXGE_HW_EVENT_UNKNOWN, |
1949 | alarm_event); | 1949 | alarm_event); |
1950 | goto out; | 1950 | goto out; |
1951 | } | 1951 | } |
@@ -1975,8 +1975,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1975 | &vp_reg->asic_ntwk_vp_err_mask); | 1975 | &vp_reg->asic_ntwk_vp_err_mask); |
1976 | 1976 | ||
1977 | __vxge_hw_device_handle_link_down_ind(hldev); | 1977 | __vxge_hw_device_handle_link_down_ind(hldev); |
1978 | alarm_event = max(VXGE_HW_EVENT_LINK_DOWN, | 1978 | alarm_event = VXGE_HW_SET_LEVEL( |
1979 | alarm_event); | 1979 | VXGE_HW_EVENT_LINK_DOWN, alarm_event); |
1980 | } | 1980 | } |
1981 | 1981 | ||
1982 | if (((val64 & | 1982 | if (((val64 & |
@@ -1996,15 +1996,15 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
1996 | &vp_reg->asic_ntwk_vp_err_mask); | 1996 | &vp_reg->asic_ntwk_vp_err_mask); |
1997 | 1997 | ||
1998 | __vxge_hw_device_handle_link_up_ind(hldev); | 1998 | __vxge_hw_device_handle_link_up_ind(hldev); |
1999 | alarm_event = max(VXGE_HW_EVENT_LINK_UP, | 1999 | alarm_event = VXGE_HW_SET_LEVEL( |
2000 | alarm_event); | 2000 | VXGE_HW_EVENT_LINK_UP, alarm_event); |
2001 | } | 2001 | } |
2002 | 2002 | ||
2003 | writeq(VXGE_HW_INTR_MASK_ALL, | 2003 | writeq(VXGE_HW_INTR_MASK_ALL, |
2004 | &vp_reg->asic_ntwk_vp_err_reg); | 2004 | &vp_reg->asic_ntwk_vp_err_reg); |
2005 | 2005 | ||
2006 | alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED, | 2006 | alarm_event = VXGE_HW_SET_LEVEL( |
2007 | alarm_event); | 2007 | VXGE_HW_EVENT_ALARM_CLEARED, alarm_event); |
2008 | 2008 | ||
2009 | if (skip_alarms) | 2009 | if (skip_alarms) |
2010 | return VXGE_HW_OK; | 2010 | return VXGE_HW_OK; |
@@ -2026,8 +2026,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2026 | ~mask64) { | 2026 | ~mask64) { |
2027 | sw_stats->error_stats.ini_serr_det++; | 2027 | sw_stats->error_stats.ini_serr_det++; |
2028 | 2028 | ||
2029 | alarm_event = max(VXGE_HW_EVENT_SERR, | 2029 | alarm_event = VXGE_HW_SET_LEVEL( |
2030 | alarm_event); | 2030 | VXGE_HW_EVENT_SERR, alarm_event); |
2031 | } | 2031 | } |
2032 | 2032 | ||
2033 | if ((val64 & | 2033 | if ((val64 & |
@@ -2035,8 +2035,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2035 | ~mask64) { | 2035 | ~mask64) { |
2036 | sw_stats->error_stats.dblgen_fifo0_overflow++; | 2036 | sw_stats->error_stats.dblgen_fifo0_overflow++; |
2037 | 2037 | ||
2038 | alarm_event = max(VXGE_HW_EVENT_FIFO_ERR, | 2038 | alarm_event = VXGE_HW_SET_LEVEL( |
2039 | alarm_event); | 2039 | VXGE_HW_EVENT_FIFO_ERR, alarm_event); |
2040 | } | 2040 | } |
2041 | 2041 | ||
2042 | if ((val64 & | 2042 | if ((val64 & |
@@ -2057,7 +2057,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2057 | if (!skip_alarms) { | 2057 | if (!skip_alarms) { |
2058 | writeq(VXGE_HW_INTR_MASK_ALL, | 2058 | writeq(VXGE_HW_INTR_MASK_ALL, |
2059 | &vp_reg->general_errors_reg); | 2059 | &vp_reg->general_errors_reg); |
2060 | alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED, | 2060 | alarm_event = VXGE_HW_SET_LEVEL( |
2061 | VXGE_HW_EVENT_ALARM_CLEARED, | ||
2061 | alarm_event); | 2062 | alarm_event); |
2062 | } | 2063 | } |
2063 | } | 2064 | } |
@@ -2073,7 +2074,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2073 | ~mask64) { | 2074 | ~mask64) { |
2074 | sw_stats->error_stats.kdfcctl_fifo0_overwrite++; | 2075 | sw_stats->error_stats.kdfcctl_fifo0_overwrite++; |
2075 | 2076 | ||
2076 | alarm_event = max(VXGE_HW_EVENT_FIFO_ERR, | 2077 | alarm_event = VXGE_HW_SET_LEVEL( |
2078 | VXGE_HW_EVENT_FIFO_ERR, | ||
2077 | alarm_event); | 2079 | alarm_event); |
2078 | } | 2080 | } |
2079 | 2081 | ||
@@ -2082,7 +2084,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2082 | ~mask64) { | 2084 | ~mask64) { |
2083 | sw_stats->error_stats.kdfcctl_fifo0_poison++; | 2085 | sw_stats->error_stats.kdfcctl_fifo0_poison++; |
2084 | 2086 | ||
2085 | alarm_event = max(VXGE_HW_EVENT_FIFO_ERR, | 2087 | alarm_event = VXGE_HW_SET_LEVEL( |
2088 | VXGE_HW_EVENT_FIFO_ERR, | ||
2086 | alarm_event); | 2089 | alarm_event); |
2087 | } | 2090 | } |
2088 | 2091 | ||
@@ -2091,14 +2094,16 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2091 | ~mask64) { | 2094 | ~mask64) { |
2092 | sw_stats->error_stats.kdfcctl_fifo0_dma_error++; | 2095 | sw_stats->error_stats.kdfcctl_fifo0_dma_error++; |
2093 | 2096 | ||
2094 | alarm_event = max(VXGE_HW_EVENT_FIFO_ERR, | 2097 | alarm_event = VXGE_HW_SET_LEVEL( |
2098 | VXGE_HW_EVENT_FIFO_ERR, | ||
2095 | alarm_event); | 2099 | alarm_event); |
2096 | } | 2100 | } |
2097 | 2101 | ||
2098 | if (!skip_alarms) { | 2102 | if (!skip_alarms) { |
2099 | writeq(VXGE_HW_INTR_MASK_ALL, | 2103 | writeq(VXGE_HW_INTR_MASK_ALL, |
2100 | &vp_reg->kdfcctl_errors_reg); | 2104 | &vp_reg->kdfcctl_errors_reg); |
2101 | alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED, | 2105 | alarm_event = VXGE_HW_SET_LEVEL( |
2106 | VXGE_HW_EVENT_ALARM_CLEARED, | ||
2102 | alarm_event); | 2107 | alarm_event); |
2103 | } | 2108 | } |
2104 | } | 2109 | } |
@@ -2122,7 +2127,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2122 | ~mask64) { | 2127 | ~mask64) { |
2123 | sw_stats->error_stats.prc_rxdcm_sc_err++; | 2128 | sw_stats->error_stats.prc_rxdcm_sc_err++; |
2124 | 2129 | ||
2125 | alarm_event = max(VXGE_HW_EVENT_VPATH_ERR, | 2130 | alarm_event = VXGE_HW_SET_LEVEL( |
2131 | VXGE_HW_EVENT_VPATH_ERR, | ||
2126 | alarm_event); | 2132 | alarm_event); |
2127 | } | 2133 | } |
2128 | 2134 | ||
@@ -2130,7 +2136,8 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2130 | & ~mask64) { | 2136 | & ~mask64) { |
2131 | sw_stats->error_stats.prc_rxdcm_sc_abort++; | 2137 | sw_stats->error_stats.prc_rxdcm_sc_abort++; |
2132 | 2138 | ||
2133 | alarm_event = max(VXGE_HW_EVENT_VPATH_ERR, | 2139 | alarm_event = VXGE_HW_SET_LEVEL( |
2140 | VXGE_HW_EVENT_VPATH_ERR, | ||
2134 | alarm_event); | 2141 | alarm_event); |
2135 | } | 2142 | } |
2136 | 2143 | ||
@@ -2138,14 +2145,16 @@ enum vxge_hw_status __vxge_hw_vpath_alarm_process( | |||
2138 | & ~mask64) { | 2145 | & ~mask64) { |
2139 | sw_stats->error_stats.prc_quanta_size_err++; | 2146 | sw_stats->error_stats.prc_quanta_size_err++; |
2140 | 2147 | ||
2141 | alarm_event = max(VXGE_HW_EVENT_VPATH_ERR, | 2148 | alarm_event = VXGE_HW_SET_LEVEL( |
2149 | VXGE_HW_EVENT_VPATH_ERR, | ||
2142 | alarm_event); | 2150 | alarm_event); |
2143 | } | 2151 | } |
2144 | 2152 | ||
2145 | if (!skip_alarms) { | 2153 | if (!skip_alarms) { |
2146 | writeq(VXGE_HW_INTR_MASK_ALL, | 2154 | writeq(VXGE_HW_INTR_MASK_ALL, |
2147 | &vp_reg->prc_alarm_reg); | 2155 | &vp_reg->prc_alarm_reg); |
2148 | alarm_event = max(VXGE_HW_EVENT_ALARM_CLEARED, | 2156 | alarm_event = VXGE_HW_SET_LEVEL( |
2157 | VXGE_HW_EVENT_ALARM_CLEARED, | ||
2149 | alarm_event); | 2158 | alarm_event); |
2150 | } | 2159 | } |
2151 | } | 2160 | } |
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h index d03f3d3805c9..7567a1140d07 100644 --- a/drivers/net/vxge/vxge-traffic.h +++ b/drivers/net/vxge/vxge-traffic.h | |||
@@ -110,6 +110,8 @@ enum vxge_hw_event { | |||
110 | VXGE_HW_EVENT_SLOT_FREEZE = VXGE_HW_EVENT_BASE + 14, | 110 | VXGE_HW_EVENT_SLOT_FREEZE = VXGE_HW_EVENT_BASE + 14, |
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define VXGE_HW_SET_LEVEL(a, b) (((a) > (b)) ? (a) : (b)) | ||
114 | |||
113 | /* | 115 | /* |
114 | * struct vxge_hw_mempool_dma - Represents DMA objects passed to the | 116 | * struct vxge_hw_mempool_dma - Represents DMA objects passed to the |
115 | caller. | 117 | caller. |