Commit Graph

32337 Commits

Author SHA1 Message Date
Satheesh Paul
6a65e22a4d common/cnxk: fix unaligned access to device memory
Use mbox_memcpy() instead of memcpy() to prevent unaligned access.

Fixes: 1f66919817 ("common/cnxk: improve MCAM entries management")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-03 10:02:00 +02:00
Satheesh Paul
c8647cd7f3 net/cnxk: add message on flow parsing failure
Set the error message with rte_flow_error_set() API
when flow parsing fails.

Fixes: 8c009b4505 ("net/cnxk: support flow API")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Reviewed-by: Kiran Kumar K <kirankumark@marvell.com>
2022-05-03 08:08:35 +02:00
Rahul Bhansali
5a75f63818 net/cnxk: use ROC errata API
Used errata APIs roc_errata_nix_has_no_drop_re() and
roc_errata_nix_has_cq_min_size_4k() instead of direct
ROC model check.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-02 20:31:30 +02:00
Rahul Bhansali
1f997c06c3 common/cnxk: add ROC errata list
Created roc_errata.h to list the errata handled in userspace drivers.
Added no_drop_re, cq_min_size_4k, no_fc_stype_ststp, no_drop_aging,
no_vwqe_flush_op etc erratas.

Signed-off-by: Rahul Bhansali <rbhansali@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-02 20:31:15 +02:00
Sunil Kumar Kori
d49bdfcf0d net/cnxk: fix crash during hotplug detach operation
hot_plug application does not perform any port setup
configuration via rte_eth_dev_configure() API. All the probed
Ethernet ports do not contain any Rx and Tx queues.

While detaching a device via rte_eal_hotplug_remove(), CNXK
driver expects Rx and Tx queues structures populated during
reset of PFC. So application gets crashed as data->rx_queues
and data->tx_queues are NULL.

Fixes: 9544713564 ("net/cnxk: support priority flow control")
Cc: stable@dpdk.org

Signed-off-by: Sunil Kumar Kori <skori@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-05-02 19:42:38 +02:00
Volodymyr Fialko
7ae43d883d common/cnxk: add null check for inline device
Inline device could be null in cases when it was not bound or missing.
Added check to prevent null pointer access.

Fixes: fe5846bcc0 ("net/cnxk: add devargs for min-max SPI")
Cc: stable@dpdk.org

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
2022-05-02 19:42:38 +02:00
Satheesh Paul
c6353c5754 common/cnxk: fix QinQ ROC item mismatch
ROC code is assuming presence of vlan extension headers in
case of QinQ, because of this, there is incompatibility
between the driver and ROC. Fixed this in ROC by treating
QINQ as multiple VLAN pattern items for DPDK (as opposed to
treating QINQ as separate pattern item).

Fixes: b8ac8b089c ("common/cnxk: support matching VLAN existence")
Cc: stable@dpdk.org

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-25 07:08:21 +02:00
Satheesh Paul
fe8e6571d5 common/cnxk: correct ROC naming conventions
Corrected some names to follow ROC naming convention in ROC NPC code.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-25 07:07:25 +02:00
Satheesh Paul
75902770ae net/cnxk: support mark pattern item type
Added support for RTE_FLOW_ITEM_TYPE_MARK. This item type
can be used to create ingress flow rules to match packets
from CPT's second pass packets.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-24 05:52:58 +02:00
Satheesh Paul
4968b362b6 common/cnxk: support CPT second pass flow rules
Added support to create flow rules to match packets
from CPT's second pass packets. With this change, ingress
rules will be created with bits 10 and 11 of channel field
in the MCAM ignored by default. For rules specific to
second pass packets, the CPT channel bits will be set
in the MCAM.

Signed-off-by: Satheesh Paul <psatheesh@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
2022-04-24 05:51:40 +02:00
Huisong Li
f0b3966a50 app/testpmd: fix MTU verification
The macro RTE_ETHER_MIN_LEN isn't the minimum value of MTU. But testpmd
used it when execute 'port config mtu 0 xx' cmd. This patch fixes it.

Fixes: 1bb4a528c4 ("ethdev: fix max Rx packet length")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2022-05-12 18:29:04 +02:00
Min Hu (Connor)
baef6bbfad app/testpmd: check statistics query before printing
In function 'fwd_stats_display', if function 'rte_eth_stats_get' fails,
'stats' is uncertainty value. The display result will be abnormal.

This patch check the return value of 'rte_eth_stats_get' to avoid
display abnormal stats.

