From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124])
	by passt.top (Postfix) with ESMTP id 7BA855A005E
	for <passt-dev@passt.top>; Thu, 12 Jan 2023 18:28:46 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
	s=mimecast20190719; t=1673544525;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=XlPmpoHQ0QfDdyppUutfACbiBOf3gUdpLfIWJDMjgQg=;
	b=K4ib8U+90Bcq4a6aI7yNsMZsga11jfIiQnCuS82pfLZqd9nG8n5APYtpngcNYqcYvXjPWa
	tcUqUgqrluZzen7JYXLAluHTqbHZmjBy4ywUGQyImYRQ1nbfb03Ez3w/P5PcRy7CR0J0tY
	HWtfrkRKWW5Ip5998TykLpmlQwuu0fs=
Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com
 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-367-5_6gP1SINkumDQzDOmjyjA-1; Thu, 12 Jan 2023 12:28:43 -0500
X-MC-Unique: 5_6gP1SINkumDQzDOmjyjA-1
Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6721F1C29D43
	for <passt-dev@passt.top>; Thu, 12 Jan 2023 17:28:43 +0000 (UTC)
Received: from maya.cloud.tilaa.com (ovpn-208-4.brq.redhat.com [10.40.208.4])
	by smtp.corp.redhat.com (Postfix) with ESMTPS id 05870C15BAD;
	Thu, 12 Jan 2023 17:28:43 +0000 (UTC)
Date: Thu, 12 Jan 2023 18:28:39 +0100
From: Stefano Brivio <sbrivio@redhat.com>
To: Laine Stump <laine@redhat.com>
Subject: Re: [libvirt PATCH 4/9] conf: add passt XML additions to schema
Message-ID: <20230112182839.0c8f9c56@elisabeth>
In-Reply-To: <11955eac-2c40-7c21-2f15-91c4bdade4ed@redhat.com>
References: <20230109041112.368790-1-laine@redhat.com>
	<20230109041112.368790-5-laine@redhat.com>
	<Y78A80CQC6MLW3jw@redhat.com>
	<11955eac-2c40-7c21-2f15-91c4bdade4ed@redhat.com>
Organization: Red Hat
MIME-Version: 1.0
X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Message-ID-Hash: N7STCK4DSGNK4H2IGCASHQTLAEVI22SW
X-Message-ID-Hash: N7STCK4DSGNK4H2IGCASHQTLAEVI22SW
X-MailFrom: sbrivio@redhat.com
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: Libvirt <libvir-list@redhat.com>, "Daniel P. =?UTF-8?B?QmVycmFuZ8Op?=" <berrange@redhat.com>, passt-dev@passt.top
X-Mailman-Version: 3.3.3
Precedence: list
List-Id: Development discussion and patches for passt <passt-dev.passt.top>
Archived-At: <https://archives.passt.top/passt-dev/20230112182839.0c8f9c56@elisabeth/>
Archived-At: <https://passt.top/hyperkitty/list/passt-dev@passt.top/message/N7STCK4DSGNK4H2IGCASHQTLAEVI22SW/>
List-Archive: <https://archives.passt.top/passt-dev/>
List-Archive: <https://passt.top/hyperkitty/list/passt-dev@passt.top/>
List-Help: <mailto:passt-dev-request@passt.top?subject=help>
List-Owner: <mailto:passt-dev-owner@passt.top>
List-Post: <mailto:passt-dev@passt.top>
List-Subscribe: <mailto:passt-dev-join@passt.top>
List-Unsubscribe: <mailto:passt-dev-leave@passt.top>

On Thu, 12 Jan 2023 09:45:39 -0500
Laine Stump <laine@redhat.com> wrote:

> On 1/11/23 1:33 PM, Daniel P. Berrang=C3=A9 wrote:
> > On Sun, Jan 08, 2023 at 11:11:07PM -0500, Laine Stump wrote: =20
> >> Initial support for network devices using passt (https://passt.top)
> >> for the backend connection will require:
> >>
> >> * new attributes of the <backend> subelement:
> >>    * "type" that can have the value "passt" (to differentiate from
> >>      slirp, because both slirp and passt will use <interface =20
> >>      type=3D'user'>) =20
> >>    * "logFile" (a path to a file that passt should use for its logging=
)
> >>    * "upstream" (a netdev name, e.g. "eth0"). =20
> >=20
> > IMHO this attribute is inappropriate for <backend>....
> >  =20
> [...]
> >> +    <interface type=3D'user'>
> >> +      <mac address=3D'00:11:22:33:44:55'/>
> >> +      <ip address=3D'172.17.2.0' family=3D'ipv4' prefix=3D'24'/>
> >> +      <ip address=3D'2001:db8:ac10:fd01::feed' family=3D'ipv6'/>
> >> +      <portForward proto=3D'tcp' address=3D'2001:db8:ac10:fd01::1:10'=
>
> >> +        <range start=3D'22' to=3D'2022'/>
> >> +        <range start=3D'1000' end=3D'1050'/>
> >> +        <range start=3D'1020' exclude=3D'yes'/>
> >> +        <range start=3D'1030' end=3D'1040' exclude=3D'yes'/>
> >> +      </portForward>
> >> +      <portForward proto=3D'udp' address=3D'1.2.3.4' dev=3D'eth0'>
> >> +        <range start=3D'5000' end=3D'5020' to=3D'6000'/>
> >> +        <range start=3D'5010' end=3D'5015' exclude=3D'yes'/>
> >> +      </portForward>
> >> +      <portForward proto=3D'tcp'>
> >> +        <range start=3D'80'/>
> >> +      </portForward>
> >> +      <portForward proto=3D'tcp'>
> >> +        <range start=3D'443' to=3D'344'/>
> >> +      </portForward>
> >> +      <model type=3D'rtl8139'/>
> >> +      <backend type=3D'passt' logFile=3D'/var/log/loglaw.blog' upstre=
am=3D'eth42'/> =20
> >=20
> > I don't think that 'upstream' is really describing a property of the
> > backend.
> >=20
> > This is expressing a traffic routing restriction for the 'user'
> > networking type. IMHO it should probably be using the existing
> > <source dev=3D"xxxx"/> element, that is currently used by the
> > 'direct' networking type. =20
>=20
> I'm still not sure *exactly* what it does; it apparently grabs the=20
> routes that are fed to the guest from the given host interface; I should=
=20
> probably ask Stefano to explain it to me again (he described it once,=20
> but that was along with explanations of several other things).

Yes, it's pretty much that... recycling from the man page:

       -i, --interface name
              Use host interface name to derive addresses and routes.  Defa=
ult
              is  to use the interfaces with the first default routes for e=
ach
              IP version.

It's not actually a routing restriction -- passt can't do that. The
only interface binding that passt implements (with Linux kernel
versions >=3D 5.7) is an optional bound interface specification for port
forwarding.

> So it's not *exactly* the same as <source dev=3D'xxx'/> for type=3D'direc=
t'=20
> (which determines the link-level connection rather than IP routing), but=
=20
> definitely very similar.

Right, I think so too, and "source" is probably a good name for that in
any case.

--=20
Stefano