From nobody Mon Aug 28 14:25:01 2023 X-Original-To: freebsd-net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RZCWV58rFz4rbfK for ; Mon, 28 Aug 2023 14:25:10 +0000 (UTC) (envelope-from zlei@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RZCWV4fBPz4RBX; Mon, 28 Aug 2023 14:25:10 +0000 (UTC) (envelope-from zlei@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693232710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WJyBDK4GnzXe2QPyWi0YhqrIf8Q6BnjasdK4N9shaBc=; b=GuaRMKuipSvUhEhzxbm7/VKZsKz+MOq6RO7zPDrTWQW5NmwZunSUX/QWeelFs+BZQHz8YK vwjG9JbH4AiTq/WptvWuo62cruIkT1NlsB5Znjoq/ug7ch2bLz4D8HlCTelARe3J17qCRs l3INtD8CJY+vXOWg3B3vVDAFjCwVpRHlEfBV8fN2sLKeIDuMU6ea0nhlRMSVyRHN6FG5hI YluHyN/QNeK6RWm4Q/bvGZFjj5wdscAznIO4THYpH4izehbSwBFnBTV8/kwi/8j/DK1uK/ WJsiaucFh53Qgcyepw2s5w+rntjfYstFKrYv0KN57oR35AzkzLjaknanXYxM3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693232710; a=rsa-sha256; cv=none; b=FR0rmOngT32b44STqYxSRoe/5gs1zmMWf2gkr/BjcZoPZBzJ8Kh1XzOiMsaEQhnSkPfoZt Gwa6WfuJdnKf2F6WWJfWtdy19uCkLpzL53xC57QcUVIv0kKcBaElkRCU0qclXz6f8TDB1c ECGz/7d5kEJnMzTB66mtF8TudrUQKNwjGoISfQfEfQISBiolb+xDPyzMYwtfzgifytt0Gg IBM+ZLpf6XfNx6uV8T6YqnqhzGC+yDfgfFb7tGCU6lDGqlj+NEs3//aq9ah7XS5ndAiC7E +fo9XjInlCc/zepYHplca3goNslObKSQA0UCxBowvaqM2LnrlCFmJzcxbGlCCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693232710; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WJyBDK4GnzXe2QPyWi0YhqrIf8Q6BnjasdK4N9shaBc=; b=LPwuw2PdQTX2fa+HfXKa9Kt4ldSYElhfQnzZ+MNvxkvl7W+40jIQgIReET9eTnKCTzHOfz B+8ZeRy8sFs8jrRlhffGQ4+FoTtRtz6ParCcT00g3zer0Pk2JPvx2iBIXXQQCr4pqHKmM0 SyZqfd5hZErWtxeUUXy5xeQ4OgB044eI9nbaRPe3SE3iD3o7nmykeNUZE0GsAUH/4/uleG 89luEyZaue9fU3l+sQ2UZW+MNvOYqp3JzU84wX1+AnkiE6GJeicW8QM3spZIwENikh7hIC etu8ZZK9457Ug7LXJ8ywQ/XRiY/dlxYf7i+Z6wBtqFszPiD9mF6sbsWbNNOUXg== Received: from smtpclient.apple (ns1.oxydns.net [45.32.91.63]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: zlei/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RZCWT4j9Hz6ch; Mon, 28 Aug 2023 14:25:09 +0000 (UTC) (envelope-from zlei@FreeBSD.org) From: Zhenlei Huang Message-Id: <20ECDA33-2638-4CFB-8740-5E8BF1F8072B@FreeBSD.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_01138789-003C-4029-A9FC-14A405EA3F7E" List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@freebsd.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.4\)) Subject: Re: About IFNET_PCP_NONE Date: Mon, 28 Aug 2023 22:25:01 +0800 In-Reply-To: Cc: freebsd-net To: Konstantin Belousov References: X-Mailer: Apple Mail (2.3696.120.41.1.4) --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 = 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

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_f= rame(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);

...

}
```


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

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