Spdk/lib/idxd
Anton Eidelman c2c8b4ebc7 lib/idxd: fix bug in crc32c with chained ops
When spdk_idxd_submit_crc32c() handles input
with multiple iovs (or multiple ops are generated
due to physically discontinuous buffers),
the first op has the original seed, while the
subsequent ops instruct the hardware to
to fetch the seed from the output of the previous op
(op->hw.crc32c_val):
        void *prev_crc;
        ...
        desc->flags |= IDXD_FLAG_FENCE | IDXD_FLAG_CRC_READ_CRC_SEED;
        desc->crc32c.addr = (uint64_t)prev_crc;  <<< virtual addr

The problem is the prev_crc is a virtual address,
so the hardware (at least with no IOMMU configured)
reports: DSA_COMP_HW_ERR1
spdk_idxd_process_events: Completion status 0x20

Solution:
Set crc32c.addr to the physical address of
the crc32c_val field in the previous desc.
Since desc->completion_addr already holds the physical address
of the dsa_hw_comp_record, we use this with the crc32c_val offset.

Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Change-Id: I330e98c2f3fd6da5cb4fc03d0745df09a9ff0e0c
Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14954
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Paul Luse <paul.e.luse@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: John Kariuki <John.K.Kariuki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
2022-10-18 07:24:55 +00:00
..
idxd_internal.h idxd: For kernel mode, handle IOMMU+SM mode 2022-09-26 11:48:39 +00:00
idxd_kernel.c idxd: For kernel mode, handle IOMMU+SM mode 2022-09-26 11:48:39 +00:00
idxd_user.c lib/idxd: Save device version during kernel and user initialization 2022-08-18 18:47:02 +00:00
idxd.c lib/idxd: fix bug in crc32c with chained ops 2022-10-18 07:24:55 +00:00
Makefile accel/idxd/iaa: Convert to use iovecs 2022-09-23 00:10:08 +00:00
spdk_idxd.map lib/idxd: add raw request for low level testing 2022-05-23 19:09:50 +00:00