struct rte_crypto_op *op)
{
struct rte_crypto_sym_op *sym_op = op->sym;
- uint32_t *crc, crc_length;
+ uint32_t *crc, crc_data_len;
uint8_t *crc_data;
if (ctx->qat_dir == ICP_QAT_HW_CIPHER_ENCRYPT &&
sym_op->auth.data.length != 0) {
- crc_length = sym_op->auth.data.length;
+ crc_data_len = sym_op->auth.data.length;
crc_data = rte_pktmbuf_mtod_offset(sym_op->m_src, uint8_t *,
sym_op->auth.data.offset);
- crc = (uint32_t *)(crc_data + crc_length);
+ crc = (uint32_t *)(crc_data + crc_data_len);
- *crc = rte_net_crc_calc(crc_data, crc_length,
+ *crc = rte_net_crc_calc(crc_data, crc_data_len,
RTE_NET_CRC32_ETH);
}
}
/* DOCSIS processing */
#ifdef RTE_LIBRTE_SECURITY
if (is_docsis_sec) {
- /* Check for OOP */
- if (unlikely((op->sym->m_dst != NULL) &&
+ /* Check for OOP or multi-segment buffers */
+ if (unlikely(((op->sym->m_dst != NULL) &&
(op->sym->m_dst !=
- op->sym->m_src))) {
+ op->sym->m_src)) ||
+ op->sym->m_src->nb_segs > 1)) {
QAT_DP_LOG(ERR,
- "OOP not supported for DOCSIS "
- "security");
+ "OOP and/or multi-segment "
+ "buffers are not supported for "
+ "DOCSIS security");
op->status =
RTE_CRYPTO_OP_STATUS_INVALID_ARGS;
return -EINVAL;