cxgb3i.c (23d19ba06b9c5614d6457f5fed349ec8f6d4dac9) cxgb3i.c (9e8f1c79831424d30c0e3df068be7f4a244157c9)
1/*
2 * cxgb3i_offload.c: Chelsio S3xx iscsi offloaded tcp connection management
3 *
4 * Copyright (C) 2003-2015 Chelsio Communications. All rights reserved.
5 *
6 * This program is distributed in the hope that it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8 * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this

--- 1130 unchanged lines hidden (view full) ---

1139 }
1140 ulp_mem_io_set_hdr(skb, pm_addr);
1141 skb->priority = CPL_PRIORITY_CONTROL;
1142 cxgb3_ofld_send(ppm->lldev, skb);
1143 }
1144}
1145
1146static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk,
1/*
2 * cxgb3i_offload.c: Chelsio S3xx iscsi offloaded tcp connection management
3 *
4 * Copyright (C) 2003-2015 Chelsio Communications. All rights reserved.
5 *
6 * This program is distributed in the hope that it will be useful, but WITHOUT
7 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8 * FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file included in this

--- 1130 unchanged lines hidden (view full) ---

1139 }
1140 ulp_mem_io_set_hdr(skb, pm_addr);
1141 skb->priority = CPL_PRIORITY_CONTROL;
1142 cxgb3_ofld_send(ppm->lldev, skb);
1143 }
1144}
1145
1146static int ddp_setup_conn_pgidx(struct cxgbi_sock *csk,
1147 unsigned int tid, int pg_idx, bool reply)
1147 unsigned int tid, int pg_idx)
1148{
1149 struct sk_buff *skb = alloc_wr(sizeof(struct cpl_set_tcb_field), 0,
1150 GFP_KERNEL);
1151 struct cpl_set_tcb_field *req;
1152 u64 val = pg_idx < DDP_PGIDX_MAX ? pg_idx : 0;
1153
1154 log_debug(1 << CXGBI_DBG_DDP,
1155 "csk 0x%p, tid %u, pg_idx %d.\n", csk, tid, pg_idx);
1156 if (!skb)
1157 return -ENOMEM;
1158
1159 /* set up ulp submode and page size */
1160 req = (struct cpl_set_tcb_field *)skb->head;
1161 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1162 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1148{
1149 struct sk_buff *skb = alloc_wr(sizeof(struct cpl_set_tcb_field), 0,
1150 GFP_KERNEL);
1151 struct cpl_set_tcb_field *req;
1152 u64 val = pg_idx < DDP_PGIDX_MAX ? pg_idx : 0;
1153
1154 log_debug(1 << CXGBI_DBG_DDP,
1155 "csk 0x%p, tid %u, pg_idx %d.\n", csk, tid, pg_idx);
1156 if (!skb)
1157 return -ENOMEM;
1158
1159 /* set up ulp submode and page size */
1160 req = (struct cpl_set_tcb_field *)skb->head;
1161 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1162 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1163 req->reply = V_NO_REPLY(reply ? 0 : 1);
1163 req->reply = V_NO_REPLY(1);
1164 req->cpu_idx = 0;
1165 req->word = htons(31);
1166 req->mask = cpu_to_be64(0xF0000000);
1167 req->val = cpu_to_be64(val << 28);
1168 skb->priority = CPL_PRIORITY_CONTROL;
1169
1170 cxgb3_ofld_send(csk->cdev->lldev, skb);
1171 return 0;
1172}
1173
1174/**
1175 * cxgb3i_setup_conn_digest - setup conn. digest setting
1176 * @csk: cxgb tcp socket
1177 * @tid: connection id
1178 * @hcrc: header digest enabled
1179 * @dcrc: data digest enabled
1164 req->cpu_idx = 0;
1165 req->word = htons(31);
1166 req->mask = cpu_to_be64(0xF0000000);
1167 req->val = cpu_to_be64(val << 28);
1168 skb->priority = CPL_PRIORITY_CONTROL;
1169
1170 cxgb3_ofld_send(csk->cdev->lldev, skb);
1171 return 0;
1172}
1173
1174/**
1175 * cxgb3i_setup_conn_digest - setup conn. digest setting
1176 * @csk: cxgb tcp socket
1177 * @tid: connection id
1178 * @hcrc: header digest enabled
1179 * @dcrc: data digest enabled
1180 * @reply: request reply from h/w
1181 * set up the iscsi digest settings for a connection identified by tid
1182 */
1183static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid,
1180 * set up the iscsi digest settings for a connection identified by tid
1181 */
1182static int ddp_setup_conn_digest(struct cxgbi_sock *csk, unsigned int tid,
1184 int hcrc, int dcrc, int reply)
1183 int hcrc, int dcrc)
1185{
1186 struct sk_buff *skb = alloc_wr(sizeof(struct cpl_set_tcb_field), 0,
1187 GFP_KERNEL);
1188 struct cpl_set_tcb_field *req;
1189 u64 val = (hcrc ? 1 : 0) | (dcrc ? 2 : 0);
1190
1191 log_debug(1 << CXGBI_DBG_DDP,
1192 "csk 0x%p, tid %u, crc %d,%d.\n", csk, tid, hcrc, dcrc);
1193 if (!skb)
1194 return -ENOMEM;
1195
1196 /* set up ulp submode and page size */
1197 req = (struct cpl_set_tcb_field *)skb->head;
1198 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1199 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1184{
1185 struct sk_buff *skb = alloc_wr(sizeof(struct cpl_set_tcb_field), 0,
1186 GFP_KERNEL);
1187 struct cpl_set_tcb_field *req;
1188 u64 val = (hcrc ? 1 : 0) | (dcrc ? 2 : 0);
1189
1190 log_debug(1 << CXGBI_DBG_DDP,
1191 "csk 0x%p, tid %u, crc %d,%d.\n", csk, tid, hcrc, dcrc);
1192 if (!skb)
1193 return -ENOMEM;
1194
1195 /* set up ulp submode and page size */
1196 req = (struct cpl_set_tcb_field *)skb->head;
1197 req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
1198 OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SET_TCB_FIELD, tid));
1200 req->reply = V_NO_REPLY(reply ? 0 : 1);
1199 req->reply = V_NO_REPLY(1);
1201 req->cpu_idx = 0;
1202 req->word = htons(31);
1203 req->mask = cpu_to_be64(0x0F000000);
1204 req->val = cpu_to_be64(val << 24);
1205 skb->priority = CPL_PRIORITY_CONTROL;
1206
1207 cxgb3_ofld_send(csk->cdev->lldev, skb);
1208 return 0;

--- 197 unchanged lines hidden ---
1200 req->cpu_idx = 0;
1201 req->word = htons(31);
1202 req->mask = cpu_to_be64(0x0F000000);
1203 req->val = cpu_to_be64(val << 24);
1204 skb->priority = CPL_PRIORITY_CONTROL;
1205
1206 cxgb3_ofld_send(csk->cdev->lldev, skb);
1207 return 0;

--- 197 unchanged lines hidden ---