Skip to content
Tom Barbette edited this page Nov 25, 2022 · 4 revisions

FromDPDKDevice Element Documentation

NAME

FromDPDKDevice — Click element; reads packets from network device using DPDK (user-level)

SYNOPSIS

FromDPDKDevice(PORT [, QUEUE, N_QUEUES, keywords PROMISC, BURST, NDESC])

Ports: no inputs, 1 output
Processing: push
Drivers: userlevel

DESCRIPTION

Reads packets from the network device with DPDK port identifier PORT.

On the contrary to FromDevice.u which acts as a sniffer by default, packets received by devices put in DPDK mode will NOT be received by the kernel, and will thus be processed only once.

To use RSS (Receive Side Scaling) to receive packets from the same device on multiple queues (possibly pinned to different Click threads), simply use multiple FromDPDKDevice with the same PORT argument. Each FromDPDKDevice will open a different RX queue attached to the same port, and packets will be dispatched among the FromDPDKDevice elements that you can pin to different thread using StaticThreadSched.

Arguments:

  • PORT — Integer or PCI address. Port identifier of the device or a PCI address in the format fffff:ff:ff.f
  • QUEUE — Integer. A specific hardware queue to use. Default is 0.
  • N_QUEUES — Integer. Number of hardware queues to use. -1 or default is to use as many queues as threads assigned to this element.
  • PROMISC — Boolean. FromDPDKDevice puts the device in promiscuous mode if PROMISC is true. The default is false.
  • BURST — Integer. Maximal number of packets that will be processed before rescheduling. The default is 32.
  • MAXTHREADS — Integer. Maximal number of threads that this element will take to read packets from the input queue. If unset (or negative) all threads not pinned with a ThreadScheduler element will be shared among FromDPDKDevice elements and other input elements supporting multiqueue (extending QueueDevice)
  • THREADOFFSET — Integer. Specify which Click thread will handle this element. If multiple j threads are used, threads with id THREADOFFSET+j will be used. Default is to share the threads available on the device's NUMA node equally.
  • NDESC — Integer. Number of descriptors per ring. The default is 256.
  • MAC — Colon-separated string. The device's MAC address.
  • MTU — Integer. The maximum transfer unit of the device.
  • MODE — String. The device's Rx mode. Can be none, rss, vmdq, vmdq_rss, vmdq_dcb, vmdq_dcb_rss. For DPDK version >= 20.02, 'flow' is also supported (DPDK's Flow API) if FastClick was built with --enable-flow-api.
  • FLOW_RULES_FILE — String. For DPDK version >= 20.02, FastClick was built with --enable-flow-api, and if MODE is set to flow, a path to a file with Flow Rule Manager rules can be supplied to the device. These rules are installed in the NIC using DPDK's flow API.
  • FLOW_ISOLATE — Boolean. Requires MODE flow. Isolated mode guarantees that all ingress traffic comes from defined flow rules only (current and future). If ingress traffic does not match any of the defined rules, it will be discarded by the NIC. Defaults to false.
  • VF_POOLS — Integer. The number of virtual function pools to be used by VMDq.
  • VF_VLAN — Vector of Integers. Contains the VLAN tags to be used for dispatching input traffic using VLAN-based VMDq.
  • PAUSE — String. Set the device pause mode. "full" to enable pause frame for both RX and TX, "rx" or "tx" to set one of them, and "none" to disable pause frames. Do not set or choose "unset" to keep device current state/default.
  • ALLOW_NONEXISTENT — Boolean. Do not fail if the PORT does not exist. If it's the case the task will never run and this element will behave like Idle.
  • RSS_AGGREGATE — Boolean. If True, sets the RSS hash into the aggregate annotation field of each packet. Defaults to False.
  • PAINT_QUEUE — Boolean. If True, sets the hardware queue number into the paint annotation field of each packet. Defaults to False.
  • NUMA — Boolean. If True, allocates CPU cores in a NUMA-aware fashion.
  • NUMA_NODE — Integer. Specify the NUMA node to undertake packet processing.
  • RX_INTR — Integer. Enables Rx interrupts if non-negative value is given. Defaults to -1 (no interrupts).
  • SCALE — String. Defines the scaling policy. Can be parallel or share. Scaling is disabled by default.
  • TIMESTAMP — Boolean. Enables hardware timestamping. Defaults to false.
  • VLAN_FILTER — Boolean. Per queue ability to filter received VLAN packets by the hardware. Defaults to false.
  • VLAN_STRIP — Boolean. Per queue ability to strip VLAN header by the hardware in received VLAN packets. Defaults to false.
  • VLAN_EXTEND — Boolean. Per queue ability to extend VLAN tagged packets via QinQ. Defaults to false.
  • LRO — Boolean. Enables hardware-based Large Receive Offloading (LRO). When set to true, the NIC coalesces consecutive frames of the same flow into larger frames. Defaults to false.
  • JUMBO — Boolean. Enables the reception of Jumbo frames by the hardware. Defaults to false.
  • ACTIVE — Boolean. If False, the device is only initialized. Use this when you want to read packet using secondary DPDK applications.
  • VERBOSE — Boolean. If True, more detailed messages about the device are printed to the stdout. Defaults to False.

