Class: Nl::Linux::Netdev

Inherits:
Genl::Family show all
Defined in:
nl-linux/generated/nl/linux/netdev.rb

Overview

netdev configuration over generic netlink.

Defined Under Namespace

Modules: AttributeSets, Enums, Flags, Messages, Notifications, Structs Classes: AsyncOperations

Constant Summary collapse

NAME =
"netdev"
VERSION =
1

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Genl::Family

version

Class Method Details

.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ Netdev .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) {|family| ... } ⇒ Object

Overloads:

  • .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) ⇒ Netdev

    Parameters:

    • resolver (#call) (defaults to: ::Nl::Linux::DEFAULT_RESOLVER)
    • executor (Symbol, nil) (defaults to: nil)
    • notification_capacity (Integer, nil) (defaults to: DEFAULT_NOTIFICATION_CAPACITY)

    Returns:

  • .open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY) {|family| ... } ⇒ Object

    Returns the result of the block.

    Parameters:

    • resolver (#call) (defaults to: ::Nl::Linux::DEFAULT_RESOLVER)
    • executor (Symbol, nil) (defaults to: nil)
    • notification_capacity (Integer, nil) (defaults to: DEFAULT_NOTIFICATION_CAPACITY)

    Yield Parameters:

    Returns:

    • (Object) —

      the result of the block



26
27
28
# File 'nl-linux/generated/nl/linux/netdev.rb', line 26

def self.open(resolver: ::Nl::Linux::DEFAULT_RESOLVER, executor: nil, notification_capacity: DEFAULT_NOTIFICATION_CAPACITY)
  super
end

Instance Method Details

#async(stream_capacity: nil) ⇒ AsyncOperations

Returns the asynchronous operation facade for this family.

Parameters:

  • stream_capacity (::Integer, nil) (defaults to: nil)

Returns:



3420
3421
3422
3423
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3420

def async(stream_capacity: nil)
  return @async_operations ||= build_async_facade(AsyncOperations) if stream_capacity.nil?
  build_async_facade(AsyncOperations, stream_capacity:)
end

#do_bind_rx(**args) ⇒ Messages::DoBindRxReply

Bind dmabuf to netdev

Requires CAP_NET_ADMIN in the user namespace owning the network namespace.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifindex (Integer) —

    netdev ifindex to bind the dmabuf to.

  • queues (Array<AttributeSets::QueueId, Hash<Symbol, Object>>) —

    receive queues to bind the dmabuf to.

  • fd (Integer) —

    dmabuf file descriptor to bind.

Returns:

See Also:



3183
3184
3185
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3183

def do_bind_rx(**args)
  exchange_message(:"do", Messages::DoBindRxRequest, Messages::DoBindRxReply, args)
end

#do_bind_tx(**args) ⇒ Messages::DoBindTxReply

Bind dmabuf to netdev for TX

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifindex (Integer) —

    netdev ifindex to bind the dmabuf to.

  • fd (Integer) —

    dmabuf file descriptor to bind.

Returns:

See Also:



3210
3211
3212
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3210

def do_bind_tx(**args)
  exchange_message(:"do", Messages::DoBindTxRequest, Messages::DoBindTxReply, args)
end

#do_dev_get(**args) ⇒ Messages::DoDevGetReply

Get / dump information about a netdev.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifindex (Integer) —

    netdev ifindex

Returns:

See Also:



3002
3003
3004
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3002

def do_dev_get(**args)
  exchange_message(:"do", Messages::DoDevGetRequest, Messages::DoDevGetReply, args)
end

#do_napi_get(**args) ⇒ Messages::DoNapiGetReply

Get information about NAPI instances configured on the system.

Parameters:

  • args (Hash)

Options Hash (**args):

  • id (Integer) —

    ID of the NAPI instance.

Returns:

See Also:



3124
3125
3126
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3124

def do_napi_get(**args)
  exchange_message(:"do", Messages::DoNapiGetRequest, Messages::DoNapiGetReply, args)
end

#do_napi_set(**args) ⇒ void

This method returns an undefined value.

Set configurable NAPI instance settings.

Requires CAP_NET_ADMIN in the initial user namespace.

Parameters:

  • args (Hash)

Options Hash (**args):

  • id (Integer) —

    ID of the NAPI instance.

  • defer_hard_irqs (Integer) —

    The number of consecutive empty polls before IRQ deferral ends and hardware IRQs are re-enabled.

  • gro_flush_timeout (Integer) —

    The timeout, in nanoseconds, of when to trigger the NAPI watchdog timer which schedules NAPI processing. Additionally, a non-zero value will also prevent GRO from flushing recent super-frames at the end of a NAPI cycle. This may add receive latency in exchange for reducing the number of frames processed by the network stack.

  • irq_suspend_timeout (Integer) —

    The timeout, in nanoseconds, of how long to suspend irq processing, if event polling finds events

  • threaded (Integer) —

    Whether the NAPI is configured to operate in threaded polling mode. If this is set to enabled then the NAPI context operates in threaded polling mode. If this is set to busy-poll, then the threaded polling mode also busy polls.

    Known enum values are defined in Nl::Linux::Netdev::Enums::NapiThreaded.

See Also:



3200
3201
3202
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3200

def do_napi_set(**args)
  exchange_message(:"do", Messages::DoNapiSetRequest, nil, args)
end

#do_page_pool_get(**args) ⇒ Messages::DoPagePoolGetReply

Get / dump information about Page Pools. Only Page Pools associated by the driver with a net_device can be listed. ifindex will not be reported if the net_device no longer exists.

Parameters:

  • args (Hash)

Options Hash (**args):

  • id (Integer) —

    Unique ID of a Page Pool instance.

Returns:

See Also:



3030
3031
3032
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3030

def do_page_pool_get(**args)
  exchange_message(:"do", Messages::DoPagePoolGetRequest, Messages::DoPagePoolGetReply, args)
end

#do_page_pool_stats_get(**args) ⇒ Messages::DoPagePoolStatsGetReply

Get page pool statistics.

Parameters:

  • args (Hash)

Options Hash (**args):

Returns:

See Also:



3066
3067
3068
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3066

def do_page_pool_stats_get(**args)
  exchange_message(:"do", Messages::DoPagePoolStatsGetRequest, Messages::DoPagePoolStatsGetReply, args)
end

#do_queue_create(**args) ⇒ Messages::DoQueueCreateReply

Create a new queue for the given netdevice. Whether this operation is supported depends on the device and the driver.

Requires CAP_NET_ADMIN in the initial user namespace.

Parameters:

  • args (Hash)

Options Hash (**args):

  • ifindex (Integer) —

    ifindex of the netdevice to which the queue belongs.

  • type (Integer) —

    Queue type as rx, tx. Each queue type defines a separate ID space. XDP TX queues allocated in the kernel are not linked to NAPIs and thus not listed. AF_XDP queues will have more information set in the xsk attribute.

    Known enum values are defined in Nl::Linux::Netdev::Enums::QueueType.

  • lease (AttributeSets::Lease, Hash<Symbol, Object>) —

    A queue from a virtual device can have a lease which refers to another queue from a physical device. This is useful for memory providers and AF_XDP operations which take an ifindex and queue id to allow applications to bind against virtual devices in containers.

Returns:

See Also:



3230
3231
3232
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3230

def do_queue_create(**args)
  exchange_message(:"do", Messages::DoQueueCreateRequest, Messages::DoQueueCreateReply, args)
end

#do_queue_get(**args) ⇒ Messages::DoQueueGetReply

Get queue information from the kernel. Only configured queues will be reported (as opposed to all available hardware queues).

Parameters:

  • args (Hash)

Options Hash (**args):

  • id (Integer) —

    Queue index; most queue types are indexed like a C array, with indexes starting at 0 and ending at queue count - 1. Queue indexes are scoped to an interface and queue type.

  • ifindex (Integer) —

    ifindex of the netdevice to which the queue belongs.

  • type (Integer) —

    Queue type as rx, tx. Each queue type defines a separate ID space. XDP TX queues allocated in the kernel are not linked to NAPIs and thus not listed. AF_XDP queues will have more information set in the xsk attribute.

    Known enum values are defined in Nl::Linux::Netdev::Enums::QueueType.

Returns:

See Also:



3097
3098
3099
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3097

def do_queue_get(**args)
  exchange_message(:"do", Messages::DoQueueGetRequest, Messages::DoQueueGetReply, args)
end

#dump_dev_get(**args) ⇒ Array<Messages::DumpDevGetReply> #dump_dev_get(**args) {|reply| ... } ⇒ void

Get / dump information about a netdev.

Overloads:

See Also:



3018
3019
3020
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3018

def dump_dev_get(**args, &block)
  exchange_message(:"dump", Messages::DumpDevGetRequest, Messages::DumpDevGetReply, args, &block)
end

#dump_napi_get(**args) ⇒ Array<Messages::DumpNapiGetReply> #dump_napi_get(**args) {|reply| ... } ⇒ void

Get information about NAPI instances configured on the system.

Overloads:

  • #dump_napi_get(**args) ⇒ Array<Messages::DumpNapiGetReply>

    Returns an array when no block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdevice to which NAPI instance belongs.

    Returns:

  • #dump_napi_get(**args) {|reply| ... } ⇒ void

    This method returns an undefined value.

    Yields each reply when a block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdevice to which NAPI instance belongs.

    Yield Parameters:

See Also:



3142
3143
3144
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3142

def dump_napi_get(**args, &block)
  exchange_message(:"dump", Messages::DumpNapiGetRequest, Messages::DumpNapiGetReply, args, &block)
end

#dump_page_pool_get(**args) ⇒ Array<Messages::DumpPagePoolGetReply> #dump_page_pool_get(**args) {|reply| ... } ⇒ void

Get / dump information about Page Pools. Only Page Pools associated by the driver with a net_device can be listed. ifindex will not be reported if the net_device no longer exists.

Overloads:

  • #dump_page_pool_get(**args) ⇒ Array<Messages::DumpPagePoolGetReply>

    Returns an array when no block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdev to which the pool belongs. May not be reported if the page pool was allocated for a netdev which got destroyed already (page pools may outlast their netdevs because they wait for all memory to be returned).

    Returns:

  • #dump_page_pool_get(**args) {|reply| ... } ⇒ void

    This method returns an undefined value.

    Yields each reply when a block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdev to which the pool belongs. May not be reported if the page pool was allocated for a netdev which got destroyed already (page pools may outlast their netdevs because they wait for all memory to be returned).

    Yield Parameters:

See Also:



3057
3058
3059
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3057

def dump_page_pool_get(**args, &block)
  exchange_message(:"dump", Messages::DumpPagePoolGetRequest, Messages::DumpPagePoolGetReply, args, &block)
end

#dump_page_pool_stats_get(**args) ⇒ Array<Messages::DumpPagePoolStatsGetReply> #dump_page_pool_stats_get(**args) {|reply| ... } ⇒ void

Get page pool statistics.

Overloads:

See Also:



3084
3085
3086
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3084

def dump_page_pool_stats_get(**args, &block)
  exchange_message(:"dump", Messages::DumpPagePoolStatsGetRequest, Messages::DumpPagePoolStatsGetReply, args, &block)
end

#dump_qstats_get(**args) ⇒ Array<Messages::DumpQstatsGetReply> #dump_qstats_get(**args) {|reply| ... } ⇒ void

Get / dump fine grained statistics. Which statistics are reported depends on the device and the driver, and whether the driver stores software counters per-queue.

Overloads:

  • #dump_qstats_get(**args) ⇒ Array<Messages::DumpQstatsGetReply>

    Returns an array when no block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdevice to which stats belong.

    • scope (Integer) —

      What object type should be used to iterate over the stats.

      Known flags are defined in Nl::Linux::Netdev::Flags::QstatsScope.

    Returns:

  • #dump_qstats_get(**args) {|reply| ... } ⇒ void

    This method returns an undefined value.

    Yields each reply when a block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdevice to which stats belong.

    • scope (Integer) —

      What object type should be used to iterate over the stats.

      Known flags are defined in Nl::Linux::Netdev::Flags::QstatsScope.

    Yield Parameters:

See Also:



3170
3171
3172
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3170

def dump_qstats_get(**args, &block)
  exchange_message(:"dump", Messages::DumpQstatsGetRequest, Messages::DumpQstatsGetReply, args, &block)
end

#dump_queue_get(**args) ⇒ Array<Messages::DumpQueueGetReply> #dump_queue_get(**args) {|reply| ... } ⇒ void

Get queue information from the kernel. Only configured queues will be reported (as opposed to all available hardware queues).

Overloads:

  • #dump_queue_get(**args) ⇒ Array<Messages::DumpQueueGetReply>

    Returns an array when no block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdevice to which the queue belongs.

    Returns:

  • #dump_queue_get(**args) {|reply| ... } ⇒ void

    This method returns an undefined value.

    Yields each reply when a block is given.

    Parameters:

    • args (Hash)

    Options Hash (**args):

    • ifindex (Integer) —

      ifindex of the netdevice to which the queue belongs.

    Yield Parameters:

See Also:



3115
3116
3117
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3115

def dump_queue_get(**args, &block)
  exchange_message(:"dump", Messages::DumpQueueGetRequest, Messages::DumpQueueGetReply, args, &block)
end

#subscribe(*groups) ⇒ self

Parameters:

  • groups (Array<:mgmt, :page_pool>)

Returns:

  • (self)


3427
3428
3429
3430
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3427

def subscribe(*groups) = super
# @rbs (*(:mgmt | :page_pool) groups) -> self
# @param [Array<:mgmt, :page_pool>] groups
# @return [self]

#unsubscribe(*groups) ⇒ self

Parameters:

  • groups (Array<:mgmt, :page_pool>)

Returns:

  • (self)


3431
# File 'nl-linux/generated/nl/linux/netdev.rb', line 3431

def unsubscribe(*groups) = super