Fixes: 53324971a1 ("app/testpmd: display/clear forwarding stats on demand")
Cc: stable@dpdk.org

Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Acked-by: Aman Singh <aman.deep.singh@intel.com>
2022-05-12 18:29:04 +02:00
Huisong Li
ec16914942 net/hns3: remove unnecessary RSS switch
Whether the RSS is enabled depends on RTE_ETH_MQ_RX_RSS_FLAG and packet
tuple are enabled. So the RSS switch is unnecessary.

Fixes: 5e782bc257 ("net/hns3: fix configuring RSS hash when rules are flushed")
Fixes: fd81968387 ("net/hns3: fix configuring device with RSS enabled")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 15:56:59 +02:00
Huisong Li
93e1ea6dfa ethdev: fix RSS update when RSS is disabled
The RTE_ETH_MQ_RX_RSS_FLAG flag is a switch to enable RSS. If the flag
is not set in dev_configure, RSS will be not configured and enabled.
However, RSS hash and reta can still be configured by ethdev ops to
enable RSS if the flag isn't set. The behavior is inconsistent.

Fixes: 99a2dd955f ("lib: remove librte_ prefix from directory names")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@xilinx.com>
2022-05-12 15:49:57 +02:00
Huisong Li
bfd0b54dc8 net/hns3: remove redundant RSS tuple field
The 'rss_tuple_fields' in struct struct hns3_rss_conf::rss_tuple_sets is
redundant. Because the enabled RSS tuple in PMD is already managed by
the 'types' in struct hns3_rss_conf::conf. This patch removes this
redundant variable.

Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Huisong Li
07f64b5f57 net/hns3: fix rollback on RSS hash update
The RSS tuple isn't restored when RSS key length is invalid or setting
algo key failed. This patch fixes it.

Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Huisong Li
75ccc3f3d7 net/hns3: fix RSS disable
Currently, hns3 PMD disable RSS by resetting redirection table when user
set rss_hf to 0 so as to all packets go to queue 0. The implementation
may cause following problems:
1) the same type packet may go to different queue on the case of
   disabling all tuples and partial tuples. The problem is determined by
   hardware design.
2) affect the configuration of redirection table and user experience.

For hns3 hardware, the packets with RSS disabled are always go to the
queue corresponding to first entry of the redirection table. Generally,
disable RSS should be implemented by disabling all tuples, This patch
fix the implementation.

Fixes: c37ca66f2b ("net/hns3: support RSS")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Chengwen Feng
2d287ea3c2 net/hns3: fix mbuf free on Tx done cleanup
Currently, the hns3 PMD may free more mbufs than free_cnt parameter,
this is an incorrect implementation. This patch fixes it.

Fixes: 0b77e8f3d3 ("net/hns3: optimize Tx performance")
Cc: stable@dpdk.org

Signed-off-by: Chengwen Feng <fengchengwen@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Huisong Li
ec0147b569 net/hns3: fix pseudo-sharing between threads
Some fields in the end of 'struct hns3_rx_queue' and
'struct hns3_tx_queue' are not accessed in the I/O path.
But these fields may be accessed in other threads, which may lead to the
problem of cache pseudo-sharing of IO threads. This patch add a
cacheline alignment to avoid it.

Fixes: 9261fd3caf ("net/hns3: improve IO path data cache usage")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Huisong Li
a65342d9d5 net/hns3: fix MAC and queues HW statistics overflow
The MAC and queues statistics are 32-bit registers in hardware. If
hardware statistics are not obtained for a long time, these statistics
will be overflow.
So PF and VF driver have to periodically obtain and save these
statistics. Since the periodical task and the stats API are in different
threads, we introduce a statistics lock to protect the statistics.

Fixes: 8839c5e202 ("net/hns3: support device stats")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Huisong Li
1a1de9879f net/hns3: fix order of clearing imissed register in PF
Clearing imissed registers in PF hardware depends on the
'drop_stats_mode' in struct hns3_hw. The variable is initialized after
the "hns3_get_configuration". But, in current code, the clearing
operation runs before the function.
So this patch fixes this order. In addition, this patch extracts a
public function to initialize and uninitialize statistics to improve the
maintainability of these codes.

Fixes: 3e9f3042d7 ("net/hns3: add imissed packet stats")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-12 10:28:54 +02:00
Aman Singh
8c9e97ddbe ethdev: fix build with vtune option
When VTune profile option is enabled, compilation error is seen.

Bugzilla ID: 1004
Fixes: f9bdee267a ("ethdev: hide internal structures")
Cc: stable@dpdk.org

