Date: Sat, 15 May 2021 22:25:08 +0100 From: Jessica Clarke <jrtc27@freebsd.org> To: Mateusz Guzik <mjguzik@gmail.com> Cc: John Baldwin <jhb@freebsd.org>, src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Subject: Re: git: e73e2ee0acf5 - main - cxgbei: Handle target transfers with excess unsolicited data. Message-ID: <2B05ED91-15B0-468B-A23A-266BD559419D@freebsd.org> In-Reply-To: <CAGudoHHoZFusWpVOKJcyKupZ-BgBgduy6ce=oQ7dbPp_rrJj_A@mail.gmail.com> References: <202105141922.14EJM1pM058368@gitrepo.freebsd.org> <CAGudoHHoZFusWpVOKJcyKupZ-BgBgduy6ce=oQ7dbPp_rrJj_A@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 15 May 2021, at 21:56, Mateusz Guzik <mjguzik@gmail.com> wrote: >=20 > One of these commits breaks tinderbox: > i386 MINIMAL kernel failed, check _.i386.MINIMAL for details > i386 GENERIC kernel failed, check _.i386.GENERIC for details > i386 GENERIC-NODEBUG kernel failed, check _.i386.GENERIC-NODEBUG for = details > i386 PAE kernel failed, check _.i386.PAE for details > i386 LINT kernel failed, check _.i386.LINT for details > i386 LINT-NOINET kernel failed, check _.i386.LINT-NOINET for details > i386 LINT-NOINET6 kernel failed, check _.i386.LINT-NOINET6 for details > i386 LINT-NOIP kernel failed, check _.i386.LINT-NOIP for details >=20 > /usr/src/sys/dev/cxgbe/tom/t4_ddp.c:1045:15: error: invalid operands > to binary expression ('void *' and 'int') > start_pva =3D trunc_page(sgl->addr); > ^~~~~~~~~~~~~~~~~~~~~ > ./machine/param.h:150:29: note: expanded from macro 'trunc_page' > #define trunc_page(x) ((x) & ~PAGE_MASK) > ~~~ ^ ~~~~~~~~~~ > /usr/src/sys/dev/cxgbe/tom/t4_ddp.c:1300:8: error: invalid operands to > binary expression ('void *' and 'int') > pva =3D trunc_page(sgl->addr); > ^~~~~~~~~~~~~~~~~~~~~ > ./machine/param.h:150:29: note: expanded from macro 'trunc_page' > #define trunc_page(x) ((x) & ~PAGE_MASK) > ~~~ ^ ~~~~~~~~~~ It seems amd64, arm64 and riscv cast to unsigned long first, but arm, = i386, mips and powerpc do not. These macros should probably just become MI in sys/sys/param.h rather than fixing the MD copies to include casts. Jess > On 5/14/21, John Baldwin <jhb@freebsd.org> wrote: >> The branch main has been updated by jhb: >>=20 >> URL: >> = https://cgit.FreeBSD.org/src/commit/?id=3De73e2ee0acf5a0e0f47b9c2bcd73c835= c4922fab >>=20 >> commit e73e2ee0acf5a0e0f47b9c2bcd73c835c4922fab >> Author: John Baldwin <jhb@FreeBSD.org> >> AuthorDate: 2021-05-14 19:20:57 +0000 >> Commit: John Baldwin <jhb@FreeBSD.org> >> CommitDate: 2021-05-14 19:21:34 +0000 >>=20 >> cxgbei: Handle target transfers with excess unsolicited data. >>=20 >> The CTL frontend might have provided a buffer that is smaller than = the >> FirstBurstLength and thus smaller than the amount of unsolicited = data >> included in the request PDU. Treat these transfers as an empty >> transfer. >>=20 >> Reported by: Jithesh Arakkan @ Chelsio >> Sponsored by: Chelsio Communications >>=20 >> Differential Revision: https://reviews.freebsd.org/D29940 >> --- >> sys/dev/cxgbe/cxgbei/icl_cxgbei.c | 9 +++++++-- >> 1 file changed, 7 insertions(+), 2 deletions(-) >>=20 >> diff --git a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c >> b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c >> index 7f638c96483a..c4eb4a35ad31 100644 >> --- a/sys/dev/cxgbe/cxgbei/icl_cxgbei.c >> +++ b/sys/dev/cxgbe/cxgbei/icl_cxgbei.c >> @@ -1064,10 +1064,15 @@ icl_cxgbei_conn_transfer_setup(struct = icl_conn *ic, >> union ctl_io *io, >> /* >> * Note that ICL calls conn_transfer_setup even if the = first >> * burst had everything and there's nothing left to = transfer. >> + * >> + * NB: The CTL frontend might have provided a buffer >> + * whose length (kern_data_len) is smaller than the >> + * FirstBurstLength of unsolicited data. Treat those >> + * as an empty transfer. >> */ >> - MPASS(ctsio->kern_data_len >=3D first_burst); >> xferlen =3D ctsio->kern_data_len; >> - if (xferlen - first_burst < ci->ddp_threshold) { >> + if (xferlen < first_burst || >> + xferlen - first_burst < ci->ddp_threshold) { >> no_ddp: >> /* >> * No DDP for this transfer. Allocate a TTT = (based on >>=20 >=20 >=20 > --=20 > Mateusz Guzik <mjguzik gmail.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2B05ED91-15B0-468B-A23A-266BD559419D>