DPDK patches and discussions
 help / color / mirror / Atom feed
* min_mbuf_head/tailroom_req in rte_cryptodev_info
@ 2023-05-09 11:53 Suanming Mou
  2023-05-09 12:13 ` Anoob Joseph
  0 siblings, 1 reply; 3+ messages in thread
From: Suanming Mou @ 2023-05-09 11:53 UTC (permalink / raw)
  To: anoobj, Doherty, Declan; +Cc: gakhil, dev

[-- Attachment #1: Type: text/plain, Size: 780 bytes --]

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.
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---|
In that case, what is the headroom mean to HW? Start from real mbuf headroom before op offset or the offset before payload?

Thanks,
Suanming Mou

[-- Attachment #2: Type: text/html, Size: 2742 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: min_mbuf_head/tailroom_req in rte_cryptodev_info
  2023-05-09 11:53 min_mbuf_head/tailroom_req in rte_cryptodev_info Suanming Mou
@ 2023-05-09 12:13 ` Anoob Joseph
  2023-05-09 13:01   ` Suanming Mou
  0 siblings, 1 reply; 3+ messages in thread
From: Anoob Joseph @ 2023-05-09 12:13 UTC (permalink / raw)
  To: Suanming Mou; +Cc: Akhil Goyal, dev, Doherty, Declan

Hi Suanming,

Please see inline.

Thanks,
Anoob

> From: Suanming Mou <suanmingm@nvidia.com> 
> Sent: Tuesday, May 9, 2023 5:23 PM
> To: Anoob Joseph <anoobj@marvell.com>; Doherty, Declan <declan.doherty@intel.com>
> Cc: Akhil Goyal <gakhil@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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: min_mbuf_head/tailroom_req in rte_cryptodev_info
  2023-05-09 12:13 ` Anoob Joseph
@ 2023-05-09 13:01   ` Suanming Mou
  0 siblings, 0 replies; 3+ messages in thread
From: Suanming Mou @ 2023-05-09 13:01 UTC (permalink / raw)
  To: Anoob Joseph; +Cc: Akhil Goyal, dev, Doherty,  Declan

Hi Anoob,

Thanks for the quick response. Nice answering. I think I have fully understood the fields meaning.

Many thanks again,
Suanming

> -----Original Message-----
> From: Anoob Joseph <anoobj@marvell.com>
> Sent: Tuesday, May 9, 2023 8:13 PM
> To: Suanming Mou <suanmingm@nvidia.com>
> Cc: Akhil Goyal <gakhil@marvell.com>; dev@dpdk.org; Doherty, Declan
> <declan.doherty@intel.com>
> Subject: RE: min_mbuf_head/tailroom_req in rte_cryptodev_info
> 
> Hi Suanming,
> 
> Please see inline.
> 
> Thanks,
> Anoob
> 
> > From: Suanming Mou <suanmingm@nvidia.com>
> > Sent: Tuesday, May 9, 2023 5:23 PM
> > To: Anoob Joseph <anoobj@marvell.com>; Doherty, Declan
> <declan.doherty@intel.com>
> > Cc: Akhil Goyal <gakhil@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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-09 13:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-09 11:53 min_mbuf_head/tailroom_req in rte_cryptodev_info Suanming Mou
2023-05-09 12:13 ` Anoob Joseph
2023-05-09 13:01   ` Suanming Mou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).