From nobody Wed Oct 13 07:35:51 2021 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id DE0F517F6B63 for ; Wed, 13 Oct 2021 07:35:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HTkpv5qhtz3sZS for ; Wed, 13 Oct 2021 07:35:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A8B1523BB2 for ; Wed, 13 Oct 2021 07:35:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 19D7ZpfP083443 for ; Wed, 13 Oct 2021 07:35:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 19D7ZpeQ083442 for bugs@FreeBSD.org; Wed, 13 Oct 2021 07:35:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f 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 Date: Wed, 13 Oct 2021 07:35:51 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: Hermes.TK@microchip.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N 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.=