Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jun 2024 14:12:04 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        Peter Jeremy <peterj@freebsd.org>
Cc:        src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org
Subject:   Re: git: bf454ca88bdf - main - wg: Add netmap support
Message-ID:  <Zm8q9P9eGaUvoRe3@nuc>
In-Reply-To: <Zm2Lv-08-qZHNCjF@server.rulingia.com>
References:  <202404201605.43KG564E080220@gitrepo.freebsd.org> <Zm2Lv-08-qZHNCjF@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Jun 15, 2024 at 10:40:31PM +1000, Peter Jeremy wrote:
> On 2024-Apr-20 16:05:06 +0000, Mark Johnston <markj@FreeBSD.org> wrote:
> >URL: https://cgit.FreeBSD.org/src/commit/?id=bf454ca88bdf4acfa873386e876ff5e772e6a830
> >
> >    wg: Add netmap support
> ...
> >--- a/sys/dev/wg/if_wg.c
> >+++ b/sys/dev/wg/if_wg.c
> ...
> >@@ -2206,6 +2341,11 @@ wg_output(if_t ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro
> > 		return (EAFNOSUPPORT);
> > 	}
> > 
> >+#ifdef DEV_NETMAP
> >+	if ((if_getcapenable(ifp) & IFCAP_NETMAP) != 0)
> >+		return (wg_xmit_netmap(ifp, m, af));
> >+#endif
> >+
> > 	defragged = m_defrag(m, M_NOWAIT);
> > 	if (defragged)
> > 		m = defragged;
> >@@ -2781,7 +2921,10 @@ wg_clone_create(struct if_clone *ifc, char *name, size_t len,
> > 	if_setinitfn(ifp, wg_init);
> > 	if_setreassignfn(ifp, wg_reassign);
> > 	if_setqflushfn(ifp, wg_qflush);
> >+#ifdef DEV_NETMAP
> > 	if_settransmitfn(ifp, wg_transmit);
> >+	if_setinputfn(ifp, wg_if_input);
> >+#endif
> > 	if_setoutputfn(ifp, wg_output);
> > 	if_setioctlfn(ifp, wg_ioctl);
> > 	if_attach(ifp);
> 
> sys/net/if.c:if_attach_internal() (called from if_attach()) requires that
> both transmit and qflush must either be NULL or set but if DEV_NETMAP is
> undefined, this code only sets qflush, guaranteeing a panic() as soon as a
> wg is attached.  Unfortunately, I don't understand the code well enough to
> offer a fix.

I've pushed a commit which fixes this problem.  Thanks for the report.



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