.. | .. |
---|
1918 | 1918 | ret = cnic_alloc_bnx2x_conn_resc(dev, l5_cid); |
---|
1919 | 1919 | if (ret) { |
---|
1920 | 1920 | atomic_dec(&cp->iscsi_conn); |
---|
1921 | | - ret = 0; |
---|
1922 | 1921 | goto done; |
---|
1923 | 1922 | } |
---|
1924 | 1923 | ret = cnic_setup_bnx2x_ctx(dev, wqes, num); |
---|
.. | .. |
---|
3010 | 3009 | return cnic_service_bnx2_queues(dev); |
---|
3011 | 3010 | } |
---|
3012 | 3011 | |
---|
3013 | | -static void cnic_service_bnx2_msix(unsigned long data) |
---|
| 3012 | +static void cnic_service_bnx2_msix(struct tasklet_struct *t) |
---|
3014 | 3013 | { |
---|
3015 | | - struct cnic_dev *dev = (struct cnic_dev *) data; |
---|
3016 | | - struct cnic_local *cp = dev->cnic_priv; |
---|
| 3014 | + struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task); |
---|
| 3015 | + struct cnic_dev *dev = cp->dev; |
---|
3017 | 3016 | |
---|
3018 | 3017 | cp->last_status_idx = cnic_service_bnx2_queues(dev); |
---|
3019 | 3018 | |
---|
.. | .. |
---|
3135 | 3134 | return last_status; |
---|
3136 | 3135 | } |
---|
3137 | 3136 | |
---|
3138 | | -static void cnic_service_bnx2x_bh(unsigned long data) |
---|
| 3137 | +static void cnic_service_bnx2x_bh(struct tasklet_struct *t) |
---|
3139 | 3138 | { |
---|
3140 | | - struct cnic_dev *dev = (struct cnic_dev *) data; |
---|
3141 | | - struct cnic_local *cp = dev->cnic_priv; |
---|
| 3139 | + struct cnic_local *cp = from_tasklet(cp, t, cnic_irq_task); |
---|
| 3140 | + struct cnic_dev *dev = cp->dev; |
---|
3142 | 3141 | struct bnx2x *bp = netdev_priv(dev->netdev); |
---|
3143 | 3142 | u32 status_idx, new_status_idx; |
---|
3144 | 3143 | |
---|
.. | .. |
---|
3312 | 3311 | } |
---|
3313 | 3312 | case CNIC_CTL_FCOE_STATS_GET_CMD: |
---|
3314 | 3313 | ulp_type = CNIC_ULP_FCOE; |
---|
3315 | | - /* fall through */ |
---|
| 3314 | + fallthrough; |
---|
3316 | 3315 | case CNIC_CTL_ISCSI_STATS_GET_CMD: |
---|
3317 | 3316 | cnic_hold(dev); |
---|
3318 | 3317 | cnic_copy_ulp_stats(dev, ulp_type); |
---|
.. | .. |
---|
4038 | 4037 | case L5CM_RAMROD_CMD_ID_CLOSE: { |
---|
4039 | 4038 | struct iscsi_kcqe *l5kcqe = (struct iscsi_kcqe *) kcqe; |
---|
4040 | 4039 | |
---|
4041 | | - if (l4kcqe->status != 0 || l5kcqe->completion_status != 0) { |
---|
4042 | | - netdev_warn(dev->netdev, "RAMROD CLOSE compl with status 0x%x completion status 0x%x\n", |
---|
4043 | | - l4kcqe->status, l5kcqe->completion_status); |
---|
4044 | | - opcode = L4_KCQE_OPCODE_VALUE_CLOSE_COMP; |
---|
4045 | | - /* Fall through */ |
---|
4046 | | - } else { |
---|
| 4040 | + if (l4kcqe->status == 0 && l5kcqe->completion_status == 0) |
---|
4047 | 4041 | break; |
---|
4048 | | - } |
---|
| 4042 | + |
---|
| 4043 | + netdev_warn(dev->netdev, "RAMROD CLOSE compl with status 0x%x completion status 0x%x\n", |
---|
| 4044 | + l4kcqe->status, l5kcqe->completion_status); |
---|
| 4045 | + opcode = L4_KCQE_OPCODE_VALUE_CLOSE_COMP; |
---|
4049 | 4046 | } |
---|
| 4047 | + fallthrough; |
---|
4050 | 4048 | case L4_KCQE_OPCODE_VALUE_RESET_RECEIVED: |
---|
4051 | 4049 | case L4_KCQE_OPCODE_VALUE_CLOSE_COMP: |
---|
4052 | 4050 | case L4_KCQE_OPCODE_VALUE_RESET_COMP: |
---|
.. | .. |
---|
4097 | 4095 | { |
---|
4098 | 4096 | struct cnic_local *cp = dev->cnic_priv; |
---|
4099 | 4097 | u32 port_id; |
---|
| 4098 | + int i; |
---|
4100 | 4099 | |
---|
4101 | 4100 | cp->csk_tbl = kvcalloc(MAX_CM_SK_TBL_SZ, sizeof(struct cnic_sock), |
---|
4102 | 4101 | GFP_KERNEL); |
---|
4103 | 4102 | if (!cp->csk_tbl) |
---|
4104 | 4103 | return -ENOMEM; |
---|
| 4104 | + |
---|
| 4105 | + for (i = 0; i < MAX_CM_SK_TBL_SZ; i++) |
---|
| 4106 | + atomic_set(&cp->csk_tbl[i].ref_count, 0); |
---|
4105 | 4107 | |
---|
4106 | 4108 | port_id = prandom_u32(); |
---|
4107 | 4109 | port_id %= CNIC_LOCAL_PORT_RANGE; |
---|
.. | .. |
---|
4456 | 4458 | CNIC_WR(dev, base + BNX2_HC_CMD_TICKS_OFF, (64 << 16) | 220); |
---|
4457 | 4459 | |
---|
4458 | 4460 | cp->last_status_idx = cp->status_blk.bnx2->status_idx; |
---|
4459 | | - tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2_msix, |
---|
4460 | | - (unsigned long) dev); |
---|
| 4461 | + tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2_msix); |
---|
4461 | 4462 | err = cnic_request_irq(dev); |
---|
4462 | 4463 | if (err) |
---|
4463 | 4464 | return err; |
---|
.. | .. |
---|
4866 | 4867 | struct cnic_eth_dev *ethdev = cp->ethdev; |
---|
4867 | 4868 | int err = 0; |
---|
4868 | 4869 | |
---|
4869 | | - tasklet_init(&cp->cnic_irq_task, cnic_service_bnx2x_bh, |
---|
4870 | | - (unsigned long) dev); |
---|
| 4870 | + tasklet_setup(&cp->cnic_irq_task, cnic_service_bnx2x_bh); |
---|
4871 | 4871 | if (ethdev->drv_state & CNIC_DRV_STATE_USING_MSIX) |
---|
4872 | 4872 | err = cnic_request_irq(dev); |
---|
4873 | 4873 | |
---|
.. | .. |
---|
5205 | 5205 | cnic_init_bnx2x_tx_ring(dev, data); |
---|
5206 | 5206 | cnic_init_bnx2x_rx_ring(dev, data); |
---|
5207 | 5207 | |
---|
| 5208 | + data->general.fp_hsi_ver = ETH_FP_HSI_VERSION; |
---|
| 5209 | + |
---|
5208 | 5210 | l5_data.phy_address.lo = udev->l2_buf_map & 0xffffffff; |
---|
5209 | 5211 | l5_data.phy_address.hi = (u64) udev->l2_buf_map >> 32; |
---|
5210 | 5212 | |
---|
.. | .. |
---|
5481 | 5483 | cdev->unregister_device = cnic_unregister_device; |
---|
5482 | 5484 | cdev->iscsi_nl_msg_recv = cnic_iscsi_nl_msg_recv; |
---|
5483 | 5485 | cdev->get_fc_npiv_tbl = cnic_get_fc_npiv_tbl; |
---|
| 5486 | + atomic_set(&cdev->ref_count, 0); |
---|
5484 | 5487 | |
---|
5485 | 5488 | cp = cdev->cnic_priv; |
---|
5486 | 5489 | cp->dev = cdev; |
---|
.. | .. |
---|
5731 | 5734 | if (realdev) { |
---|
5732 | 5735 | dev = cnic_from_netdev(realdev); |
---|
5733 | 5736 | if (dev) { |
---|
5734 | | - vid |= VLAN_TAG_PRESENT; |
---|
| 5737 | + vid |= VLAN_CFI_MASK; /* make non-zero */ |
---|
5735 | 5738 | cnic_rcv_netevent(dev->cnic_priv, event, vid); |
---|
5736 | 5739 | cnic_put(dev); |
---|
5737 | 5740 | } |
---|