Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Mar 2022 23:03:44 +0100
From:      Vincenzo Maffione <vmaffione@freebsd.org>
To:        Santiago Martinez <sm@codenetworks.net>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: FBSD-13 - Vale maximum virtual switches.
Message-ID:  <CA%2B_eA9hd4Cn%2Bt1_F989bZyW52scOyV8kZAPODKoqsJqOs=W-FQ@mail.gmail.com>
In-Reply-To: <87d079ec-13da-6c8f-a801-5e68ca696466@codenetworks.net>
References:  <87d079ec-13da-6c8f-a801-5e68ca696466@codenetworks.net>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000049e7005d9579318
Content-Type: text/plain; charset="UTF-8"

Hi,
  Yes, the maximum number of VALE bridges should definitely become a sysctl.
I'll try to implement the change asap.

Cheers,
  Vincenzo

Il giorno gio 3 mar 2022 alle ore 19:07 Santiago Martinez <
sm@codenetworks.net> ha scritto:

> Hi Everyone,
>
> The other day had to simulate a network topology and I wanted to use vale
> switches instead of in-kernel bridges.
>
> After creating a few switches I notice that there was a hard limit of 8
> switches ( that is clearly stated on the man page).
>
> For my simulation I needed 32 virtual switches, hence I increase the value
> of NM_BRIDGES from 8 to 64.
>
> After that I was able to create the bridges and they seem to work fine.
>
> My question is, do we need that hard limit on 8? Should this be change to
> a dynamic value set with sysctl?
>
> Best regards.
> Santi
>
> diff --git a/sys/dev/netmap/netmap_bdg.h b/sys/dev/netmap/netmap_bdg.h
>
> index e4683885e66c..3afe1d9d5d99 100644
> --- a/sys/dev/netmap/netmap_bdg.h
> +++ b/sys/dev/netmap/netmap_bdg.h
> @@ -73,8 +73,8 @@ struct netmap_bdg_ops {
> int netmap_bwrap_attach(const char *name, struct netmap_adapter *, struct
> netmap_bdg_ops *);
> int netmap_bdg_regops(const char *name, struct netmap_bdg_ops *bdg_ops,
> void *private_data, void *auth_token);
>
> -#define        NM_BRIDGES              8       /* number of bridges */
> -#define        NM_BDG_MAXPORTS         254     /* up to 254 */
> +#define        NM_BRIDGES              64      /* number of bridges */
> +#define        NM_BDG_MAXPORTS         16      /* up to 254 */
> #define        NM_BDG_BROADCAST        NM_BDG_MAXPORTS
> #define        NM_BDG_NOPORT           (NM_BDG_MAXPORTS+1)
>
>
>
>

--000000000000049e7005d9579318
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div>Hi,</div><div>=C2=A0 Yes, the maximum number of VALE =
bridges should definitely become a sysctl.</div><div>I&#39;ll try to implem=
ent the change asap.</div><div><br></div><div>Cheers,</div><div>=C2=A0 Vinc=
enzo<br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=
=3D"gmail_attr">Il giorno gio 3 mar 2022 alle ore 19:07 Santiago Martinez &=
lt;<a href=3D"mailto:sm@codenetworks.net">sm@codenetworks.net</a>&gt; ha sc=
ritto:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
 =20

   =20
 =20
  <div>
    <span style=3D"font-weight:bold;color:rgb(0,0,0);background-color:rgb(2=
55,255,255)"></span>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">Hi Everyo=
ne, <br>
        </span></span></p>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">The other=
 day had to simulate a network
          topology and I wanted to use vale switches instead of
          in-kernel bridges.</span></span></p>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">After cre=
ating a few switches I notice
          that there was a hard limit of 8 switches ( that is clearly
          stated on the man page).</span></span></p>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">For my si=
mulation I needed 32 virtual
          switches, hence I increase the value of NM_BRIDGES from 8 to
          64.</span></span></p>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">After tha=
t I was able to create the
          bridges and they seem to work fine.<br>
        </span></span></p>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">My questi=
