Article View: linux.kernel.netdev
Article #16436Re: [PATCH net-next v2 02/10] net: ieee8021q: add pcp_to_tt()
From: Luiz Angelo Daros de Luca
Date: Sat, 14 Nov 2026 19:56
Date: Sat, 14 Nov 2026 19:56
31 lines
13530 bytes
13530 bytes
> Add a helper that maps an IEEE 802.1Q Priority Code Point (PCP) to the > corresponding 802.1Q traffic type, complementing the existing > ietf_dscp_to_ieee8021q_tt(). > > It is very nearly an identity map, except that PCP 0 (Best Effort) and > PCP 1 (Background) are swapped: per 802.1Q-2022 (Annex I, Table I-2) > Background is a lower priority than Best Effort even though it carries > the higher PCP value. PCP 2..7 map straight through to the matching > traffic type, and values above 7 are rejected with -EINVAL. This decodes > the 8P0D encoding (Table 6-3), where every PCP value is a priority and > none carries drop eligibility. > > Drivers that classify ingress traffic by PCP need this to map into a > priority-ordered internal space without misordering Best Effort and > Background. The first consumer, the realtek rtl8365mb DSA driver, lands > later in this series. > > Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> > Reviewed-by: Linus Walleij <linusw@kernel.org> > --- > Changes in v2: > - use a lookup table instead of the switch (Luiz) > - check the lookup table size at build time > - kernel-doc: cite Table 6-3 instead of Table I-7, fix the sentence on > 7P1D/6P2D/5P3D, document the stub's return value > - commit message: cite Table 6-3 instead of Table I-7 > - reword the @IEEE8021Q_TT_BE kernel-doc and the enum title > - keep Linus's Reviewed-by: the mapping is unchanged Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Technical Details
Message-ID:
<CAJq09z5BfnCjNnp1TSN+Hz8sCSocxu5ycoUH_PXm==zggTtKZg@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363440-linux-kernel-netdev=dewy.ruReferences:
<20261112-rtl8365mb-dcb-ingress-v2-0-f8e6fbdf8c99@pengutronix.de> <20261112-rtl8365mb-dcb-ingress-v2-2-f8e6fbdf8c99@pengutronix.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-363440-linux-kernel-netdev=dewy.ru
From: luizluca@gmail.com (Luiz Angelo Daros de Luca)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2 02/10] net: ieee8021q: add pcp_to_tt()
Date: Sat, 14 Nov 2026 16:56:38 -0300
Organization: Usenet Network
Message-ID: <CAJq09z5BfnCjNnp1TSN+Hz8sCSocxu5ycoUH_PXm==zggTtKZg@mail.gmail.com>
References: <20261112-rtl8365mb-dcb-ingress-v2-0-f8e6fbdf8c99@pengutronix.de> <20261112-rtl8365mb-dcb-ingress-v2-2-f8e6fbdf8c99@pengutronix.de>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
logging-data="1651077"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:lzss3piSHNVOWOM0HWu0o7gCuB8= sha256:nWT395jFpswzCjlz66CtTQ1DEO3V7Gbuf5AI4jghD5k=
sha1:OqI88Y9plPi4XLddu2bsQdkyKnM= sha256:SiNLZgcoGKb5UR82jnimiwhaanrvzzkMjh2Mf6omjNk=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 536341148C2; Sat, 14 Nov 2026 22:58:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id R1ZTMI6qkyod;
Sat, 14 Nov 2026 22:57:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-363440-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 053A911489B; Sat, 14 Nov 2026 22:57:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id 1C00F350E1; Sat, 14 Nov 2026 19:57:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794686215;
b=2Ydoo2YTNvw9ME1uVrh17HFCpQsUnNrurmLab7sJcHCx+arFapKAXAkcm12veE1l/XCV
H7mrNZoEroP4s4SUWvxvXynvrN9ys9irF7AskGzatHe8Ckem9I/gXBf6kB7umwvrJyEJj
VoRMeBKJddv4gOvQX6d/RqW4If27oLnKJ6vCmItOznBv0wXU23ZRBQ67zOj8DGZ86o3c5
P1wn8zAja6z5K0O8woHPhi74Fuwu0/49/h+8x9kW8DSNykYkg0gXA+bETi+zdGXT7Rqnw
/xCceb4CV5w/tdcxkKY03ZF3SvFLkv+uzIYcUXsEDnwvNKm6aSW/8ef0hpzYAyxLHGw==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794686215;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:X-Mailing-List:List-Id:List-Post:List-Help:
List-Subscribe:List-Unsubscribe:List-Owner:Precedence:MIME-Version:
References:In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:
Cc:Content-Type;
bh=30MCZI4kNA+mBPnrnfoEtNdD8jnl62hOav7zZ9cZHCQ=;
b=4F1cdGtziDx8BLq/oLo0Bxwz4wEOpoNE9JpV0NeauD/GuoLNJy5N1xdZmv0erD7BIRfI
4Dx1wWFJd7+OoQIqtbNdMeqJ4ntIKRKVi8nAkP7dGlxDvbdKS04OskZK5Ge27ml+AnaAx
ECka8nLIC6YN9711KG0oyHJQ06Plj7Jtg4aycJLw7dAo85fAqGsv5V70EXCceXbkirx4p
3hvu1WigBUINgiFnI+4Psa0+7syhDNIJSYeB+FtcyXK9TyN+hTMEX8hRwRQvjAYROvc1X
RiNZHCb9mIqjCct6Y7FqFFNRkgsG/Vo5WX7O44z2c/H3/gpk/OuZdKGhRjpCER8eiNg==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rQs3WlZs;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id E5A1C60A262E;
Sat, 14 Nov 2026 19:56:54 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rQs3WlZs
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.218.43
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1794686214;
b=wc+w8mzP4wyYzGdGDAICXcAjD2DAVp8JAs0ym0OKWEQlEpTVWHbMeQEIY/+hrZnxpE+i
tBvNQou1w3nrwLTbPho5HwhqxlIUHnGrAqOuWN+xNf0qTIRfGvAXeEplx6mbJU75PMHBG
sjIyzwdgtyiZmFYizBJkz+xfIU50B2CRRf5doNMw/B61ld8xbTzyC7AZ6jLL3ya+iHJaU
XYhqCGODfVhoOOzp4u5CIRAWJ/ajKwl0+fEWNgz0YuS/yt3HyiRa+VX4LJYlXz6U3uTdd
Qo02poG0qpx3Zgggi/F8ypDxSrGsv+tOgG5u2rhMr3RvXVoV+bdbnuMJwr309x6F0pQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794686214;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:
MIME-Version:References:In-Reply-To:From:Date:X-Gm-Features:
Message-ID:Subject:To:Cc:Content-Type;
bh=30MCZI4kNA+mBPnrnfoEtNdD8jnl62hOav7zZ9cZHCQ=;
b=TJaPRD9oCuAeP5INnIULUjIdAzM4Ylvoa91bmk3txSlc4zLubIC2tW1mTiMUKIGD/tBE
2m4AcxbKkhCkv0GuNNwFQFcJ1KowhN1KjNKALGLnKwv2gEMvn2RpGsizRfVX2HnVMPqgG
1/B1OZsCDoiQizjIl14k/SFPlZ1DV+GghZGtAm+XSzuh40kpXGTsXlQ0DRl8QFCt7D2ZI
4Z3j+0NhBbzMN/dL6zyszn+8vLLHVf/MhkEmPe9UzEkCRdktjSLYBIKZcJVoa2E3xm/aS
hkaSu7nJ8QLnrN+Vc9NvLQPpfu1VKcM4N6FLPMKKbq52j9EWyKk0erddWV7Ilts+wuw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=rQs3WlZs;
arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.218.43
X-Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id B896960A2626
for <netdev@vger.kernel.org>; Sat, 14 Nov 2026 19:56:53 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B896960A2626
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-ej1-f43.google.com with SMTP id a640c23a62f3a-c445c95d553so339305466b.1
for <netdev@vger.kernel.org>; Sat, 14 Nov 2026 11:56:53 -0800 (PST)
X-ARC-Seal: i=1; a=rsa-sha256; t=1794686212; cv=none;
d=google.com; s=arc-20260327;
b=AqThGSyqGXC4TXMbSukdC8KenupLu6cL/WiVeYFtMStmXwuCmunAWB3AV61V2oYtcR
z6/aywmCHLoCZG7MFMdmitAwnKpYKIEAUBc1+ACjl3Pf8sI1WeLhdWmNcn6bOHBpE53+
rbB9Zgtwa0U1NpyRTZyTsFagvRNLB1GiuercGv8jdss5tm6N6fIqktwMvXnIOdD3TBwi
6OVTur5fwd2Z0CJIHiuYw/qoydVEVtn0Re2DYAmvWMOekoW4EvW/LWAmrdMrvXftoc5t
rL4dSw2Y5P+Yais8wfWfsxhZDZtERCTwmm1WL3s3gDwn4GZKHPJNUUiX6xiPPRFDRy+i
LxXw==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
h=cc:to:subject:message-id:date:from:in-reply-to:references
:mime-version:dkim-signature;
bh=30MCZI4kNA+mBPnrnfoEtNdD8jnl62hOav7zZ9cZHCQ=;
fh=LtzsWaKrod+SAFYcpahZ+vfUKgEx9RmKIZWbdnVNcu8=;
b=ESyJsqUEyoatRDKQ42MUWmJErVKKYNHHGOaCqOtVQt9gtuBB8ZJns2a+3BxH76S/bb
+DbOSvtcrFViYUveblTSCpd7UMHQtu61VVmkR1UuqSxdnTtAnA5KquixuJUL1pgd7Irj
pztnzjqThYlbFJ2a19IXR7gKxguKh9qBw8IlQzal1WKPOnnnxFsQ3fkghEdn7RvW0dI5
j8sdD2dgytMfubSxeTBJ+C1WDZvN90rS73vkfU+AUIB2MgFmX1m86d8BxRcPA79JTu2e
dAg8lbIomXRAnAgUpBoS0FNdKSOcGZOf3dxQgZcahT6cnNBJC2zhtCACnU/GLjWqqoYR
uVoA==;
darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794686212; x=1795291012; darn=vger.kernel.org;
h=content-type:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=30MCZI4kNA+mBPnrnfoEtNdD8jnl62hOav7zZ9cZHCQ=;
b=rQs3WlZsbvbwOCe3JBwOj1wHNiPHVH1n1WPD06GXYcmU5bi9d5UePvKXpmPbv2Ro3L
RsJGfjkHt/OOT8G06tY9HP5CnkytWPnYpMiDDVUmaAxenVIiLnnvnVxo9hr0fEUb7ac6
wER8sL0audpLVOo0FWtVpiqOwVvXUmiftWNm036B0wkFSs7jJfC98HUREv5tchDf5xGV
pLj72ErnU5nXqSIv/jB1BqqaWclRDk2aUowPEjF/LBYThZgWBwXdzN9qbTYuMysLGIcc
23RW3Mv1kMWuAisovsEuYlMAJEmR56AwrLRw53rDydfIHl0DZOQlBDv5vHG+mBXSR0js
9W1Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794686212; x=1795291012;
h=content-type:cc:to:subject:message-id:date:from:in-reply-to
:references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
:subject:date:message-id:reply-to:content-type;
bh=30MCZI4kNA+mBPnrnfoEtNdD8jnl62hOav7zZ9cZHCQ=;
b=cZvsdqKdVljTMXfgIrJhNGRNN0gvYEzFA6vi/5xZw5q5QXsPXuFp3msRXjt4woZ21L
m2CW8j1SJZ30rWovO3GZOT9tXUfiQOsALQv7jmdzSOwuDp+ESZ3P05c/33oEK9l4+M9B
sONUeBzCR+YzdhfZcYUcvjvDJsRdWX843G5HwQUQN+J8xxEPfKuI451l4egSstNuhCVy
qEzTKUhifGa5PUUH/t5YF2XJ1V+q3Vj00M8ivlUhcnmHhwFmgTWC2YyMI8P6793KjIJP
jFgQpXhwBe0f9GWTODB85lmSoHo1xXm2sG6kvQa37CErVoMMWPT7EKLhZz7sZ67Nyzvc
p39A==
X-Forwarded-Encrypted: i=1; AL+hErFNY5SVl1yWPxjobjmKK8KbgsrpUNDAwCXHzjFR8/sa6ejWgPgfckQjREk2U2SHqppgj/gCxBw=@vger.kernel.org
X-Gm-Message-State: APuU4Z8gIk0o2Z1QqHemaIT8eKbBGGu31BBghaSyJyIPl5BYKuwitBBh
c6BExO1t17WkVSh749lfHkXQq2HGxfZ7nww8XGn9GOB3wZ3J7A0KaP1KS1DHaVfRZyojyg7ZBN2
UBSlT1DA7q4jmJHpqfCkWv273R8WANhw=
X-Gm-Gg: AYBFou25KOPRQQES814Jjtz23k+icfkc4G0KTUfHOB5iuugmQZ2NqCN0XNePwuusSvW
KQQ1Ujdm4Pbr88XA04cVZu17ziPJ4oIkxGH/Vr+M7A+KgZ1r3i5/xKxvZNaE/v5KIWMF/dQpFFe
rqdA1jAQ5vwDMBtN3G1g0VSIbGZ6dHK3107hIXOakUZ5Far+u/B5vElLnDD159hEMTmU87IxR6S
0cDdbnPPfa/GZqPDW8q05j1PwAUlgGp4CsxGiFQuJ9bWefYN26KQpgcjcquHMFqLtcVxhyRqP7r
+aykBlnGuCbhhKIZ4Aq76yc2mDc28Y7I8TKk/a1J4V9tIAakEZjhDHFBo/72qxCKsT4uNrna66Q
NFw+9eDfUrB/DDKTrd5cLvvtyNGrb/ALJQj9P
X-Received: by 2002:a17:906:7309:b0:c25:afb6:2d91 with SMTP id
a640c23a62f3a-c509614e541mr511427966b.2.1794686211861; Sat, 14 Nov 2026
11:56:51 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261112-rtl8365mb-dcb-ingress-v2-2-f8e6fbdf8c99@pengutronix.de>
X-Gm-Features: AclHuK8e80Cs30KX-korijUfgMB35N8ODch8H-NjMETF8kqtp_dsj3zSHGq-DEs
X-Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Linus Walleij <linusw@kernel.org>, Alvin ล ipraga <alvin.sipraga@analog.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, kernel@pengutronix.de