Interface interrupts configuration

Overview

Query and change the SMP affinity of the interrupts of a network interface. More…

// global functions

te_errno tapi_cfg_irq_affinity_get(const char* ta, const char* if_name, unsigned int irq, char** cpu_list);
te_errno tapi_cfg_irq_affinity_set(const char* ta, const char* if_name, unsigned int irq, const char* cpu_list);
te_errno tapi_cfg_irq_affinity_set_all(const char* ta, const char* if_name, const char* cpu_list);
te_errno tapi_cfg_irq_affinity_mask_get(const char* ta, const char* if_name, unsigned int irq, uint64_t* mask);
te_errno tapi_cfg_irq_affinity_mask_set(const char* ta, const char* if_name, unsigned int irq, uint64_t mask);
te_errno tapi_cfg_irq_affinity_mask_set_all(const char* ta, const char* if_name, uint64_t mask);

Detailed Documentation

Query and change the SMP affinity of the interrupts of a network interface.

Affinity is expressed in two interchangeable ways:

  • as a CPU list in the Linux kernel syntax, e.g. "0-3,8", which places no limit on the number of CPUs;

  • as a 64-bit mask, which is easier to compute in a test but cannot address CPUs numbered 64 and above.

Global Functions

te_errno tapi_cfg_irq_affinity_get(const char* ta, const char* if_name, unsigned int irq, char** cpu_list)

Get the affinity of a single IRQ as a CPU list.

Parameters:

ta

Test agent name.

if_name

Interface name.

irq

IRQ number.

cpu_list

CPU list in the Linux kernel syntax, e.g. "0-3,8". The caller owns the string and should free() it.

Returns:

Status code.

te_errno tapi_cfg_irq_affinity_set(const char* ta, const char* if_name, unsigned int irq, const char* cpu_list)

Set the affinity of a single IRQ from a CPU list.

Parameters:

ta

Test agent name.

if_name

Interface name.

irq

IRQ number.

cpu_list

CPU list in the Linux kernel syntax, e.g. "0-3,8". Must not be empty.

Returns:

Status code.

te_errno tapi_cfg_irq_affinity_set_all(const char* ta, const char* if_name, const char* cpu_list)

Set the affinity of every IRQ of an interface from a CPU list.

Parameters:

ta

Test agent name.

if_name

Interface name.

cpu_list

CPU list in the Linux kernel syntax, e.g. "0-3,8". Must not be empty.

Returns:

Status code.

te_errno tapi_cfg_irq_affinity_mask_get(const char* ta, const char* if_name, unsigned int irq, uint64_t* mask)

Get the affinity of a single IRQ as a 64-bit mask.

Parameters:

ta

Test agent name.

if_name

Interface name.

irq

IRQ number.

mask

Affinity mask, bit N set iff CPU N may handle the interrupt.

TE_ERANGE

The IRQ is allowed on a CPU numbered 64 or above, so the affinity does not fit into a 64-bit mask. Use tapi_cfg_irq_affinity_get() instead.

Returns:

Status code.

te_errno tapi_cfg_irq_affinity_mask_set(const char* ta, const char* if_name, unsigned int irq, uint64_t mask)

Set the affinity of a single IRQ from a 64-bit mask.

Parameters:

ta

Test agent name.

if_name

Interface name.

irq

IRQ number.

mask

Affinity mask, bit N set iff CPU N may handle the interrupt. Must not be zero.

Returns:

Status code.

te_errno tapi_cfg_irq_affinity_mask_set_all(const char* ta, const char* if_name, uint64_t mask)

Set the affinity of every IRQ of an interface from a 64-bit mask.

Parameters:

ta

Test agent name.

if_name

Interface name.

mask

Affinity mask, bit N set iff CPU N may handle the interrupt. Must not be zero.

Returns:

Status code.