Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Aug 2023 22:25:01 +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:  <20ECDA33-2638-4CFB-8740-5E8BF1F8072B@FreeBSD.org>
In-Reply-To: <ZOxSozLKmA0eeQx5@kib.kiev.ua>
References:  <DC95210D-FFB4-461C-BCD0-50E47DF263EF@FreeBSD.org> <ZOxSozLKmA0eeQx5@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_01138789-003C-4029-A9FC-14A405EA3F7E
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii



> 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.

I meant

```
int
ether_output_frame(struct ifnet *ifp, struct mbuf *m)
{
    uint8_t pcp;

    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
>> 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.

Think about the following case:

1. Set interface's PCP to IFNET_PCP_NONE, application / firewall provide =
per-flow PCP, should
the traffic be tagged with the priority ?


>=20
> IEEE8021Q_PCP_BE is a name of one of the priorities, it seems from my
> code reading.


Best regards,
Zhenlei


--Apple-Mail=_01138789-003C-4029-A9FC-14A405EA3F7E
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 28, 2023, at 3:54 PM, Konstantin Belousov &lt;<a =
href=3D"mailto:kostikbel@gmail.com" class=3D"">kostikbel@gmail.com</a>&gt;=
 wrote:</div><br class=3D"Apple-interchange-newline"><div class=3D""><meta=
 charset=3D"UTF-8" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); =
font-family: Menlo-Regular; font-size: 13px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">On Mon, Aug 28, 2023 at 09:51:38AM +0800, Zhenlei Huang =
wrote:</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><blockquote type=3D"cite" style=3D"font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;" 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></div></blockquote><div><br =
class=3D""></div><div>I meant</div><div><br =
class=3D""></div><div>```</div><div><div><div>int</div><div>ether_output_f=
rame(struct ifnet *ifp, struct mbuf *m)</div><div>{</div><div>&nbsp; =
&nbsp; uint8_t pcp;</div><div><br class=3D""></div><div>&nbsp; &nbsp; =
pcp =3D ifp-&gt;if_pcp;</div><div>&nbsp; &nbsp; if (pcp !=3D 0 /* =
IEEE8021Q_PCP_BE */ &amp;&amp; ifp-&gt;if_type !=3D IFT_L2VLAN =
&amp;&amp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; !ether_set_pcp(&amp;m, =
ifp, pcp))</div><div>&nbsp; &nbsp; &nbsp; &nbsp; return =
(0);</div><div><br class=3D""></div><div>...</div><div><br =
class=3D""></div><div>}</div></div></div><div>```</div><div><br =
class=3D""></div><blockquote type=3D"cite" class=3D""><div =
class=3D""><blockquote type=3D"cite" style=3D"font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; =
-webkit-text-stroke-width: 0px; text-decoration: none;" 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<span =
class=3D"Apple-converted-space">&nbsp;</span><br class=3D"">```<br =
class=3D"">#define IFNET_PCP_NONE 0xff &nbsp;&nbsp;/* PCP disabled */<br =
class=3D"">```<br class=3D""></blockquote><span style=3D"caret-color: =
rgb(0, 0, 0); font-family: Menlo-Regular; font-size: 13px; font-style: =
normal; font-variant-caps: normal; font-weight: 400; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline !important;" =
class=3D"">I fail to understand your question.</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 13px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">IFNET_PCP_NONE =
is a value that means that no 802.1q prio is inserted into</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 13px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">the packet. =
&nbsp;Otherwise, non-vlan traffic is tagged with the priority.</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 13px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""></div></blockquote><div><br class=3D""></div><div>Think =
about the following case:</div><div><br class=3D""></div><div>1. Set =
interface's PCP to IFNET_PCP_NONE, application / firewall provide =
per-flow PCP, should</div><div>the traffic be tagged with =
the&nbsp;priority ?</div><div><br class=3D""></div><div><br =
class=3D""></div><blockquote type=3D"cite" class=3D""><div class=3D""><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Menlo-Regular; =
font-size: 13px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" =
class=3D"">IEEE8021Q_PCP_BE is a name of one of the priorities, it seems =
from my</span><br style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;" class=3D""><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
Menlo-Regular; font-size: 13px; font-style: normal; font-variant-caps: =
normal; font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;" class=3D"">code =
reading.</span></div></blockquote><br class=3D""></div><div><br =
class=3D""></div><div class=3D"">
<div>Best regards,</div><div>Zhenlei</div>

</div>
<br class=3D""></body></html>=

--Apple-Mail=_01138789-003C-4029-A9FC-14A405EA3F7E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20ECDA33-2638-4CFB-8740-5E8BF1F8072B>