| 1ff8b9a6 | 04-Oct-2024 |
Stephen Hemminger <stephen@networkplumber.org> |
ethdev: require checking result of query functions
With functions that return a data structure, the application must check the return value since the data structure contents will be undefined in cas
ethdev: require checking result of query functions
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 <stephen@networkplumber.org> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> Acked-by: Morten Brørup <mb@smartsharesystems.com>
show more ...
|
| 25a2a0dc | 09-Oct-2024 |
Bruce Richardson <bruce.richardson@intel.com> |
ethdev: add traffic manager query
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 que
ethdev: add traffic manager query
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 <bruce.richardson@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
| e14ebecf | 11-Oct-2024 |
Dariusz Sosnowski <dsosnowski@nvidia.com> |
ethdev: restore config only when requested
Use get_restore_flags() internal API introduced in previous commits in rte_eth_dev_start(), to restore only the configuration requested by the driver.
Sig
ethdev: restore config only when requested
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 <dsosnowski@nvidia.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|
| 5e46b176 | 11-Oct-2024 |
Dariusz Sosnowski <dsosnowski@nvidia.com> |
ethdev: add restore flags as driver callback
Before this patch, ethdev layer assumed that all drivers require that it has to forcefully restore:
- MAC addresses - promiscuous mode setting - all mul
ethdev: add restore flags as driver callback
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 <dsosnowski@nvidia.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|
| a98bd0fe | 11-Oct-2024 |
Dariusz Sosnowski <dsosnowski@nvidia.com> |
ethdev: rework config restore
Extract promiscuous and all multicast configuration restore to separate functions. This change will allow easier integration of disabling these procedures for supportin
ethdev: rework config restore
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 <dsosnowski@nvidia.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|
| e0d947a1 | 04-Oct-2024 |
Ferruh Yigit <ferruh.yigit@amd.com> |
ethdev: convert string initialization
gcc 15 experimental [1], with -Wextra flag, gives warning in variable initialization as string [2].
The warning has a point when initialized variable is intend
ethdev: convert string initialization
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 <ferruh.yigit@amd.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
show more ...
|
| 5d963566 | 07-Oct-2024 |
Bruce Richardson <bruce.richardson@intel.com> |
ethdev: make TM profile add parameters constant
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
ethdev: make TM profile add parameters constant
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 <bruce.richardson@intel.com> Reviewed-by: Rosen Xu <rosen.xu@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@amd.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
show more ...
|
| 30efe60d | 30-Sep-2024 |
Niall Meade <niall.meade@intel.com> |
ethdev: fix overflow in descriptor count
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 th
ethdev: fix overflow in descriptor count
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: stable@dpdk.org
Signed-off-by: Niall Meade <niall.meade@intel.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|
| 60bac722 | 26-Sep-2024 |
Damodharam Ammepalli <damodharam.ammepalli@broadcom.com> |
ethdev: add link speed lanes configuration
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 requir
ethdev: add link speed lanes configuration
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 <damodharam.ammepalli@broadcom.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com> Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
show more ...
|
| d916d27e | 26-Sep-2024 |
Jie Hai <haijie1@huawei.com> |
ethdev: add telemetry command for registers
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 t
ethdev: add telemetry command for registers
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 <haijie1@huawei.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
| 083db2ed | 26-Sep-2024 |
Jie Hai <haijie1@huawei.com> |
ethdev: add report of register names and filter
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 b
ethdev: add report of register names and filter
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 <haijie1@huawei.com> Acked-by: Huisong Li <lihuisong@huawei.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
show more ...
|
| be5ded2f | 25-Sep-2024 |
Alexander Kozyrev <akozyrev@nvidia.com> |
ethdev: add trace points to flow insertion by index
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.
ethdev: add trace points to flow insertion by index
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 <akozyrev@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
show more ...
|
| 2c52a2b3 | 25-Sep-2024 |
Alexander Kozyrev <akozyrev@nvidia.com> |
ethdev: add jump to table index action
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 creat
ethdev: add jump to table index action
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 <akozyrev@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
show more ...
|
| 933f18db | 25-Sep-2024 |
Alexander Kozyrev <akozyrev@nvidia.com> |
ethdev: add flow rule by index with pattern
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, requir
ethdev: add flow rule by index with pattern
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 <akozyrev@nvidia.com> Acked-by: Ori Kam <orika@nvidia.com>
show more ...
|