Skip to content

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

@xtor

Description

@xtor

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:

  • Set the socket prio
  • Set the XDP queue to be used
  • Set the PCP value
	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:

  • AF_PACKET (socket mode afpkt parameter)

    • Only vlan-prio is provided: same behavior as of now, to keep backwards compatibility.
    • Only socket-prio is provided
      • Check that the value is in the 0 to 15 range
      • Initialize opt->socket_prio to the value provided for the parameter
      • Leave opt->vlan_prio with the default value
    • Both are provided: vlan-prio is configured first as when only vlan-prio is provided. Then, on top of it, apply the socket-prio configuration as above: check that the value is in the 0-15 range, and then initialize opt->socket_prio to the value provided for the parameter. opt->vlan_prio remains with the value provided for the vlan-prio parameter.
  • AF_XDP (socket mode afxdp parameter)

    • Only vlan-prio is provided: same behavior as of now, to keep backwards compatibility.
    • Only socket-prio is provided: raise an error and inform that AF_XDP sockets do not implement a socket priority
    • Both are provided: raise an error and inform that AF_XDP sockets do not implement a socket priority

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions