You need to configure traffic classification before configuring traffic class-based QoS. The traffic classification can be configured based on ACL, IP precedence, protocol type, MAC address, protocol address, and so on.
If traffic is classed on the basis of Layer 3 or Layer 4 information, traffic policies can be applied to only Layer 3 interface.
If traffic is classed on the basis of Layer 2 information, the key word link-layer must be specified in the command line when a traffic policy is applied.