On Wed, Dec 22, 2021 at 02:19:03AM +0800, G.R. wrote:
> > > I omitted all operational details with the assumption that you are
> > > familiar
> > > with TrueNAS and iSCSI setup.
> >
> > Not really. Ideally I would like a way to reproduce that can be done
> > using iperf, nc or similar simple command line tool, without requiring
> > to setup iSCSI.
> I think it would be tricky then. The problem hide itself well enough
> that I wasn't
> aware soon after upgrading since everything else works flawlessly --
> nfs, ssh, web etc.
>
> > Can you also paste the output of `ifconfig xn0`?
> Here it is:
> xn0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
> options=503<RXCSUM,TXCSUM,TSO4,LRO>
> ether 00:18:3c:51:6e:4c
> inet 192.168.1.9 netmask 0xffffff00 broadcast 192.168.1.255
> media: Ethernet manual
> status: active
> nd6 options=1<PERFORMNUD>
>
> >
> > If I provided a patch for the FreeBSD kernel, would you be able to
> > apply and test it?
> Probably. I did this before when your XEN support for freeBSD was not
> available out-of-box.
> Just need to recreate all the required environments to apply the patch.
Could you build a debug kernel with the following patch applied and
give me the trace when it explodes?
Thanks, Roger.
---
diff --git a/sys/dev/xen/netfront/netfront.c b/sys/dev/xen/netfront/netfront.c
index fd2d97a7c70c..87bc3ecfc4dd 100644
--- a/sys/dev/xen/netfront/netfront.c
+++ b/sys/dev/xen/netfront/netfront.c
@@ -1519,8 +1519,12 @@ xn_count_frags(struct mbuf *m)
{
int nfrags;
- for (nfrags = 0; m != NULL; m = m->m_next)
+ for (nfrags = 0; m != NULL; m = m->m_next) {
+ KASSERT(
+ (mtod(m, vm_offset_t) & PAGE_MASK) + m->m_len <= PAGE_SIZE,
+ ("mbuf fragment crosses a page boundary"));
nfrags++;
+ }
return (nfrags);
}