Hi Suanming, Please see inline.
Thanks, Anoob > From: Suanming Mou <suanmi...@nvidia.com> > Sent: Tuesday, May 9, 2023 5:23 PM > To: Anoob Joseph <ano...@marvell.com>; Doherty, Declan > <declan.dohe...@intel.com> > Cc: Akhil Goyal <gak...@marvell.com>; dev@dpdk.org > Subject: [EXT] min_mbuf_head/tailroom_req in rte_cryptodev_info > > External Email > ________________________________________ > Hi Guys, > > Sorry for disturbing you. I have one small question regarding the > min_mbuf_head/tailroom_req in rte_cryptodev_info. > I saw you were the people who discussed, reviewed and added that two fields. > IIUC, the two fields provided a hint to the PMD that HW can use(modify) the > headroom and tailroom space to improve the performance. [Anoob] That's right. > But regarding the space(e.g. headroom) user reserved, should the data > offset(sym_op->aead.data.offset) in struct rte_crypto_op also be taken into > account? > e.g. if the mbuf in the operation is something like below: > |---headroom--|----op offset---|---payload to process---|---tailroom---| [Anoob] Above layout is correct. Headroom that can be used by cryptodev is the headroom of the mbuf. > In that case, what is the headroom mean to HW? Start from real mbuf headroom > before op offset or the offset before payload? [Anoob] May be let me explain how we use it in CNXK PMDs. We have to pass fields such as IV & offsets to the hardware for performing crypto operation. To maximize performance, we pass it as single buffer and hence the requirement on this headroom. In our enqueue path, we use headroom for storing some of these transient data. |---headroom--|-------------- packet_len ---------------------|---tailroom---| |---headroom--|----op offset---|---payload to process---|---tailroom---| |--------| <---- Space used by cryptodev for internal purpose ^ = rte_pktmbuf_mtod(mbuf, void *); All offsets mentioned in rte_crypto_op would be calculated from the packet start [rte_pktmbuf_mtod()]. In other words, the packet data from the start of the packet till offset would be untouched by the cryptodev in all circumstances. It is the space that is before start of the packet(ie headroom of mbuf) which would be used for this purpose. Hope it is clear now.