Skip to content

Commit 01a45da

Browse files
rogerqdavem330
authored andcommitted
net: ethernet: ti: am65-cpsw: update pri_thread_map as per IEEE802.1Q-2014
IEEE802.1Q-2014 supersedes IEEE802.1D-2004. Now Priority Code Point (PCP) 2 is no longer at a lower priority than PCP 0. PCP 1 (Background) is still at a lower priority than PCP 0 (Best Effort). Reference: IEEE802.1Q-2014, Standard for Local and metropolitan area networks Table I-2 - Traffic type acronyms Table I-3 - Defining traffic types Signed-off-by: Roger Quadros <rogerq@kernel.org> Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com> Reviewed-by: Guillaume Nault <gnault@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ac60031 commit 01a45da

1 file changed

Lines changed: 22 additions & 14 deletions

File tree

drivers/net/ethernet/ti/cpsw_ale.c

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1704,26 +1704,34 @@ static void cpsw_ale_policer_reset(struct cpsw_ale *ale)
17041704
void cpsw_ale_classifier_setup_default(struct cpsw_ale *ale, int num_rx_ch)
17051705
{
17061706
int pri, idx;
1707-
/* IEEE802.1D-2004, Standard for Local and metropolitan area networks
1708-
* Table G-2 - Traffic type acronyms
1709-
* Table G-3 - Defining traffic types
1710-
* User priority values 1 and 2 effectively communicate a lower
1711-
* priority than 0. In the below table 0 is assigned to higher priority
1712-
* thread than 1 and 2 wherever possible.
1713-
* The below table maps which thread the user priority needs to be
1707+
1708+
/* Reference:
1709+
* IEEE802.1Q-2014, Standard for Local and metropolitan area networks
1710+
* Table I-2 - Traffic type acronyms
1711+
* Table I-3 - Defining traffic types
1712+
* Section I.4 Traffic types and priority values, states:
1713+
* "0 is thus used both for default priority and for Best Effort, and
1714+
* Background is associated with a priority value of 1. This means
1715+
* that the value 1 effectively communicates a lower priority than 0."
1716+
*
1717+
* In the table below, Priority Code Point (PCP) 0 is assigned
1718+
* to a higher priority thread than PCP 1 wherever possible.
1719+
* The table maps which thread the PCP traffic needs to be
17141720
* sent to for a given number of threads (RX channels). Upper threads
17151721
* have higher priority.
17161722
* e.g. if number of threads is 8 then user priority 0 will map to
1717-
* pri_thread_map[8-1][0] i.e. thread 2
1723+
* pri_thread_map[8-1][0] i.e. thread 1
17181724
*/
1719-
int pri_thread_map[8][8] = { { 0, 0, 0, 0, 0, 0, 0, 0, },
1725+
1726+
int pri_thread_map[8][8] = { /* BK,BE,EE,CA,VI,VO,IC,NC */
1727+
{ 0, 0, 0, 0, 0, 0, 0, 0, },
17201728
{ 0, 0, 0, 0, 1, 1, 1, 1, },
17211729
{ 0, 0, 0, 0, 1, 1, 2, 2, },
1722-
{ 1, 0, 0, 1, 2, 2, 3, 3, },
1723-
{ 1, 0, 0, 1, 2, 3, 4, 4, },
1724-
{ 1, 0, 0, 2, 3, 4, 5, 5, },
1725-
{ 1, 0, 0, 2, 3, 4, 5, 6, },
1726-
{ 2, 0, 1, 3, 4, 5, 6, 7, } };
1730+
{ 0, 0, 1, 1, 2, 2, 3, 3, },
1731+
{ 0, 0, 1, 1, 2, 2, 3, 4, },
1732+
{ 1, 0, 2, 2, 3, 3, 4, 5, },
1733+
{ 1, 0, 2, 3, 4, 4, 5, 6, },
1734+
{ 1, 0, 2, 3, 4, 5, 6, 7 } };
17271735

17281736
cpsw_ale_policer_reset(ale);
17291737

0 commit comments

Comments
 (0)