Skip to content

Commit 2ccb1ac

Browse files
oleremkuba-moo
authored andcommitted
net: dsa: microchip: dcb: rename IPV to IPM
IPV is added and used term in 802.1Qci PSFP and merged into 802.1Q (from 802.1Q-2018) for another functions. Even it does similar operation holding temporal priority value internally (as it is named), because KSZ datasheet doesn't use the term of IPV (Internal Priority Value) and avoiding any confusion later when PSFP is in the Linux world, it is better to rename IPV to IPM (Internal Priority Mapping). In addition, LAN937x documentation already use IPV for 802.1Qci PSFP related functionality. Suggested-by: Woojung Huh <[email protected]> Signed-off-by: Oleksij Rempel <[email protected]> Reviewed-by: Woojung Huh <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3647980 commit 2ccb1ac

File tree

3 files changed

+51
-51
lines changed

3 files changed

+51
-51
lines changed

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
12271227
.port_cnt = 3, /* total port count */
12281228
.port_nirqs = 3,
12291229
.num_tx_queues = 4,
1230-
.num_ipvs = 8,
1230+
.num_ipms = 8,
12311231
.tc_cbs_supported = true,
12321232
.ops = &ksz9477_dev_ops,
12331233
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
@@ -1257,7 +1257,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
12571257
.cpu_ports = 0x10, /* can be configured as cpu port */
12581258
.port_cnt = 5, /* total cpu and user ports */
12591259
.num_tx_queues = 4,
1260-
.num_ipvs = 4,
1260+
.num_ipms = 4,
12611261
.ops = &ksz8_dev_ops,
12621262
.phylink_mac_ops = &ksz8_phylink_mac_ops,
12631263
.ksz87xx_eee_link_erratum = true,
@@ -1298,7 +1298,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
12981298
.cpu_ports = 0x10, /* can be configured as cpu port */
12991299
.port_cnt = 5, /* total cpu and user ports */
13001300
.num_tx_queues = 4,
1301-
.num_ipvs = 4,
1301+
.num_ipms = 4,
13021302
.ops = &ksz8_dev_ops,
13031303
.phylink_mac_ops = &ksz8_phylink_mac_ops,
13041304
.ksz87xx_eee_link_erratum = true,
@@ -1325,7 +1325,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
13251325
.cpu_ports = 0x10, /* can be configured as cpu port */
13261326
.port_cnt = 5, /* total cpu and user ports */
13271327
.num_tx_queues = 4,
1328-
.num_ipvs = 4,
1328+
.num_ipms = 4,
13291329
.ops = &ksz8_dev_ops,
13301330
.phylink_mac_ops = &ksz8_phylink_mac_ops,
13311331
.ksz87xx_eee_link_erratum = true,
@@ -1352,7 +1352,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
13521352
.cpu_ports = 0x4, /* can be configured as cpu port */
13531353
.port_cnt = 3,
13541354
.num_tx_queues = 4,
1355-
.num_ipvs = 4,
1355+
.num_ipms = 4,
13561356
.ops = &ksz8_dev_ops,
13571357
.phylink_mac_ops = &ksz8830_phylink_mac_ops,
13581358
.mib_names = ksz88xx_mib_names,
@@ -1378,7 +1378,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
13781378
.port_cnt = 7, /* total physical port count */
13791379
.port_nirqs = 4,
13801380
.num_tx_queues = 4,
1381-
.num_ipvs = 8,
1381+
.num_ipms = 8,
13821382
.tc_cbs_supported = true,
13831383
.ops = &ksz9477_dev_ops,
13841384
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
@@ -1413,7 +1413,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
14131413
.port_cnt = 6, /* total physical port count */
14141414
.port_nirqs = 2,
14151415
.num_tx_queues = 4,
1416-
.num_ipvs = 8,
1416+
.num_ipms = 8,
14171417
.ops = &ksz9477_dev_ops,
14181418
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
14191419
.mib_names = ksz9477_mib_names,
@@ -1447,7 +1447,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
14471447
.port_cnt = 7, /* total physical port count */
14481448
.port_nirqs = 2,
14491449
.num_tx_queues = 4,
1450-
.num_ipvs = 8,
1450+
.num_ipms = 8,
14511451
.ops = &ksz9477_dev_ops,
14521452
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
14531453
.mib_names = ksz9477_mib_names,
@@ -1479,7 +1479,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
14791479
.port_cnt = 3, /* total port count */
14801480
.port_nirqs = 2,
14811481
.num_tx_queues = 4,
1482-
.num_ipvs = 8,
1482+
.num_ipms = 8,
14831483
.ops = &ksz9477_dev_ops,
14841484
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
14851485
.mib_names = ksz9477_mib_names,
@@ -1507,7 +1507,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
15071507
.port_cnt = 3, /* total port count */
15081508
.port_nirqs = 3,
15091509
.num_tx_queues = 4,
1510-
.num_ipvs = 8,
1510+
.num_ipms = 8,
15111511
.tc_cbs_supported = true,
15121512
.ops = &ksz9477_dev_ops,
15131513
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
@@ -1536,7 +1536,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
15361536
.port_cnt = 7, /* total port count */
15371537
.port_nirqs = 3,
15381538
.num_tx_queues = 4,
1539-
.num_ipvs = 8,
1539+
.num_ipms = 8,
15401540
.tc_cbs_supported = true,
15411541
.ops = &ksz9477_dev_ops,
15421542
.phylink_mac_ops = &ksz9477_phylink_mac_ops,
@@ -1570,7 +1570,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
15701570
.port_cnt = 7, /* total physical port count */
15711571
.port_nirqs = 3,
15721572
.num_tx_queues = 4,
1573-
.num_ipvs = 8,
1573+
.num_ipms = 8,
15741574
.tc_cbs_supported = true,
15751575
.ops = &ksz9477_dev_ops,
15761576
.mib_names = ksz9477_mib_names,
@@ -1602,7 +1602,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
16021602
.port_cnt = 5, /* total physical port count */
16031603
.port_nirqs = 6,
16041604
.num_tx_queues = 8,
1605-
.num_ipvs = 8,
1605+
.num_ipms = 8,
16061606
.tc_cbs_supported = true,
16071607
.ops = &lan937x_dev_ops,
16081608
.phylink_mac_ops = &lan937x_phylink_mac_ops,
@@ -1630,7 +1630,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
16301630
.port_cnt = 6, /* total physical port count */
16311631
.port_nirqs = 6,
16321632
.num_tx_queues = 8,
1633-
.num_ipvs = 8,
1633+
.num_ipms = 8,
16341634
.tc_cbs_supported = true,
16351635
.ops = &lan937x_dev_ops,
16361636
.phylink_mac_ops = &lan937x_phylink_mac_ops,
@@ -1658,7 +1658,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
16581658
.port_cnt = 8, /* total physical port count */
16591659
.port_nirqs = 6,
16601660
.num_tx_queues = 8,
1661-
.num_ipvs = 8,
1661+
.num_ipms = 8,
16621662
.tc_cbs_supported = true,
16631663
.ops = &lan937x_dev_ops,
16641664
.phylink_mac_ops = &lan937x_phylink_mac_ops,
@@ -1690,7 +1690,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
16901690
.port_cnt = 5, /* total physical port count */
16911691
.port_nirqs = 6,
16921692
.num_tx_queues = 8,
1693-
.num_ipvs = 8,
1693+
.num_ipms = 8,
16941694
.tc_cbs_supported = true,
16951695
.ops = &lan937x_dev_ops,
16961696
.phylink_mac_ops = &lan937x_phylink_mac_ops,
@@ -1722,7 +1722,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
17221722
.port_cnt = 8, /* total physical port count */
17231723
.port_nirqs = 6,
17241724
.num_tx_queues = 8,
1725-
.num_ipvs = 8,
1725+
.num_ipms = 8,
17261726
.tc_cbs_supported = true,
17271727
.ops = &lan937x_dev_ops,
17281728
.phylink_mac_ops = &lan937x_phylink_mac_ops,
@@ -2726,20 +2726,20 @@ static int ksz9477_set_default_prio_queue_mapping(struct ksz_device *dev,
27262726
int port)
27272727
{
27282728
u32 queue_map = 0;
2729-
int ipv;
2729+
int ipm;
27302730

2731-
for (ipv = 0; ipv < dev->info->num_ipvs; ipv++) {
2731+
for (ipm = 0; ipm < dev->info->num_ipms; ipm++) {
27322732
int queue;
27332733

27342734
/* Traffic Type (TT) is corresponding to the Internal Priority
2735-
* Value (IPV) in the switch. Traffic Class (TC) is
2735+
* Map (IPM) in the switch. Traffic Class (TC) is
27362736
* corresponding to the queue in the switch.
27372737
*/
2738-
queue = ieee8021q_tt_to_tc(ipv, dev->info->num_tx_queues);
2738+
queue = ieee8021q_tt_to_tc(ipm, dev->info->num_tx_queues);
27392739
if (queue < 0)
27402740
return queue;
27412741

2742-
queue_map |= queue << (ipv * KSZ9477_PORT_TC_MAP_S);
2742+
queue_map |= queue << (ipm * KSZ9477_PORT_TC_MAP_S);
27432743
}
27442744

27452745
return ksz_pwrite32(dev, port, KSZ9477_PORT_MRI_TC_MAP__4, queue_map);
@@ -3609,7 +3609,7 @@ static int ksz_tc_ets_add(struct ksz_device *dev, int port,
36093609
for (tc_prio = 0; tc_prio < ARRAY_SIZE(p->priomap); tc_prio++) {
36103610
int queue;
36113611

3612-
if (tc_prio >= dev->info->num_ipvs)
3612+
if (tc_prio >= dev->info->num_ipms)
36133613
break;
36143614

36153615
queue = ksz_ets_band_to_queue(p, p->priomap[tc_prio]);

drivers/net/dsa/microchip/ksz_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ struct ksz_chip_data {
6262
int port_cnt;
6363
u8 port_nirqs;
6464
u8 num_tx_queues;
65-
u8 num_ipvs; /* number of Internal Priority Values */
65+
u8 num_ipms; /* number of Internal Priority Maps */
6666
bool tc_cbs_supported;
6767
const struct ksz_dev_ops *ops;
6868
const struct phylink_mac_ops *phylink_mac_ops;

drivers/net/dsa/microchip/ksz_dcb.c

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static const struct ksz_apptrust_map ksz9477_apptrust_map_to_bit[] = {
5252
};
5353

5454
/* ksz_supported_apptrust[] - Supported apptrust selectors and Priority Order
55-
* of Internal Priority Value (IPV) sources.
55+
* of Internal Priority Map (IPM) sources.
5656
*
5757
* This array defines the apptrust selectors supported by the hardware, where
5858
* the index within the array indicates the priority of the selector - lower
@@ -246,7 +246,7 @@ int ksz_port_set_default_prio(struct dsa_switch *ds, int port, u8 prio)
246246
int reg, shift, ret;
247247
u8 mask;
248248

249-
if (prio >= dev->info->num_ipvs)
249+
if (prio >= dev->info->num_ipms)
250250
return -EINVAL;
251251

252252
if (ksz_is_ksz88x3(dev)) {
@@ -282,15 +282,15 @@ int ksz_port_get_dscp_prio(struct dsa_switch *ds, int port, u8 dscp)
282282
ksz_get_dscp_prio_reg(dev, &reg, &per_reg, &mask);
283283

284284
/* If DSCP remapping is disabled, DSCP bits 3-5 are used as Internal
285-
* Priority Value (IPV)
285+
* Priority Map (IPM)
286286
*/
287287
if (!is_ksz8(dev)) {
288288
ret = ksz_read8(dev, KSZ9477_REG_SW_MAC_TOS_CTRL, &data);
289289
if (ret)
290290
return ret;
291291

292292
/* If DSCP remapping is disabled, DSCP bits 3-5 are used as
293-
* Internal Priority Value (IPV)
293+
* Internal Priority Map (IPM)
294294
*/
295295
if (!(data & KSZ9477_SW_TOS_DSCP_REMAP))
296296
return FIELD_GET(KSZ9477_SW_TOS_DSCP_DEFAULT_PRIO_M,
@@ -310,7 +310,7 @@ int ksz_port_get_dscp_prio(struct dsa_switch *ds, int port, u8 dscp)
310310
return (data >> shift) & mask;
311311
}
312312

313-
static int ksz_set_global_dscp_entry(struct ksz_device *dev, u8 dscp, u8 ipv)
313+
static int ksz_set_global_dscp_entry(struct ksz_device *dev, u8 dscp, u8 ipm)
314314
{
315315
int reg, per_reg, shift;
316316
u8 mask;
@@ -320,7 +320,7 @@ static int ksz_set_global_dscp_entry(struct ksz_device *dev, u8 dscp, u8 ipv)
320320
shift = (dscp % per_reg) * (8 / per_reg);
321321

322322
return ksz_rmw8(dev, reg + (dscp / per_reg), mask << shift,
323-
ipv << shift);
323+
ipm << shift);
324324
}
325325

326326
/**
@@ -349,29 +349,29 @@ static int ksz_init_global_dscp_map(struct ksz_device *dev)
349349
}
350350

351351
for (dscp = 0; dscp < DSCP_MAX; dscp++) {
352-
int ipv, tt;
352+
int ipm, tt;
353353

354354
/* Map DSCP to Traffic Type, which is corresponding to the
355-
* Internal Priority Value (IPV) in the switch.
355+
* Internal Priority Map (IPM) in the switch.
356356
*/
357357
if (!is_ksz8(dev)) {
358-
ipv = ietf_dscp_to_ieee8021q_tt(dscp);
358+
ipm = ietf_dscp_to_ieee8021q_tt(dscp);
359359
} else {
360-
/* On KSZ8xxx variants we do not have IPV to queue
360+
/* On KSZ8xxx variants we do not have IPM to queue
361361
* remapping table. We need to convert DSCP to Traffic
362362
* Type and then to queue.
363363
*/
364364
tt = ietf_dscp_to_ieee8021q_tt(dscp);
365365
if (tt < 0)
366366
return tt;
367367

368-
ipv = ieee8021q_tt_to_tc(tt, dev->info->num_tx_queues);
368+
ipm = ieee8021q_tt_to_tc(tt, dev->info->num_tx_queues);
369369
}
370370

371-
if (ipv < 0)
372-
return ipv;
371+
if (ipm < 0)
372+
return ipm;
373373

374-
ret = ksz_set_global_dscp_entry(dev, dscp, ipv);
374+
ret = ksz_set_global_dscp_entry(dev, dscp, ipm);
375375
}
376376

377377
return 0;
@@ -381,7 +381,7 @@ int ksz_port_add_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio)
381381
{
382382
struct ksz_device *dev = ds->priv;
383383

384-
if (prio >= dev->info->num_ipvs)
384+
if (prio >= dev->info->num_ipms)
385385
return -ERANGE;
386386

387387
return ksz_set_global_dscp_entry(dev, dscp, prio);
@@ -390,21 +390,21 @@ int ksz_port_add_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio)
390390
int ksz_port_del_dscp_prio(struct dsa_switch *ds, int port, u8 dscp, u8 prio)
391391
{
392392
struct ksz_device *dev = ds->priv;
393-
int ipv;
393+
int ipm;
394394

395395
if (ksz_port_get_dscp_prio(ds, port, dscp) != prio)
396396
return 0;
397397

398398
if (is_ksz8(dev)) {
399-
ipv = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE,
399+
ipm = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE,
400400
dev->info->num_tx_queues);
401-
if (ipv < 0)
402-
return ipv;
401+
if (ipm < 0)
402+
return ipm;
403403
} else {
404-
ipv = IEEE8021Q_TT_BE;
404+
ipm = IEEE8021Q_TT_BE;
405405
}
406406

407-
return ksz_set_global_dscp_entry(dev, dscp, ipv);
407+
return ksz_set_global_dscp_entry(dev, dscp, ipm);
408408
}
409409

410410
/**
@@ -741,20 +741,20 @@ int ksz_port_get_apptrust(struct dsa_switch *ds, int port, u8 *sel, int *nsel)
741741
int ksz_dcb_init_port(struct ksz_device *dev, int port)
742742
{
743743
const u8 *sel;
744-
int ret, ipv;
744+
int ret, ipm;
745745
int sel_len;
746746

747747
if (is_ksz8(dev)) {
748-
ipv = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE,
748+
ipm = ieee8021q_tt_to_tc(IEEE8021Q_TT_BE,
749749
dev->info->num_tx_queues);
750-
if (ipv < 0)
751-
return ipv;
750+
if (ipm < 0)
751+
return ipm;
752752
} else {
753-
ipv = IEEE8021Q_TT_BE;
753+
ipm = IEEE8021Q_TT_BE;
754754
}
755755

756756
/* Set the default priority for the port to Best Effort */
757-
ret = ksz_port_set_default_prio(dev->ds, port, ipv);
757+
ret = ksz_port_set_default_prio(dev->ds, port, ipm);
758758
if (ret)
759759
return ret;
760760

0 commit comments

Comments
 (0)