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
[-- Attachment #1 --] > 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); ... } ``` >> >> 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 ? > > 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 28, 2023, at 3:54 PM, Konstantin Belousov <<a href="mailto:kostikbel@gmail.com" class="">kostikbel@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta charset="UTF-8" class=""><span style="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="">On Mon, Aug 28, 2023 at 09:51:38AM +0800, Zhenlei Huang wrote:</span><br style="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=""><blockquote type="cite" style="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="">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></div></blockquote><div><br class=""></div><div>I meant</div><div><br class=""></div><div>```</div><div><div><div>int</div><div>ether_output_frame(struct ifnet *ifp, struct mbuf *m)</div><div>{</div><div> uint8_t pcp;</div><div><br class=""></div><div> pcp = ifp->if_pcp;</div><div> if (pcp != 0 /* IEEE8021Q_PCP_BE */ && ifp->if_type != IFT_L2VLAN &&</div><div> !ether_set_pcp(&m, ifp, pcp))</div><div> return (0);</div><div><br class=""></div><div>...</div><div><br class=""></div><div>}</div></div></div><div>```</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><blockquote type="cite" style="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=""><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<span class="Apple-converted-space"> </span><br class="">```<br class="">#define IFNET_PCP_NONE 0xff /* PCP disabled */<br class="">```<br class=""></blockquote><span style="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="">I fail to understand your question.</span><br style="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=""><br style="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=""><span style="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="">IFNET_PCP_NONE is a value that means that no 802.1q prio is inserted into</span><br style="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=""><span style="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="">the packet. Otherwise, non-vlan traffic is tagged with the priority.</span><br style="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=""></div></blockquote><div><br class=""></div><div>Think about the following case:</div><div><br class=""></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 priority ?</div><div><br class=""></div><div><br class=""></div><blockquote type="cite" class=""><div class=""><br style="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=""><span style="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="">IEEE8021Q_PCP_BE is a name of one of the priorities, it seems from my</span><br style="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=""><span style="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="">code reading.</span></div></blockquote><br class=""></div><div><br class=""></div><div class=""> <div>Best regards,</div><div>Zhenlei</div> </div> <br class=""></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20ECDA33-2638-4CFB-8740-5E8BF1F8072B>
