---
title: Classification and Scheduling
slug: aidc/classification-and-scheduling
createdAt: 2025-12-01T11:11:08.000Z
---

# <font color="#1d50a2">Class Map</font>

## <font color="#1d50a2">Class Map View</font>

<font color="#1d05a2">Table 1 Class Map View</font>

| **Command**                              | **Purpose**                      |
| ---------------------------------------- | -------------------------------- |
| **show class-map** \[*class\_map\_name*] | Display class map configuration. |

### <font color="#1d50a2">show class-map \[*class\_map\_name*\]</font>

**\[Command]**
**show class-map** \[*class\_map\_name*]

**\[Purpose]**
Display class map configuration.

**\[Parameters]**

| **Parameter**      | **Description** |
| ------------------ | --------------- |
| *class\_map\_name* | Class map name. |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show class-map
```

## <font color="#1d50a2">Class Map Config</font>

<font color="#1d05a2">Table 2 Class Map Config</font>

| **Command**                      | **Purpose**                                                 |
| -------------------------------- | ----------------------------------------------------------- |
| **class-map** *class\_map\_name* | Create a class map, and enter Class Map Configuration View. |
| **match cos** *cos\_value*       | Specify the COS value.                                      |

### <font color="#1d50a2">class-map *class\_map\_name*</font>

**\[Command]**
**class-map** *class\_map\_name*

**\[Purpose]**
Create a class map, and enter Class Map Configuration View

**\[Parameters]**

| **Parameter**      | **Description** |
| ------------------ | --------------- |
| *class\_map\_name* | Class map name. |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no class-map** *class\_map\_name* to delete the class map.

**\[Use Cases]**

```plaintext
sonic# configure terminal
leaf-138(config)# class-map cmap_4
leaf-138(config-cmap-cmap_4)# match cos 4
leaf-138(config-cmap-cmap_4)# show this
!
class-map cmap_4
 match cos 4
leaf-138(config-cmap-cmap_4)#
leaf-138(config-cmap-cmap_4)# match cos 3 4
leaf-138(config-cmap-cmap_4)# show this
!
class-map cmap_4
 match cos 3 4
```

### <font color="#1d50a2">match cos *cos\_value*</font>

**\[Command]**
**match cos** *cos\_value*

**\[Purpose]**
Specify the COS value.

**\[Parameters]**

| **Parameter** | **Description**                                                                      |
| ------------- | ------------------------------------------------------------------------------------ |
| *cos\_value*  | The range is from 0 to7. When specifying more than one, use spaces to separate them. |

**\[View]**
Class Map Configuration View

**\[Notes]**
COS 0\~7 corresponds to queues 0\~7 one-to-one. Modifying the map of COS to queues is not supported yet.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# class-map test_1000
sonic(config-cmap-test_1000)# match cos 2 3 4 5
```

# <font color="#1d50a2">Diffserv Map</font>

## <font color="#1d50a2">Diffserv Map View</font>

<font color="#1d05a2">Table 3 Diffserv Map View</font>

| **Command**                                                                                                       | **Purpose**                         |
| ----------------------------------------------------------------------------------------------------------------- | ----------------------------------- |
| **show diffserv-map** \[**type** \{**ip-dscp default**\|*diffserv\_map\_name* \|**8021p** *diffserv\_map\_name*}] | Display diffserv map configuration. |

### <font color="#1d50a2">show diffserv-map \[type \{ip-dscp default|*diffserv\_map\_name* |8021p *diffserv\_map\_name*\}\]</font>

**\[Command]**
**show diffserv-map** \[**type** \{*ip-dscp default|diffserv\_map\_name* |**8021p** *diffserv\_map\_name*}]

**\[Purpose]**
Display diffserv map configuration.

**\[Parameters]**

| **Parameter**         | **Description**    |
| --------------------- | ------------------ |
| *diffserv\_map\_name* | Diffserv map name. |

**\[View]**
Privileged User View

**\[Notes]**
**default** is the default diffserv map (ip-dscp type).

**\[Use Cases]**

