* 64-Byte Instruction Format * * ---------------------- * | DPTR0 | 8 bytes * ---------------------- * | PKT_IN_INSTR_HDR | 8 bytes * ---------------------- * | PKT_IN_HDR | 16 bytes * ---------------------- * | SLC_INFO | 16 bytes * ---------------------- * | Front data | 16 bytes * ---------------------- */
| 191 | * ---------------------- |
| 192 | */ |
| 193 | static void |
| 194 | create_se_instr(struct nitrox_softreq *sr, uint8_t qno) |
| 195 | { |
| 196 | struct nitrox_crypto_ctx *ctx = sr->ctx; |
| 197 | rte_iova_t ctx_handle; |
| 198 | |
| 199 | /* fill the packet instruction */ |
| 200 | /* word 0 */ |
| 201 | sr->instr.dptr0 = rte_cpu_to_be_64(sr->dptr); |
| 202 | |
| 203 | /* word 1 */ |
| 204 | sr->instr.ih.value = 0; |
| 205 | sr->instr.ih.s.g = 1; |
| 206 | sr->instr.ih.s.gsz = sr->in.map_bufs_cnt; |
| 207 | sr->instr.ih.s.ssz = sr->out.map_bufs_cnt; |
| 208 | sr->instr.ih.s.fsz = FDATA_SIZE + sizeof(struct gphdr); |
| 209 | sr->instr.ih.s.tlen = sr->instr.ih.s.fsz + sr->in.total_bytes; |
| 210 | sr->instr.ih.value = rte_cpu_to_be_64(sr->instr.ih.value); |
| 211 | |
| 212 | /* word 2 */ |
| 213 | sr->instr.irh.value[0] = 0; |
| 214 | sr->instr.irh.s.uddl = MIN_UDD_LEN; |
| 215 | /* context length in 64-bit words */ |
| 216 | sr->instr.irh.s.ctxl = RTE_ALIGN_MUL_CEIL(sizeof(ctx->fctx), 8) / 8; |
| 217 | /* offset from solicit base port 256 */ |
| 218 | sr->instr.irh.s.destport = SOLICIT_BASE_DPORT + qno; |
| 219 | /* Invalid context cache */ |
| 220 | sr->instr.irh.s.ctxc = 0x3; |
| 221 | sr->instr.irh.s.arg = ctx->req_op; |
| 222 | sr->instr.irh.s.opcode = ctx->opcode; |
| 223 | sr->instr.irh.value[0] = rte_cpu_to_be_64(sr->instr.irh.value[0]); |
| 224 | |
| 225 | /* word 3 */ |
| 226 | ctx_handle = ctx->iova + offsetof(struct nitrox_crypto_ctx, fctx); |
| 227 | sr->instr.irh.s.ctxp = rte_cpu_to_be_64(ctx_handle); |
| 228 | |
| 229 | /* word 4 */ |
| 230 | sr->instr.slc.value[0] = 0; |
| 231 | sr->instr.slc.s.ssz = sr->out.map_bufs_cnt; |
| 232 | sr->instr.slc.value[0] = rte_cpu_to_be_64(sr->instr.slc.value[0]); |
| 233 | |
| 234 | /* word 5 */ |
| 235 | sr->instr.slc.s.rptr = rte_cpu_to_be_64(sr->rptr); |
| 236 | /* |
| 237 | * No conversion for front data, |
| 238 | * It goes into payload |
| 239 | * put GP Header in front data |
| 240 | */ |
| 241 | memcpy(&sr->instr.fdata[0], &sr->gph, sizeof(sr->instr.fdata[0])); |
| 242 | sr->instr.fdata[1] = 0; |
| 243 | } |
| 244 | |
| 245 | static void |
| 246 | softreq_copy_iv(struct nitrox_softreq *sr, uint8_t salt_size) |
no test coverage detected