intel / iotg_tsn_ref_sw

IOTG Time-Sensitive Networking Reference Software
BSD 3-Clause "New" or "Revised" License
141 stars 68 forks source link

Add a parameter to specify the socket priority to txrx-tsn #30

Open xtor opened 1 year ago

xtor commented 1 year ago

The vlan-prio command line option is used to specify the PCP value and the socket priority:

    {"vlan-prio",   'q',    "NUM",  0, "packet vlan priority, also socket priority\n"
                       "    Def: 0 | Min: 0 | Max: 7"},

The value supplied, between 0 and 7, is then used to:

    case 'q':
        len = strlen(arg);
        res = strtol((const char *)arg, &str_end, 10);
        if (errno || res < 0 || res >= 7 || str_end != &arg[len])
            exit_with_error("Invalid queue number/socket priority. Check --help");
        opt->socket_prio = (uint32_t)res;
#ifdef WITH_XDP
        opt->x_opt.queue = opt->socket_prio;
#endif
        opt->vlan_prio = opt->socket_prio * 32;
        break;

Implementation suggestion

The implementation would require to parse a new option for 'socket-prio'. The behavior would be as follows:

@AzuraTarmiziIntel could you please provide some guidance about how to proceed with this usage of socket_prio?