From nobody Wed Feb 23 11:30:43 2022 X-Original-To: dev-commits-src-branches@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 2D3C919E3C04; Wed, 23 Feb 2022 11:31:02 +0000 (UTC) (envelope-from ozkan.kirik@gmail.com) Received: from mail-vk1-xa32.google.com (mail-vk1-xa32.google.com [IPv6:2607:f8b0:4864:20::a32]) (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 "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K3Yks2hP5z3CmL; Wed, 23 Feb 2022 11:31:01 +0000 (UTC) (envelope-from ozkan.kirik@gmail.com) Received: by mail-vk1-xa32.google.com with SMTP id f12so12007147vkl.2; Wed, 23 Feb 2022 03:31:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=YXBxdRgfR10WNKm/1C+Vl83dEW/E2pK60FXva6Qiq9c=; b=aJhiUxNGvH2LVTbMLue0OORMh+DuB7u6YoD2IdO7elE+PeR76N8NozaU6yaPo5Bwlv a2/RORK22LmhbvPaqFZcMU2ra8I+ZhviS8Zi5iud7xGx/h+5aNO2QV492C8o3pPdhAmy BguyaVWmt8JzKYtE64NC0zXO0DnHaBkoXjqjPHqfZx+tf4k1k13CetylJmgPncKMfyJH uZN5vbqaeBeyAYvErSUu7YbHfo43k+bMMGJXb8LjKjDIZBob8O3An3/RdgZQW3hfZslD P/h2an2pyqVL6CA+fucf7pmMCY4GZf9uaYcQT3vNHUWRBq+sdZ7KEn2QK6p7DCagMKS9 qo1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=YXBxdRgfR10WNKm/1C+Vl83dEW/E2pK60FXva6Qiq9c=; b=vNgQtKuaP6aFyK5nVt+uZkyH8t6n+AdzZaRFajqPCeOV/+5Tqjwr3t2WXQ2+Kc9YsJ XQGkAsO3b67fQ+9va+c9YqgLcsEdY4nSGO1VJCPN2R7YdQ5WIlyHxqyvQ81Xocv4MWZf JbrXwFFLLYNaatt9UiGdMhSzOisP1055Ymd2IXBNtAMuHO6/9X6J9rgp/YeJojIQ3Sl+ hj/JeJ4Ws8ABIoTdMNPljVzvogeZ9/y9aix6I842jrT/eCkQqlMysIZdJz9urHOstgcg M6zcfo3jRR4sje0XLWNOiKsfw3IvDvLHPZS9B+GEaZKDyugzNsG0PFDJGZqfArZZFaz5 ac/Q== X-Gm-Message-State: AOAM530WWiQ/8mEXqJHdItV48PDfTXUpIZdotkLz5Wdf/AFBhIseT8bW yx/QUNy2Rv1t6DlhQbHe75bNvx5PVmWiHVqZZOV+s0d8 X-Google-Smtp-Source: ABdhPJxut++STkt45X3diGWFQrEnoF7+fkPsqH9BU5qqLULEOTW+fN+dYqlOfAcPt1fzVcwn59G7M9MW7JMnROnpsJM= X-Received: by 2002:a1f:9e87:0:b0:32c:bcba:d83c with SMTP id h129-20020a1f9e87000000b0032cbcbad83cmr12329254vke.28.1645615854551; Wed, 23 Feb 2022 03:30:54 -0800 (PST) List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 References: <202202231103.21NB34Vh052195@gitrepo.freebsd.org> In-Reply-To: <202202231103.21NB34Vh052195@gitrepo.freebsd.org> From: =?UTF-8?B?w5Z6a2FuIEtJUklL?= Date: Wed, 23 Feb 2022 14:30:43 +0300 Message-ID: Subject: Re: git: 543b492fa569 - stable/13 - if_vxlan(4): Allow netmap_generic to intercept RX packets. To: Aleksandr Fedorov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-branches@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4K3Yks2hP5z3CmL X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=aJhiUxNG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of ozkankirik@gmail.com designates 2607:f8b0:4864:20::a32 as permitted sender) smtp.mailfrom=ozkankirik@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; FREEMAIL_FROM(0.00)[gmail.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_SOME(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::a32:from]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MLMMJ_DEST(0.00)[dev-commits-src-all,dev-commits-src-branches]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N Will it be MFCed to stable/12 ? On Wed, Feb 23, 2022 at 2:03 PM Aleksandr Fedorov wrote: > > The branch stable/13 has been updated by afedorov: > > URL: https://cgit.FreeBSD.org/src/commit/?id=543b492fa569cd5839657bd9f74826ef2df121fb > > commit 543b492fa569cd5839657bd9f74826ef2df121fb > Author: Aleksandr Fedorov > AuthorDate: 2022-02-06 12:27:46 +0000 > Commit: Aleksandr Fedorov > CommitDate: 2022-02-23 11:01:20 +0000 > > if_vxlan(4): Allow netmap_generic to intercept RX packets. > > Netmap (generic) intercepts the if_input method to handle RX packets. > > Call ifp->if_input() instead of netisr_dispatch(). > Add stricter check for incoming packet length. > > This change is very useful with bhyve + vale + if_vxlan. > > Reviewed by: vmaffione (mentor), kib, np, donner > Approved by: vmaffione (mentor), kib, np, donner > MFC after: 2 weeks > Sponsored by: vstack.com > Differential Revision: https://reviews.freebsd.org/D30638 > > (cherry picked from commit ceaf442ff236dd0dcd303001ff41e6c64a0cfc1f) > --- > sys/net/if_vxlan.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/sys/net/if_vxlan.c b/sys/net/if_vxlan.c > index f56ec23540a7..972af73fb50e 100644 > --- a/sys/net/if_vxlan.c > +++ b/sys/net/if_vxlan.c > @@ -2812,12 +2812,16 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, struct mbuf **m0, > struct ether_header *eh; > int error; > > + m = *m0; > + > + if (m->m_pkthdr.len < ETHER_HDR_LEN) > + return (EINVAL); > + > sc = vxlan_socket_lookup_softc(vso, vni); > if (sc == NULL) > return (ENOENT); > > ifp = sc->vxl_ifp; > - m = *m0; > eh = mtod(m, struct ether_header *); > > if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { > @@ -2857,8 +2861,9 @@ vxlan_input(struct vxlan_socket *vso, uint32_t vni, struct mbuf **m0, > m->m_pkthdr.csum_data = 0; > } > > - error = netisr_dispatch(NETISR_ETHER, m); > + (*ifp->if_input)(ifp, m); > *m0 = NULL; > + error = 0; > > out: > vxlan_release(sc); >