]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
cnic: Finetune iSCSI connection set up.
authorEddie Wai <waie@broadcom.com>
Wed, 24 Feb 2010 14:42:04 +0000 (14:42 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 26 Feb 2010 10:10:12 +0000 (02:10 -0800)
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>
drivers/net/cnic.c
drivers/net/cnic.h

index 6aecef930fa86adc55359e515279154b5f3dc81a..0fe83717967ac41a89f1063da45bfc4c4e0fd0f2 100644 (file)
@@ -2507,7 +2507,7 @@ static int cnic_cm_offload_pg(struct cnic_sock *csk)
        l4kwqe->sa5 = dev->mac_addr[5];
 
        l4kwqe->etype = ETH_P_IP;
-       l4kwqe->ipid_count = DEF_IPID_COUNT;
+       l4kwqe->ipid_start = DEF_IPID_START;
        l4kwqe->host_opaque = csk->l5_cid;
 
        if (csk->vlan_id) {
@@ -3046,6 +3046,14 @@ static void cnic_cm_process_offld_pg(struct cnic_dev *dev, struct l4_kcq *kcqe)
                clear_bit(SK_F_OFFLD_SCHED, &csk->flags);
                goto done;
        }
+       /* Possible PG kcqe status:  SUCCESS, OFFLOADED_PG, or CTX_ALLOC_FAIL */
+       if (kcqe->status == L4_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAIL) {
+               clear_bit(SK_F_OFFLD_SCHED, &csk->flags);
+               cnic_cm_upcall(cp, csk,
+                              L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE);
+               goto done;
+       }
+
        csk->pg_cid = kcqe->pg_cid;
        set_bit(SK_F_PG_OFFLD_COMPLETE, &csk->flags);
        cnic_cm_conn_req(csk);
@@ -3083,6 +3091,13 @@ static void cnic_cm_process_kcqe(struct cnic_dev *dev, struct kcqe *kcqe)
        }
 
        switch (opcode) {
+       case L5CM_RAMROD_CMD_ID_TCP_CONNECT:
+               if (l4kcqe->status != 0) {
+                       clear_bit(SK_F_OFFLD_SCHED, &csk->flags);
+                       cnic_cm_upcall(cp, csk,
+                                      L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE);
+               }
+               break;
        case L4_KCQE_OPCODE_VALUE_CONNECT_COMPLETE:
                if (l4kcqe->status == 0)
                        set_bit(SK_F_OFFLD_COMPLETE, &csk->flags);
index 241d09acc0d474039b9323def713fdb51ac6e58a..1921597ab4a32bf48e1a57041cba90a8a63e3e4b 100644 (file)
@@ -101,7 +101,7 @@ struct cnic_redirect_entry {
 #define BNX2X_KWQ_DATA(cp, x)                                          \
        &(cp)->kwq_16_data[BNX2X_KWQ_DATA_PG(cp, x)][BNX2X_KWQ_DATA_IDX(cp, x)]
 
-#define DEF_IPID_COUNT         0xc001
+#define DEF_IPID_START         0x8000
 
 #define DEF_KA_TIMEOUT         10000
 #define DEF_KA_INTERVAL                300000