From nobody Sun Jun 16 18:12:04 2024 X-Original-To: dev-commits-src-all@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 4W2LhB6xF3z5PDTw; Sun, 16 Jun 2024 18:12:10 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W2Lh95Z93z4hqT; Sun, 16 Jun 2024 18:12:09 +0000 (UTC) (envelope-from markjdb@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=cgWXHBVd; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=freebsd.org (policy=none); spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::72d as permitted sender) smtp.mailfrom=markjdb@gmail.com Received: by mail-qk1-x72d.google.com with SMTP id af79cd13be357-797a7f9b52eso289548485a.2; Sun, 16 Jun 2024 11:12:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718561528; x=1719166328; darn=freebsd.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=7yEeCBQlRh6WcxkmiXqb7bmQbhTuh9tXzaXp7CwqRXc=; b=cgWXHBVdsESostcLrIDyreK/fDhbrplha5Aj6fdwj1CHn/OYULl2riZiaXqtX4EWdG RihVQgewdmEPLFItIhLUmH/bofz0IUz+Xv11SHy1QvrSXIY2rEIJlIZoithaHThtg+O+ kx0nigubVZxQtPfpaMeWLZhnL5sNl6M5P2TNj1rdBfc4xd5NQl5uh1Y7jueBaVTBR0xT iEi4+DuJzSYEfYJddZvxybir9qpd4Ffi4tUOQrgMItSM1sIwpbp8tbvfO648aaYq158k hO+1Oj3h6Z9jyriFBwcobGrDfgVQbMdSNRDTH3ZfKC2ky+UNzTPELhw4UXcdIFARY+Vq 5Ofg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718561528; x=1719166328; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7yEeCBQlRh6WcxkmiXqb7bmQbhTuh9tXzaXp7CwqRXc=; b=PCu6s7+//GizWUci5w9itcqLR9HML/P66keOpZ+igN2w5yaAbZ9rfr+vGS+4hESORY waHh3upEKwUJ5lWFRH40+4+mTs2AE2/cffxIK7W6ZcrvhKiUx0kNn93UiU0Epd/DLwTL 9LXSGarzQfuqYrWgwjete4S81+JVnNakwVF8Lhw4zQ0GAWc27bsirMe084KMMKBpCsFa 5Bn+gJDKnNo9lh5XcQUY9KQjlAoAEsEdO+wikREa6ayDXxH/8Alqv9nsTG+ANedeuKxl c6u7N00XH+e1dhPmgn5QVnvmIJgG71SfwGz45ssXC+1ygNdPzP8qDSuAuQG9sZ+7RUks Odrg== X-Forwarded-Encrypted: i=1; AJvYcCUlJUIv7j1jdsfDQloX5HT1Bvd06MC8mWxBL7gssXSGOPF6wZSimHrw03lBWwYMKmFMp8vIalWMQ5Qzt+lUlUMDErNd1k5x5j5UX2RG95za1QhxrKW72oM3RXzffnkZzSyFaEmALDtRgEdDm6t8QNRFwQ== X-Gm-Message-State: AOJu0YwtOQ6YTY9xG58y7nTEcEYhsxz2I2uIBvsSuSdGg9yoc6vn6hUz 8rP3CS2kX/nHWXZjMTiVSCqPF0jW89WlFXRnu2l/W4LX3LqXZDdYZi7lbqLY X-Google-Smtp-Source: AGHT+IGKK2D79l8Tvp4ah9lPgpX4l9naN2Qt5pPG5R7SNFRlxETmAOwiwPNEw8usGDfXO33b+FzsbQ== X-Received: by 2002:ac8:7fd6:0:b0:441:1536:2faf with SMTP id d75a77b69052e-442168aac8dmr95760831cf.19.1718561527572; Sun, 16 Jun 2024 11:12:07 -0700 (PDT) Received: from nuc (192-0-220-237.cpe.teksavvy.com. [192.0.220.237]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4448f5719c7sm4174661cf.34.2024.06.16.11.12.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Jun 2024 11:12:06 -0700 (PDT) Date: Sun, 16 Jun 2024 14:12:04 -0400 From: Mark Johnston To: Peter Jeremy 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: References: <202404201605.43KG564E080220@gitrepo.freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; DMARC_POLICY_SOFTFAIL(0.10)[freebsd.org : SPF not aligned (relaxed), DKIM not aligned (relaxed),none]; MIME_GOOD(-0.10)[text/plain]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DN_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[dev-commits-src-all@freebsd.org,dev-commits-src-main@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::72d:from]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim] X-Rspamd-Queue-Id: 4W2Lh95Z93z4hqT On Sat, Jun 15, 2024 at 10:40:31PM +1000, Peter Jeremy wrote: > On 2024-Apr-20 16:05:06 +0000, Mark Johnston 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.