cxgb4i.c (23d19ba06b9c5614d6457f5fed349ec8f6d4dac9) | cxgb4i.c (9e8f1c79831424d30c0e3df068be7f4a244157c9) |
---|---|
1/* 2 * cxgb4i.c: Chelsio T4 iSCSI driver. 3 * 4 * Copyright (c) 2010-2015 Chelsio Communications, Inc. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation. --- 1534 unchanged lines hidden (view full) --- 1543{ 1544 struct cpl_set_tcb_rpl *rpl = (struct cpl_set_tcb_rpl *)skb->data; 1545 unsigned int tid = GET_TID(rpl); 1546 struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(cdev); 1547 struct tid_info *t = lldi->tids; 1548 struct cxgbi_sock *csk; 1549 1550 csk = lookup_tid(t, tid); | 1/* 2 * cxgb4i.c: Chelsio T4 iSCSI driver. 3 * 4 * Copyright (c) 2010-2015 Chelsio Communications, Inc. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation. --- 1534 unchanged lines hidden (view full) --- 1543{ 1544 struct cpl_set_tcb_rpl *rpl = (struct cpl_set_tcb_rpl *)skb->data; 1545 unsigned int tid = GET_TID(rpl); 1546 struct cxgb4_lld_info *lldi = cxgbi_cdev_priv(cdev); 1547 struct tid_info *t = lldi->tids; 1548 struct cxgbi_sock *csk; 1549 1550 csk = lookup_tid(t, tid); |
1551 if (!csk) | 1551 if (!csk) { |
1552 pr_err("can't find conn. for tid %u.\n", tid); | 1552 pr_err("can't find conn. for tid %u.\n", tid); |
1553 return; 1554 } |
|
1553 1554 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 1555 "csk 0x%p,%u,%lx,%u, status 0x%x.\n", 1556 csk, csk->state, csk->flags, csk->tid, rpl->status); 1557 | 1555 1556 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 1557 "csk 0x%p,%u,%lx,%u, status 0x%x.\n", 1558 csk, csk->state, csk->flags, csk->tid, rpl->status); 1559 |
1558 if (rpl->status != CPL_ERR_NONE) | 1560 if (rpl->status != CPL_ERR_NONE) { |
1559 pr_err("csk 0x%p,%u, SET_TCB_RPL status %u.\n", 1560 csk, tid, rpl->status); | 1561 pr_err("csk 0x%p,%u, SET_TCB_RPL status %u.\n", 1562 csk, tid, rpl->status); |
1563 csk->err = -EINVAL; 1564 } |
|
1561 | 1565 |
1566 complete(&csk->cmpl); 1567 |
|
1562 __kfree_skb(skb); 1563} 1564 1565static int alloc_cpls(struct cxgbi_sock *csk) 1566{ 1567 csk->cpl_close = alloc_wr(sizeof(struct cpl_close_con_req), 1568 0, GFP_KERNEL); 1569 if (!csk->cpl_close) --- 408 unchanged lines hidden (view full) --- 1978 if (err < 0) 1979 break; 1980 } 1981 1982 return err; 1983} 1984 1985static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, unsigned int tid, | 1568 __kfree_skb(skb); 1569} 1570 1571static int alloc_cpls(struct cxgbi_sock *csk) 1572{ 1573 csk->cpl_close = alloc_wr(sizeof(struct cpl_close_con_req), 1574 0, GFP_KERNEL); 1575 if (!csk->cpl_close) --- 408 unchanged lines hidden (view full) --- 1984 if (err < 0) 1985 break; 1986 } 1987 1988 return err; 1989} 1990 1991static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk, unsigned int tid, |
1986 int pg_idx, bool reply) | 1992 int pg_idx) |
1987{ 1988 struct sk_buff *skb; 1989 struct cpl_set_tcb_field *req; 1990 1991 if (!pg_idx || pg_idx >= DDP_PGIDX_MAX) 1992 return 0; 1993 1994 skb = alloc_wr(sizeof(*req), 0, GFP_KERNEL); 1995 if (!skb) 1996 return -ENOMEM; 1997 1998 /* set up ulp page size */ 1999 req = (struct cpl_set_tcb_field *)skb->head; 2000 INIT_TP_WR(req, csk->tid); 2001 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, csk->tid)); | 1993{ 1994 struct sk_buff *skb; 1995 struct cpl_set_tcb_field *req; 1996 1997 if (!pg_idx || pg_idx >= DDP_PGIDX_MAX) 1998 return 0; 1999 2000 skb = alloc_wr(sizeof(*req), 0, GFP_KERNEL); 2001 if (!skb) 2002 return -ENOMEM; 2003 2004 /* set up ulp page size */ 2005 req = (struct cpl_set_tcb_field *)skb->head; 2006 INIT_TP_WR(req, csk->tid); 2007 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, csk->tid)); |
2002 req->reply_ctrl = htons(NO_REPLY_V(reply) | QUEUENO_V(csk->rss_qid)); | 2008 req->reply_ctrl = htons(NO_REPLY_V(0) | QUEUENO_V(csk->rss_qid)); |
2003 req->word_cookie = htons(0); 2004 req->mask = cpu_to_be64(0x3 << 8); 2005 req->val = cpu_to_be64(pg_idx << 8); 2006 set_wr_txq(skb, CPL_PRIORITY_CONTROL, csk->port_id); 2007 2008 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 2009 "csk 0x%p, tid 0x%x, pg_idx %u.\n", csk, csk->tid, pg_idx); 2010 | 2009 req->word_cookie = htons(0); 2010 req->mask = cpu_to_be64(0x3 << 8); 2011 req->val = cpu_to_be64(pg_idx << 8); 2012 set_wr_txq(skb, CPL_PRIORITY_CONTROL, csk->port_id); 2013 2014 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 2015 "csk 0x%p, tid 0x%x, pg_idx %u.\n", csk, csk->tid, pg_idx); 2016 |
2017 reinit_completion(&csk->cmpl); |
|
2011 cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb); | 2018 cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb); |
2012 return 0; | 2019 wait_for_completion(&csk->cmpl); 2020 2021 return csk->err; |
2013} 2014 2015static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid, | 2022} 2023 2024static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid, |
2016 int hcrc, int dcrc, int reply) | 2025 int hcrc, int dcrc) |
2017{ 2018 struct sk_buff *skb; 2019 struct cpl_set_tcb_field *req; 2020 2021 if (!hcrc && !dcrc) 2022 return 0; 2023 2024 skb = alloc_wr(sizeof(*req), 0, GFP_KERNEL); 2025 if (!skb) 2026 return -ENOMEM; 2027 2028 csk->hcrc_len = (hcrc ? 4 : 0); 2029 csk->dcrc_len = (dcrc ? 4 : 0); 2030 /* set up ulp submode */ 2031 req = (struct cpl_set_tcb_field *)skb->head; 2032 INIT_TP_WR(req, tid); 2033 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); | 2026{ 2027 struct sk_buff *skb; 2028 struct cpl_set_tcb_field *req; 2029 2030 if (!hcrc && !dcrc) 2031 return 0; 2032 2033 skb = alloc_wr(sizeof(*req), 0, GFP_KERNEL); 2034 if (!skb) 2035 return -ENOMEM; 2036 2037 csk->hcrc_len = (hcrc ? 4 : 0); 2038 csk->dcrc_len = (dcrc ? 4 : 0); 2039 /* set up ulp submode */ 2040 req = (struct cpl_set_tcb_field *)skb->head; 2041 INIT_TP_WR(req, tid); 2042 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid)); |
2034 req->reply_ctrl = htons(NO_REPLY_V(reply) | QUEUENO_V(csk->rss_qid)); | 2043 req->reply_ctrl = htons(NO_REPLY_V(0) | QUEUENO_V(csk->rss_qid)); |
2035 req->word_cookie = htons(0); 2036 req->mask = cpu_to_be64(0x3 << 4); 2037 req->val = cpu_to_be64(((hcrc ? ULP_CRC_HEADER : 0) | 2038 (dcrc ? ULP_CRC_DATA : 0)) << 4); 2039 set_wr_txq(skb, CPL_PRIORITY_CONTROL, csk->port_id); 2040 2041 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 2042 "csk 0x%p, tid 0x%x, crc %d,%d.\n", csk, csk->tid, hcrc, dcrc); 2043 | 2044 req->word_cookie = htons(0); 2045 req->mask = cpu_to_be64(0x3 << 4); 2046 req->val = cpu_to_be64(((hcrc ? ULP_CRC_HEADER : 0) | 2047 (dcrc ? ULP_CRC_DATA : 0)) << 4); 2048 set_wr_txq(skb, CPL_PRIORITY_CONTROL, csk->port_id); 2049 2050 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 2051 "csk 0x%p, tid 0x%x, crc %d,%d.\n", csk, csk->tid, hcrc, dcrc); 2052 |
2053 reinit_completion(&csk->cmpl); |
|
2044 cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb); | 2054 cxgb4_ofld_send(csk->cdev->ports[csk->port_id], skb); |
2045 return 0; | 2055 wait_for_completion(&csk->cmpl); 2056 2057 return csk->err; |
2046} 2047 2048static struct cxgbi_ppm *cdev2ppm(struct cxgbi_device *cdev) 2049{ 2050 return (struct cxgbi_ppm *)(*((struct cxgb4_lld_info *) 2051 (cxgbi_cdev_priv(cdev)))->iscsi_ppm); 2052} 2053 --- 269 unchanged lines hidden --- | 2058} 2059 2060static struct cxgbi_ppm *cdev2ppm(struct cxgbi_device *cdev) 2061{ 2062 return (struct cxgbi_ppm *)(*((struct cxgb4_lld_info *) 2063 (cxgbi_cdev_priv(cdev)))->iscsi_ppm); 2064} 2065 --- 269 unchanged lines hidden --- |