```plaintext
sonic# show diffserv-map
Diffserv Map default:
Type ip-dscp
    from 30 to 3
    from 42 to 5
    from 43 to 5
    from 60 to 7
    from 61 to 7
    from 62 to 7
    from 63 to 7
    from 53 to 6
    from 52 to 6
    from 23 to 2
    from 24 to 3
    from 25 to 3
    from 26 to 3
    from 27 to 3
    from 20 to 2
    from 21 to 2
    from 22 to 2
    from 49 to 6
    from 46 to 5
    from 47 to 5
    from 44 to 5
    from 45 to 5
    from 28 to 3
    from 29 to 3
    from 40 to 5
    from 41 to 5
    from 1 to 0
    from 0 to 0
    from 3 to 0
    from 2 to 0
    from 5 to 0
    from 4 to 0
    from 7 to 0
    from 6 to 0
    from 9 to 1
    from 8 to 1
    from 18 to 2
    from 39 to 4
    from 38 to 4
    from 59 to 7
    from 32 to 4
    from 14 to 1
    from 11 to 1
    from 10 to 1
    from 13 to 1
    from 12 to 1
    from 15 to 1
    from 58 to 7
    from 17 to 2
    from 16 to 2
    from 19 to 2
    from 54 to 6
    from 31 to 3
    from 56 to 7
    from 51 to 6
    from 36 to 4
    from 35 to 4
    from 34 to 4
    from 33 to 4
    from 55 to 6
    from 37 to 4
    from 48 to 6
    from 57 to 7
    from 50 to 6
```

## <font color="#1d50a2">Diffserv Map Config</font>

<font color="#1d05a2">Table 4 Diffserv Map Config</font>

| **Command**                                                           | **Purpose**                                                       |
| --------------------------------------------------------------------- | ----------------------------------------------------------------- |
| **diffserv-map type** \{**ip-dscp**\|**8021p**} *diffserv\_map\_name* | Create a diffserv map, and enter Diffserv Map Configuration View. |
| **default** \{*cos\_value*\|**copy**}                                 | Configure COS mapping in bulk.                                    |
| **ip-dscp** *dscp\_value* **cos** *cos\_value*                        | Set DSCP to COS mapping.                                          |
| **8021p** *dot1p\_value* **cos** *cos\_value*                         | Set DOT1P to COS mapping.                                         |

### <font color="#1d50a2">diffserv-map type \{ip-dscp|8021p\} *diffserv\_map\_name*</font>

**\[Command]**
**diffserv-maptype** \{**ip-dscp**|**8021p**} *diffserv\_map\_name*

**\[Purpose]**
Create a diffserv map, and enter Diffserv Map Configuration View

**\[Parameters]**

| **Parameter**         | **Description**    |
| --------------------- | ------------------ |
| *diffserv\_map\_name* | Diffserv map name. |

**\[View]**
Global Configuration View

**\[Notes]**
There are DSCP mappings and DOT1P mappings.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# diffserv-map type ip-dscp testdiff1
sonic(config-diffservmap-testdiff1)# exit
sonic(config)#diffserv-map type 8021p testdiff2
sonic(config-diffservmap-testdiff2)#
```

### <font color="#1d50a2">default \{*cos\_value*|copy\}</font>

**\[Command]**
**default** \{*cos\_value*|**copy**}

**\[Purpose]**
Configure COS mapping in bulk.

**\[Parameters]**

| **Parameter** | **Description**          |
| ------------- | ------------------------ |
| *cos\_value*  | The range is from 0 to7. |

**\[View]**
Diffserv Map Configuration View

**\[Notes]**
COS 0\~7 corresponds to queues 0\~7 one-to-one. Modifying the map of COS to queues is not supported yet.;
**default** *cos\_value* indicates that all traffic will be mapped to the specified COS value.
**default copy** indicates to use the default DSCP mapping(only for DSCP to COS mapping).
Run command **no default** to delete this mapping configuration.

**\[Use Cases]**

```plaintext
sonic(config)# diffserv-map type 8021p test1
sonic(config-diffservmap-test1)# default 0
sonic(config-diffservmap-test1)# do show diffserv-map
Diffserv Map test1:
Type 8021p
    from 0 to 0
    from 1 to 0
    from 2 to 0
    from 3 to 0
    from 4 to 0
    from 5 to 0
    from 6 to 0
    from 7 to 0
