]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/scsi/bnx2i/bnx2i_hwi.c
cnic: Add VLAN ID as a parameter during netevent upcall
[karo-tx-linux.git] / drivers / scsi / bnx2i / bnx2i_hwi.c
index f0b89513faed35704cb6c6ff02d1beb5ffc64407..372d30c099cce3792c6d940191301bf6423065d5 100644 (file)
@@ -138,7 +138,6 @@ void bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action)
        u16 next_index;
        u32 num_active_cmds;
 
-
        /* Coalesce CQ entries only on 10G devices */
        if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type))
                return;
@@ -148,16 +147,19 @@ void bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action)
         * interrupts and other unwanted results
         */
        cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt;
-       if (cq_db->sqn[0] && cq_db->sqn[0] != 0xFFFF)
-               return;
 
-       if (action == CNIC_ARM_CQE) {
+       if (action != CNIC_ARM_CQE_FP)
+               if (cq_db->sqn[0] && cq_db->sqn[0] != 0xFFFF)
+                       return;
+
+       if (action == CNIC_ARM_CQE || action == CNIC_ARM_CQE_FP) {
                num_active_cmds = ep->num_active_cmds;
                if (num_active_cmds <= event_coal_min)
                        next_index = 1;
                else
                        next_index = event_coal_min +
-                               (num_active_cmds - event_coal_min) / event_coal_div;
+                                    ((num_active_cmds - event_coal_min) >>
+                                    ep->ec_shift);
                if (!next_index)
                        next_index = 1;
                cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1;
@@ -1274,6 +1276,7 @@ int bnx2i_send_fw_iscsi_init_msg(struct bnx2i_hba *hba)
        iscsi_init.dummy_buffer_addr_hi =
                (u32) ((u64) hba->dummy_buf_dma >> 32);
 
+       hba->num_ccell = hba->max_sqes >> 1;
        hba->ctx_ccell_tasks =
                        ((hba->num_ccell & 0xFFFF) | (hba->max_sqes << 16));
        iscsi_init.num_ccells_per_conn = hba->num_ccell;
@@ -1934,7 +1937,6 @@ cqe_out:
                        qp->cq_cons_idx++;
                }
        }
-       bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE);
 }
 
 /**
@@ -1948,22 +1950,23 @@ cqe_out:
 static void bnx2i_fastpath_notification(struct bnx2i_hba *hba,
                                        struct iscsi_kcqe *new_cqe_kcqe)
 {
-       struct bnx2i_conn *conn;
+       struct bnx2i_conn *bnx2i_conn;
        u32 iscsi_cid;
 
        iscsi_cid = new_cqe_kcqe->iscsi_conn_id;
-       conn = bnx2i_get_conn_from_id(hba, iscsi_cid);
+       bnx2i_conn = bnx2i_get_conn_from_id(hba, iscsi_cid);
 
-       if (!conn) {
+       if (!bnx2i_conn) {
                printk(KERN_ALERT "cid #%x not valid\n", iscsi_cid);
                return;
        }
-       if (!conn->ep) {
+       if (!bnx2i_conn->ep) {
                printk(KERN_ALERT "cid #%x - ep not bound\n", iscsi_cid);
                return;
        }
-
-       bnx2i_process_new_cqes(conn);
+       bnx2i_process_new_cqes(bnx2i_conn);
+       bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE_FP);
+       bnx2i_process_new_cqes(bnx2i_conn);
 }
 
 
@@ -2383,14 +2386,20 @@ static void bnx2i_indicate_kcqe(void *context, struct kcqe *kcqe[],
  * bnx2i_indicate_netevent - Generic netdev event handler
  * @context:   adapter structure pointer
  * @event:     event type
+ * @vlan_id:   vlans id - associated vlan id with this event
  *
  * Handles four netdev events, NETDEV_UP, NETDEV_DOWN,
  *     NETDEV_GOING_DOWN and NETDEV_CHANGE
  */
-static void bnx2i_indicate_netevent(void *context, unsigned long event)
+static void bnx2i_indicate_netevent(void *context, unsigned long event,
+                                   u16 vlan_id)
 {
        struct bnx2i_hba *hba = context;
 
+       /* Ignore all netevent coming from vlans */
+       if (vlan_id != 0)
+               return;
+
        switch (event) {
        case NETDEV_UP:
                if (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state))