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
[-- Attachment #1 --] > On Aug 29, 2023, at 9:23 AM, Konstantin Belousov <kostikbel@gmail.com> wrote: > > On Mon, Aug 28, 2023 at 10:25:01PM +0800, Zhenlei Huang wrote: >> >> >>> On Aug 28, 2023, at 3:54 PM, Konstantin Belousov <kostikbel@gmail.com> wrote: >>> >>> On Mon, Aug 28, 2023 at 09:51:38AM +0800, Zhenlei Huang wrote: >>>> Hi Konstantin, >>>> >>>> >>>> I was just about going to open a PR for https://reviews.freebsd.org/D39536 and >>>> realized I might made wrong assumption. >>>> >>>> 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 = ifp->if_pcp; >> if (pcp != 0 /* IEEE8021Q_PCP_BE */ && ifp->if_type != IFT_L2VLAN && >> !ether_set_pcp(&m, ifp, pcp)) >> return (0); >> >> ... > This is wrong. PCP_BE is just one of the priorities, that should allowed to > be specified in the 802.1q pseudo-vlan header. > >> >> } >> ``` >> >>>> >>>> So despite its naming IFNET_PCP_NONE, is it actually a flag to let specific interface >>>> completely bypass (disable) PCP processing? >>>> >>>> The const IFNET_PCP_NONE is defined in sys/net/if.h with >>>> ``` >>>> #define IFNET_PCP_NONE 0xff /* PCP disabled */ >>>> ``` >>> I fail to understand your question. >>> >>> 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 ? > 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. > >> >> >>> >>> IEEE8021Q_PCP_BE is a name of one of the priorities, it seems from my >>> code reading. >> >> >> Best regards, >> Zhenlei >> [-- Attachment #2 --] <html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Aug 29, 2023, at 9:23 AM, Konstantin Belousov <<a href="mailto:kostikbel@gmail.com" class="">kostikbel@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On Mon, Aug 28, 2023 at 10:25:01PM +0800, Zhenlei Huang wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class=""><blockquote type="cite" class="">On Aug 28, 2023, at 3:54 PM, Konstantin Belousov <<a href="mailto:kostikbel@gmail.com" class="">kostikbel@gmail.com</a>> wrote:<br class=""><br class="">On Mon, Aug 28, 2023 at 09:51:38AM +0800, Zhenlei Huang wrote:<br class=""><blockquote type="cite" class="">Hi Konstantin,<br class=""><br class=""><br class="">I was just about going to open a PR for <a href="https://reviews.freebsd.org/D39536" class="">https://reviews.freebsd.org/D39536</a> and<br class="">realized I might made wrong assumption.<br class=""><br class="">I thought IFNET_PCP_NONE is something like IEEE8021Q_PCP_BE but I second why not<br class="">use IEEE8021Q_PCP_BE but a new const IFNET_PCP_NONE.<br class=""></blockquote></blockquote><br class="">I meant<br class=""><br class="">```<br class="">int<br class="">ether_output_frame(struct ifnet *ifp, struct mbuf *m)<br class="">{<br class=""> uint8_t pcp;<br class=""><br class=""> pcp = ifp->if_pcp;<br class=""> if (pcp != 0 /* IEEE8021Q_PCP_BE */ && ifp->if_type != IFT_L2VLAN &&<br class=""> !ether_set_pcp(&m, ifp, pcp))<br class=""> return (0);<br class=""><br class="">...<br class=""></blockquote>This is wrong. PCP_BE is just one of the priorities, that should allowed to<br class="">be specified in the 802.1q pseudo-vlan header.<br class=""><br class=""><blockquote type="cite" class=""><br class="">}<br class="">```<br class=""><br class=""><blockquote type="cite" class=""><blockquote type="cite" class=""><br class="">So despite its naming IFNET_PCP_NONE, is it actually a flag to let specific interface<br class="">completely bypass (disable) PCP processing?<br class=""><br class="">The const IFNET_PCP_NONE is defined in sys/net/if.h with <br class="">```<br class="">#define IFNET_PCP_NONE 0xff /* PCP disabled */<br class="">```<br class=""></blockquote>I fail to understand your question.<br class=""><br class="">IFNET_PCP_NONE is a value that means that no 802.1q prio is inserted into<br class="">the packet. Otherwise, non-vlan traffic is tagged with the priority.<br class=""></blockquote><br class="">Think about the following case:<br class=""><br class="">1. Set interface's PCP to IFNET_PCP_NONE, application / firewall provide per-flow PCP, should<br class="">the traffic be tagged with the priority ?<br class=""></blockquote>Yes, it should, but only for packets from the specified flows.<br class=""></div></div></blockquote><div><br class=""></div><div>Thanks for the clarification !</div><div><br class=""></div><div>I updated <a href="https://reviews.freebsd.org/D39536" class="">https://reviews.freebsd.org/D39536</a> as per discussion.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class=""><blockquote type="cite" class=""><br class=""><br class=""><blockquote type="cite" class=""><br class="">IEEE8021Q_PCP_BE is a name of one of the priorities, it seems from my<br class="">code reading.<br class=""></blockquote><br class=""><br class="">Best regards,<br class="">Zhenlei<br class=""><br class=""></blockquote></div></div></blockquote></div><div class=""><div><br class=""></div> </div> <br class=""></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DDE1CAD9-AC15-4254-B305-906843E2722A>
