The reason for these output queue drops is that there were several congestions earlier on the output queue.
The default queueing strategy for Gig interfaces is FIFO, which means First In First Out.
Output queue 0/40 means that the FIFO queue size is 40 packets (40 packets can be stored in the FIFO queue). If there is congestion and more than 40 packets try to go out of interface Gig2/0/1, then the packets above 40 cannot be stored as there is no memory allocated for them.
Depending on your traffic patterns there can be several solutions to this.
One solution may be to increase the FIFO queue size using the hold-queue x interface config command, where x is the number of packets. But this cannot always solve the problem.
Another solution could be to use some other queuing strategy like Weighted Round Robin with priority queueing.
You should look at QoS possibilities in the product documentation of your switch on cisco.com.
Introduction: The "external-out enable" command is available for
configuration under the "router ospf process" in case of the IOS-XR
operating system. This command basically enables advertisement of
intra-area routes on the device as external routes in th...
Introduction Basic configuration for netflow Scale parameters for
netflow Netflow support Architecture Packet flow for netflow Inside the
LC CPU Netflow Cache size, maintenance and memory Sample usage Cache
Size Aging Permanent cache Characteristics Which...