```

### <font color="#1d50a2">ip-dscp *dscp\_value* cos *cos\_value*</font>

**\[Command]**
**ip-dscp** *dscp\_value* **cos** *cos\_value*

**\[Purpose]**
Set DSCP to COS mapping.

**\[Parameters]**

| **Parameter** | **Description**            |
| ------------- | -------------------------- |
| *dscp\_value* | The range is from 0 to 63. |
| *cos\_value*  | The range is from 0 to 7.  |

**\[View]**
DSCP Diffserv Map Configuration View

**\[Notes]**
COS 0\~7 corresponds to queues 0\~7 one-to-one. Modifying the map of COS to queues is not supported yet.;
Run command **no ip-dscp** *dscp\_value* **cos** *cos\_value* to delete DSCP to COS mapping.

**\[Use Cases]**

```plaintext
sonic(config)# diffserv-map type ip-dscp testdiff1
sonic(config-diffservmap-testdiff1)# ip-dscp 0 cos 2
sonic(config-diffservmap-testdiff1)# ip-dscp 1 cos 4
```

### <font color="#1d50a2">8021p *dot1p\_value* cos *cos\_value*</font>

**\[Command]**
**8021p** *dot1p\_value* **cos** *cos\_value*

**\[Purpose]**
Set DOT1P to COS mapping.

**\[Parameters]**

| **Parameter**  | **Description**           |
| -------------- | ------------------------- |
| *dot1p\_value* | The range is from 0 to 7. |
| *cos\_value*   | The range is from 0 to 7. |

**\[View]**
DOT1P Diffserv Map Configuration View

**\[Notes]**
COS 0\~7 corresponds to queues 0\~7 one-to-one. Modifying the map of COS to queues is not supported yet.;
Run command **no 8021p** *dot1p\_value* **cos** *cos\_value* to delete DOT1P to COS mapping.

**\[Use Cases]**

```plaintext
sonic(config)# diffserv-map type 8021p testdiff2
sonic(config-diffservmap-testdiff2)# 8021p 0 cos 2
sonic(config-diffservmap-testdiff2)# 8021p 1 cos 4
```

# <font color="#1d50a2">Policy Map</font>

## <font color="#1d50a2">Policy Map View</font>

<font color="#1d05a2">Table 5 Policy Map View</font>

| **Command**                                | **Purpose**                                                  |
| ------------------------------------------ | ------------------------------------------------------------ |
| **show policy-map** \[*policy\_map\_name*] | Display policy map configuration.                            |
| **show interface policy-map**              | Display the relationship between interfaces and policy-maps. |

### <font color="#1d50a2">show policy-map \[*policy\_map\_name*\]</font>

**\[Command]**
**show policy-map** \[*policy\_map\_name*]

**\[Purpose]**
Display policy map configuration.

**\[Parameters]**

| **Parameter**       | **Description**  |
| ------------------- | ---------------- |
| *policy\_map\_name* | Policy map name. |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show policy-map
!
policy-map test
!
policy-map test11
!
policy-map test_pfc
 class cmap_4
  priority-group-buffer pg_lossless_1
!
```

### <font color="#1d50a2">show interface policy-map</font>

**\[Command]**
**show interface policy-map**