Signed-off-by: Aman Singh <aman.deep.singh@intel.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
2022-05-12 10:23:52 +02:00
Quentin Armitage
0809d870fc net/tap: fix interrupt handler freeing
rte_pmd_tun/tap_probe() allocates pmd->intr_handle in eth_dev_tap_create()
and it should not be freed until rte_pmd_tap_remove() is called.

Inspection of tap_rx_intr_vec_set() shows that the call to
tap_tx_intr_vec_uninstall() was calling rte_intr_instance_free() but
tap_tx_intr_vec_install() can then be immediately called, and this then
uses pmd->intr_handle without it being reallocated.

Move rte_intr_instance_free() call from tap_tx_intr_vec_uninstall()
to rte_pmd_tap_remove().

Fixes: d61138d4f0 ("drivers: remove direct access to interrupt handle")
Cc: stable@dpdk.org

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
Reviewed-by: David Marchand <david.marchand@redhat.com>
2022-05-12 10:11:16 +02:00
Huisong Li
1c5c6cd85f net/bonding: fix slave stop and remove on port close
All slaves will be stopped and removed when closing a bonded port.
But the while loop can not end if both rte_eth_dev_stop and
rte_eth_bond_slave_remove fails, runs infinitely.
This is because the skipped slave port counted in both function failures
but it should be counted only one.

Fixing by not continue to process in the loop after first failure.

Fixes: fb0379bc5d ("net/bonding: check stop call status")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-11 14:48:16 +02:00
Huisong Li
f5e72e8e8d net/bonding: fix stopping non-active slaves
When stopping a bonded port, all slaves should be stopped. But only
active slaves are stopped.
So fix by stopping all slave ports and later do "deactivate_slave()" for
active slaves.

Fixes: 0911d4ec01 ("net/bonding: fix crash when stopping mode 4 port")
Cc: stable@dpdk.org

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
2022-05-11 14:48:16 +02:00
Kevin Liu
8da794e956 net/ice: support power management in DCF mode
Implement support for the power management API by implementing a
'get_monitor_addr' function that will return an address of an RX ring's
status bit.

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Kevin Liu
2abb590ff7 net/ice: support DCF queue information query
Add below ops,
rxq_info_get
txq_info_get

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Kevin Liu
d72071dda2 net/ice: support extended statistics in DCF mode
Add implementation of xstats() functions in DCF PMD.

Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Alvin Zhang
1e1dd4d8c7 net/ice: support DCF VLAN filter and offload
Below PMD ops are supported in this patch:
    .vlan_filter_set  = dcf_dev_vlan_filter_set
    .vlan_offload_set = dcf_dev_vlan_offload_set

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Kevin Liu
22f3907338 net/ice: support DCF MAC configuration
Below PMD ops are supported in this patch:
    .mac_addr_add      = dcf_dev_add_mac_addr
    .mac_addr_remove   = dcf_dev_del_mac_addr
    .set_mc_addr_list  = dcf_set_mc_addr_list
    .mac_addr_set      = dcf_dev_set_default_mac_addr

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Alvin Zhang
cdfbcfa110 net/ice: support DCF promiscuous configuration
Support configuration of unicast and multicast promisc on dcf.

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Jie Wang
9a69ac8014 net/ice: add supported packet types query to DCF mode
Add API "dev_supported_ptypes_get" to DCF, that DCF pmd can get
ptypes through the new API.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Jie Wang
1298c7d7d0 net/ice: support MTU configuration in DCF mode
add API "mtu_set" to dcf, and it can configure the port mtu through
cmdline.

Signed-off-by: Jie Wang <jie1x.wang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Robin Zhang
f6168ca7af net/ice: support Tx buffers cleanup in DCF mode
Add support for ops rte_eth_tx_done_cleanup in dcf

Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Steve Yang
c223cadc9e net/ice: support RSS hash configuration in DCF mode
RSS HASH should be updated and queried by application,
Add related ops ('.rss_hash_update', '.rss_hash_conf_get') for DCF.

Because DCF doesn't support configure RSS HASH, only HASH key can be
updated within ops '.rss_hash_update'.

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:24 +02:00
Steve Yang
79b1f7ab46 net/ice: support RSS RETA configuration in DCF mode
RSS RETA should be updated and queried by application,
Add related ops ('.reta_update', '.reta_query') for DCF.