on is, do we need that hard
          limit on 8? Should this be change to a dynamic value set with
          sysctl?</span></span></p>
    <p><span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)"><=
span style=3D"color:rgb(0,0,0);background-color:rgb(255,255,255)">
          Best regards.<br>
          Santi</span></span></p>
    <p><span style=3D"font-family:monospace"><span style=3D"font-weight:bol=
d;color:rgb(0,0,0);background-color:rgb(255,255,255)">diff
          --git a/sys/dev/netmap/netmap_bdg.h
          b/sys/dev/netmap/netmap_bdg.h</span><span style=3D"color:rgb(0,0,=
0);background-color:rgb(255,255,255)">
        </span></span></p>
    <span style=3D"font-family:monospace"></span>
    <p><span style=3D"font-family:monospace"><span style=3D"font-weight:bol=
d;color:rgb(0,0,0);background-color:rgb(255,255,255)">index
          e4683885e66c..3afe1d9d5d99 100644</span><span style=3D"color:rgb(=
0,0,0);background-color:rgb(255,255,255)">
        </span><br>
        <span style=3D"font-weight:bold;color:rgb(0,0,0);background-color:r=
gb(255,255,255)">---
          a/sys/dev/netmap/netmap_bdg.h</span><span style=3D"color:rgb(0,0,=
0);background-color:rgb(255,255,255)">
        </span><br>
        <span style=3D"font-weight:bold;color:rgb(0,0,0);background-color:r=
gb(255,255,255)">+++
          b/sys/dev/netmap/netmap_bdg.h</span><span style=3D"color:rgb(0,0,=
0);background-color:rgb(255,255,255)">
        </span><br>
        <span style=3D"color:rgb(24,178,178);background-color:rgb(255,255,2=
55)">@@ -73,8
          +73,8 @@</span><span style=3D"color:rgb(0,0,0);background-color:r=
gb(255,255,255)"> struct
          netmap_bdg_ops {
        </span><br>
        int netmap_bwrap_attach(const char *name, struct netmap_adapter
        *, struct netmap_bdg_ops *);
        <br>
        int netmap_bdg_regops(const char *name, struct netmap_bdg_ops
        *bdg_ops, void *private_data, void *auth_token);
        <br>
        =C2=A0<br>
        <span style=3D"color:rgb(178,24,24);background-color:rgb(255,255,25=
5)">-#define
          =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BRIDGES =C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A08 =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0/* number of bridges */</span><span style=3D"=
color:rgb(0,0,0);background-color:rgb(255,255,255)">
        </span><br>
        <span style=3D"color:rgb(178,24,24);background-color:rgb(255,255,25=
5)">-#define
          =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BDG_MAXPORTS =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0254 =C2=A0=C2=A0=C2=A0=C2=A0/* up=
 to 254 */</span><span style=3D"color:rgb(0,0,0);background-color:rgb(255,2=
55,255)">
        </span><br>
        <span style=3D"color:rgb(24,178,24);background-color:rgb(255,255,25=
5)">+#define
          =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BRIDGES =C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A064 =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0/* number of bridges */</span><span style=3D"color:=
rgb(0,0,0);background-color:rgb(255,255,255)">
        </span><br>
        <span style=3D"color:rgb(24,178,24);background-color:rgb(255,255,25=
5)">+#define
          =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BDG_MAXPORTS =C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A016 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
/* up to 254 */</span><span style=3D"color:rgb(0,0,0);background-color:rgb(=
255,255,255)">
        </span><br>
        #define =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BDG_BROADCAST =
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BDG_MAXPORTS
        <br>
        #define =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0NM_BDG_NOPORT =C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0(NM_BDG_MAXPORTS+1=
)<br>
        <br>
        <br>
      </span></p>
    <p><br>
    </p>
  </div>

</blockquote></div>

--000000000000049e7005d9579318--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA%2B_eA9hd4Cn%2Bt1_F989bZyW52scOyV8kZAPODKoqsJqOs=W-FQ>