diff options
author | kxie@chelsio.com <kxie@chelsio.com> | 2010-09-23 16:43:23 -0700 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-07 17:21:11 -0500 |
commit | 0b3d8947972bfd2dd6d55c8009427ad2941ef038 (patch) | |
tree | f2e750b25a948016233b382f05cbf5e13a966d2e /drivers/scsi/cxgbi/cxgb3i | |
parent | e3d2ad8cb2775e4201446489efd1cf26c5bbce5c (diff) | |
download | kernel_goldelico_gta04-0b3d8947972bfd2dd6d55c8009427ad2941ef038.zip kernel_goldelico_gta04-0b3d8947972bfd2dd6d55c8009427ad2941ef038.tar.gz kernel_goldelico_gta04-0b3d8947972bfd2dd6d55c8009427ad2941ef038.tar.bz2 |
[SCSI] cxgb3i: fixed connection over vlan
Signed-off-by: Karen Xie <kxie@chelsio.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/cxgbi/cxgb3i')
-rw-r--r-- | drivers/scsi/cxgbi/cxgb3i/cxgb3i.c | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c index a2c207f..a129a17 100644 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c @@ -589,9 +589,10 @@ static int do_act_open_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx) struct cxgbi_sock *csk = ctx; struct cpl_act_open_rpl *rpl = cplhdr(skb); - log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, - "csk 0x%p,%u,0x%lx,%u, status %u.\n", - csk, csk->state, csk->flags, csk->atid, rpl->status); + pr_info("csk 0x%p,%u,0x%lx,%u, status %u, %pI4:%u-%pI4:%u.\n", + csk, csk->state, csk->flags, csk->atid, rpl->status, + &csk->saddr.sin_addr.s_addr, ntohs(csk->saddr.sin_port), + &csk->daddr.sin_addr.s_addr, ntohs(csk->daddr.sin_port)); if (rpl->status != CPL_ERR_TCAM_FULL && rpl->status != CPL_ERR_CONN_EXIST && @@ -662,8 +663,7 @@ static int abort_status_to_errno(struct cxgbi_sock *csk, int abort_reason, switch (abort_reason) { case CPL_ERR_BAD_SYN: /* fall through */ case CPL_ERR_CONN_RESET: - return csk->state > CTP_ESTABLISHED ? - -EPIPE : -ECONNRESET; + return csk->state > CTP_ESTABLISHED ? -EPIPE : -ECONNRESET; case CPL_ERR_XMIT_TIMEDOUT: case CPL_ERR_PERSIST_TIMEDOUT: case CPL_ERR_FINWAIT2_TIMEDOUT: @@ -945,17 +945,44 @@ static void release_offload_resources(struct cxgbi_sock *csk) csk->cdev = NULL; } +static void update_address(struct cxgbi_hba *chba) +{ + if (chba->ipv4addr) { + if (chba->vdev && + chba->ipv4addr != cxgb3i_get_private_ipv4addr(chba->vdev)) { + cxgb3i_set_private_ipv4addr(chba->vdev, chba->ipv4addr); + cxgb3i_set_private_ipv4addr(chba->ndev, 0); + pr_info("%s set %pI4.\n", + chba->vdev->name, &chba->ipv4addr); + } else if (chba->ipv4addr != + cxgb3i_get_private_ipv4addr(chba->ndev)) { + cxgb3i_set_private_ipv4addr(chba->ndev, chba->ipv4addr); + pr_info("%s set %pI4.\n", + chba->ndev->name, &chba->ipv4addr); + } + } else if (cxgb3i_get_private_ipv4addr(chba->ndev)) { + if (chba->vdev) + cxgb3i_set_private_ipv4addr(chba->vdev, 0); + cxgb3i_set_private_ipv4addr(chba->ndev, 0); + } +} + static int init_act_open(struct cxgbi_sock *csk) { struct dst_entry *dst = csk->dst; struct cxgbi_device *cdev = csk->cdev; struct t3cdev *t3dev = (struct t3cdev *)cdev->lldev; struct net_device *ndev = cdev->ports[csk->port_id]; + struct cxgbi_hba *chba = cdev->hbas[csk->port_id]; struct sk_buff *skb = NULL; log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, "csk 0x%p,%u,0x%lx.\n", csk, csk->state, csk->flags); + update_address(chba); + if (chba->ipv4addr) + csk->saddr.sin_addr.s_addr = chba->ipv4addr; + csk->rss_qid = 0; csk->l2t = t3_l2t_get(t3dev, dst->neighbour, ndev); if (!csk->l2t) { @@ -984,6 +1011,12 @@ static int init_act_open(struct cxgbi_sock *csk) cxgbi_sock_reset_wr_list(csk); csk->err = 0; + log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, + "csk 0x%p,%u,0x%lx, %pI4:%u-%pI4:%u.\n", + csk, csk->state, csk->flags, + &csk->saddr.sin_addr.s_addr, ntohs(csk->saddr.sin_port), + &csk->daddr.sin_addr.s_addr, ntohs(csk->daddr.sin_port)); + cxgbi_sock_set_state(csk, CTP_ACTIVE_OPEN); send_act_open_req(csk, skb, csk->l2t); return 0; @@ -1143,9 +1176,9 @@ static int ddp_alloc_gl_skb(struct cxgbi_ddp_info *ddp, int idx, for (i = 0; i < cnt; i++) { struct sk_buff *skb = alloc_wr(sizeof(struct ulp_mem_io) + PPOD_SIZE, 0, gfp); - if (skb) { + if (skb) ddp->gl_skb[idx + i] = skb; - } else { + else { ddp_free_gl_skb(ddp, idx, i); return -ENOMEM; } |