Signed-off-by: Steve Yang <stevex.yang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:54:20 +02:00
Wenjun Wu
33db16136e net/iavf: improve performance of Rx timestamp offload
In this patch, We use CPU ticks instead of HW register
to determine whether low 32 bits timestamp has turned
over. It can avoid requesting register value frequently
and improve receiving performance.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:53:22 +02:00
Simei Su
b5cd735132 net/iavf: enable Rx timestamp on flex descriptor
Dump Rx timestamp value into dynamic mbuf field by flex descriptor.
This feature is turned on by dev config "enable-rx-timestamp".
Currently, it's only supported under scalar path.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:53:18 +02:00
Simei Su
90160401a2 common/iavf: support Rx timestamp in virtual channel
Add new ops and structures to support VF to support Rx timestamp
on flex descriptor.

"VIRTCHNL_OP_1588_PTP_GET_CAPS" ops is sent by the VF to request PTP
capabilities and responded by the PF with capabilities enabled for
that VF.

"VIRTCHNL_OP_1588_PTP_GET_TIME" ops is sent by the VF to request
the current time of the PHC. The PF will respond by reading the
device time and reporting it back to the VF.

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:51:51 +02:00
Zhichao Zeng
ef1fff204c net/ixgbe: promote MDIO API
Promote the MDIO APIs to be stable.

Signed-off-by: Zhichao Zeng <zhichaox.zeng@intel.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
2022-05-09 03:51:51 +02:00
Qiming Yang
93866b3b68 doc: update matching versions in ice guide
Add recommended matching list for ice PMD in DPDK 22.03.

Cc: stable@dpdk.org

Signed-off-by: Qiming Yang <qiming.yang@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
2022-05-09 03:51:51 +02:00
Qi Zhang
8c03aa5e00 net/ice: optimize maximum queue number calculation
Remove the limitation that max queue pair number must be 2^n.
With this patch, even on a 8 ports device, the max queue pair
number increased from 128 to 254.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Wenjun Wu <wenjun1.wu@intel.com>
2022-05-09 03:51:51 +02:00
Gagandeep Singh
ee6647e016 net/dpaa: fix event queue detach
Calling the correct qman queue free APIs to de-attach the queue.

Fixes: 5e74559314 ("net/dpaa: support Rx queue configurations with eventdev")
Cc: stable@dpdk.org

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-05-10 15:43:09 +02:00
Gagandeep Singh
0bffc64a0b net/dpaa2: support ESP in packet type parsing
This patch supports ESP packet type in packet parsing.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-05-10 15:43:09 +02:00
Gagandeep Singh
3fa54e3d00 net/dpaa2: support mempool debug
This patch supports mempool debug to detect
buffer overflows.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-05-10 15:43:08 +02:00
Rohit Raj
01690f8f53 net/dpaa2: update management complex to 10.32
Updating the management complex to version 10.32

Signed-off-by: Rohit Raj <rohit.raj@nxp.com>
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2022-05-10 15:43:08 +02:00
Walter Heymans
733afb244d net/nfp: update how max MTU is read
The 'max_rx_pktlen' value was previously read from hardware, which was
set by the running firmware. This caused confusion due to different
meanings of 'MAX_MTU'. This patch updates the 'max_rx_pktlen' to the
maximum value that the NFP NIC can support. The 'max_mtu' value that is
read from hardware, is assigned to the 'dev_info->max_mtu' variable.

If more layer 2 metadata must be used, the firmware can be updated to
report a smaller 'max_mtu' value.

The constant defined for NFP_FRAME_SIZE_MAX is derived for the maximum
supported buffer size of 10240, minus 136 bytes that is reserved by the
hardware and another 56 bytes reserved for expansion in firmware. This
results in a usable maximum packet length of 10048 bytes.

Signed-off-by: Walter Heymans <walter.heymans@corigine.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Richard Donkin <richard.donkin@corigine.com>
2022-05-10 13:53:29 +02:00
Xueming Li
476048d546 vdpa/mlx5: make statistics counter persistent
In order to speed-up the device suspend and resume, make the statistics
counters persistent in reconfiguration until the device gets removed.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2022-05-09 21:39:58 +02:00
Xueming Li
d7e5d5a7e5 vdpa/mlx5: support device cleanup callback
This patch supports device cleanup callback API which is called when
the device is disconnected from the VM. Cached resources like VM MR and
VQ memory are released.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2022-05-09 21:39:58 +02:00
Xueming Li
934ef2b666 vdpa/mlx5: cache and reuse hardware resources
During device suspend and resume, resources are not changed normally.
When huge resources were allocated to VM, like huge memory size or lots
of queues, time spent on release and recreate became significant.

To speed up, this patch reuses resources like VM MR and VirtQ memory if
not changed.

Signed-off-by: Xueming Li <xuemingl@nvidia.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
2022-05-09 21:39:58 +02:00