Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 Oct 2021 07:35:51 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 259129] FreeBSD 13.0: Corruption in SGL observed while running IO with smartqpi driver
Message-ID:  <bug-259129-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D259129

            Bug ID: 259129
           Summary: FreeBSD 13.0: Corruption in SGL observed while running
                    IO with smartqpi driver
           Product: Base System
           Version: 13.0-RELEASE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: Hermes.TK@microchip.com

Created attachment 228651
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D228651&action=
=3Dedit
Attaching kernel logs for reference

In FreeBSD 13.0, while running IO with blocksize 1MB, observed corruption in
SGL. We were running IO with FIO (version 3.28)IO tool.
Command used :

fio --filename=3D/dev/da0: -direct=3D1 -iodepth=3D32 -ioengine=3Dposixaio -=
rw=3Drandrw
-bs=3D1024k -numjobs=3D8 -runtime=3D30 -group_reporting -name=3Dstress

Transfer size used in smartpqi  driver:

In update_sim_properties FUNCTION
cpi->maxio =3D (softs->pqi_cap.max_sg_elem - 1) * PAGE_SIZE;
ie: Max transfer size: 0x21f000  (2.24 MB)

While running IO with 1mb block size , getting EINPROGRESS status for
bus_dmamap_load_ccb in pqi_map_request function.

function stack =3D> smartpqi_cam_action() -> pqisrc_io_start() ->
pqi_map_request() -> bus_dmamap_load_ccb() ->  pqi_request_map_helper

After receiving the EINPROGRESS status for bus_dmamap_load_ccb(),=20
pqi_request_map_helper callback function is called .
Then observed corruption in the SGL received.
Eg: While running FIO with 1 MB block size, the total mapped SGL length
received is 0x3002c0 (3.14MB), where the total transfer size for the IO was=
=20
0x100000 (1.04MB).=20=20
SGL dump(Added debug prints to dump sgl):

05:30:29 freebsd13 kernel: [NOTE]:[ pqi_map_request ] [ 615 ]Total transfer
size : 100000 for tag value 37, Max transfer size: 21f000
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqi_request_map_helper ] [ 577
]Submitting IO With tag 30 after EINPROGRESS status[NOTE]:[ pqisrc_build_sg=
l ]
[ 108 ]SGL_Count :256 for tag 30
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 131 ]SGL
Chaining
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 140 ]TAG: 30
sgt->addr[0]: 5930000
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 142 ]TAG: 30
sgt->len[0]: 1000
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 140 ]TAG: 30
sgt->addr[1]: 592f000
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 142 ]TAG: 30
sgt->len[1]: 1000


Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 140 ]TAG: 30
sgt->addr[255]: 5831000
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 142 ]TAG: 30
sgt->len[255]: 1000
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_build_sgl ] [ 147 ]Total =
sg
length =3D 3002c0 for tag value 30
Oct  6 05:30:29 freebsd13 kernel: [NOTE]:[ pqisrc_show_cdb ] [ 1615 ]TAG: 30


When we tried in FreeBSD 12.2, the maximum block size allowed to run in fio=
 is
128k.

We are suspecting some issue in SGL handling with FreeBSD 13.0.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-259129-227>