RE: [PATCH] net/mlx5: fix the hairpin Tx queue reference count
Hi, > -Original Message- > From: Bing Zhao > Sent: Tuesday, March 7, 2023 12:31 PM > To: Raslan Darawsheh > Cc: dev@dpdk.org; sta...@dpdk.org; Matan Azrad ; Slava > Ovsiienko > Subject: [PATCH] net/mlx5: fix the hairpin Tx queue reference count > > When calling the haipin unbind interface, all the hairpin Tx queues > of the port will be unbound from the peer Rx queues. If one of the > Tx queue is working in the auto bind mode, the interface will return > directly. > > Only when the Tx and peer Rx ports are the same, the auto bind mode > is supported. In this condition branch, the Tx queue release is > missed and the reference count is not decreased. Then in the port > stop stage, the hardware resources of this Tx queue won't be > freed. There would be some assertion or failure when starting the > port again. > > With this commit, the reference count will be operated correctly. > > Fixes: 37cd4501e873 ("net/mlx5: support two ports hairpin mode") > Cc: sta...@dpdk.org > > Signed-off-by: Bing Zhao > Acked-by: Matan Azrad > Acked-by: Viacheslav Ovsiienko > --- Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh
RE: [PATCH] doc: fix naming of NVIDIA devices
Hi, > -Original Message- > From: Thomas Monjalon > Sent: Tuesday, March 7, 2023 5:28 PM > To: dev@dpdk.org > Cc: Matan Raz ; Gal Cohen (ProdM) ; > Asaf Penso ; Raslan Darawsheh ; > Matan Azrad ; Slava Ovsiienko > Subject: [PATCH] doc: fix naming of NVIDIA devices > > The networking NVIDIA devices may be named as the following, using 0 and Ax > as fake suffixes: > - ConnectX-0 > - ConnectX-0 Ax > - BlueField-0 > > Casing and missing hyphens are fixed to avoid future wrong copy/paste. > > Signed-off-by: Thomas Monjalon Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh
RE: [PATCH v3] net/mlx5: use just sufficient barrier for ARM platforms
Hi, > -Original Message- > From: Honnappa Nagarahalli > Sent: Thursday, March 9, 2023 4:33 AM > To: Matan Azrad ; Shahaf Shuler ; > Slava Ovsiienko > Cc: dev@dpdk.org; honnappa.nagaraha...@arm.com; ruifeng.w...@arm.com; > n...@arm.com; Matan Azrad ; sta...@dpdk.org > Subject: [PATCH v3] net/mlx5: use just sufficient barrier for ARM platforms > > cqe->op_own indicates if the CQE is owned by the NIC. The rest of > the fields in CQE should be read only after op_own is read. On Arm platforms > using "dmb ishld" is sufficient to enforce this. > > Fixes: 88c0733535d6 ("net/mlx5: extend Rx completion with error handling") > Cc: ma...@mellanox.com > Cc: sta...@dpdk.org > > Signed-off-by: Honnappa Nagarahalli > Reviewed-by: Ruifeng Wang Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh
Re: [PATCH v6 00/10] dts: add hello world test case
> Juraj Linkeš (10): > dts: add node and os abstractions > dts: add ssh command verification > dts: add dpdk build on sut > dts: add dpdk execution handling > dts: add node memory setup > dts: add test suite module > dts: add hello world testsuite > dts: add test suite config and runner > dts: add test results module > doc: update dts setup and test suite cookbook Applied, thanks.
RE: [PATCH 0/2] net/mlx5: fix representor matching
From: Dariusz Sosnowski > This patch series addresses a few issues with representor matching mode > available in mlx5 PMD: > > - First patch fixes an issue with internal flow group > index translation occurring when both extended metadata mode > and representor matching was enabled. > - Second patch fixes an issue with isolated mode occurring > when representor matching was disabled. > > Dariusz Sosnowski (2): > net/mlx5: fix egress group translation in HWS > net/mlx5: fix isolated mode when repr matching is disabled > > doc/guides/nics/mlx5.rst | 3 +++ > drivers/net/mlx5/linux/mlx5_os.c | 16 > drivers/net/mlx5/mlx5_flow.c | 4 > drivers/net/mlx5/mlx5_flow_hw.c | 14 +- > 4 files changed, 32 insertions(+), 5 deletions(-) > Series-acked-by: Matan Azrad
RE: release candidate 23.03-rc2
Hi, > -Original Message- > From: Thomas Monjalon > Sent: Sunday, March 12, 2023 5:27 PM > To: annou...@dpdk.org > Subject: release candidate 23.03-rc2 > > A new DPDK release candidate is ready for testing: > https://git.dpdk.org/dpdk/tag/?id=v23.03-rc2 > > There are 319 new patches in this snapshot. > > Release notes: > https://doc.dpdk.org/guides/rel_notes/release_23_03.html > > Few major additions arrived in this -rc2: > - machine learning inference device API > - platform bus > - open link speed to 400G > There were a lot of updates in drivers, including new ones: > - Intel cpfl IPU driver > - Marvell CNXK machine learning inference The driver features should > be frozen now. > > Please test and report issues on bugs.dpdk.org. > Do not forget to review examples, tests and documentation updates. > > DPDK 23.03-rc3 is expected in one week. > > Thank you everyone > Note: all tests are passed, and no critical issues were found. The following is a list of tests that we ran on NVIDIA hardware this release: - Basic functionality: Send and receive multiple types of traffic. - passed - testpmd xstats counter test. - passed - testpmd timestamp test. - passed - Changing/checking link status through testpmd. - passed - RTE flow tests: Matching on: - ecpri: - sync is passed - esp: sync and async are passed - eth: sync and async are passed - flex: sync is passed - geneve: sync is passed - geneve_opt: sync is passed - gre : sync and async are passed - gre_key: sync and async are passed - gre_option: sync is passed - gtp: sync and async are passed - gtp_psc: sync and async are passed - icmp: sync is passed - icmp6: sync is passed - integrity: sync and async are passed - ipv4: sync and async are passed - ipv6: sync and async are passed - ipv6_frag_ext: sync is passed - mark: sync and async are passed - meta: sync and async are passed - meter color: async is passed - mpls: sync and async are passed - nvgre: sync and async are passed - port_id: sync is passed - represented port: async is passed - tag: sync and async are passed - tcp: sync and async are passed - udp: sync and async are passed - vlan: sync and async are passed - vxlan: sync and async are passed - vxlan_gpe: sync and async are passed - phy_port: sync is passed Actions: - age: sync is passed - count: sync and async are passed - dec_tcp_ack: sync is passed - dec_tcp_seq: sync is passed - dec_ttl: sync is passed - drop: sync and async is passed - flag: sync is passed - inc_tcp_ack: sync is passed - inc_tcp_seq: sync is passed - jump: sync and async are passed - mark: sync and async are passed - meter: sync is passed - meter_mark: async is passed - modify_field: sync and async are passed - nvgre_decap: sync is passed - nvgre_encap: sync is passed - of_pop_vlan: sync and async are passed - of_push_vlan: sync and async are passed - of_set_vlan_pcp: sync and async are passed - of_set_vlan_vid: sync and async are passed - port_id: sync and async are passed - queue: sync and async are passed - raw_decap: sync and async are passed - raw_encap: sync and async are passed - represented_port: async are passed - rss: sync and async are passed - sample: sync is passed - set_ipv4_dscp: sync is passed - set_ipv4_dst: sync is passed - set_ipv4_src: sync is passed - set_ipv6_dscp: sync is passed - set_ipv6_dst: sync is passed - set_ipv6_src: sync is passed - set_mac_dst: sync is passed - set_mac_src: sync is passed - set_meta: sync is passed - set_tag: sync is passed - set_tp_dst: sync is passed - set_tp_src: sync is passed - set_ttl: sync is passed - vxlan_decap: sync and async are passed - vxlan_encap: sync and async are passed - RSS testing. -passed - VLAN filtering, stripping and insertion tests. -passed - Checksum and TSO tests. -passed - ptype reporting -passed - link status interrupt using the example application link_status_interrupt tests. - passed - Interrupt mode using l3fwd-power example application tests. - passed - Multi process testing using multi process example applications. - passed - Hardware LRO tests. - passed - Regex tests. - passed - Buffer Split. - passed - Tx scheduling. - passed Kindest Regards, Wael Abualrub
RE: [PATCH] net/mlx5: reject flow template API reconfiguration
From: Dariusz Sosnowski > Flow Template API allows rte_flow_configure() to be called more than once, > to allow applications to dynamically reconfigure the amount of resources > available for flow table and flow rule creation. > PMDs can reject the change in configuration and keep the old configuration. > > Before this patch, during Flow Template API reconfiguration in mlx5 PMD, all > the allocated resources (HW/FW object pools, flow rules, pattern and actions > templates) were released and reallocated according to the new > configuration. This however leads to undefined behavior, since all references > to templates, flows or indirect actions, which are held by the user, are now > invalidated. > > This patch changes the reconfiguration behavior. > Configuration provided to rte_flow_configure() is stored in port's private > data structure. On any subsequent call to rte_flow_configure(), the provided > configuration is compared against the stored configuration. > If both are equal, rte_flow_configure() reports a success and configuration is > unaffected. Otherwise, (-ENOTSUP) is returned. > > Signed-off-by: Dariusz Sosnowski Acked-by: Matan Azrad
Re: 回复: [PATCH v3 2/3] net/i40e: enable direct rearm with separate API
+int +i40e_tx_fill_sw_ring(void *tx_queue, + struct rte_eth_rxq_rearm_data *rxq_rearm_data) { + struct i40e_tx_queue *txq = tx_queue; + struct i40e_tx_entry *txep; + void **rxep; + struct rte_mbuf *m; + int i, n; + int nb_rearm = 0; + + if (*rxq_rearm_data->rearm_nb < txq->tx_rs_thresh || + txq->nb_tx_free > txq->tx_free_thresh) + return 0; + + /* check DD bits on threshold descriptor */ + if ((txq->tx_ring[txq->tx_next_dd].cmd_type_offset_bsz & + rte_cpu_to_le_64(I40E_TXD_QW1_DTYPE_MASK)) != + rte_cpu_to_le_64(I40E_TX_DESC_DTYPE_DESC_DONE)) + return 0; + + n = txq->tx_rs_thresh; + + /* first buffer to free from S/W ring is at index +* tx_next_dd - (tx_rs_thresh-1) +*/ + txep = &txq->sw_ring[txq->tx_next_dd - (n - 1)]; + rxep = rxq_rearm_data->rx_sw_ring; + rxep += *rxq_rearm_data->rearm_start; + + if (txq->offloads & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) { + /* directly put mbufs from Tx to Rx */ + for (i = 0; i < n; i++, rxep++, txep++) + *rxep = txep[0].mbuf; + } else { + for (i = 0; i < n; i++, rxep++) { + m = rte_pktmbuf_prefree_seg(txep[i].mbuf); One thing I forgot to ask: What would happen if this mbuf belongs to different mempool (not one that we specify at rx_queue_setup())? Do we need to check it here? Or would it be upper layer constraint? Or...? First, 'different mempool' is valid for no FAST_FREE path in tx_free_buffers. If buffers belong to different mempool, we can have an example here: Buffer 1 from mempool 1, its recycle path is: -- --- 1. queue_setup: rearm from mempool 1 into Rx sw-ring 2. rte_eth_Rx_burst: used by user app (Rx) 3. rte_eth_Tx_burst: mount on Tx sw-ring 4. rte_eth_direct_rearm: free into Rx sw-ring: or tx_free_buffers: free into mempool 1 (no fast_free path) -- --- Buffer 2 from mempool 2, its recycle path is: -- --- 1. queue_setup: rearm from mempool 2 into Rx sw-ring 2. rte_eth_Rx_burst: used by user app (Rx) 3. rte_eth_Tx_burst: mount on Tx sw-ring 4. rte_eth_direct_rearm: free into Rx sw-ring or tx_free_buffers: free into mempool 2 (no fast_free_path) -- --- Thus, buffers from Tx different mempools are the same for Rx. The difference point is that they will be freed into different mempool if the thread uses generic free buffers. I think this cannot affect direct-rearm mode, and we do not need to check this. I understand that it should work even with multiple mempools. What I am trying to say - user may not want to use mbufs from particular mempool for RX (while it is still ok to use it for TX). Let say user can have a separate mempool with small data-buffers (less then normal MTU) to send some 'special' paclets, or even use this memppol with small buffers for zero-copy updating of packet L2/L3 headers, etc. Or it could be some 'special' user provided mempool. That's why I wonder should we allow only mbufs from mempool that is assigned to that RX queue. Sorry for my misleading. If I understand correctly this time, you means a special mempool. Maybe its buffer size is very small and this Tx buffer is generated from control plane. However, if we recycle this Tx buffer into Rx buffer ring, there maybe some error due to its size is so small. Thus we can only allow general buffers which is valid for Rx buffer ring. Furthermore, this should be user's responsibility to ensure the Tx recycling buffers should be valid. If we check this in the data plane, it will cost a lot of CPU cycles. At last, what we can do is to add constraint in the notes to remind users. As I thought: in theory we can add 'struct rte_mempool *mp' into rte_eth_rxq_rearm_data. And then: if (mbuf->pool == rxq_rearm_data->mp) /* put mbuf into rearm buffer */ else /* free mbuf */ For the 'proper' config (when txq contains mbufs from expected mempool) the overhead will be minimal. In other case it might be higher, but still would work and no need for extra limitations. + if (m != NULL) { + *rxep = m; + nb_rearm++; + } + } + n = nb_rearm; + } + + /* update counters for Tx */ + txq->nb_tx_free = (uint16_t)(txq->nb_tx_free + txq- tx_rs_thresh); + txq->tx_next_dd = (uint16_t)(txq->tx_next_dd + txq- tx_rs_thresh); + if (txq->tx_next_dd >= txq->nb_tx_desc) + tx
Re: [PATCH 1/1] usertools/devbind: add ml device class
14/03/2023 07:31, Jerin Jacob: > On Mon, Mar 13, 2023 at 10:53 PM Srikanth Yalavarthi > wrote: > > > > Added new ML device class and support for cnxk ML device. > > > > Signed-off-by: Srikanth Yalavarthi > > Acked-by: Jerin Jacob Applied, thanks.
Re: [PATCH v2 1/1] ml/cnxk: fix reporting of incorrect error info
16/03/2023 18:22, Srikanth Yalavarthi: > In the rte_ml_op_error_get driver function, the errcode > field of rte_ml_op_error structure is not being updated. > This is causing an incorrect or junk value being reported > as errcode to caller. > > For error subtype not supported by driver, the error > message reported is incorrect or junk. > > Fixes: 57c37b852f2c ("ml/cnxk: support firmware error code query") > > Signed-off-by: Srikanth Yalavarthi Applied, thanks.
RE: [PATCH] net/mlx5: reject flow template API reconfiguration
Hi, > -Original Message- > From: Dariusz Sosnowski > Sent: Saturday, February 25, 2023 9:58 PM > To: Matan Azrad ; Slava Ovsiienko > > Cc: dev@dpdk.org > Subject: [PATCH] net/mlx5: reject flow template API reconfiguration > > Flow Template API allows rte_flow_configure() to be called more than once, to > allow applications to dynamically reconfigure the amount of resources > available for flow table and flow rule creation. > PMDs can reject the change in configuration and keep the old configuration. > > Before this patch, during Flow Template API reconfiguration in mlx5 PMD, all > the allocated resources (HW/FW object pools, flow rules, pattern and actions > templates) were released and reallocated according to the new configuration. > This however leads to undefined behavior, since all references to templates, > flows or indirect actions, which are held by the user, are now invalidated. > > This patch changes the reconfiguration behavior. > Configuration provided to rte_flow_configure() is stored in port's private > data > structure. On any subsequent call to rte_flow_configure(), the provided > configuration is compared against the stored configuration. > If both are equal, rte_flow_configure() reports a success and configuration is > unaffected. Otherwise, (-ENOTSUP) is returned. > > Signed-off-by: Dariusz Sosnowski Patch applied to net-net-mlx, Kindest regards Raslan Darawsheh
RE: [PATCH 0/2] net/mlx5: fix representor matching
Hi, > -Original Message- > From: Dariusz Sosnowski > Sent: Saturday, February 25, 2023 10:18 PM > To: Matan Azrad ; Slava Ovsiienko > > Cc: dev@dpdk.org; sta...@dpdk.org; Ori Kam > Subject: [PATCH 0/2] net/mlx5: fix representor matching > > This patch series addresses a few issues with representor matching mode > available in mlx5 PMD: > > - First patch fixes an issue with internal flow group > index translation occurring when both extended metadata mode > and representor matching was enabled. > - Second patch fixes an issue with isolated mode occurring > when representor matching was disabled. > > Dariusz Sosnowski (2): > net/mlx5: fix egress group translation in HWS > net/mlx5: fix isolated mode when repr matching is disabled > > doc/guides/nics/mlx5.rst | 3 +++ > drivers/net/mlx5/linux/mlx5_os.c | 16 > drivers/net/mlx5/mlx5_flow.c | 4 > drivers/net/mlx5/mlx5_flow_hw.c | 14 +- > 4 files changed, 32 insertions(+), 5 deletions(-) > > -- > 2.25.1 Series applied to next-net-mlx, Kindest regards, Raslan Darawsheh
Re: [PATCH v3 0/8] Fixes to ml/cnxk driver
> Srikanth Yalavarthi (8): > ml/cnxk: fix evaluation order violation issues > ml/cnxk: fix potential division by zero > ml/cnxk: add pointer check after memory allocation > ml/cnxk: remove logically dead code > ml/cnxk: fix potential memory leak in xstats > ml/cnxk: check for null pointer before dereference > ml/cnxk: avoid variable name reuse in a function > ml/cnxk: reduce levels of nested variables access Applied, thanks.
Re: [PATCH v7 00/11] Implementation of mldev test application
16/03/2023 22:14, Srikanth Yalavarthi: > Srikanth Yalavarthi (11): > app/mldev: implement test framework for mldev > app/mldev: add common test functions > app/mldev: add test case to validate device ops > app/mldev: add test case to validate model ops > app/mldev: add ordered inference test case > app/mldev: add test case to interleave inferences > app/mldev: enable support for burst inferences > app/mldev: enable support for queue pairs and size > app/mldev: enable support for inference batches > app/mldev: enable support for inference validation > app/mldev: enable reporting stats in mldev app Reworked the documentation a little and other details, and applied, thanks.
Re: [PATCH] gpudev: export header file for external drivers
16/03/2023 10:23, David Marchand: > On Thu, Mar 16, 2023 at 9:59 AM Thomas Monjalon wrote: > > > > In DPDK 21.05, the option driver_sdk_headers was introduced > > to export required headers to allow building out-of-tree drivers. > > > > In DPDK 21.11, the gpudev driver class was introduced, > > without this out-of-tree compatibility. > > > > It is fixed by exporting gpudev_driver.h as part of the driver SDK. > > > > Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library") > > Cc: sta...@dpdk.org > > > > Reported-by: David Marchand > > Signed-off-by: Thomas Monjalon > > LGTM, thanks. Applied
Re: [PATCH] gpudev: export header file for external drivers
19/03/2023 23:28, Thomas Monjalon: > 16/03/2023 10:23, David Marchand: > > On Thu, Mar 16, 2023 at 9:59 AM Thomas Monjalon wrote: > > > > > > In DPDK 21.05, the option driver_sdk_headers was introduced > > > to export required headers to allow building out-of-tree drivers. > > > > > > In DPDK 21.11, the gpudev driver class was introduced, > > > without this out-of-tree compatibility. > > > > > > It is fixed by exporting gpudev_driver.h as part of the driver SDK. > > > > > > Fixes: 8b8036a66e3d ("gpudev: introduce GPU device class library") > > > Cc: sta...@dpdk.org > > > > > > Reported-by: David Marchand > > > Signed-off-by: Thomas Monjalon > > > > LGTM, thanks. > > Applied Forgot to send the v2 merged with this addition: " As a consequence of exporting this header file, C++ "extern C" guard must be added. "
Re: [PATCH v5] testpmd: go back to using cmdline_interact
17/03/2023 22:12, Olivier Matz: > On Fri, Mar 17, 2023 at 09:59:41AM -0700, Stephen Hemminger wrote: > > The cmdline_poll() function is broken and was > > not fully tested, don't use it. > > > > Instead, use sigaction() to cancel read character on Unix OS's > > and a new helper to cancel I/O on Windows. > > > > Fixes: 0fd1386c30c3 ("app/testpmd: cleanup cleanly from signal") > > Bugzilla ID: 1180 > > Signed-off-by: Stephen Hemminger > > Acked-by: Olivier Matz > > Thank you Applied, thanks. I hope we won't have new issues with testpmd in -rc3.
[PATCH v9] app/procinfo: display eventdev xstats
This commit extends proc-info application to display xstats for the eventdev devices. New command line arguments are introduced to display xstats for eventdev devices. The command example is like: For displaying a specific port stats (e.g. port 1): ./dpdk-proc-info -- --show-edev-port-xstats=1 If any xstats parameters for eventdev passed through proc-info command line, proc-info will only display requested eventdev data and exit. Users should not pass any eventdev xstats parameters if they desire to dump other proc-info data such as Rx/Tx descriptor dump. More information can be found in proc-info app doc. Signed-off-by: Abdullah Sevincer --- app/proc-info/main.c | 297 - app/proc-info/meson.build | 2 +- doc/guides/tools/proc_info.rst | 32 +++- 3 files changed, 328 insertions(+), 3 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 53e852a07c..c6a854c993 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -40,11 +40,17 @@ #include #include #include +#include /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +/* Note: Port_queue_id in xstats APIs is 8 bits, so we have a maximum of + * 256 ports and queues for event_Dev + */ +#define MAX_PORTS_QUEUES 256 + #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) @@ -121,6 +127,18 @@ static uint32_t enable_shw_module_eeprom; static uint32_t enable_shw_rx_desc_dump; static uint32_t enable_shw_tx_desc_dump; +static uint32_t enable_shw_all_eventdev_queues; +static uint32_t enable_shw_all_eventdev_ports; +static uint32_t enable_dump_eventdev_xstats; +static uint32_t enable_eventdev_reset_xstats; +static uint32_t enable_shw_eventdev_device_xstats; + +static uint8_t evdev_id; +static uint8_t num_ports; +static uint8_t ports[MAX_PORTS_QUEUES]; +static uint8_t num_queues; +static uint8_t queues[MAX_PORTS_QUEUES]; + #define DESC_PARAM_NUM 3 struct desc_param { @@ -172,7 +190,12 @@ proc_info_usage(const char *prgname) "offset: The offset of the descriptor starting from tail. " "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" - " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", + " --dump-regs=file-prefix: dump registers to file with the file-prefix\n" + " --show-edev-queue-xstats=queue_num:evdev_id or *:evdev_id to get queue xstats for specified queue or all queues;\n" + " --show-edev-port-xstats=port_num:evdev_id or *:evdev_id to get queue xstats for specified port or all ports;\n" + " --edev-dump-xstats=evdev_id to dump all event_dev xstats for specified eventdev device;\n" + " --edev-reset-xstats=evdev_id to reset event_dev xstats after reading;\n" + " --show-edev-device-xstats=evdev_id to get event_dev device xstats for specified eventdev device;\n", prgname); } @@ -236,6 +259,41 @@ parse_descriptor_param(char *list, struct desc_param *desc) return 0; } +static int +parse_eventdev_queue_params(char *list) +{ + int queue_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_queues = 1; + } else if (sscanf(list, "%d:%hhu", &queue_id, &evdev_id) == 2) { + queues[num_queues] = queue_id; + num_queues++; + } else { + return -EINVAL; + } + + return 0; +} + +static int +parse_eventdev_port_params(char *list) +{ + int port_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_ports = 1; + } else if (sscanf(list, "%d:%hhu", &port_id, &evdev_id) == 2) { + ports[num_ports] = port_id; + num_ports++; + } else { + return -EINVAL; + } + + return 0; +} + + static int proc_info_preparse_args(int argc, char **argv) { @@ -302,6 +360,11 @@ proc_info_parse_args(int argc, char **argv) {"show-module-eeprom", 0, NULL, 0}, {"show-rx-descriptor", required_argument, NULL, 1}, {"show-tx-descriptor", required_argument, NULL, 1}, + {"show-edev-queue-xstats", required_argument, NULL, 0}, + {"show-edev-port-xstats", required_argument, NULL, 0}, + {"edev-dump-xstats", required_argument, NULL, 0}, + {"edev-reset-xstats", required_argument, NULL, 0}, + {"show-edev-device-xstats", required_argument, NULL, 0}, {NULL, 0, 0, 0} }; @@ -385,6 +448,35 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name,
[PATCH v10] app/procinfo: display eventdev xstats
This commit extends proc-info application to display xstats for the eventdev devices. New command line arguments are introduced to display xstats for eventdev devices. The command example is like: For displaying a specific port stats (e.g. port 1): ./dpdk-proc-info -- --show-edev-port-xstats=1:0 If any xstats parameters for eventdev passed through proc-info command line, proc-info will only display requested eventdev data and exit. Users should not pass any eventdev xstats parameters if they desire to dump other proc-info data such as Rx/Tx descriptor dump. More information can be found in proc-info app doc. Signed-off-by: Abdullah Sevincer --- app/proc-info/main.c | 297 - app/proc-info/meson.build | 2 +- doc/guides/tools/proc_info.rst | 32 +++- 3 files changed, 328 insertions(+), 3 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 53e852a07c..c6a854c993 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -40,11 +40,17 @@ #include #include #include +#include /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +/* Note: Port_queue_id in xstats APIs is 8 bits, so we have a maximum of + * 256 ports and queues for event_Dev + */ +#define MAX_PORTS_QUEUES 256 + #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) @@ -121,6 +127,18 @@ static uint32_t enable_shw_module_eeprom; static uint32_t enable_shw_rx_desc_dump; static uint32_t enable_shw_tx_desc_dump; +static uint32_t enable_shw_all_eventdev_queues; +static uint32_t enable_shw_all_eventdev_ports; +static uint32_t enable_dump_eventdev_xstats; +static uint32_t enable_eventdev_reset_xstats; +static uint32_t enable_shw_eventdev_device_xstats; + +static uint8_t evdev_id; +static uint8_t num_ports; +static uint8_t ports[MAX_PORTS_QUEUES]; +static uint8_t num_queues; +static uint8_t queues[MAX_PORTS_QUEUES]; + #define DESC_PARAM_NUM 3 struct desc_param { @@ -172,7 +190,12 @@ proc_info_usage(const char *prgname) "offset: The offset of the descriptor starting from tail. " "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" - " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", + " --dump-regs=file-prefix: dump registers to file with the file-prefix\n" + " --show-edev-queue-xstats=queue_num:evdev_id or *:evdev_id to get queue xstats for specified queue or all queues;\n" + " --show-edev-port-xstats=port_num:evdev_id or *:evdev_id to get queue xstats for specified port or all ports;\n" + " --edev-dump-xstats=evdev_id to dump all event_dev xstats for specified eventdev device;\n" + " --edev-reset-xstats=evdev_id to reset event_dev xstats after reading;\n" + " --show-edev-device-xstats=evdev_id to get event_dev device xstats for specified eventdev device;\n", prgname); } @@ -236,6 +259,41 @@ parse_descriptor_param(char *list, struct desc_param *desc) return 0; } +static int +parse_eventdev_queue_params(char *list) +{ + int queue_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_queues = 1; + } else if (sscanf(list, "%d:%hhu", &queue_id, &evdev_id) == 2) { + queues[num_queues] = queue_id; + num_queues++; + } else { + return -EINVAL; + } + + return 0; +} + +static int +parse_eventdev_port_params(char *list) +{ + int port_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_ports = 1; + } else if (sscanf(list, "%d:%hhu", &port_id, &evdev_id) == 2) { + ports[num_ports] = port_id; + num_ports++; + } else { + return -EINVAL; + } + + return 0; +} + + static int proc_info_preparse_args(int argc, char **argv) { @@ -302,6 +360,11 @@ proc_info_parse_args(int argc, char **argv) {"show-module-eeprom", 0, NULL, 0}, {"show-rx-descriptor", required_argument, NULL, 1}, {"show-tx-descriptor", required_argument, NULL, 1}, + {"show-edev-queue-xstats", required_argument, NULL, 0}, + {"show-edev-port-xstats", required_argument, NULL, 0}, + {"edev-dump-xstats", required_argument, NULL, 0}, + {"edev-reset-xstats", required_argument, NULL, 0}, + {"show-edev-device-xstats", required_argument, NULL, 0}, {NULL, 0, 0, 0} }; @@ -385,6 +448,35 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name,
[PATCH v11] app/procinfo: display eventdev xstats
This commit extends proc-info application to display xstats for the eventdev devices. New command line arguments are introduced to display xstats for eventdev devices. The command example is like: For displaying a specific port stats (e.g. port 1): ./dpdk-proc-info -- --show-edev-port-xstats=1:0 If any xstats parameters for eventdev passed through proc-info command line, proc-info will only display requested eventdev data and exit. Users should not pass any eventdev xstats parameters if they desire to dump other proc-info data such as Rx/Tx descriptor dump. More information can be found in proc-info app doc. Signed-off-by: Abdullah Sevincer --- app/proc-info/main.c | 296 - app/proc-info/meson.build | 2 +- doc/guides/tools/proc_info.rst | 32 +++- 3 files changed, 327 insertions(+), 3 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 53e852a07c..ceed525b3e 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -40,11 +40,17 @@ #include #include #include +#include /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +/* Note: Port_queue_id in xstats APIs is 8 bits, so we have a maximum of + * 256 ports and queues for event_Dev + */ +#define MAX_PORTS_QUEUES 256 + #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) @@ -121,6 +127,18 @@ static uint32_t enable_shw_module_eeprom; static uint32_t enable_shw_rx_desc_dump; static uint32_t enable_shw_tx_desc_dump; +static uint32_t enable_shw_all_eventdev_queues; +static uint32_t enable_shw_all_eventdev_ports; +static uint32_t enable_dump_eventdev_xstats; +static uint32_t enable_eventdev_reset_xstats; +static uint32_t enable_shw_eventdev_device_xstats; + +static uint8_t evdev_id; +static uint8_t num_ports; +static uint8_t ports[MAX_PORTS_QUEUES]; +static uint8_t num_queues; +static uint8_t queues[MAX_PORTS_QUEUES]; + #define DESC_PARAM_NUM 3 struct desc_param { @@ -172,7 +190,12 @@ proc_info_usage(const char *prgname) "offset: The offset of the descriptor starting from tail. " "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" - " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", + " --dump-regs=file-prefix: dump registers to file with the file-prefix\n" + " --show-edev-queue-xstats=queue_num:evdev_id or *:evdev_id to get queue xstats for specified queue or all queues;\n" + " --show-edev-port-xstats=port_num:evdev_id or *:evdev_id to get queue xstats for specified port or all ports;\n" + " --edev-dump-xstats=evdev_id to dump all event_dev xstats for specified eventdev device;\n" + " --edev-reset-xstats=evdev_id to reset event_dev xstats after reading;\n" + " --show-edev-device-xstats=evdev_id to get event_dev device xstats for specified eventdev device;\n", prgname); } @@ -236,6 +259,41 @@ parse_descriptor_param(char *list, struct desc_param *desc) return 0; } +static int +parse_eventdev_queue_params(char *list) +{ + int queue_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_queues = 1; + } else if (sscanf(list, "%d:%hhu", &queue_id, &evdev_id) == 2) { + queues[num_queues] = queue_id; + num_queues++; + } else { + return -EINVAL; + } + + return 0; +} + +static int +parse_eventdev_port_params(char *list) +{ + int port_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_ports = 1; + } else if (sscanf(list, "%d:%hhu", &port_id, &evdev_id) == 2) { + ports[num_ports] = port_id; + num_ports++; + } else { + return -EINVAL; + } + + return 0; +} + + static int proc_info_preparse_args(int argc, char **argv) { @@ -302,6 +360,11 @@ proc_info_parse_args(int argc, char **argv) {"show-module-eeprom", 0, NULL, 0}, {"show-rx-descriptor", required_argument, NULL, 1}, {"show-tx-descriptor", required_argument, NULL, 1}, + {"show-edev-queue-xstats", required_argument, NULL, 0}, + {"show-edev-port-xstats", required_argument, NULL, 0}, + {"edev-dump-xstats", required_argument, NULL, 0}, + {"edev-reset-xstats", required_argument, NULL, 0}, + {"show-edev-device-xstats", required_argument, NULL, 0}, {NULL, 0, 0, 0} }; @@ -385,6 +448,35 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name,
[PATCH v12] app/procinfo: display eventdev xstats
This commit extends proc-info application to display xstats for the eventdev devices. New command line arguments are introduced to display xstats for eventdev devices. The command example is like: For displaying a specific port stats (e.g. port 1): ./dpdk-proc-info -- --show-edev-port-xstats=1:0 If any xstats parameters for eventdev passed through proc-info command line, proc-info will only display requested eventdev data and exit. Users should not pass any eventdev xstats parameters if they desire to dump other proc-info data such as Rx/Tx descriptor dump. More information can be found in proc-info app doc. Signed-off-by: Abdullah Sevincer --- app/proc-info/main.c | 294 - app/proc-info/meson.build | 2 +- doc/guides/tools/proc_info.rst | 32 +++- 3 files changed, 325 insertions(+), 3 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 53e852a07c..0e0d8ab4ce 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -40,11 +40,17 @@ #include #include #include +#include /* Maximum long option length for option parsing. */ #define MAX_LONG_OPT_SZ 64 #define MAX_STRING_LEN 256 +/* Note: Port_queue_id in xstats APIs is 8 bits, so we have a maximum of + * 256 ports and queues for event_Dev + */ +#define MAX_PORTS_QUEUES 256 + #define ETHDEV_FWVERS_LEN 32 #define RTE_RETA_CONF_GROUP_NUM 32 #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) @@ -121,6 +127,18 @@ static uint32_t enable_shw_module_eeprom; static uint32_t enable_shw_rx_desc_dump; static uint32_t enable_shw_tx_desc_dump; +static uint32_t enable_shw_all_eventdev_queues; +static uint32_t enable_shw_all_eventdev_ports; +static uint32_t enable_dump_eventdev_xstats; +static uint32_t enable_eventdev_reset_xstats; +static uint32_t enable_shw_eventdev_device_xstats; + +static uint8_t evdev_id; +static uint8_t num_ports; +static uint8_t ports[MAX_PORTS_QUEUES]; +static uint8_t num_queues; +static uint8_t queues[MAX_PORTS_QUEUES]; + #define DESC_PARAM_NUM 3 struct desc_param { @@ -172,7 +190,12 @@ proc_info_usage(const char *prgname) "offset: The offset of the descriptor starting from tail. " "num: The number of the descriptors to dump.\n" " --iter-mempool=name: iterate mempool elements to display content\n" - " --dump-regs=file-prefix: dump registers to file with the file-prefix\n", + " --dump-regs=file-prefix: dump registers to file with the file-prefix\n" + " --show-edev-queue-xstats=queue_num:evdev_id or *:evdev_id to get queue xstats for specified queue or all queues;\n" + " --show-edev-port-xstats=port_num:evdev_id or *:evdev_id to get queue xstats for specified port or all ports;\n" + " --edev-dump-xstats=evdev_id to dump all event_dev xstats for specified eventdev device;\n" + " --edev-reset-xstats=evdev_id to reset event_dev xstats after reading;\n" + " --show-edev-device-xstats=evdev_id to get event_dev device xstats for specified eventdev device;\n", prgname); } @@ -236,6 +259,40 @@ parse_descriptor_param(char *list, struct desc_param *desc) return 0; } +static int +parse_eventdev_queue_params(char *list) +{ + int queue_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_queues = 1; + } else if (sscanf(list, "%d:%hhu", &queue_id, &evdev_id) == 2) { + queues[num_queues] = queue_id; + num_queues++; + } else { + return -EINVAL; + } + + return 0; +} + +static int +parse_eventdev_port_params(char *list) +{ + int port_id; + + if (sscanf(list, "*:%hhu", &evdev_id) == 1) { + enable_shw_all_eventdev_ports = 1; + } else if (sscanf(list, "%d:%hhu", &port_id, &evdev_id) == 2) { + ports[num_ports] = port_id; + num_ports++; + } else { + return -EINVAL; + } + + return 0; +} + static int proc_info_preparse_args(int argc, char **argv) { @@ -302,6 +359,11 @@ proc_info_parse_args(int argc, char **argv) {"show-module-eeprom", 0, NULL, 0}, {"show-rx-descriptor", required_argument, NULL, 1}, {"show-tx-descriptor", required_argument, NULL, 1}, + {"show-edev-queue-xstats", required_argument, NULL, 0}, + {"show-edev-port-xstats", required_argument, NULL, 0}, + {"edev-dump-xstats", required_argument, NULL, 0}, + {"edev-reset-xstats", required_argument, NULL, 0}, + {"show-edev-device-xstats", required_argument, NULL, 0}, {NULL, 0, 0, 0} }; @@ -385,6 +447,35 @@ proc_info_parse_args(int argc, char **argv) else if (!strncmp(long_option[option_index].name,
[PATCH] config/arm: enable rcpc feature on neoverse n1
Enable rcpc meson configuration for Neoverse N1 platform. Signed-off-by: Joyce Kong Reviewed-by: Ruifeng Wang --- config/arm/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/arm/meson.build b/config/arm/meson.build index 5ff66248de..5213434ca4 100644 --- a/config/arm/meson.build +++ b/config/arm/meson.build @@ -65,7 +65,7 @@ part_number_config_arm = { '0xd0b': {'compiler_options': ['-mcpu=cortex-a76']}, '0xd0c': { 'march': 'armv8.2-a', -'march_features': ['crypto'], +'march_features': ['crypto', 'rcpc'], 'compiler_options': ['-mcpu=neoverse-n1'], 'flags': [ ['RTE_MACHINE', '"neoverse-n1"'], -- 2.25.1
af_packet can't send packet more than framecnt
Hi, I used af_packet interface, but found only can send packets successfully less than framecnt argument. E.g. if I pass "--vdev=eth_af_packet0,iface=tap0,blocksz=4096,framesz=2048,framecnt=512,qpa irs=1,qdisc_bypass=0" to DPDK, the rte_eth_tx_burst only return 1 for 512 times, after that it always return 0. If I pass "--vdev=eth_af_packet0,iface=tap0,blocksz=4096,framesz=2048,framecnt=1024,qp airs=1,qdisc_bypass=0" to DPDK, the rte_eth_tx_burst only return 1 for 1024 times, after that it always return 0. BTW, I use busy loop mode in project, Is there any help for this? Thanks so much Haifeng
RE: [PATCH v1] bus/ifpga: fix issue of accessing null address
> -Original Message- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:44 AM > To: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com > Cc: sta...@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] bus/ifpga: fix issue of accessing null address > > In function ifpga_scan_one(), variable 'path' is NULL if device argument > 'afu_bts' is > not set, subsequent string copy with 'path' would lead to segmentation fault. > > Fixes: 6fa4aa2b3645 ("bus/ifpga: fix forcing optional devargs") > Cc: sta...@dpdk.org > > Signed-off-by: Wei Huang > --- > drivers/bus/ifpga/ifpga_bus.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c > index > bb943b5..07e316b 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -135,6 +135,8 @@ struct rte_afu_device * > goto end; > } > afu_pr_conf.pr_enable = 1; > + strlcpy(afu_pr_conf.bs_path, path, > + sizeof(afu_pr_conf.bs_path)); > } else { > afu_pr_conf.pr_enable = 0; > } > @@ -174,7 +176,6 @@ struct rte_afu_device * > rawdev->dev_ops->dev_start(rawdev)) > goto end; > > - strlcpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path)); > if (rawdev->dev_ops && > rawdev->dev_ops->firmware_load && > rawdev->dev_ops->firmware_load(rawdev, > -- > 1.8.3.1 It looks good for me. Acked-by: Tianfei Zhang
RE: [PATCH v1] bus/ifpga: add fpga bus cleanup
Hi, > -Original Message- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:45 AM > To: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com > Cc: sta...@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] bus/ifpga: add fpga bus cleanup > > In this patch, cleanup method is implemented for FPGA bus which will be > called during eal_bus_cleanup(). > > Signed-off-by: Wei Huang > --- > drivers/bus/ifpga/ifpga_bus.c | 36 > > 1 file changed, 36 insertions(+) > > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c > index 07e316b..ffb0c61 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -360,6 +360,41 @@ struct rte_afu_device * > return ret; > } > > +/* > + * Cleanup the content of the Intel FPGA bus, and call the remove() > +function > + * for all registered devices. > + */ > +static int > +ifpga_cleanup(void) > +{ > + struct rte_afu_device *afu_dev, *tmp_dev; > + int error = 0; > + > + RTE_TAILQ_FOREACH_SAFE(afu_dev, &ifpga_afu_dev_list, next, > tmp_dev) { > + struct rte_afu_driver *drv = afu_dev->driver; > + int ret = 0; > + > + if (drv == NULL || drv->remove == NULL) > + goto free; > + > + ret = drv->remove(afu_dev); > + if (ret < 0) { > + rte_errno = errno; > + error = -1; > + } > + afu_dev->driver = NULL; > + afu_dev->device.driver = NULL; > + > +free: > + TAILQ_REMOVE(&ifpga_afu_dev_list, afu_dev, next); > + rte_devargs_remove(afu_dev->device.devargs); > + rte_intr_instance_free(afu_dev->intr_handle); > + free(afu_dev); > + } > + > + return error; > +} > + > static int > ifpga_plug(struct rte_device *dev) > { > @@ -470,6 +505,7 @@ struct rte_afu_device * static struct rte_bus > rte_ifpga_bus = { > .scan= ifpga_scan, > .probe = ifpga_probe, > + .cleanup = ifpga_cleanup, > .find_device = ifpga_find_device, > .plug= ifpga_plug, > .unplug = ifpga_unplug, > -- > 1.8.3.1 Acked-by: Rosen Xu
RE: [PATCH v1] raw/ifpga: remove virtual device unplug operation
Hi, > -Original Message- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:45 AM > To: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com > Cc: sta...@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] raw/ifpga: remove virtual device unplug operation > > VDEV bus has implemented cleanup() function to perform cleanup for > devices on the bus during eal_cleanup(), so there is no need for ifpga driver > to record virtual devices and unplug them. > > Signed-off-by: Wei Huang > --- > drivers/raw/ifpga/ifpga_rawdev.c | 99 > > drivers/raw/ifpga/ifpga_rawdev.h | 2 - > 2 files changed, 9 insertions(+), 92 deletions(-) > > diff --git a/drivers/raw/ifpga/ifpga_rawdev.c > b/drivers/raw/ifpga/ifpga_rawdev.c > index 1020adc..8e6e70f 100644 > --- a/drivers/raw/ifpga/ifpga_rawdev.c > +++ b/drivers/raw/ifpga/ifpga_rawdev.c > @@ -140,8 +140,6 @@ struct ifpga_rawdev * > for (i = 0; i < IFPGA_MAX_IRQ; i++) > dev->intr_handle[i] = NULL; > dev->poll_enabled = 0; > - for (i = 0; i < IFPGA_MAX_VDEV; i++) > - dev->vdev_name[i] = NULL; > > return dev; > } > @@ -749,17 +747,11 @@ static int set_surprise_link_check_aer( > struct ifpga_rawdev *ifpga_rdev = NULL; > struct opae_adapter *adapter; > struct opae_manager *mgr; > - char *vdev_name = NULL; > - int i, ret = 0; > + int ret = 0; > > if (dev) { > ifpga_rdev = ifpga_rawdev_get(dev); > if (ifpga_rdev) { > - for (i = 0; i < IFPGA_MAX_VDEV; i++) { > - vdev_name = ifpga_rdev->vdev_name[i]; > - if (vdev_name) > - rte_vdev_uninit(vdev_name); > - } > ifpga_monitor_stop_func(ifpga_rdev); > ifpga_rdev->rawdev = NULL; > } > @@ -1778,104 +1770,31 @@ static int ifpga_rawdev_get_string_arg(const > char *key __rte_unused, static int ifpga_cfg_probe(struct rte_vdev_device > *vdev) { > - struct rte_rawdev *rawdev = NULL; > - struct ifpga_rawdev *ifpga_dev; > struct ifpga_vdev_args args; > char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; > - const char *vdev_name = NULL; > - int i, n, ret = 0; > - > - vdev_name = rte_vdev_device_name(vdev); > - if (!vdev_name) > - return -EINVAL; > + int ret = 0; > > - IFPGA_RAWDEV_PMD_INFO("probe ifpga virtual device %s", > vdev_name); > + IFPGA_RAWDEV_PMD_INFO("probe ifpga virtual device %s", > + rte_vdev_device_name(vdev)); > > ret = ifpga_vdev_parse_devargs(vdev->device.devargs, &args); > if (ret) > return ret; > > memset(dev_name, 0, sizeof(dev_name)); > - snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "IFPGA:%s", > args.bdf); > - rawdev = rte_rawdev_pmd_get_named_dev(dev_name); > - if (!rawdev) > - return -ENODEV; > - ifpga_dev = ifpga_rawdev_get(rawdev); > - if (!ifpga_dev) > - return -ENODEV; > - > - for (i = 0; i < IFPGA_MAX_VDEV; i++) { > - if (ifpga_dev->vdev_name[i] == NULL) { > - n = strlen(vdev_name) + 1; > - ifpga_dev->vdev_name[i] = rte_malloc(NULL, n, 0); > - if (ifpga_dev->vdev_name[i] == NULL) > - return -ENOMEM; > - strlcpy(ifpga_dev->vdev_name[i], vdev_name, n); > - break; > - } > - } > - > - if (i >= IFPGA_MAX_VDEV) { > - IFPGA_RAWDEV_PMD_ERR("Can't create more virtual > device!"); > - return -ENOENT; > - } > - > snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s", > args.port, args.bdf); > - ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME), > - dev_name, vdev->device.devargs->args); > - if (ret) { > - rte_free(ifpga_dev->vdev_name[i]); > - ifpga_dev->vdev_name[i] = NULL; > - } > - > - return ret; > + return rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME), > dev_name, > + vdev->device.devargs->args); > } > > static int > ifpga_cfg_remove(struct rte_vdev_device *vdev) { > - struct rte_rawdev *rawdev = NULL; > - struct ifpga_rawdev *ifpga_dev; > - struct ifpga_vdev_args args; > - char dev_name[RTE_RAWDEV_NAME_MAX_LEN]; > - const char *vdev_name = NULL; > - char *tmp_vdev = NULL; > - int i, ret = 0; > - > - vdev_name = rte_vdev_device_name(vdev); > - if (!vdev_name) > - return -EINVAL; > + IFPGA_RAWDEV_PMD_INFO("remove ifpga virtual device %s", > + rte_vdev_device_name(vdev)); > > - IFPGA_RAWDEV_PMD_INFO("remove ifpga virtual device %s", > vdev_name); > - > - ret = ifpga_vdev_parse_devargs(vdev->device.devargs, &args); > - if (r
RE: [PATCH v1] net/ipn3ke: fix representor name
Hi, > -Original Message- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:45 AM > To: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com > Cc: sta...@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] net/ipn3ke: fix representor name > > The device name used in rte_eth_dev_allocated() function is afu device > name instead of representor name, this patch correct it. > > Fixes: c01c748e4ae6 ("net/ipn3ke: add new driver") > Cc: sta...@dpdk.org > > Signed-off-by: Wei Huang > --- > drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c > b/drivers/net/ipn3ke/ipn3ke_ethdev.c > index 70a06a3..2c15611 100644 > --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c > +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c > @@ -558,7 +558,7 @@ static int ipn3ke_vswitch_remove(struct > rte_afu_device *afu_dev) > snprintf(name, sizeof(name), "net_%s_representor_%d", > afu_dev->device.name, i); > > - ethdev = rte_eth_dev_allocated(afu_dev->device.name); > + ethdev = rte_eth_dev_allocated(name); > if (ethdev != NULL) > rte_eth_dev_destroy(ethdev, ipn3ke_rpst_uninit); > } > -- > 1.8.3.1 Acked-by: Rosen Xu
RE: [PATCH v1] net/ipn3ke: fix thread exit issue
Hi, > -Original Message- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:45 AM > To: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com > Cc: sta...@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] net/ipn3ke: fix thread exit issue > > Thread does not exit after driver is removed. When there is no more > representor exist, the variable 'num' will be 0 and thread can exit safely at > this time. > > Fixes: 70d6b7f550f4 ("net/ipn3ke: add representor") > Cc: sta...@dpdk.org > > Signed-off-by: Wei Huang > --- > drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c > b/drivers/net/ipn3ke/ipn3ke_representor.c > index 2ef96a9..e50fc73 100644 > --- a/drivers/net/ipn3ke/ipn3ke_representor.c > +++ b/drivers/net/ipn3ke/ipn3ke_representor.c > @@ -2579,7 +2579,7 @@ struct rte_eth_xstat_name *xstats_names, > } > rte_delay_us(50 * MS); > > - if (num == 0xff) > + if (num == 0 || num == 0xff) > return NULL; > } > > -- > 1.8.3.1 Acked-by: Rosen Xu
RE: [PATCH v1] bus/ifpga: fix issue of accessing null address
Hi, > -Original Message- > From: Huang, Wei > Sent: Friday, March 17, 2023 4:44 AM > To: dev@dpdk.org; tho...@monjalon.net; david.march...@redhat.com > Cc: sta...@dpdk.org; Xu, Rosen ; Zhang, Tianfei > ; Zhang, Qi Z ; Huang, Wei > > Subject: [PATCH v1] bus/ifpga: fix issue of accessing null address > > In function ifpga_scan_one(), variable 'path' is NULL if device argument > 'afu_bts' is not set, subsequent string copy with 'path' would lead to > segmentation fault. > > Fixes: 6fa4aa2b3645 ("bus/ifpga: fix forcing optional devargs") > Cc: sta...@dpdk.org > > Signed-off-by: Wei Huang > --- > drivers/bus/ifpga/ifpga_bus.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c > index bb943b5..07e316b 100644 > --- a/drivers/bus/ifpga/ifpga_bus.c > +++ b/drivers/bus/ifpga/ifpga_bus.c > @@ -135,6 +135,8 @@ struct rte_afu_device * > goto end; > } > afu_pr_conf.pr_enable = 1; > + strlcpy(afu_pr_conf.bs_path, path, > + sizeof(afu_pr_conf.bs_path)); > } else { > afu_pr_conf.pr_enable = 0; > } > @@ -174,7 +176,6 @@ struct rte_afu_device * > rawdev->dev_ops->dev_start(rawdev)) > goto end; > > - strlcpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path)); > if (rawdev->dev_ops && > rawdev->dev_ops->firmware_load && > rawdev->dev_ops->firmware_load(rawdev, > -- > 1.8.3.1 Acked-by: Rosen Xu