| Age | Commit message (Collapse) | Author |
|
With functions that return a data structure, the application must
check the return value since the data structure contents will
be undefined in case of error.
Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Morten Brørup <[email protected]>
|
|
The mac compare must check return value from rte_eth_dev_info_get
before using the dev_info information.
Signed-off-by: Stephen Hemminger <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Morten Brørup <[email protected]>
|
|
Some ethdev symbols were put out of extern "C" {} and became unavailable
when linking with C++ objects.
Fixes: 719834a6849e ("use C linkage where appropriate in headers")
Reported-by: John Miller <[email protected]>
Signed-off-by: David Marchand <[email protected]>
Acked-by: Morten Brørup <[email protected]>
Acked-by: Andrew Rybchenko <[email protected]>
|
|
Update rte_flow_tunnel, rte_flow_action_set_ipv6,
rte_flow_item_icmp6_nd_na and rte_flow_item_icmp6_nd_ns to use
rte_ipv6_addr structures instead of uint8_t[16] arrays.
Signed-off-by: Robin Jarry <[email protected]>
|
|
The rte_ipv6_hdr uses ad-hoc uint8_t[16] arrays to represent addresses.
Replace these arrays with the newly added rte_ipv6_addr structure. Adapt
all code accordingly.
Signed-off-by: Robin Jarry <[email protected]>
|
|
Verify queue_id for rte_eth_tx_done_cleanup API.
Fixes: 44a718c457b5 ("ethdev: add API to free consumed buffers in Tx ring")
Cc: [email protected]
Signed-off-by: Chengwen Feng <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
Add function to allow querying a node in the scheduler tree. Returns
the parameters as were given to the add function. Adding this function
allows apps to just query the hierarchy rather than having to maintain
their own copies of it internally.
It is used in testpmd to print out details about previously added TM nodes.
Example output, configuring three nodes, and then printing the details:
testpmd> add port tm nonleaf node 0 100 -1 0 1 0 -1 1 0 0
testpmd> add port tm nonleaf node 0 90 100 0 1 1 -1 1 0 0
testpmd> add port tm leaf node 0 0 90 0 1 2 -1 0 0xffffffff 0 0
testpmd>
testpmd> show port tm node 0 100
Port 0 TM Node 100
Parent Node ID: <NULL>
Level ID: 0
Priority: 0
Weight: 0
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 90
Port 0 TM Node 90
Parent Node ID: 100
Level ID: 1
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Nonleaf Node Parameters
Num Strict Priorities: 1
WFQ Weights Mode: WFQ
testpmd> show port tm node 0 0
Port 0 TM Node 0
Parent Node ID: 90
Level ID: 2
Priority: 0
Weight: 1
Shaper Profile ID: <none>
Shared Shaper IDs: <none>
Stats Mask: 0
Leaf Node Parameters
CMAN Mode: Tail Drop
WRED Profile ID: <none>
Shared WRED Context Ids: <none>
Signed-off-by: Bruce Richardson <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Chengwen Feng <[email protected]>
|
|
This patch adds freq adjustment API for PTP high accuracy.
Signed-off-by: Simei Su <[email protected]>
Signed-off-by: Mingjin Ye <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
Use get_restore_flags() internal API introduced in previous commits
in rte_eth_dev_start(), to restore only the configuration
requested by the driver.
Signed-off-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Before this patch, ethdev layer assumed that all drivers require that
it has to forcefully restore:
- MAC addresses
- promiscuous mode setting
- all multicast mode setting
upon rte_eth_dev_start().
This patch introduces a new callback to eth_dev_ops -
get_restore_flags().
Drivers implementing this callback can explicitly enable/disable
certain parts of config restore procedure.
In order to minimize the changes to all the drivers and
preserve the current behavior, it is assumed that
if this callback is not defined, all configuration should be restored.
Signed-off-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Extract promiscuous and all multicast configuration restore
to separate functions.
This change will allow easier integration of disabling
these procedures for supporting PMDs in follow up commits.
Signed-off-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
gcc 15 experimental [1], with -Wextra flag, gives warning in variable
initialization as string [2].
The warning has a point when initialized variable is intended to use as
string, since assignment is missing the required null terminator for
this case. But warning is useless for our usecase.
In this patch only updated a few instance to show the issue, there are
many instances to fix, if we prefer to go this way.
Other option is to disable warning but it can be useful for actual
string usecases, so I prefer to keep it.
Converted string initialization to array initialization.
[1]
gcc (GCC) 15.0.0 20241003 (experimental)
[2]
../lib/ethdev/rte_flow.h:906:36:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
906 | .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/ethdev/rte_flow.h:907:36:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
907 | .hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/ethdev/rte_flow.h:1009:25:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
1009 | "\xff\xff\xff\xff\xff\xff\xff\xff"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/ethdev/rte_flow.h:1012:25:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
1012 | "\xff\xff\xff\xff\xff\xff\xff\xff"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lib/ethdev/rte_flow.h:1135:20:
error: initializer-string for array of ‘unsigned char’ is too long
[-Werror=unterminated-string-initialization]
1135 | .hdr.vni = "\xff\xff\xff",
| ^~~~~~~~~~~~~~
Signed-off-by: Ferruh Yigit <[email protected]>
Acked-by: Morten Brørup <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
Acked-by: Andrew Rybchenko <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
|
|
The function to add a new shaper profile in rte_tm should not (and does
not) modify the profile parameters passed in via struct pointer. We
should guarantee this by marking the parameter pointer as const. This
allows SW to create multiple profiles using the same parameter
struct without having to reset it each time.
Signed-off-by: Bruce Richardson <[email protected]>
Reviewed-by: Rosen Xu <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
|
|
The function to add a new profile in rte_tm should not (and does not)
modify the profile parameters passed in via struct pointer. We should
guarantee this by marking the parameter pointer as const. This allows
SW to create multiple profiles using the same parameter struct without
having to reset it each time.
Signed-off-by: Bruce Richardson <[email protected]>
Reviewed-by: Rosen Xu <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
|
|
The function to add a new scheduling node in rte_tm should not (and
does not) modify the actual node parameters passed in via struct
pointer. We should guarantee this by marking the parameter pointer as
const. This allows SW to create multiple scheduling nodes using the same
parameter struct without having to reset it each time.
Signed-off-by: Bruce Richardson <[email protected]>
Reviewed-by: Rosen Xu <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
|
|
Addressed a specific overflow issue in the eth_dev_adjust_nb_desc()
function where the uint16_t variable nb_desc would overflow when its
value was greater than (2^16 - nb_align). This overflow caused nb_desc
to incorrectly wrap around between 0 and nb_align-1, leading to the
function setting nb_desc to nb_min instead of the expected nb_max.
To give an example, let nb_desc=UINT16_MAX, nb_align=32, nb_max=4096 and
nb_min=64. RTE_ALIGN_CEIL(nb_desc, nb_align) calls
RTE_ALIGN_FLOOR(nb_desc + nb_align - 1, nb_align). This results in an
overflow of nb_desc, leading to nb_desc being set to 30 and then 0 when
the macros return. As a result of this, nb_desc is then set to nb_min
later on.
The resolution involves upcasting nb_desc to a uint32_t before the
RTE_ALIGN_CEIL macro is applied. This change ensures that the subsequent
call to RTE_ALIGN_FLOOR(nb_desc + (nb_align - 1), nb_align) does not
result in an overflow, as it would when nb_desc is a uint16_t. By using
a uint32_t for these operations, the correct behavior is maintained
without the risk of overflow.
Fixes: 0f67fc3baeb9 ("ethdev: add function to adjust number of descriptors")
Cc: [email protected]
Signed-off-by: Niall Meade <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
Update the eth_dev_ops structure with new function vectors
to get, get capabilities and set Ethernet link speed lanes.
Update the testpmd to provide required config and information
display infrastructure.
The supporting Ethernet controller driver will register callbacks
to avail link speed lanes config and get services. This lanes
configuration is applicable only when the NIC is forced to fixed
speeds. In Autonegotiation mode, the hardware automatically
negotiates the number of lanes.
These are the new commands.
testpmd> show port 0 speed_lanes capabilities
Supported speeds Valid lanes
-----------------------------------
10 Gbps 1
25 Gbps 1
40 Gbps 4
50 Gbps 1 2
100 Gbps 1 2 4
200 Gbps 2 4
400 Gbps 4 8
testpmd>
testpmd>
testpmd> port stop 0
testpmd> port config 0 speed_lanes 4
testpmd> port config 0 speed 200000 duplex full
testpmd> port start 0
testpmd>
testpmd> show port info 0
********************* Infos for port 0 *********************
MAC address: 14:23:F2:C3:BA:D2
Device name: 0000:b1:00.0
Driver name: net_bnxt
Firmware-version: 228.9.115.0
Connect to socket: 2
memory allocation on the socket: 2
Link status: up
Link speed: 200 Gbps
Active Lanes: 4
Link duplex: full-duplex
Autoneg status: Off
Signed-off-by: Damodharam Ammepalli <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
Reviewed-by: Ajit Khaparde <[email protected]>
|
|
This patch adds a telemetry command for registers dump,
and supports obtaining the registers of a specified module.
In one way, the number of registers that can be exported
is limited by the number of elements carried by dict and
container. In another way, the length of the string
exported by telemetry is limited by MAX_OUTPUT_LEN.
Therefore, when the number of registers to be exported
exceeds, some information will be lost. Warn on the former
case.
An example usage is shown below:
--> /ethdev/regs,0,ring
{
"/ethdev/regs": {
"registers_length": 318,
"registers_width": 4,
"register_offset": "0x0",
"version": "0x1140011",
"group_0": {
"Q0_ring_rx_bd_num": "0x0",
"Q0_ring_rx_bd_len": "0x0",
...
},
"group_1": {
...
},
...
}
Signed-off-by: Jie Hai <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
Acked-by: Chengwen Feng <[email protected]>
|
|
This patch adds "filter" and "names" fields to "rte_dev_reg_info"
structure. Names of registers in data fields can be reported and
the registers can be filtered by their module names.
The new API rte_eth_dev_get_reg_info_ext() is added to support
reporting names and filtering by modules. And the original API
rte_eth_dev_get_reg_info() does not use the names and filter fields.
A local variable is used in rte_eth_dev_get_reg_info for
compatibility. If the drivers does not report the names, set them
to "index_XXX", which means the location in the register table.
Signed-off-by: Jie Hai <[email protected]>
Acked-by: Huisong Li <[email protected]>
Acked-by: Chengwen Feng <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
Adds trace points for rte_flow rule insertion by index functions:
rte_flow_async_create_by_index and
rte_flow_async_create_by_index_with_pattern.
Signed-off-by: Alexander Kozyrev <[email protected]>
Acked-by: Ori Kam <[email protected]>
|
|
Introduce the RTE_FLOW_ACTION_TYPE_JUMP_TO_TABLE_INDEX action.
It redirects packets to a particular index in a flow table.
testpmd example:
flow queue 0 create 0 template_table 0 pattern_template 0
actions_template 0 postpone no pattern eth / end
actions jump_to_table_index table 0x166f9ce00 index 5 / end
Signed-off-by: Alexander Kozyrev <[email protected]>
Acked-by: Ori Kam <[email protected]>
|
|
Add a new API to enqueue flow rule creation by index with pattern.
The new template table rules insertion type,
index-based insertion with pattern, requires a new flow rule creation
function with both rule index and pattern provided.
Packets will match on the provided pattern at the provided index.
In testpmd, allow to specify both the rule index and the pattern
in the flow rule creation command line parameters.
Both are needed for rte_flow_async_create_by_index_with_pattern().
flow queue 0 create 0 template_table 2 rule_index 5
pattern_template 0 actions_template 0 postpone no pattern eth / end
actions count / queue index 1 / end
Signed-off-by: Alexander Kozyrev <[email protected]>
Acked-by: Ori Kam <[email protected]>
|
|
There are two flow table rules insertion type today:
pattern-based insertion when packets match on the pattern and
index-based insertion when packets always hit at the index.
We need another mode that allows to match on the pattern at
the index: insertion by index with pattern.
testpmd example:
flow template_table 0 create table_id 2 group 13 priority 0
insertion_type index_with_pattern ingress rules_number 64
pattern_template 2 actions_template 2
Signed-off-by: Alexander Kozyrev <[email protected]>
Acked-by: Ori Kam <[email protected]>
|
|
Split the tracepoints rte_ethdev_trace_rx_burst and
rte_eth_trace_call_rx_callbacks into two separate ones
for empty and non-empty calls to avoid saturating
quickly the trace buffer.
Signed-off-by: Adel Belkhiri <[email protected]>
Acked-by: Jerin Jacob <[email protected]>
|
|
While invoking telemetry commands (which may happen at any time, out of
control of the application), an application thread may concurrently
add/remove ports. The telemetry callbacks may then access partially
initialized/uninitialised ethdev data.
Reuse the ethdev lock that protects port allocation/destruction and the
new telemetry callback register api that takes an additional private
argument. Pass eth_dev_telemetry_do as the main callback and the actual
endpoint callbacks as private argument.
Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
Cc: [email protected]
Signed-off-by: Robin Jarry <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
Acked-by: Stephen Hemminger <[email protected]>
|
|
Assure that 'extern "C" { /../ }' do not cover files included from a
particular header file, and address minor issues resulting from this
change of order.
Dealing with C++ should delegate to the individual include file level,
rather than being imposed by the user of that file. For example,
forcing C linkage prevents __Generic macros being replaced with
overloaded static inline functions in C++ translation units.
Eliminate 'extern "C"' from files which do not declare any symbols
(e.g., only macros or struct types).
On the other hand, the headers check is too naive in assuming that all
headers must contain a 'extern "C"'. Such a check was added in commit
1ee492bdc4ff ("buildtools/chkincs: check missing C++ guards").
Since this current change results in many headers not containing such
a token, remove the check for 'extern "C"' until we have a better
implementation.
Signed-off-by: Mattias Rönnblom <[email protected]>
Acked-by: Morten Brørup <[email protected]>
Signed-off-by: David Marchand <[email protected]>
|
|
Start a new release cycle with empty release notes.
The ABI version becomes 25.0.
The map files are updated to the new ABI major number (25).
The ABI exceptions are dropped and CI ABI checks are disabled because
compatibility is not preserved.
Signed-off-by: David Marchand <[email protected]>
Acked-by: Thomas Monjalon <[email protected]>
|
|
When allocating memory for an ethdev, the rte_malloc_socket call used
only allocates memory on the NUMA node/socket local to the device. This
means that even if the user wanted to, they could never use a remote NIC
without also having memory on that NIC's socket.
For example, if we change examples/skeleton/basicfwd.c to have
SOCKET_ID_ANY as the socket_id parameter for Rx and Tx rings, we should
be able to run the app cross-numa e.g. as below, where the two PCI
devices are on socket 1, and core 1 is on socket 0:
./build/examples/dpdk-skeleton -l 1 --legacy-mem --socket-mem=1024,0 \
-a a8:00.0 -a b8:00.0
This fails however, with the error:
ETHDEV: failed to allocate private data
PCI_BUS: Requested device 0000:a8:00.0 cannot be used
We can remove this restriction by doing a fallback call to general
rte_malloc after a call to rte_malloc_socket fails. This should be safe
to do because the later ethdev calls to setup Rx/Tx queues all take a
socket_id parameter, which can be used by applications to enforce the
requirement for local-only memory for a device, if so desired. [If
device-local memory is present it will be used as before, while if not
present the rte_eth_dev_configure call will now pass, but the subsequent
queue setup calls requesting local memory will fail].
Fixes: e489007a411c ("ethdev: add generic create/destroy ethdev APIs")
Fixes: dcd5c8112bc3 ("ethdev: add PCI driver helpers")
Cc: [email protected]
Signed-off-by: Bruce Richardson <[email protected]>
Signed-off-by: Padraig Connolly <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
The "rte_flow_conv()" function, enables, among other things, to copy
item list.
For GENEVE option item, the function copies it without considering deep
copy. It copies the "data" pointer without copying the pointed values.
This patch adds deep copy for after regular copy.
Fixes: 2b4c72b4d10d ("ethdev: introduce GENEVE header TLV option item")
Cc: [email protected]
Signed-off-by: Michael Baum <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Extend rte_flow_conv() to support working only on item's mask.
This allows drivers to get only the mask's size when working on pattern
templates and duplicate items having only the mask in a generic way.
Signed-off-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ori Kam <[email protected]>
|
|
VXLAN and VXLAN-GPE were supported with similar header structures.
In order to add VXLAN-GBP, which is another extension to VXLAN, both
extensions are merged in the original VXLAN header structure for an easier
usage. More VXLAN extensions may be added in the future in the same single
structure.
VXLAN and VXLAN-GBP use the same UDP port (4789), while VXLAN-GPE uses a
different port (4790).
The three protocols have the same header length and overall a similar
header structure as below.
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|R|R|R|I|R|R|R| Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| VXLAN Network Identifier (VNI) | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 1: VXLAN Header
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|R|R|Ver|I|P|B|O| Reserved |Next Protocol |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| VXLAN Network Identifier (VNI) | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 2: VXLAN-GPE Header
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|G|R|R|R|I|R|R|R|R|D|R|R|A|R|R|R| Group Policy ID |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| VXLAN Network Identifier (VNI) | Reserved |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 3: VXLAN-GBP Extension
Both GPE and GBP are extending VXLAN by using some reserved bits.
It means the packets can be processed with the same pattern and most of
the code can be reused.
The old field names are kept with the use of anonymous unions.
The Group Policy ID (GBP) and the Next Protocol (GPE) fields are
overlapping so they are in a union as well.
Another improvement is defining and documenting each bit.
Instead of adding flow items, a single VXLAN flow item is more flexible
as it uses the same header anyway.
GBP can be matches with the G bit.
GPE can be matched with the UDP port number.
VXLAN-GPE flow item and specific header are marked as deprecated.
A removal of the deprecated structures and macros may be proposed later.
Signed-off-by: Gavin Li <[email protected]>
Signed-off-by: Thomas Monjalon <[email protected]>
|
|
Add "uint8_t last_rsvd" as union with origin rsvd1.
Add RTE_FLOW_FIELD_VXLAN_LAST_RSVD into rte flow packet
field.
The new union is used by testpmd matching item VXLAN
"last_rsvd" and modify target RTE_FLOW_FIELD_VXLAN_LAST_RSVD.
Signed-off-by: Rongwei Liu <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
Acked-by: Thomas Monjalon <[email protected]>
|
|
Fix a problem introduced by a compiler upgrade (from gcc10 to gcc12.3),
which will lead the hns3 NIC can't link up. The root cause is strict
aliasing violation in rte_eth_linkstatus_set() with hns3 driver, see
[1] for more details.
This commit use union to avoid such aliasing violation. Also the
impacted components (cxgbe and qos_sched) have been adapted to the
struct change.
[1] https://inbox.dpdk.org/dev/[email protected]/
Cc: [email protected]
Signed-off-by: Chengwen Feng <[email protected]>
Signed-off-by: Dengdui Huang <[email protected]>
Acked-by: Morten Brørup <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
rte_eth_devargs_parse() stops initialising eth_devargs variable to zero,
which causes regression in ixgbe PCI probe.
Restore the memset for fix.
As the listed commit introduces a new argument: nb_da, the memset
takes it into account.
Fixes: 9a9eb104edf6 ("ethdev: parse multiple representor devargs")
Signed-off-by: Thierry Herbelot <[email protected]>
Signed-off-by: Olivier Matz <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
The current location used for __rte_aligned(a) for alignment of types
is not compatible with MSVC. There is only a single location accepted
by both toolchains.
The standard offers no alignment facility that compatibly interoperates
with C and C++ but it may be achieved by relocating the placement of
__rte_aligned(a) to the aforementioned location accepted by all currently
supported toolchains.
To allow alignment for both compilers, do the following:
* Expand __rte_aligned(a) to __declspec(align(a)) when building
with MSVC.
* Move __rte_aligned from the end of {struct,union} definitions to
be between {struct,union} and tag.
The placement between {struct,union} and the tag allows the desired
alignment to be imparted on the type regardless of the toolchain being
used for all of GCC, LLVM, MSVC compilers building both C and C++.
Note: this move has an additional benefit as Doxygen is not confused
anymore like for the rte_event_vector struct definition.
Signed-off-by: Tyler Retzlaff <[email protected]>
Acked-by: Morten Brørup <[email protected]>
Acked-by: Bruce Richardson <[email protected]>
Acked-by: Konstantin Ananyev <[email protected]>
Acked-by: Chengwen Feng <[email protected]>
Reviewed-by: Maxime Coquelin <[email protected]>
Signed-off-by: David Marchand <[email protected]>
|
|
Speed capabilities of a NIC may be discovered through its Linux
kernel driver. It is especially useful for bifurcated drivers,
so they don't have to duplicate the same logic in the DPDK driver.
Parsing ethtool speed capabilities is made easy thanks to
the functions added in ethdev for internal usage only.
Of course these functions work only on Linux,
so they are not compiled in other environments.
In order to ease parsing, the ethtool macro names are parsed
externally in a shell command which generates a C array
included in this patch.
It also avoids to depend on a kernel version.
This C array should be updated in future to get latest ethtool bits.
Note it is easier to update this array than adding new cases
in a parsing code.
The types in the functions are following the ethtool type:
uint32_t for bitmaps, and int8_t for the number of 32-bitmaps.
Signed-off-by: Thomas Monjalon <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Fixing uninitialized value access.
Coverity issue: 414934
Fixes: 9a9eb104edf6 ("ethdev: parse multiple representor devargs")
Signed-off-by: Harman Kalra <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Add a function to check if a device is representor port, also
modified the related codes for PMDs.
Signed-off-by: Long Wu <[email protected]>
Reviewed-by: Chaoyong He <[email protected]>
Reviewed-by: Peng Zhang <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|
|
Add new "rte_flow_field_id" enumeration values to describe both IPv6
traffic class and IPv6 flow label fields.
The TC value is "RTE_FLOW_FIELD_IPV6_TRAFFIC_CLASS" in flow API and
"ipv6_traffic_class" in testpmd command.
The FL value is "RTE_FLOW_FIELD_IPV6_FLOW_LABEL" in flow API and
"ipv6_flow_label" in testpmd command.
Signed-off-by: Michael Baum <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
The following IPsec related field definitions added:
- RTE_FLOW_FIELD_ESP_SPI - SPI value in IPsec header
- RTE_FLOW_FIELD_ESP_SEQ_NUM - sequence number in header
- RTE_FLOW_FIELD_ESP_PROTO - next protocol value in trailer
Signed-off-by: Viacheslav Ovsiienko <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ori Kam <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Add IPv4 next protocol modify field definition.
Signed-off-by: Viacheslav Ovsiienko <[email protected]>
Acked-by: Ori Kam <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Template table creation API sets table flows capacity.
If application needs more flows then the table was designed for,
the following procedures must be completed:
1. Create a new template table with larger flows capacity.
2. Re-create existing flows in the new table and delete flows from
the original table.
3. Destroy original table.
Application cannot always execute that procedure:
* Port may not have sufficient resources to allocate a new table
while maintaining original table.
* Application may not have existing flows "recipes" to re-create
flows in a new table.
The patch defines a new API that allows application to resize
existing template table:
* Resizable template table must be created with the
RTE_FLOW_TABLE_SPECIALIZE_RESIZABLE_TABLE bit set.
* Application resizes existing table with the
`rte_flow_template_table_resize()` function call.
The table resize procedure updates the table maximal flow number
only. Other table attributes are not affected by the table resize.
** The table resize procedure must not interrupt
existing table flows operations in hardware.
** The table resize procedure must not alter flow handles held by
application.
* After `rte_flow_template_table_resize()` returned, application must
update table flow rules by calling
`rte_flow_async_update_resized()`.
The call reconfigures internal flow resources for the new table
configuration.
The flow update must not interrupt hardware flow operations.
* After table flows were updated, application must call
`rte_flow_template_table_resize_complete()`.
The function releases PMD resources related to the original
table.
Application can start new table resize after
`rte_flow_template_table_resize_complete()` returned.
Testpmd commands:
* Create resizable template table
flow template_table <port-id> create table_id <tbl-id> resizable \
[transfer|ingress|egres] group <group-id> \
rules_number <initial table capacity> \
pattern_template <pt1> [ pattern_template <pt2> [ ... ]] \
actions_template <at1> [ actions_template <at2> [ ... ]]
* Resize table:
flow template_table <tbl-id> resize table_resize_id <tbl-id> \
table_resize_rules_num <new table capacity>
* Queue a flow update:
flow queue <port-id> update_resized <tbl-id> rule <flow-id>
* Complete table resize:
flow template_table <port-id> resize_complete table <tbl-id>
Signed-off-by: Gregory Etelson <[email protected]>
Acked-by: Ori Kam <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Thomas Monjalon <[email protected]>
|
|
During encapsulation of a packet, it is possible to change some
outer headers to improve flow distribution.
For example, from VXLAN RFC:
"It is recommended that the UDP source port number
be calculated using a hash of fields from the inner packet --
one example being a hash of the inner Ethernet frame's headers.
This is to enable a level of entropy for the ECMP/load-balancing"
The tunnel protocol defines which outer field should hold this hash,
but it doesn't define the hash calculation algorithm.
An application that uses flow offloads gets the first few packets
(exception path) and then decides to offload the flow.
As a result, there are two different paths that a packet from a given
flow may take. SW for the first few packets or HW for the rest.
When the packet goes through the SW, the SW encapsulates the packet
and must use the same hash calculation as the HW will do for
the rest of the packets in this flow.
The new function rte_flow_calc_encap_hash can query the hash value
from the driver for a given packet as if the packet was passed
through the HW.
Testpmd command:
flow hash {port} encap {target field}
pattern {item} [/ {item} [...] ] / end
Testpmd example for VXLAN encapsulation:
flow hash 0 encap hash_field_sport
pattern ipv4 dst is 7.7.7.7 src is 8.8.8.8 /
udp dst is 5678 src is 1234 / end
Signed-off-by: Ori Kam <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
On supporting hardware, the 20-bit Flow Label field in the
IPv6 header can be used to perform RSS in the ingress path.
Flow label values can be chosen such that they can be
used as part of the input to a hash function used in a load
distribution scheme.
Example to configure IPv6 flow label based RSS:
flow create 0 ingress pattern eth / ipv6 / tcp / end
actions rss types ipv6-flow-label end / end
Signed-off-by: Ajit Khaparde <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
As described in a recent bugzilla opened against the net/iavf driver,
a driver may call a event callback from other calls of the ethdev API.
Nothing guarantees in the ethdev API against such behavior.
Add a notice against using locks in those callbacks.
Bugzilla ID: 1337
Signed-off-by: David Marchand <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
Acked-by: Kevin Traynor <[email protected]>
Acked-by: Dariusz Sosnowski <[email protected]>
|
|
This patch reworks the async flow API functions called in data path,
to reduce the overhead during flow operations at the library level.
Main source of the overhead was indirection and checks done while
ethdev library was fetching rte_flow_ops from a given driver.
This patch introduces rte_flow_fp_ops struct which holds callbacks
to driver's implementation of fast path async flow API functions.
Each driver implementing these functions must populate flow_fp_ops
field inside rte_eth_dev structure with a reference to
its own implementation.
By default, ethdev library provides dummy callbacks with
implementations returning ENOSYS.
Such design provides a few assumptions:
- rte_flow_fp_ops struct for given port is always available.
- Each callback is either:
- Default provided by library.
- Set up by driver.
As a result, no checks for availability of the implementation
are needed at library level in data path.
Any library-level validation checks in async flow API are compiled
if and only if RTE_FLOW_DEBUG macro is defined.
This design was based on changes in ethdev library introduced in [1].
These changes apply only to the following API functions:
- rte_flow_async_create()
- rte_flow_async_create_by_index()
- rte_flow_async_actions_update()
- rte_flow_async_destroy()
- rte_flow_push()
- rte_flow_pull()
- rte_flow_async_action_handle_create()
- rte_flow_async_action_handle_destroy()
- rte_flow_async_action_handle_update()
- rte_flow_async_action_handle_query()
- rte_flow_async_action_handle_query_update()
- rte_flow_async_action_list_handle_create()
- rte_flow_async_action_list_handle_destroy()
- rte_flow_async_action_list_handle_query_update()
This patch also adjusts the mlx5 PMD to the introduced flow API changes.
[1]
commit c87d435a4d79 ("ethdev: copy fast-path API into separate structure")
Signed-off-by: Dariusz Sosnowski <[email protected]>
Acked-by: Ori Kam <[email protected]>
Acked-by: Thomas Monjalon <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
The new item type is added for the case user wants to match traffic
based on packet field compare result with other fields or immediate
value.
e.g. take advantage the compare item user will be able to accumulate
a IPv4/TCP packet's TCP data_offset and IPv4 IHL field to a tag
register, then compare the tag register with IPv4 header total length
to understand the packet has payload or not.
The supported operations can be as below:
- RTE_FLOW_ITEM_COMPARE_EQ (equal)
- RTE_FLOW_ITEM_COMPARE_NE (not equal)
- RTE_FLOW_ITEM_COMPARE_LT (less than)
- RTE_FLOW_ITEM_COMPARE_LE (less than or equal)
- RTE_FLOW_ITEM_COMPARE_GT (great than)
- RTE_FLOW_ITEM_COMPARE_GE (great than or equal)
A sample for create the comparison flow:
flow pattern_template 0 create ingress pattern_template_id 1 template \
compare op mask le a_type mask tag a_tag_index mask 1 b_type \
mask tag b_tag_index mask 2 width mask 0xffffffff / end
flow actions_template 0 create ingress actions_template_id 1 template \
count / drop / end mask count / drop / end
flow template_table 0 create table_id 1 group 2 priority 1 ingress \
rules_number 1 pattern_template 1 actions_template 1
flow queue 0 create 0 template_table 1 pattern_template 0 \
actions_template 0 postpone no pattern compare op is le \
a_type is tag a_tag_index is 1 b_type is tag b_tag_index is 2 \
width is 32 / end actions count / drop / end
Signed-off-by: Suanming Mou <[email protected]>
Acked-by: Ori Kam <[email protected]>
Acked-by: Andrew Rybchenko <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
As flow field relevant data structures will be used by both actions and
items, this commit moves the relevant data structures up to item parts.
Signed-off-by: Suanming Mou <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Current rte_flow_action_modify_data struct describes the pkt
field perfectly and is used only in action.
It is planned to be used for item as well. This commit renames
it to "rte_flow_field_data" making it compatible to be used by item.
Signed-off-by: Suanming Mou <[email protected]>
Acked-by: Ori Kam <[email protected]>
Acked-by: Andrew Rybchenko <[email protected]>
Acked-by: Ferruh Yigit <[email protected]>
|
|
Missing "RTE_PTYPE_UNKNOWN" ptype causes buffer overflow.
Enhance code such that the dev_supported_ptypes_get()
function pointer now returns the number of elements to
eliminate the need for "RTE_PTYPE_UNKNOWN" as the last item.
Same applied to 'buffer_split_supported_hdr_ptypes_get()' dev_ops too.
Signed-off-by: Sivaramakrishnan Venkat <[email protected]>
Reviewed-by: Ferruh Yigit <[email protected]>
|