**\[Purpose]**
Display the relationship between interfaces and policy-maps.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show interface policy-map
Port    service policy
------  ----------------
0/0     roce_lossless
0/4     test
0/8     roce_lossless
0/12    roce_lossless
0/16    roce_lossless
0/20    roce_lossless
0/24    roce_lossless
0/28    roce_lossless
0/32    roce_lossless
0/36    roce_lossless
0/40    roce_lossless
0/44    roce_lossless
0/48    roce_lossless
……
```

## <font color="#1d50a2">Policy Map Config</font>

<font color="#1d05a2">Table 6 Policy Map Config</font>

| **Command**                                                                | **Purpose**                                                                             |
| -------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| **policy-map** *policy\_map\_name*                                         | Create a policy map, and enter Traffic Policy Configuration View.                       |
| **set cos** \{**dscp**\|**8021p**} **diffserv** *diffserv\_map\_name*      | Set DSCP or DOT1P to COS mapping.                                                       |
| **port-shape** *target-bit-rate* *burst-size*                              | Add a speed limit policy for ports.                                                     |
| **queue-sheduler priority queue** *queue-id*                               | Add strict queue scheduling policies.                                                   |
| **queue-scheduler queue-limit percent** *queue-wight* **queue** *queue-id* | Add DWRR queue scheduling policies.                                                     |
| **class** \{*class\_map\_name*\|**class-default**}                         | Specify the COS value of the policy, and enter Policy Map-Class Map Configuration View. |
| **queue-shape** *target-bit-rate* *burst-size*                             | Add a speed limit policy for queues.                                                    |
| **wred** *\{wred\_profile\_name*\|**default\_drop**\|**default\_ecn**}     | Bind WRED profile to the class map.                                                     |
| **priority-group-buffer** *buffer\_profile\_name*                          | Bind a custom PG buffer profile (Ingress).                                              |
| **queue-buffer** *buffer\_profile\_name*                                   | Bind a custom Queue Buffer Profile (Egress).                                            |
| **bandwidth** *rate-bps* \[*burst-size*]                                   | Set minimum guaranteed bandwidth.                                                       |
| **service-policy** *policy\_map\_name*                                     | Apply the policy to the interface.                                                      |

### <font color="#1d50a2">policy-map *policy\_map\_name*</font>

**\[Command]**
**policy-map** *policy\_map\_name*

**\[Purpose]**
Create a policy map, and enter Traffic Policy Configuration View.

**\[Parameters]**

| **Parameter**       | **Description**  |
| ------------------- | ---------------- |
| *policy\_map\_name* | Policy map name. |

**\[View]**
Global Configuration View

**\[Notes]**
Run command **no policy-map** *policy\_map\_name* to delete the policy map.

**\[Use Cases]**

```plaintext
sonic# configure terminal
sonic(config)# policy-map test1
sonic(config-pmap-test1)#
```

### <font color="#1d50a2">set cos \{dscp|8021p\} diffserv *diffserv\_map\_name*</font>

**\[Command]**
**set cos** \{**dscp**|**8021p**} **diffserv** *diffserv\_map\_name*

**\[Purpose]**
Set DSCP or DOT1P to COS mapping.

**\[Parameters]**

| **Parameter**         | **Description**    |
| --------------------- | ------------------ |
| *diffserv\_map\_name* | Diffserv map name. |

**\[View]**
Traffic Policy Configuration View

**\[Notes]**
COS 0\~7 corresponds to queues 0\~7 one-to-one. Modifying the map of COS to queues is not supported yet.
Run command **no set cos** \{**dscp**|**8021p**} **diffserv** *diffserv\_map\_name* to delete the mapping.

**\[Use Cases]**

```plaintext
sonic(config-pmap-test1)# set cos dscp diffserv testdiff1
```

### <font color="#1d50a2">port-shape *target-bit-rate* *burst-size*</font>

**\[Command]**
**port-shape** *target-bit-rate* *burst-size*

**\[Purpose]**
Add a speed limit policy for ports.

**\[Parameters]**

| **Parameter**     | **Description**                                                                                                                                                                                                 |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *target-bit-rate* | Specify the target rate in Bps, the value range of CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 model equipment is from 320000 to line rate, and the value range of other equipment is from 64000 to line rate. |
| *burst-size*      | Specify the burst size in bytes, and the range is from 1000 to 3145728.                                                                                                                                         |

**\[View]**
Traffic Policy Configuration View

**\[Notes]**
The port shaping policy should be configured on the egress interface of the traffic.
Run command **no port-shape** to delete the speed limit policy.

**\[Use Cases]**

```plaintext
Limit the speed of the interface to 2Gbps.
sonic(config)# policy-map pmap1
sonic(config-pmap-pmap1)# port-shape 250000000 128000
sonic(config-pmap-pmap1)# interface ethernet 0/76
sonic(config-if-0/76)# service-policy pmap1
```

### <font color="#1d50a2">queue-scheduler priority queue *queue-id*</font>

**\[Command]**
**queue-scheduler priority queue** *queue-id*

**\[Purpose]**
Add strict queue scheduling policies.

**\[Parameters]**

| **Parameter** | **Description**               |
| ------------- | ----------------------------- |
| *queue-id*    | Queue ID, the range is \[0,7] |

**\[View]**
Traffic Policy Configuration View

**\[Notes]**
Run command **no queue-scheduler priority queue** *queue-id* to delete strict queue scheduling policies.

**\[Use Cases]**

```plaintext
sonic(config-pmap-test1)# queue-scheduler priority queue 2
sonic(config-pmap-test1)# queue-scheduler priority queue 3
```

### <font color="#1d50a2">queue-scheduler queue-limit percent *queue-wight* queue *queue-id*</font>

**\[Command]**
**queue-scheduler queue-limit percent** *queue-wight* **queue** *queue-id*

**\[Purpose]**
Add DWRR queue scheduling policies.

**\[Parameters]**

| **Parameter** | **Description**                     |
| ------------- | ----------------------------------- |
| *queue-wight* | Queue weight, the range is \[1,100] |
| *queue-id*    | Queue ID, the range is \[0,7]       |

**\[View]**
Traffic Policy Configuration View

**\[Notes]**
Run command **no queue-scheduler queue-limit percent** *queue-wight* **queue** *queue-id* to delete DWRR queue scheduling policies.

**\[Use Cases]**

```plaintext
sonic(config-pmap-test1)# queue-scheduler priority queue 2
sonic(config-pmap-test1)# queue-scheduler priority queue 3
sonic(config-pmap-test1)# queue-scheduler queue-limit percent 20 queue 4
sonic(config-pmap-test1)# queue-scheduler queue-limit percent 20 queue 5
```

### <font color="#1d50a2">class \{*class\_map\_name*|class-default\}</font>

**\[Command]**
**class** \{*class\_map\_name*|**class-default**}

**\[Purpose]**
Specify the COS value of the policy, and enter Policy Map-Class Map Configuration View.

**\[Parameters]**

| **Parameter**      | **Description** |
| ------------------ | --------------- |
| *class\_map\_name* | Class map name. |

**\[View]**
Traffic Policy Configuration View

**\[Notes]**
When configuring queue limit/WRED/Queue Buffer/PG Buffer policy, you need to specify the matching COS value first.
COS 0\~7 corresponds to queues 0\~7 one-to-one. Modifying the map of COS to queues is not supported yet.;
**class-default** is the default class map of the system, which will match any other unclassified packets.
Run command **no class** \{*class\_map\_name*|**class-default**} to unbind the class map from the policy.

**\[Use Cases]**

```plaintext
sonic(config)# policy-map roce_lossless
sonic(config-pmap-roce_lossless)# class roce_lossless_class_map
sonic(config-pmap-c)#
```

### <font color="#1d50a2">queue-shape *target-bit-rate* *burst-size*</font>

**\[Command]**
**queue-shape** *target-bit-rate* *burst-size*

**\[Purpose]**
Add a speed limit policy for queues.

**\[Parameters]**

| **Parameter**     | **Description**                                                                                                                                                                                                     |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *target-bit-rate* | Specify the target rate in Bps, and the value range of CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 model equipment is from 320000 to line rate, and the value range of other equipment is from 64000 to line rate. |
| *burst-size*      | Specify the burst size in bytes, and the range is from 1000 to 3145728.                                                                                                                                             |

**\[View]**
Policy Map-Class Map Configuration View

**\[Notes]**
Before running this command, please bind an existing class map to specify the queue to be matched for the policy.
Run command **no queue-shape** to delete the speed limit policy.

**\[Use Cases]**

```plaintext
sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# queue-shape 1200000 128000
```

### <font color="#1d50a2">wred \{*wred\_profile\_name*|default\_drop|default\_ecn\}</font>

**\[Command]**
**wred** \{*wred\_profile\_name*|**default\_drop**|**default\_ecn**}

**\[Purpose]**
Bind WRED profile to the class map.

**\[Parameters]**

| **Parameter**         | **Description** |
| --------------------- | --------------- |
| *wred\_profile\_name* | Profile name.   |

**\[View]**
Policy Map-Class Map Configuration View

**\[Notes]**
Before running this command, please bind an existing class map to specify the queue to be matched for the policy.
Two default WRED templates, **default\_drop** and **default\_ecn**, are built in '-N' model switches, which users can bind directly, and not in '-N-V2'.
Run command **no wred** *wred\_profile\_name* to unbind the WRED profile.

**\[Use Cases]**

```plaintext
sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# wred wred_profile
```

### <font color="#1d50a2">priority-group-buffer *buffer\_profile\_name*</font>

**\[Command]**
**priority-group-buffer** *buffer\_profile\_name*

**\[Purpose]**
Bind a custom PG buffer profile (Ingress).

**\[Parameters]**

| **Parameter**           | **Description** |
| ----------------------- | --------------- |
| *buffer\_profile\_name* | Profile name.   |

**\[View]**
Policy Map-Class Map Configuration View

**\[Notes]**
Use this command to bind a PG buffer profile when configuring a custom PFC.
Before running this command, please bind an existing class map to specify the queue to be matched for the policy.
Run command **no priority-group-buffer** *buffer\_profile\_name* to unbind the PG buffer profile.

**\[Use Cases]**

```plaintext
sonic(config)# buffer-profile pg_lossless_100000_100m_profile
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# mode lossless dynamic 1 size 1518 xoff 46496 xon-offset 13440
sonic(config-buffer-profile-pg_lossless_100000_100m_profile)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class cmap_4
sonic(config-pmap-c)# priority-group-buffer pg_lossless_100000_100m_profile
```

### <font color="#1d50a2">queue-buffer *buffer\_profile\_name*</font>

**\[Command]**
**queue-buffer** *buffer\_profile\_name*

**\[Purpose]**
Bind a custom Queue Buffer Profile (Egress).

**\[Parameters]**

| **Parameter**           | **Description** |
| ----------------------- | --------------- |
| *buffer\_profile\_name* | Profile name.   |

**\[View]**
Policy Map-Class Map Configuration View

**\[Notes]**
Before running this command, please bind an existing class map to specify the queue to be matched for the policy.
It is generally not recommended to modify the interface egress queue buffer manually, so please be careful. Setting unreasonable parameters may cause loss of packets while forwarding traffic on the interface.
Run command **no queue-buffer** *buffer\_profile\_name* to unbind the queue buffer profile.

**\[Use Cases]**

```plaintext
sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# queue-buffer buffer_profile
```

### <font color="#1d50a2">bandwidth *rate-Bps* \[*burst-size*\]</font>

**\[Command]**
**bandwidth** *rate-Bps* \[*burst-size*]

**\[Purpose]**
Set minimum guaranteed bandwidth.

**\[Parameters]**

| **Parameter** | **Description**                                                                                                                                                                                                 |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *rate-Bps*    | Bandwidth value, unit bytes/s,  the value range of CX308P-48Y-N-V2, CX532P-N-V2 and CX732Q-N-V2 model equipment is from 320000 to line rate, and the value range of other equipment is from 64000 to line rate. |
| *burst-size*  | Burst value, unit byte, range \[64000,3145728]                                                                                                                                                                  |

**\[View]**
Policy Map-Class Map Configuration View

**\[Notes]**
Before running this command, please bind an existing class map to specify the queue to be matched for the policy.
Run command **no bandwidth** to delete Bandwidth Configuration.

**\[Use Cases]**

```plaintext
sonic(config)# class-map classtest
sonic(conifg-cmap-classtest)# exit
sonic(config)# polic-map test1
sonic(config-pmap-test1)# class classtest
sonic(config-pmap-c)# bandwidth 64000
```

### <font color="#1d50a2">service-policy *policy\_map\_name*</font>

**\[Command]**
**service-policy** *policy\_map\_name*

**\[Purpose]**
Apply the policy to the interface.

**\[Parameters]**

| **Parameter**       | **Description**  |
| ------------------- | ---------------- |
| *policy\_map\_name* | Policy map name. |

**\[View]**

Physical Interface Configuration View

**\[Notes]**
When the policy has been applied to an interface, please unbind the interface from the policy before modifying the policy configuration.
Run command **no service-policy** *policy\_map\_name* to unbind the policy.

**\[Use Cases]**

```plaintext
sonic(config)# interface ethernet 0/0
sonic(config-if-0/0)# service-policy test1
```

# <font color="#1d50a2">Queue</font>

## <font color="#1d50a2">Queue View</font>

<font color="#1d05a2">Table 7 Queue View</font>

| **Command**                                  | **Purpose**             |
| -------------------------------------------- | ----------------------- |
| **show counters queue** \[*interface\_name*] | Display queue counters. |
| **clear counters queue**                     | Clear queue counters.   |

### <font color="#1d50a2">show counters queue \[*interface\_name*\]</font>

**\[Command]**
**show counters queue** \[*interface\_name*]

**\[Purpose]**
Display queue counters.

**\[Parameters]**

| **Parameter**     | **Description**         |
| ----------------- | ----------------------- |
| *interface\_name* | Interface name (eg.0/1) |

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# show counters queue 0/0
The poll time of QUEUES COUNTERS is  2000.0 ms, update time of queue rates is  4000.0 ms
     Port    TxQ    Counter/pkts    Counter/bytes    Drop/pkts    Drop/bytes    CounterRate/pkts    CounterRate/bytes    DropRate/pkts    DropRate/bytes    Occupancy/bytes    SharedOccupancy/bytes
---------  -----  --------------  ---------------  -----------  ------------  ------------------  -------------------  ---------------  ----------------  -----------------  -----------------------
      0/0    UC0               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC1               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC2               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC3               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC4               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC5               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC6               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
      0/0    UC7               0                0            0             0              0.00/s             0.00 B/s           0.00/s          0.00 B/s                  0                        0
```

### <font color="#1d50a2">clear counters queue</font>

**\[Command]**
**clear counters queue**

**\[Purpose]**
Clear queue counters.

**\[View]**
Privileged User View

**\[Use Cases]**

```plaintext
sonic# clear counters queue
```

