- /*
- * First parse all items in the list and store their value.
- */
- value = 0;
- nb_item = 0;
- value_ok = 0;
- for (i = 0; i < strlen(str); i++) {
- c = str[i];
- if ((c >= '0') && (c <= '9')) {
- value = (unsigned int) (value * 10 + (c - '0'));
- value_ok = 1;
- continue;
- }
- if (c != ',') {
- printf("character %c is not a decimal digit\n", c);
- return (0);
- }
- if (! value_ok) {
- printf("No valid value before comma\n");
- return (0);
- }
- if (nb_item < max_items) {
- parsed_items[nb_item] = value;
- value_ok = 0;
- value = 0;
- }
- nb_item++;
+ if (!strcmp(optarg, "unknown"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_UNKNOWN;
+ else if (!strcmp(optarg, "intr_lsc"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_LSC;
+ else if (!strcmp(optarg, "queue_state"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_QUEUE_STATE;
+ else if (!strcmp(optarg, "intr_reset"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_RESET;
+ else if (!strcmp(optarg, "vf_mbox"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_VF_MBOX;
+ else if (!strcmp(optarg, "macsec"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_MACSEC;
+ else if (!strcmp(optarg, "intr_rmv"))
+ mask = UINT32_C(1) << RTE_ETH_EVENT_INTR_RMV;
+ else if (!strcmp(optarg, "all"))
+ mask = ~UINT32_C(0);
+ else {
+ fprintf(stderr, "Invalid event: %s\n", optarg);
+ return -1;