Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Nov 2020 10:33:28 -0700
From:      Scott Long <scottl@samsco.org>
To:        Alexander Motin <mav@FreeBSD.org>
Cc:        Konstantin Belousov <kostikbel@gmail.com>, "freebsd-arch@freebsd.org" <freebsd-arch@freebsd.org>
Subject:   Re: MAXPHYS bump for FreeBSD 13
Message-ID:  <BC2FDDF5-31BE-4D2C-840C-3371D8730EAB@samsco.org>
In-Reply-To: <a54f4fe1-cfc0-0a49-d91c-6d8c62bb8168@FreeBSD.org>
References:  <aac44f21-3a6d-c697-bb52-1a669b11aa3b@FreeBSD.org> <X7Aj0a6ZtIQfBscC@kib.kiev.ua> <ae6861cf-108f-19f7-9525-c89cac850164@FreeBSD.org> <X7EJ8K0Jaw6/dkjl@kib.kiev.ua> <46AB39AF-B09A-4694-AA86-30EC82A1EB9E@samsco.org> <a54f4fe1-cfc0-0a49-d91c-6d8c62bb8168@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


> On Nov 15, 2020, at 10:27 AM, Alexander Motin <mav@FreeBSD.org> wrote:
>=20
> On 15.11.2020 12:11, Scott Long wrote:
>> The MAXPHYS use for AHCI is related to the maximum size of a PRD =
needed
>> for a command.  AHCI specifies that you can have up to 65536 PRD =
entries,
>> which translates into 2^16 + 2^12 =3D 256MB maximum I/O size.  =
However, the
>> AHCI driver seems inconsistent already in that it defines =
AHCI_PRD_MAX=20
>> (via an indirection through AHCI_PRD_MASK) to be 2^22, or 4MB.  This =
is
>> a pretty reasonable max default for AHCI, and I don=E2=80=99t think =
we need to jump
>> through hoops to make it dynamic or make it larger for the future.  =
My
>> recommendation is to abandon the partial changes you have for AHCI =
and
>> use AHCI_PRD_MAX in place of MAXPHYS for the structure sizing and for
>> the cpi->maxio attribute.
>=20
> Scott, AHCI_PRD_MAX is a maximum size of single DMA segment.  It does
> not limit number of segments, which allows up to 256MB maximum I/O as
> you have said.  I am already looking on making number of of PRDs
> dynamic.  It does not look difficult.  Though generally yes, the =
memory
> difference is not big, simply because SATA has maximal queue depth of
> only 32 commands.  For SAS/FC/NVMe/... it is more interesting.
>=20

Sorry, you=E2=80=99re right, I got it backwards when I read the =
arguments to bus_dma.
Still, 4MB is a pretty reasonable maximum for AHCI, and keeping it =
static would
avoid extra complexity in the code.

Scott




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BC2FDDF5-31BE-4D2C-840C-3371D8730EAB>