diff options
author | Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com> | 2010-03-28 18:11:41 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-03-29 19:57:22 -0400 |
commit | b59c94571a6593c71a78bbcebb42982099154938 (patch) | |
tree | 32e6cfca72e2b24ebb2f399f68637bca54e6163a /drivers/net/vxge/vxge-traffic.c | |
parent | 4c5f3b210f53e315e460d539655a8d14595c5d1a (diff) |
vxge: Fixed MSIX interrupt configuration.
- Fixed MSIX interrupt configuration to support non contiguous vpaths in
functions. Four msi-x vectors are reserved per vpath internal to the chip.
In all, there are 68 msi-x vectors for the 17 vpaths in the chip. In the
multi function configurations, non-contiguous vpaths are configured to
represent a function. For instance vpaths 0 and 8 can be configured to
represent function zero.
- If pci_enable_msix fails for the requested vectors, try with a lesser number
vectors by reducing the vpath count.
Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com>
Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge/vxge-traffic.c')
-rw-r--r-- | drivers/net/vxge/vxge-traffic.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c index c8b3997e9eeb..f83e6aee3f6a 100644 --- a/drivers/net/vxge/vxge-traffic.c +++ b/drivers/net/vxge/vxge-traffic.c | |||
@@ -231,8 +231,7 @@ void vxge_hw_channel_msix_mask(struct __vxge_hw_channel *channel, int msix_id) | |||
231 | { | 231 | { |
232 | 232 | ||
233 | __vxge_hw_pio_mem_write32_upper( | 233 | __vxge_hw_pio_mem_write32_upper( |
234 | (u32)vxge_bVALn(vxge_mBIT(channel->first_vp_id+(msix_id/4)), | 234 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), |
235 | 0, 32), | ||
236 | &channel->common_reg->set_msix_mask_vect[msix_id%4]); | 235 | &channel->common_reg->set_msix_mask_vect[msix_id%4]); |
237 | 236 | ||
238 | return; | 237 | return; |
@@ -252,8 +251,7 @@ vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channel, int msix_id) | |||
252 | { | 251 | { |
253 | 252 | ||
254 | __vxge_hw_pio_mem_write32_upper( | 253 | __vxge_hw_pio_mem_write32_upper( |
255 | (u32)vxge_bVALn(vxge_mBIT(channel->first_vp_id+(msix_id/4)), | 254 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), |
256 | 0, 32), | ||
257 | &channel->common_reg->clear_msix_mask_vect[msix_id%4]); | 255 | &channel->common_reg->clear_msix_mask_vect[msix_id%4]); |
258 | 256 | ||
259 | return; | 257 | return; |
@@ -2220,29 +2218,24 @@ exit: | |||
2220 | * This API will associate a given MSIX vector numbers with the four TIM | 2218 | * This API will associate a given MSIX vector numbers with the four TIM |
2221 | * interrupts and alarm interrupt. | 2219 | * interrupts and alarm interrupt. |
2222 | */ | 2220 | */ |
2223 | enum vxge_hw_status | 2221 | void |
2224 | vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vp, int *tim_msix_id, | 2222 | vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vp, int *tim_msix_id, |
2225 | int alarm_msix_id) | 2223 | int alarm_msix_id) |
2226 | { | 2224 | { |
2227 | u64 val64; | 2225 | u64 val64; |
2228 | struct __vxge_hw_virtualpath *vpath = vp->vpath; | 2226 | struct __vxge_hw_virtualpath *vpath = vp->vpath; |
2229 | struct vxge_hw_vpath_reg __iomem *vp_reg = vpath->vp_reg; | 2227 | struct vxge_hw_vpath_reg __iomem *vp_reg = vpath->vp_reg; |
2230 | u32 first_vp_id = vpath->hldev->first_vp_id; | 2228 | u32 vp_id = vp->vpath->vp_id; |
2231 | 2229 | ||
2232 | val64 = VXGE_HW_INTERRUPT_CFG0_GROUP0_MSIX_FOR_TXTI( | 2230 | val64 = VXGE_HW_INTERRUPT_CFG0_GROUP0_MSIX_FOR_TXTI( |
2233 | (first_vp_id * 4) + tim_msix_id[0]) | | 2231 | (vp_id * 4) + tim_msix_id[0]) | |
2234 | VXGE_HW_INTERRUPT_CFG0_GROUP1_MSIX_FOR_TXTI( | 2232 | VXGE_HW_INTERRUPT_CFG0_GROUP1_MSIX_FOR_TXTI( |
2235 | (first_vp_id * 4) + tim_msix_id[1]) | | 2233 | (vp_id * 4) + tim_msix_id[1]); |
2236 | VXGE_HW_INTERRUPT_CFG0_GROUP2_MSIX_FOR_TXTI( | ||
2237 | (first_vp_id * 4) + tim_msix_id[2]); | ||
2238 | |||
2239 | val64 |= VXGE_HW_INTERRUPT_CFG0_GROUP3_MSIX_FOR_TXTI( | ||
2240 | (first_vp_id * 4) + tim_msix_id[3]); | ||
2241 | 2234 | ||
2242 | writeq(val64, &vp_reg->interrupt_cfg0); | 2235 | writeq(val64, &vp_reg->interrupt_cfg0); |
2243 | 2236 | ||
2244 | writeq(VXGE_HW_INTERRUPT_CFG2_ALARM_MAP_TO_MSG( | 2237 | writeq(VXGE_HW_INTERRUPT_CFG2_ALARM_MAP_TO_MSG( |
2245 | (first_vp_id * 4) + alarm_msix_id), | 2238 | (vpath->hldev->first_vp_id * 4) + alarm_msix_id), |
2246 | &vp_reg->interrupt_cfg2); | 2239 | &vp_reg->interrupt_cfg2); |
2247 | 2240 | ||
2248 | if (vpath->hldev->config.intr_mode == | 2241 | if (vpath->hldev->config.intr_mode == |
@@ -2263,7 +2256,7 @@ vxge_hw_vpath_msix_set(struct __vxge_hw_vpath_handle *vp, int *tim_msix_id, | |||
2263 | 0, 32), &vp_reg->one_shot_vect3_en); | 2256 | 0, 32), &vp_reg->one_shot_vect3_en); |
2264 | } | 2257 | } |
2265 | 2258 | ||
2266 | return VXGE_HW_OK; | 2259 | return; |
2267 | } | 2260 | } |
2268 | 2261 | ||
2269 | /** | 2262 | /** |
@@ -2283,8 +2276,7 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw_vpath_handle *vp, int msix_id) | |||
2283 | { | 2276 | { |
2284 | struct __vxge_hw_device *hldev = vp->vpath->hldev; | 2277 | struct __vxge_hw_device *hldev = vp->vpath->hldev; |
2285 | __vxge_hw_pio_mem_write32_upper( | 2278 | __vxge_hw_pio_mem_write32_upper( |
2286 | (u32) vxge_bVALn(vxge_mBIT(hldev->first_vp_id + | 2279 | (u32) vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), |
2287 | (msix_id / 4)), 0, 32), | ||
2288 | &hldev->common_reg->set_msix_mask_vect[msix_id % 4]); | 2280 | &hldev->common_reg->set_msix_mask_vect[msix_id % 4]); |
2289 | 2281 | ||
2290 | return; | 2282 | return; |
@@ -2309,14 +2301,12 @@ vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id) | |||
2309 | if (hldev->config.intr_mode == | 2301 | if (hldev->config.intr_mode == |
2310 | VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) { | 2302 | VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) { |
2311 | __vxge_hw_pio_mem_write32_upper( | 2303 | __vxge_hw_pio_mem_write32_upper( |
2312 | (u32)vxge_bVALn(vxge_mBIT(hldev->first_vp_id + | 2304 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), |
2313 | (msix_id/4)), 0, 32), | ||
2314 | &hldev->common_reg-> | 2305 | &hldev->common_reg-> |
2315 | clr_msix_one_shot_vec[msix_id%4]); | 2306 | clr_msix_one_shot_vec[msix_id%4]); |
2316 | } else { | 2307 | } else { |
2317 | __vxge_hw_pio_mem_write32_upper( | 2308 | __vxge_hw_pio_mem_write32_upper( |
2318 | (u32)vxge_bVALn(vxge_mBIT(hldev->first_vp_id + | 2309 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), |
2319 | (msix_id/4)), 0, 32), | ||
2320 | &hldev->common_reg-> | 2310 | &hldev->common_reg-> |
2321 | clear_msix_mask_vect[msix_id%4]); | 2311 | clear_msix_mask_vect[msix_id%4]); |
2322 | } | 2312 | } |
@@ -2341,8 +2331,7 @@ vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vp, int msix_id) | |||
2341 | { | 2331 | { |
2342 | struct __vxge_hw_device *hldev = vp->vpath->hldev; | 2332 | struct __vxge_hw_device *hldev = vp->vpath->hldev; |
2343 | __vxge_hw_pio_mem_write32_upper( | 2333 | __vxge_hw_pio_mem_write32_upper( |
2344 | (u32)vxge_bVALn(vxge_mBIT(hldev->first_vp_id + | 2334 | (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32), |
2345 | (msix_id/4)), 0, 32), | ||
2346 | &hldev->common_reg->clear_msix_mask_vect[msix_id%4]); | 2335 | &hldev->common_reg->clear_msix_mask_vect[msix_id%4]); |
2347 | 2336 | ||
2348 | return; | 2337 | return; |