aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Wai <waie@broadcom.com>2010-02-24 09:42:04 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-26 05:10:12 -0500
commita9736c086cc6221659e498f0855152c32dbc1396 (patch)
tree59a48584f0af70bdbb5b338ba3d47cf9ed230618
parentc85a26189660e1cfd1f50989468313c544487950 (diff)
cnic: Finetune iSCSI connection set up.
Initialize IP ID and handle some additional connection errors. Signed-off-by: Eddie Wai <waie@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/cnic.c17
-rw-r--r--drivers/net/cnic.h2
2 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 6aecef930fa8..0fe83717967a 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -2507,7 +2507,7 @@ static int cnic_cm_offload_pg(struct cnic_sock *csk)
2507 l4kwqe->sa5 = dev->mac_addr[5]; 2507 l4kwqe->sa5 = dev->mac_addr[5];
2508 2508
2509 l4kwqe->etype = ETH_P_IP; 2509 l4kwqe->etype = ETH_P_IP;
2510 l4kwqe->ipid_count = DEF_IPID_COUNT; 2510 l4kwqe->ipid_start = DEF_IPID_START;
2511 l4kwqe->host_opaque = csk->l5_cid; 2511 l4kwqe->host_opaque = csk->l5_cid;
2512 2512
2513 if (csk->vlan_id) { 2513 if (csk->vlan_id) {
@@ -3046,6 +3046,14 @@ static void cnic_cm_process_offld_pg(struct cnic_dev *dev, struct l4_kcq *kcqe)
3046 clear_bit(SK_F_OFFLD_SCHED, &csk->flags); 3046 clear_bit(SK_F_OFFLD_SCHED, &csk->flags);
3047 goto done; 3047 goto done;
3048 } 3048 }
3049 /* Possible PG kcqe status: SUCCESS, OFFLOADED_PG, or CTX_ALLOC_FAIL */
3050 if (kcqe->status == L4_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAIL) {
3051 clear_bit(SK_F_OFFLD_SCHED, &csk->flags);
3052 cnic_cm_upcall(cp, csk,
3053 L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE);
3054 goto done;
3055 }
3056
3049 csk->pg_cid = kcqe->pg_cid; 3057 csk->pg_cid = kcqe->pg_cid;
3050 set_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags); 3058 set_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags);
3051 cnic_cm_conn_req(csk); 3059 cnic_cm_conn_req(csk);
@@ -3083,6 +3091,13 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
3083 } 3091 }
3084 3092
3085 switch (opcode) { 3093 switch (opcode) {
3094 case L5CM_RAMROD_CMD_ID_TCP_CONNECT:
3095 if (l4kcqe->status != 0) {
3096 clear_bit(SK_F_OFFLD_SCHED, &csk->flags);
3097 cnic_cm_upcall(cp, csk,
3098 L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE);
3099 }
3100 break;
3086 case L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE: 3101 case L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE:
3087 if (l4kcqe->status == 0) 3102 if (l4kcqe->status == 0)
3088 set_bit(SK_F_OFFLD_COMPLETE, &csk->flags); 3103 set_bit(SK_F_OFFLD_COMPLETE, &csk->flags);
diff --git a/drivers/net/cnic.h b/drivers/net/cnic.h
index 241d09acc0d4..1921597ab4a3 100644
--- a/drivers/net/cnic.h
+++ b/drivers/net/cnic.h
@@ -101,7 +101,7 @@ struct cnic_redirect_entry {
101#define BNX2X_KWQ_DATA(cp, x) \ 101#define BNX2X_KWQ_DATA(cp, x) \
102 &(cp)->kwq_16_data[BNX2X_KWQ_DATA_PG(cp, x)][BNX2X_KWQ_DATA_IDX(cp, x)] 102 &(cp)->kwq_16_data[BNX2X_KWQ_DATA_PG(cp, x)][BNX2X_KWQ_DATA_IDX(cp, x)]
103 103
104#define DEF_IPID_COUNT 0xc001 104#define DEF_IPID_START 0x8000
105 105
106#define DEF_KA_TIMEOUT 10000 106#define DEF_KA_TIMEOUT 10000
107#define DEF_KA_INTERVAL 300000 107#define DEF_KA_INTERVAL 300000