[SPDK] Re: DIF/DIX acceleration in SPDK

Sasha Kotchubievsky <sashakot at dev.mellanox.co.il>
Newsgroups dev.linux.lists.spdk
Message-ID <[email protected]>
Hi Paul,

 From DSA spec, I don't quite understand which exactly DIF it supports.  
NVME and SCSI supports DIF with CRC16 guard,  not CRC32c (which is 
commonly used in Intel platform).
In NVME-OF we have "insert&stip" mode in TCP and RDMA transport. I would 
say, DSA looks applicable for TCP case. When data comes into target, we 
have extra for copy for the data. At this stage, copy with DSA can 
insert. or strip DIF. In case of RDMA Transport, using DSA will add 
extra copy. I'm not sure that will be better, than existing CRC 
calculation.

Best regards
Sasha

On 11-Jun-20 6:45 PM, Luse, Paul E wrote:
>
> Hi Everyone,
>
> This is primarily for Shuhei but please feel free, anyone, to respond J
>
> Adding support for Intel’s next generation offload engine is going 
> well (Note, the feature is not available in HW yet, I’m using a 
> simulator to do dev/test). Currently support exists, or is about to 
> land on master, for:
>
> Copy, fill, dual-cast, CRC32C, compare and the ability to submit 
> batches of commands.
>
> Currently these are only being used by a new tool in 
> /examples/accel/perf but once they all land and I’ve added some more 
> tests, we’ll start using them in SPDK modules – the most notable uses 
> will be for CRC32C 9iscsi) and DIF/DIX throughout the stack.  There 
> will be other uses (compare, fill, copy, etc) as well but those are 
> the big ones.
>
> I’ve just now started looking at DIF/DIX and have determined that 
> using these within SPDK won’t be quite as straightforward as some of 
> the others. I’ll explain what I’m thinking after briefly summering the 
> DSA DIF/DIX functions (more detail is available in the public spec at 
> https://software.intel.com/content/www/us/en/develop/download/intel-data-streaming-accelerator-preliminary-architecture-specification.html)
>
> Note: there is no SGL support in any of these, all are single src 
> and/or dst:
>
>   * DIF Check: The DIF Check operation computes the Data Integrity
>     Field (DIF) on the source data and compares the computed DIF to
>     the DIF contained in the source data.
>   * DIF Insert: The DIF Insert operation copies memory from the Source
>     Address to the Destination Address, while computing the Data
>     Integrity Field (DIF) on the source data and inserting the DIF
>     into the output data.
>   * DIF Strip: The DIF Strip operation copies memory from the Source
>     Address to the Destination Address, removing the Data Integrity
>     Field (DIF). It optionally computes the DIF on the source data and
>     compares the computed DIF to the DIF contained in the source data.
>   * DIF Update: The DIF Update operation copies memory from the Source
>     Address to the Destination Address. It optionally computes the
>     Data Integrity Field (DIF) on the source data and compares the
>     computed DIF to the DIF contained in the data. It simultaneously
>     computes the DIF on the source data using Destination DIF fields
>     in the descriptor and inserts the computed DIF into the output data.
>
> Upon initial review of the relatively complex implementation of 
> DIF?DIX we have in SPDK I have the following observations that I’m 
> hoping to get some feedback on:
>
>   * It looks like we require SGL in most if not all cases. I can go
>     through them one by one but wanted to get an initial feel mainly
>     from Shuhei on how lack of SGL support impacts our ability to use
>     DIF?DIX offload w/DSA before I start adding support J
>   * With the exception of DIF Check, all of the DSA functions include
>     a copy (I can only assume they figured a use case where they are
>     moving data from a host buffer into a different memory subsystem
>     in prep for DMA’ing to disk).  It looks like most if not all of
>     our calculations are done on fixed buffers. I see a few copy
>     functions in diff.c but I don’t see them used anywhere
>
> I’m almost thinking the DSA functions are too “simple” for our current 
> implementation but wonder if there’s some refactoring we can do to 
> make use of them. I don’t know if the DSA CRC32C engine calculates the 
> same exact CRC as the DIF/DIX functions but if so (I can verify) at a 
> minum maybe use just accelerate the CRCs called from funcs within diff.c
>
> Thoughts? We can chat in a community meeting soon too but email might 
> be easier to get us all on the amge page first.
>
> Thanks!!
>
> Paul
>
>
> _______________________________________________
> SPDK mailing list -- spdk(a)lists.01.org
> To unsubscribe send an email to spdk-leave(a)lists.01.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.