85 "Syntax: example_cos \n\r"
87 "Paramaters: None. \n\r"
89 "Example: The following command is used to test the CoS functionality \n\r"
93 "Usage Guidelines: None. \n\r";
96 #define DEFAULT_UNIT 0
97 #define DEFAULT_VLAN 1
126 printf(
"Error, opennsl_multicast_create, flags $flags mc_group_id $mc_group_id \n");
130 printf(
"Created mc_group %d \n", *mc_group_id);
150 for (i=0;i<nof_mc_entries;i++)
158 printf(
"Error, opennsl_multicast_egress_add: port %d encap_id: %d \n", ports[i], cud[i]);
168 printf(
"Error, opennsl_multicast_ingress_add: port %d encap_id: %d \n", ports[i], cud[i]);
190 printf(
"Error, multicast__open_mc_group, extra_flags $extra_flags mc_group $mc_group_id \n");
194 for(i=0;i<num_of_ports;i++)
200 printf(
"Error, opennsl_cosq_gport_handle_get, gport_type $gport_type \n");
207 printf(
"Error, multicast__add_multicast_entry, mc_group_id $mc_group_id dest_gport $gport_info.out_gport \n");
226 int min_kbits_rate = 0;
237 printf(
"Error, in handle get, gport_type $gport_type \n");
245 printf(
"Error, in bandwidth set, out_gport $out_gport max_kbits_sec $max_kbits_sec \n");
275 printf(
"Error, in handle get, gport_type $gport_type \n");
293 printf(
"Error, in SP set, out_gport $out_gport queue $queue sp_type $sp_type \n");
328 printf(
"Error, in handle get, gport_type $gport_type \n");
340 printf(
"Error, in weight set, out_gport $out_gport queue $queue weight $weight \n");
400 printf(
"Error, in handle get, gport_type $gport_type \n");
410 printf(
"Error, in uc queue mapping, out_gport $out_gport incoming_tc $incoming_tc incoming_dp $incoming_dp queue $queue \n");
439 printf(
"Error, in handle get, gport_type $gport_type \n");
450 &multicast_egress_mapping );
454 printf(
"Error, in mc queue mapping, out_gport $out_gport incoming_tc $incoming_tc incoming_dp $incoming_dp queue $queue \n");
477 l2_addr.
port = dest_gport;
488 printf(
"Error, in example_setup_mac_forwarding, dest_type $dest_type dest_id $dest_id \n");
509 printf(
"Starting Egress Transmit Application\n");
513 printf(
"opennsl_stk_my_modid_get failed $rv\n");
518 printf(
"Setting up Multicast Groups.\n");
519 int mc_group_id = 5005;
533 printf(
"Setting up MAC Forwarding for PP Ports.\n");
536 incoming_mac_uc[5] = 0x1;
537 int incoming_vlan_uc = 1;
538 incoming_mac_mc[5] = 0x2;
539 int incoming_vlan_mc = 1;
548 printf(
"Setting Port Bandwidth.\n");
549 int max_bandwidth = 5000000;
554 printf(
"Setting Weight for low priority queues.\n");
563 printf(
"Setting Strict Priority for high priority queues.\n");
568 printf(
"Setting UC queue mapping.\n");
569 for (tc=0; tc <= 3 ; tc++)
571 for(dp = 0; dp <=3; dp++ )
579 for (tc=4; tc <= 7 ; tc++)
581 for(dp = 0; dp <=3; dp++ )
590 printf(
"Setting MC queue mapping.\n");
591 for (tc=0; tc <= 5 ; tc++)
593 for(dp = 0; dp <=3; dp++ )
601 for (tc=6; tc <= 7 ; tc++)
603 for(dp = 0; dp <=3; dp++ )
611 printf(
"Engress Transmit Application Completed Successfully.\n");
624 int main(
int argc,
char *argv[])
631 if((argc != 1) || ((argc > 1) && (strcmp(argv[1],
"--help") == 0)))
641 printf(
"\r\nFailed to initialize the system. Error: %s\r\n",
650 printf(
"\r\nFailed to apply default config on ports, rc = %d (%s).\r\n",
655 printf(
"Adding ports to default vlan.\r\n");
659 printf(
"\r\nFailed to add default ports. Error: %s\r\n",
664 printf(
"\r\nUser menu: Select one of the following options\r\n");
665 printf(
"1. Apply CoS mapping to the traffic\n");
666 #ifdef INCLUDE_DIAG_SHELL
667 printf(
"9. Launch diagnostic shell\n");
669 printf(
"0. Quit the application.\r\n");
673 printf(
"Invalid option entered. Please re-enter.\n");
680 printf(
"Enter the egress port number(belonging to core-0):\n");
683 printf(
"Invalid value entered. Please re-enter.\n");
691 printf(
"\r\nFailed to create the CoS mapping. Error: %s\r\n",
698 #ifdef INCLUDE_DIAG_SHELL
701 opennsl_driver_shell();
708 printf(
"Exiting the application.\n");