This element is only available at user level, when compiled with DPDK support.

EXAMPLES

  FromDPDKDevice(3, QUEUE 1) -> ...

ELEMENT HANDLERS

  • device (read-only) — Returns the device number.

  • duplex (read-only) — Returns whether link is duplex (1) or not (0) for an active link (status is up).

  • autoneg (read-only) — Returns whether device supports auto negotiation.

  • speed (read-only) — Returns the device's link speed in Mbps.

  • carrier (read-only) — Returns the device's link status (1 for link up, otherwise 0).

  • type (read-only) — Returns the device's link type (only fiber is currently supported).

  • xstats (read-only) — Returns a device's detailed packet and byte counters. If a parameter is given, only the matching counter will be returned.

  • queue_count (read-only) — Returns the number of used descriptors of a specific Rx queue. If no queue is specified, all queues' used descriptors are returned.

  • queue_packets (read-only) — Returns the number of packets of a specific Rx queue. If no queue is specified, all queues' packets are returned.

  • queue_bytes (read-only) — Returns the number of bytes of a specific Rx queue. If no queue is specified, all queues' bytes are returned.

  • rule_packet_hits (read-only) — Returns the number of packets matched by a specific rule. If no rule number is specified, an error is returned (aggregate statistics not supported).

  • rule_byte_count (read-only) — Returns the number of bytes matched by a specific rule. If no rule number is specified, an error is returned (aggregate statistics not supported).

  • rules_aggr_stats (read-only) — Returns aggregate rule statistics.

  • active (read-only) — Returns the status of the device (1 for active, otherwise 0).

  • active/safe_active (write-only) — Sets the status of the device (1 for active, otherwise 0).

  • count (read-only) — Returns the number of packets read by the device.

  • reset_counts (write-only) — Resets "count" to zero.

  • reset_load (write-only) — Resets load counters to zero.

  • nb_rx_queues (read-only) — Returns the number of Rx queues of this device.

  • nb_tx_queues (read-only) — Returns the number of Tx queues of this device.

  • nb_vf_pools (read-only) — Returns the number of Virtual Function pools of this device.

  • nb_rx_desc (read-only) — Returns the number of Rx descriptors of this device.

  • mac (read-only) — Returns the Ethernet address of this device.

  • vendor (read-only) — Returns the vendor of this device.

  • driver (read-only) — Returns the driver of this device.

  • add_mac (write-only) — Sets the Ethernet address of this device.

  • remove_mac (write-only) — Removes the Ethernet address of this device.

  • vf_mac_addr (read-only) — Returns the Ethernet addresses of the Virtual Functions of this device. If JSON is supported, the return format is JSON, otherwise a string is returned.

  • max_rss (write-only) — Reconfigures the size of the RSS table.

  • hw_count (read-only) — Returns the number of packets received by this device, as computed by the hardware.

  • hw_bytes (read-only) — Returns the number of bytes received by this device, as computed by the hardware.

  • hw_dropped (read-only) — Returns the number of packets dropped by this device, as computed by the hardware.

  • hw_errors (read-only) — Returns the number of errors of this device, as computed by the hardware.

  • nombufs (read-only) — Returns the total number of RX mbuf allocation failures.

  • rule_add (write-only) — Inserts a new rule into this device's rule table. The format of the rule must comply with testpmd. If so, the rule is translated into DPDK's Flow API format. For example: rule_add ingress pattern eth / ipv4 src is 192.168.100.7 dst is 192.168.1.7 / udp src is 53 / end actions queue index 3 / count / end A rule could be optionally prepended with the pattern 'flow create X' (where X is the correct port number), otherwise this pattern will be automatically prepended. Upon success, the ID of the added rule is returned, otherwise an error is returned.

  • rules_del (write-only) — Deletes a (set of) rule(s) from this device's rule table. Rule numbers to be deleted are specified as a space-separated list (e.g., rules_del 0 1 2). Upon success, the number of deleted flow rules is returned, otherwise an error is returned.

  • rules_isolate (write-only) — Enables/Disables Flow Rule Manager's isolation mode. Isolated mode guarantees that all ingress traffic comes from defined flow rules only (current and future). Usage:

      'rules_isolate 0' disables isolation.
      'rules_isolate 1' enables isolation.
    
  • rules_flush (write-only) — Deletes all of the rules from this device's rule table. Upon success, the number of deleted flow rules is returned.

  • rules_ids_global (read-only) — Returns a string of space-separated global rule IDs that correspond to the rules being installed.

  • rules_ids_internal (read-only) — Returns a string of space-separated internal rule IDs that correspond to the rules being installed.

  • rules_list (read-only) — Returns the list of flow rules being installed along with statistics per rule.

  • rules_list_with_hits (read-only) — Returns the list of flow rules being installed that exhibit at least one hit. This list is a subset of the list returned by rules_list handler.

  • rules_count (read-only) — Returns the number of flow rules being installed.

SEE ALSO

DPDKInfo, ToDPDKDevice

Generated by click-elem2man from ../elements/userlevel/fromdpdkdevice.hh:13 on 2022/11/25.

Clone this wiki locally