diff options
author | Dmitry Kravkov <dmitry@broadcom.com> | 2010-10-05 23:33:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-06 17:10:40 -0400 |
commit | c2bff63fad94eeecf59e4ba8e4cb51688ccae1ec (patch) | |
tree | 677c59a6a9c3a37a569c14cf55c305d63c20b8c4 /drivers/net/cnic.c | |
parent | d6214d7aaa9a82b206dac9e3b0665c49c522a271 (diff) |
bnx2x, cnic: Fix SPQ return credit
Return proper L2 and L5 SPQ (slow path queue) credits. Previously, all
SPQ events were counted as L5 types.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r-- | drivers/net/cnic.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c index 80259815af06..27449bf775e3 100644 --- a/drivers/net/cnic.c +++ b/drivers/net/cnic.c | |||
@@ -242,14 +242,14 @@ static int cnic_in_use(struct cnic_sock *csk) | |||
242 | return test_bit(SK_F_INUSE, &csk->flags); | 242 | return test_bit(SK_F_INUSE, &csk->flags); |
243 | } | 243 | } |
244 | 244 | ||
245 | static void cnic_kwq_completion(struct cnic_dev *dev, u32 count) | 245 | static void cnic_spq_completion(struct cnic_dev *dev, int cmd, u32 count) |
246 | { | 246 | { |
247 | struct cnic_local *cp = dev->cnic_priv; | 247 | struct cnic_local *cp = dev->cnic_priv; |
248 | struct cnic_eth_dev *ethdev = cp->ethdev; | 248 | struct cnic_eth_dev *ethdev = cp->ethdev; |
249 | struct drv_ctl_info info; | 249 | struct drv_ctl_info info; |
250 | 250 | ||
251 | info.cmd = DRV_CTL_COMPLETION_CMD; | 251 | info.cmd = cmd; |
252 | info.data.comp.comp_count = count; | 252 | info.data.credit.credit_count = count; |
253 | ethdev->drv_ctl(dev->netdev, &info); | 253 | ethdev->drv_ctl(dev->netdev, &info); |
254 | } | 254 | } |
255 | 255 | ||
@@ -2069,7 +2069,7 @@ static int cnic_submit_bnx2x_kwqes(struct cnic_dev *dev, struct kwqe *wqes[], | |||
2069 | static void service_kcqes(struct cnic_dev *dev, int num_cqes) | 2069 | static void service_kcqes(struct cnic_dev *dev, int num_cqes) |
2070 | { | 2070 | { |
2071 | struct cnic_local *cp = dev->cnic_priv; | 2071 | struct cnic_local *cp = dev->cnic_priv; |
2072 | int i, j; | 2072 | int i, j, comp = 0; |
2073 | 2073 | ||
2074 | i = 0; | 2074 | i = 0; |
2075 | j = 1; | 2075 | j = 1; |
@@ -2080,7 +2080,7 @@ static void service_kcqes(struct cnic_dev *dev, int num_cqes) | |||
2080 | u32 kcqe_layer = kcqe_op_flag & KCQE_FLAGS_LAYER_MASK; | 2080 | u32 kcqe_layer = kcqe_op_flag & KCQE_FLAGS_LAYER_MASK; |
2081 | 2081 | ||
2082 | if (unlikely(kcqe_op_flag & KCQE_RAMROD_COMPLETION)) | 2082 | if (unlikely(kcqe_op_flag & KCQE_RAMROD_COMPLETION)) |
2083 | cnic_kwq_completion(dev, 1); | 2083 | comp++; |
2084 | 2084 | ||
2085 | while (j < num_cqes) { | 2085 | while (j < num_cqes) { |
2086 | u32 next_op = cp->completed_kcq[i + j]->kcqe_op_flag; | 2086 | u32 next_op = cp->completed_kcq[i + j]->kcqe_op_flag; |
@@ -2089,7 +2089,7 @@ static void service_kcqes(struct cnic_dev *dev, int num_cqes) | |||
2089 | break; | 2089 | break; |
2090 | 2090 | ||
2091 | if (unlikely(next_op & KCQE_RAMROD_COMPLETION)) | 2091 | if (unlikely(next_op & KCQE_RAMROD_COMPLETION)) |
2092 | cnic_kwq_completion(dev, 1); | 2092 | comp++; |
2093 | j++; | 2093 | j++; |
2094 | } | 2094 | } |
2095 | 2095 | ||
@@ -2119,6 +2119,8 @@ end: | |||
2119 | i += j; | 2119 | i += j; |
2120 | j = 1; | 2120 | j = 1; |
2121 | } | 2121 | } |
2122 | if (unlikely(comp)) | ||
2123 | cnic_spq_completion(dev, DRV_CTL_RET_L5_SPQ_CREDIT_CMD, comp); | ||
2122 | } | 2124 | } |
2123 | 2125 | ||
2124 | static u16 cnic_bnx2_next_idx(u16 idx) | 2126 | static u16 cnic_bnx2_next_idx(u16 idx) |
@@ -4246,7 +4248,7 @@ static void cnic_init_rings(struct cnic_dev *dev) | |||
4246 | if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags)) | 4248 | if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags)) |
4247 | netdev_err(dev->netdev, | 4249 | netdev_err(dev->netdev, |
4248 | "iSCSI CLIENT_SETUP did not complete\n"); | 4250 | "iSCSI CLIENT_SETUP did not complete\n"); |
4249 | cnic_kwq_completion(dev, 1); | 4251 | cnic_spq_completion(dev, DRV_CTL_RET_L2_SPQ_CREDIT_CMD, 1); |
4250 | cnic_ring_ctl(dev, BNX2X_ISCSI_L2_CID, cli, 1); | 4252 | cnic_ring_ctl(dev, BNX2X_ISCSI_L2_CID, cli, 1); |
4251 | } | 4253 | } |
4252 | } | 4254 | } |
@@ -4283,7 +4285,7 @@ static void cnic_shutdown_rings(struct cnic_dev *dev) | |||
4283 | if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags)) | 4285 | if (test_bit(CNIC_LCL_FL_L2_WAIT, &cp->cnic_local_flags)) |
4284 | netdev_err(dev->netdev, | 4286 | netdev_err(dev->netdev, |
4285 | "iSCSI CLIENT_HALT did not complete\n"); | 4287 | "iSCSI CLIENT_HALT did not complete\n"); |
4286 | cnic_kwq_completion(dev, 1); | 4288 | cnic_spq_completion(dev, DRV_CTL_RET_L2_SPQ_CREDIT_CMD, 1); |
4287 | 4289 | ||
4288 | memset(&l5_data, 0, sizeof(l5_data)); | 4290 | memset(&l5_data, 0, sizeof(l5_data)); |
4289 | type = (NONE_CONNECTION_TYPE << SPE_HDR_CONN_TYPE_SHIFT) | 4291 | type = (NONE_CONNECTION_TYPE << SPE_HDR_CONN_TYPE_SHIFT) |