(struct rte_security_session *)sess;
uint32_t buf_sz;
+ uint32_t *per_pkt_hfn = rte_crypto_op_ctod_offset(ops[i],
+ uint32_t *, iv_offset);
+ *per_pkt_hfn = options->pdcp_ses_hfn_en ? 0 : PDCP_DEFAULT_HFN;
+
ops[i]->status = RTE_CRYPTO_OP_STATUS_NOT_PROCESSED;
rte_security_attach_session(ops[i], sec_sess);
sym_op->m_src = (struct rte_mbuf *)((uint8_t *)ops[i] +
cipher_xform.cipher.algo = options->cipher_algo;
cipher_xform.cipher.op = options->cipher_op;
cipher_xform.cipher.iv.offset = iv_offset;
+ cipher_xform.cipher.iv.length = 4;
/* cipher different than null */
if (options->cipher_algo != RTE_CRYPTO_CIPHER_NULL) {
cipher_xform.cipher.key.data = test_vector->cipher_key.data;
cipher_xform.cipher.key.length = test_vector->cipher_key.length;
- cipher_xform.cipher.iv.length = test_vector->cipher_iv.length;
} else {
cipher_xform.cipher.key.data = NULL;
cipher_xform.cipher.key.length = 0;
- cipher_xform.cipher.iv.length = 0;
}
/* Setup Auth Parameters */
.domain = options->pdcp_domain,
.pkt_dir = 0,
.sn_size = options->pdcp_sn_sz,
- .hfn = 0x1,
+ .hfn = options->pdcp_ses_hfn_en ?
+ PDCP_DEFAULT_HFN : 0,
.hfn_threshold = 0x70C0A,
+ .hfn_ovrd = !(options->pdcp_ses_hfn_en),
} },
.crypto_xform = &cipher_xform
};
#ifdef RTE_LIBRTE_SECURITY
#define CPERF_PDCP_SN_SZ ("pdcp-sn-sz")
#define CPERF_PDCP_DOMAIN ("pdcp-domain")
+#define CPERF_PDCP_SES_HFN_EN ("pdcp-ses-hfn-en")
+#define PDCP_DEFAULT_HFN 0x1
#define CPERF_DOCSIS_HDR_SZ ("docsis-hdr-sz")
#endif
#ifdef RTE_LIBRTE_SECURITY
uint16_t pdcp_sn_sz;
+ uint16_t pdcp_ses_hfn_en;
enum rte_security_pdcp_domain pdcp_domain;
uint16_t docsis_hdr_sz;
#endif
" and dequeue in pmd-cyclecount benchmarking mode\n"
" --csv-friendly: enable test result output CSV friendly\n"
#ifdef RTE_LIBRTE_SECURITY
+ " --pdcp-sn-sz N: set PDCP SN size N <5/7/12/15/18>\n"
+ " --pdcp-domain DOMAIN: set PDCP domain <control/user>\n"
+ " --pdcp-ses-hfn-en: enable session based fixed HFN\n"
" --docsis-hdr-sz: set DOCSIS header size\n"
#endif
" -h: prints this help\n",
return 0;
}
+static int
+parse_pdcp_ses_hfn_en(struct cperf_options *opts, const char *arg __rte_unused)
+{
+ opts->pdcp_ses_hfn_en = 1;
+ return 0;
+}
+
static int
parse_docsis_hdr_sz(struct cperf_options *opts, const char *arg)
{
#ifdef RTE_LIBRTE_SECURITY
{ CPERF_PDCP_SN_SZ, required_argument, 0, 0 },
{ CPERF_PDCP_DOMAIN, required_argument, 0, 0 },
+ { CPERF_PDCP_SES_HFN_EN, no_argument, 0, 0 },
{ CPERF_DOCSIS_HDR_SZ, required_argument, 0, 0 },
#endif
{ CPERF_CSV, no_argument, 0, 0},
#ifdef RTE_LIBRTE_SECURITY
opts->pdcp_sn_sz = 12;
opts->pdcp_domain = RTE_SECURITY_PDCP_MODE_CONTROL;
+ opts->pdcp_ses_hfn_en = 0;
opts->docsis_hdr_sz = 17;
#endif
}
#ifdef RTE_LIBRTE_SECURITY
{ CPERF_PDCP_SN_SZ, parse_pdcp_sn_sz },
{ CPERF_PDCP_DOMAIN, parse_pdcp_domain },
+ { CPERF_PDCP_SES_HFN_EN, parse_pdcp_ses_hfn_en },
{ CPERF_DOCSIS_HDR_SZ, parse_docsis_hdr_sz },
#endif
{ CPERF_CSV, parse_csv_friendly},