Date: Wed, 30 Aug 2023 00:26:05 +0800 From: Zhenlei Huang <zlei@FreeBSD.org> To: Konstantin Belousov <kostikbel@gmail.com> Cc: freebsd-net <freebsd-net@freebsd.org> Subject: Re: About IFNET_PCP_NONE Message-ID: <DDE1CAD9-AC15-4254-B305-906843E2722A@FreeBSD.org> In-Reply-To: <ZO1IlRpFo51mMWmZ@kib.kiev.ua> References: <DC95210D-FFB4-461C-BCD0-50E47DF263EF@FreeBSD.org> <ZOxSozLKmA0eeQx5@kib.kiev.ua> <20ECDA33-2638-4CFB-8740-5E8BF1F8072B@FreeBSD.org> <ZO1IlRpFo51mMWmZ@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--Apple-Mail=_23D9BC82-82BB-4A5E-BAEE-39A65F10568E Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Aug 29, 2023, at 9:23 AM, Konstantin Belousov <kostikbel@gmail.com> = wrote: >=20 > On Mon, Aug 28, 2023 at 10:25:01PM +0800, Zhenlei Huang wrote: >>=20 >>=20 >>> On Aug 28, 2023, at 3:54 PM, Konstantin Belousov = <kostikbel@gmail.com> wrote: >>>=20 >>> On Mon, Aug 28, 2023 at 09:51:38AM +0800, Zhenlei Huang wrote: >>>> Hi Konstantin, >>>>=20 >>>>=20 >>>> I was just about going to open a PR for = https://reviews.freebsd.org/D39536 and >>>> realized I might made wrong assumption. >>>>=20 >>>> I thought IFNET_PCP_NONE is something like IEEE8021Q_PCP_BE but I = second why not >>>> use IEEE8021Q_PCP_BE but a new const IFNET_PCP_NONE. >>=20 >> I meant >>=20 >> ``` >> int >> ether_output_frame(struct ifnet *ifp, struct mbuf *m) >> { >> uint8_t pcp; >>=20 >> pcp =3D ifp->if_pcp; >> if (pcp !=3D 0 /* IEEE8021Q_PCP_BE */ && ifp->if_type !=3D = IFT_L2VLAN && >> !ether_set_pcp(&m, ifp, pcp)) >> return (0); >>=20 >> ... > This is wrong. PCP_BE is just one of the priorities, that should = allowed to > be specified in the 802.1q pseudo-vlan header. >=20 >>=20 >> } >> ``` >>=20 >>>>=20 >>>> So despite its naming IFNET_PCP_NONE, is it actually a flag to let = specific interface >>>> completely bypass (disable) PCP processing? >>>>=20 >>>> The const IFNET_PCP_NONE is defined in sys/net/if.h with=20 >>>> ``` >>>> #define IFNET_PCP_NONE 0xff /* PCP disabled */ >>>> ``` >>> I fail to understand your question. >>>=20 >>> IFNET_PCP_NONE is a value that means that no 802.1q prio is inserted = into >>> the packet. Otherwise, non-vlan traffic is tagged with the = priority. >>=20 >> Think about the following case: >>=20 >> 1. Set interface's PCP to IFNET_PCP_NONE, application / firewall = provide per-flow PCP, should >> the traffic be tagged with the priority ? > Yes, it should, but only for packets from the specified flows. Thanks for the clarification ! I updated https://reviews.freebsd.org/D39536 = <https://reviews.freebsd.org/D39536> as per discussion. >=20 >>=20 >>=20 >>>=20 >>> IEEE8021Q_PCP_BE is a name of one of the priorities, it seems from = my >>> code reading. >>=20 >>=20 >> Best regards, >> Zhenlei >>=20 --Apple-Mail=_23D9BC82-82BB-4A5E-BAEE-39A65F10568E Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br = class=3D""><div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D"">On Aug 29, 2023, at 9:23 AM, Konstantin Belousov <<a = href=3D"mailto:kostikbel@gmail.com" class=3D"">kostikbel@gmail.com</a>>= wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><div = class=3D"">On Mon, Aug 28, 2023 at 10:25:01PM +0800, Zhenlei Huang = wrote:<br class=3D""><blockquote type=3D"cite" class=3D""><br = class=3D""><br class=3D""><blockquote type=3D"cite" class=3D"">On Aug = 28, 2023, at 3:54 PM, Konstantin Belousov <<a = href=3D"mailto:kostikbel@gmail.com" class=3D"">kostikbel@gmail.com</a>>= wrote:<br class=3D""><br class=3D"">On Mon, Aug 28, 2023 at 09:51:38AM = +0800, Zhenlei Huang wrote:<br class=3D""><blockquote type=3D"cite" = class=3D"">Hi Konstantin,<br class=3D""><br class=3D""><br class=3D"">I = was just about going to open a PR for <a = href=3D"https://reviews.freebsd.org/D39536" = class=3D"">https://reviews.freebsd.org/D39536</a> and<br = class=3D"">realized I might made wrong assumption.<br class=3D""><br = class=3D"">I thought IFNET_PCP_NONE is something like IEEE8021Q_PCP_BE = but I second why not<br class=3D"">use IEEE8021Q_PCP_BE but a new const = IFNET_PCP_NONE.<br class=3D""></blockquote></blockquote><br class=3D"">I = meant<br class=3D""><br class=3D"">```<br class=3D"">int<br = class=3D"">ether_output_frame(struct ifnet *ifp, struct mbuf *m)<br = class=3D"">{<br class=3D""> uint8_t pcp;<br = class=3D""><br class=3D""> pcp =3D ifp->if_pcp;<br = class=3D""> if (pcp !=3D 0 /* IEEE8021Q_PCP_BE */ = && ifp->if_type !=3D IFT_L2VLAN &&<br class=3D""> = !ether_set_pcp(&m, ifp, = pcp))<br class=3D""> return = (0);<br class=3D""><br class=3D"">...<br class=3D""></blockquote>This is = wrong. PCP_BE is just one of the priorities, that should allowed = to<br class=3D"">be specified in the 802.1q pseudo-vlan header.<br = class=3D""><br class=3D""><blockquote type=3D"cite" class=3D""><br = class=3D"">}<br class=3D"">```<br class=3D""><br class=3D""><blockquote = type=3D"cite" class=3D""><blockquote type=3D"cite" class=3D""><br = class=3D"">So despite its naming IFNET_PCP_NONE, is it actually a flag = to let specific interface<br class=3D"">completely bypass (disable) PCP = processing?<br class=3D""><br class=3D"">The const IFNET_PCP_NONE is = defined in sys/net/if.h with <br class=3D"">```<br class=3D"">#define = IFNET_PCP_NONE 0xff /* PCP disabled */<br class=3D"">```<br = class=3D""></blockquote>I fail to understand your question.<br = class=3D""><br class=3D"">IFNET_PCP_NONE is a value that means that no = 802.1q prio is inserted into<br class=3D"">the packet. Otherwise, = non-vlan traffic is tagged with the priority.<br = class=3D""></blockquote><br class=3D"">Think about the following = case:<br class=3D""><br class=3D"">1. Set interface's PCP to = IFNET_PCP_NONE, application / firewall provide per-flow PCP, should<br = class=3D"">the traffic be tagged with the priority ?<br = class=3D""></blockquote>Yes, it should, but only for packets from the = specified flows.<br class=3D""></div></div></blockquote><div><br = class=3D""></div><div>Thanks for the clarification !</div><div><br = class=3D""></div><div>I updated <a = href=3D"https://reviews.freebsd.org/D39536" = class=3D"">https://reviews.freebsd.org/D39536</a> as per = discussion.</div><br class=3D""><blockquote type=3D"cite" class=3D""><div = class=3D""><div class=3D""><br class=3D""><blockquote type=3D"cite" = class=3D""><br class=3D""><br class=3D""><blockquote type=3D"cite" = class=3D""><br class=3D"">IEEE8021Q_PCP_BE is a name of one of the = priorities, it seems from my<br class=3D"">code reading.<br = class=3D""></blockquote><br class=3D""><br class=3D"">Best regards,<br = class=3D"">Zhenlei<br class=3D""><br = class=3D""></blockquote></div></div></blockquote></div><div = class=3D""><div><br class=3D""></div> </div> <br class=3D""></body></html>= --Apple-Mail=_23D9BC82-82BB-4A5E-BAEE-39A65F10568E--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DDE1CAD9-AC15-4254-B305-906843E2722A>