Re: [PATCH] vhost: fix FD entries cleanup

2025-02-06 Thread Chenbo Xia
> > static void > -vduse_events_handler(int fd, void *arg, int *remove __rte_unused) > +vduse_events_handler(int fd, void *arg, int *close __rte_unused) > { >struct virtio_net *dev = arg; >struct vduse_dev_request req; > @@ -563,14 +563,13 @@ vduse_reconnect_log_check(struct virtio_net *dev, > uint64_t features, uint32_t to > } > > static void > -vduse_reconnect_handler(int fd, void *arg, int *remove) > +vduse_reconnect_handler(int fd __rte_unused, void *arg, int *close) > { >struct virtio_net *dev = arg; > >vduse_device_start(dev, true); > > - close(fd); > - *remove = 1; > + *close = 1; > } > > static int > -- > 2.48.1 > Reviewed-by: Chenbo Xia

Re: [PATCH] net/vhost: improve devargs documentation

2025-02-06 Thread Chenbo Xia
t PMD acts as client or server. > + (Default: 0 (server)) > + > #. ``iommu-support``: > > It is used to enable iommu support in vhost library. > — > 2.47.0 > Reviewed-by: Chenbo Xia

Re: [PATCH] vhost: fix VDUSE devices registration

2025-02-06 Thread Chenbo Xia
@@ -1028,8 +1025,7 @@ rte_vhost_driver_register(const char *path, uint64_t > flags) >} > out: >pthread_mutex_unlock(&vhost_user.mutex); > - > - return ret; > + return -1; > } > > static bool > -- > 2.48.1 > Reviewed-by: Chenbo Xia

Re: [RFC 0/3] Vhost: fix FD entries cleanup

2025-02-04 Thread Chenbo Xia
Hi David, > On Feb 4, 2025, at 21:18, David Marchand wrote: > > External email: Use caution opening links or attachments > > > Hello vhost maintainers, > > On Tue, Dec 24, 2024 at 4:50 PM Maxime Coquelin > wrote: >> >> The vhost FD manager provides a way for the read/write >> callbacks to r

Re: [PATCH v3 3/3] vhost: improve RARP handling in dequeue paths

2025-01-16 Thread Chenbo Xia
; vchan_id); >else > - nb_rx = virtio_dev_tx_async_split_compliant(dev, vq, > mbuf_pool, > - pkts, count, dma_id, vchan_id); > + nb_rx += virtio_dev_tx_async_split_compliant(dev, vq, > mbuf_pool, > + pkts + nb_rx, count - nb_rx, dma_id, > vchan_id); >} > >*nr_inflight = vq->async->pkts_inflight_n; > @@ -4315,9 +4306,6 @@ rte_vhost_async_try_dequeue_burst(int vid, uint16_t > queue_id, > out_access_unlock: >rte_rwlock_read_unlock(&vq->access_lock); > > - if (unlikely(rarp_mbuf != NULL)) > - nb_rx += 1; > - > out_no_unlock: >return nb_rx; > } > -- > 2.47.1 > Reviewed-by: Chenbo Xia

Re: [PATCH v3 2/3] vhost: rework dequeue paths error handling

2025-01-16 Thread Chenbo Xia
IRTIO_DEV_LEGACY_OL_FLAGS) > - count = virtio_dev_tx_async_split_legacy(dev, vq, > mbuf_pool, > + nb_rx = virtio_dev_tx_async_split_legacy(dev, vq, > mbuf_pool, > pkts, count, dma_id, vchan_id); >else > - count = virtio_dev_tx_async_split_compliant(dev, vq, > mbuf_pool, > + nb_rx = virtio_dev_tx_async_split_compliant(dev, vq, > mbuf_pool, >pkts, count, dma_id, vchan_id); >} > >*nr_inflight = vq->async->pkts_inflight_n; > - vhost_queue_stats_update(dev, vq, pkts, count); > + vhost_queue_stats_update(dev, vq, pkts, nb_rx); > > out: >vhost_user_iotlb_rd_unlock(vq); > @@ -4322,8 +4316,8 @@ rte_vhost_async_try_dequeue_burst(int vid, uint16_t > queue_id, >rte_rwlock_read_unlock(&vq->access_lock); > >if (unlikely(rarp_mbuf != NULL)) > - count += 1; > + nb_rx += 1; > > out_no_unlock: > - return count; > + return nb_rx; > } > -- > 2.47.1 > Reviewed-by: Chenbo Xia

Re: [PATCH v3 1/3] vhost: fix missing packets count reset when not ready

2025-01-16 Thread Chenbo Xia
id, uint16_t queue_id, >rte_rwlock_read_unlock(&vq->access_lock); > >virtio_dev_vring_translate(dev, vq); > + > + count = 0; >goto out_no_unlock; >} > > -- > 2.47.1 > Reviewed-by: Chenbo Xia

Re: [PATCH] vhost: fix misleading log when setting max queue num

2025-01-10 Thread Chenbo Xia
um number of queue pairs supported by VDUSE > devices. However, a log mentioning the maximim number of maximum With above fixed: Reviewed-by: Chenbo Xia > queue pairs is being set is emitted unconditionally, which > may confuse the end user. > > This patch moves this log after the b

Re: [RFC] crypto/virtio: add vhost-vdpa backend

2024-11-26 Thread Chenbo Xia
Hi Gowrishankar, > On Nov 27, 2024, at 14:50, Gowrishankar Muthukrishnan > wrote: > > External email: Use caution opening links or attachments > > > Hi, > I wanted to follow up on my previous message regarding the development of a > vhost vDPA host driver for crypto/virtio. We have proposed

Re: [RFC v3 0/2] An API for Stashing Packets into CPU caches

2024-10-21 Thread Chenbo Xia
Hi, > On Oct 21, 2024, at 09:52, Wathsala Vithanage > wrote: > > External email: Use caution opening links or attachments > > > DPDK applications benefit from Direct Cache Access (DCA) features like > Intel DDIO and Arm's write-allocate-to-SLC. However, those features do > not allow fine-grai

Re: [PATCH] vhost: promote max queue setting API to stable

2024-10-09 Thread Chenbo Xia
> @@ -97,7 +98,6 @@ EXPERIMENTAL { >rte_vhost_async_dma_unconfigure; > ># added in 23.07 > - rte_vhost_driver_set_max_queue_num; >rte_vhost_notify_guest; > }; > > — > 2.46.2 > Reviewed-by: Chenbo Xia

Re: [PATCH v9 05/17] examples/vhost: fix free function mismatch

2024-10-08 Thread Chenbo Xia
bdev->data = rte_zmalloc(NULL, blk_cnt * blk_size, 0); >if (!bdev->data) { >fprintf(stderr, "No enough reserved huge memory for disk\n"); > - free(bdev); > + rte_free(bdev); >return NULL; >} > > -- > 2.45.2 > Reviewed-by: Chenbo Xia

Re: [PATCH v2 2/2] vhost: add reconnection support to VDUSE

2024-09-23 Thread Chenbo Xia
errno)); > + ret = -1; > + goto out_dev_destroy; > + } > + > + ret = fdset_add(vduse.fdset, reco_fd, > vduse_reconnect_handler, NULL, dev); > + if (ret) { > + VHOST_CONFIG_LOG(name, ERR, "Failed to add reconnect > fd %d to vduse fdset", > + reco_fd); > + goto out_dev_destroy; > + } > + > + ret = eventfd_write(reco_fd, (eventfd_t)1); > + if (ret < 0) { > + VHOST_CONFIG_LOG(name, ERR, "Failed to write to > reconnect eventfd"); > + goto out_dev_destroy; > + } > + } > >return 0; > > @@ -587,6 +796,9 @@ vduse_device_destroy(const char *path) >if (vid == RTE_MAX_VHOST_DEVICE) >return -1; > > + if (dev->reconnect_log) > + munmap(dev->reconnect_log, sizeof(*dev->reconnect_log)); > + >vduse_device_stop(dev); > >fdset_del(vduse.fdset, dev->vduse_dev_fd); > @@ -597,10 +809,26 @@ vduse_device_destroy(const char *path) >} > >if (dev->vduse_ctrl_fd >= 0) { > + char reconnect_file[PATH_MAX]; > + >ret = ioctl(dev->vduse_ctrl_fd, VDUSE_DESTROY_DEV, name); > - if (ret) > + if (ret) { >VHOST_CONFIG_LOG(name, ERR, "Failed to destroy VDUSE > device: %s", >strerror(errno)); > + } else { > + /* > +* VDUSE device was no more attached to the vDPA bus, > +* so we can remove the reconnect file. > +*/ > + ret = snprintf(reconnect_file, > sizeof(reconnect_file), "%s/%s", > + vduse_reconnect_dir, name); > + if (ret < 0 || ret == sizeof(reconnect_file)) > + VHOST_CONFIG_LOG(name, ERR, > + "Failed to create vduse > reconnect path name"); > + else > + unlink(reconnect_file); > + } > + >close(dev->vduse_ctrl_fd); >dev->vduse_ctrl_fd = -1; >} > -- > 2.46.0 > Reviewed-by: Chenbo Xia

Re: [PATCH v2 1/2] vhost: add logging mechanism for reconnection

2024-09-23 Thread Chenbo Xia
uct virtio_net *dev, struct > vhost_virtqueue *cvq, >cvq->last_avail_idx++; >if (cvq->last_avail_idx >= cvq->size) >cvq->last_avail_idx -= cvq->size; > + vhost_virtqueue_reconnect_log_split(cvq); > >if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) >vhost_avail_event(cvq) = cvq->last_avail_idx; > @@ -181,6 +182,7 @@ virtio_net_ctrl_pop(struct virtio_net *dev, struct > vhost_virtqueue *cvq, >cvq->last_avail_idx++; >if (cvq->last_avail_idx >= cvq->size) >cvq->last_avail_idx -= cvq->size; > + vhost_virtqueue_reconnect_log_split(cvq); > >if (dev->features & (1ULL << VIRTIO_RING_F_EVENT_IDX)) >vhost_avail_event(cvq) = cvq->last_avail_idx; > -- > 2.46.0 > Reviewed-by: Chenbo Xia

Re: [PATCH 2/2] vhost: add reconnection support to VDUSE

2024-09-06 Thread Chenbo Xia
Hi Maxime, > On Sep 5, 2024, at 22:26, Maxime Coquelin wrote: > > External email: Use caution opening links or attachments > > > This patch enables VDUSE reconnection support making use of > the newly introduced reconnection mechanism in Vhost > library. > > At DPDK VDUSE device creation time

Re: [PATCH v2] bus/pci: don't open uio device in secondary process

2024-08-29 Thread Chenbo Xia
name, sizeof(devname), "/dev/uio%u", uio_num); > + /* save fd */ > + fd = open(devname, O_RDWR); > + if (fd < 0) { > + PCI_LOG(ERR, "Cannot open %s: %s", devname, strerror(errno)); > + goto error; > + } > + > + if (rte_intr_fd_set(dev->intr_handle, fd)) > + goto error; > + > /* allocate the mapping details for secondary processes*/ > *uio_res = rte_zmalloc("UIO_RES", sizeof(**uio_res), 0); > if (*uio_res == NULL) { > -- > 2.45.0 > Reviewed-by: Chenbo Xia

Re: [PATCH] bus/pci: don't open uio device in secondary process

2024-08-29 Thread Chenbo Xia
-digit. Please also fix the coding style: WARNING:BLOCK_COMMENT_STYLE: Block comments use a trailing */ on a separate line #176: FILE: drivers/bus/pci/linux/pci_uio.c:265: + * closed, so open it only in the primary process */ With above fixed: Reviewed-by: Chenbo Xia &g

Re: [PATCH] vhost-user: optimize stats counters performance

2024-08-06 Thread Chenbo Xia
} > + ea = rte_pktmbuf_mtod(pkt, const struct rte_ether_addr *); > + RTE_BUILD_BUG_ON(offsetof(struct virtqueue_stats, broadcast) > != > + offsetof(struct virtqueue_stats, multicast) + > sizeof(uint64_t)); > + if (unlikely(rte_is_multicast_ether_addr(ea))) > + > (&stats->multicast)[rte_is_broadcast_ether_addr(ea)]++; >} > } > > -- > 2.43.0 > Reviewed-by: Chenbo Xia

Re: [PATCH v5] virtio: optimize stats counters performance

2024-08-06 Thread Chenbo Xia
-- a/drivers/net/virtio/virtio_rxtx.h > +++ b/drivers/net/virtio/virtio_rxtx.h > @@ -35,7 +35,7 @@ struct virtnet_tx { > }; > > int virtio_rxq_vec_setup(struct virtnet_rx *rxvq); > -void virtio_update_packet_stats(struct virtnet_stats *stats, > - struct rte_mbuf *mbuf); > +void virtio_update_packet_stats(struct virtnet_stats *const stats, > + const struct rte_mbuf *const mbuf); > > #endif /* _VIRTIO_RXTX_H_ */ > — > 2.43.0 > Reviewed-by: Chenbo Xia

Re: [PATCH v6 2/2] bus/pci: fix secondary process save 'FD' problem

2024-07-14 Thread Chenbo Xia
>> Reviewed-by: Chaoyong He >> Reviewed-by: Long Wu >> Reviewed-by: Peng Zhang >> Acked-by: Anatoly Burakov > > Chenbo, > Are you ok with this fix? Sorry that I was interrupted when I was reviewing this and later I forgot.. For this patch: Reviewed-by: Chenbo Xia > > Thanks. > > -- > David Marchand

Re: [PATCH] vhost: fix offset while mmaping log base address

2024-07-09 Thread Chenbo Xia
ase address") The commit id length should be 12. Since QEMU always send offset 0, I think it’s no need to backport the patch, so no cc-stable is fine. With above fixed: Reviewed-by: Chenbo Xia > Signed-off-by: BillXiang > --- > lib/vhost/vhost_user.c | 2 +- > 1 file changed,

Re: [PATCH v6 1/2] bus/pci: fix secondary process PCI uio resource map problem

2024-07-04 Thread Chenbo Xia
_pci_device *dev) >} >return -1; > } > - dev->mem_resource[i].addr = mapaddr; > + dev->mem_resource[res_idx].addr = mapaddr; > + > + i++; >} >return 0; >} > — > 2.39.1 > Reviewed-by: Chenbo Xia

Re: [PATCH 5/6] bus/pci: use a dynamic logtype

2024-06-25 Thread Chenbo Xia
mmon_uio.c | 15 +-- > drivers/bus/pci/pci_params.c | 9 +- > drivers/bus/pci/private.h| 6 + > drivers/bus/pci/windows/pci.c| 13 +- > drivers/bus/pci/windows/pci_netuio.c | 7 +- > 10 files changed, 202 insertions(+), 277 deletions(-) Reviewed-by: Chenbo Xia

Question about why doing VFIO RESET after device open

2024-05-06 Thread Chenbo Xia
Hi, I am not sure why we are calling ioctl(vfio_dev_fd, VFIO_DEVICE_RESET) in pci_rte_vfio_setup_device() , which is after opening the VFIO device fd. As I see in linux kernel, opening the vfio device fd will trigger the device reset and put device into clean state. Another VFIO_DEVICE_RESET se

Re: [PATCH v3 5/5] vhost: manage FD with epoll

2024-04-27 Thread Chenbo Xia
Hi Maxime, > On Apr 9, 2024, at 19:48, Maxime Coquelin wrote: > > External email: Use caution opening links or attachments > > > From: David Marchand > > Switch to epoll so that the concern over the poll() fd array > is removed. > Add a simple list of used entries and track the next free ent

Re: [PATCH v3 4/5] vhost: improve fdset initialization

2024-04-26 Thread Chenbo Xia
Hi Maxime, > On Apr 9, 2024, at 19:48, Maxime Coquelin wrote: > > External email: Use caution opening links or attachments > > > This patch heavily reworks fdset initialization: > - fdsets are now dynamically allocated by the FD manager > - the event dispatcher is now created by the FD manager

Re: [PATCH v7 1/2] vfio: add get device info API

2023-11-28 Thread Chenbo Xia
On Nov 22, 2023, at 18:22, Mingjin Ye wrote: > > External email: Use caution opening links or attachments > > > This patch adds an API to support getting device information. > > The driver can use the "rte_vfio_get_device_info" helper to get > device information from EAL. > > Signed-off-by: M

Re: [PATCH v2] bus/pci: revise support PASID control

2023-11-16 Thread Chenbo Xia
13/* Page Request Interface */ > -#define RTE_PCI_EXT_CAP_ID_PASID 0x1B/* Process Address Space ID */ > +#define RTE_PCI_EXT_CAP_ID_PASID 0x1b/* Process Address Space ID */ > > /* Advanced Error Reporting (RTE_PCI_EXT_CAP_ID_ERR) */ > #define RTE_PCI_ERR_UNCOR_STATUS 0x04/* Uncorrectable Error Status > */ > -- > 2.25.1 > Reviewed-by: Chenbo Xia

Re: [PATCH v1] bus/pci: revise support PASID control

2023-11-16 Thread Chenbo Xia
On Nov 17, 2023, at 01:43, Chen, Mike Ximing wrote: > > External email: Use caution opening links or attachments > > >> -Original Message----- >> From: Chenbo Xia >> Sent: Tuesday, November 14, 2023 8:54 PM >> To: Sevincer, Abdullah >> Cc: de

Re: [PATCH] vfio: add get device info API

2023-11-14 Thread Chenbo Xia
> On Nov 14, 2023, at 18:23, Mingjin Ye wrote: > > External email: Use caution opening links or attachments > > > This patch adds an API to support getting device information. > > The driver can use the "rte_vfio_get_device_info" helper to get > device information from EAL. > > Cc: sta...@d

Re: [PATCH v1] bus/pci: revise support PASID control

2023-11-14 Thread Chenbo Xia
On Nov 15, 2023, at 01:39, Sevincer, Abdullah wrote: > > External email: Use caution opening links or attachments > > >> +I don’t know about the details, so it means for different devices that >> support PASID, they have different offsets? > >> +Btw, Is this cap still not exposed to user spa

Re: [PATCH v1] bus/pci: revise support PASID control

2023-11-14 Thread Chenbo Xia
+Nipun Please cc me and Nipun if there is a new version. > On Nov 14, 2023, at 01:27, Abdullah Sevincer > wrote: > > External email: Use caution opening links or attachments > > > This commit revises PASID control function to accept PASID offset to > pasid *structure* instead of taking exact

Re: [PATCH v6 1/2] bus/pci: add function to enable/disable PASID

2023-11-05 Thread Chenbo Xia
Sorry I missed all previous versions… +ARM guy > On Nov 4, 2023, at 02:29, Abdullah Sevincer > wrote: > > External email: Use caution opening links or attachments > > > This commit implements an internal api to enable and disable PASID for > a device e.g. device driver event/dlb2. > > For k

[PATCH v2] maintainers: update email address

2023-10-22 Thread Chenbo Xia
I left Intel and joined Nvidia, so update my email address. Signed-off-by: Chenbo Xia Acked-by: Maxime Coquelin --- .mailmap| 2 +- MAINTAINERS | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.mailmap b/.mailmap index 3f5bab26a8..d40b3ad6c0 100644 --- a

[PATCH] maintainers: update email address

2023-10-20 Thread Chenbo Xia
I left Intel and joined Nvidia, so update my email address. Signed-off-by: Chenbo Xia --- .mailmap| 2 +- MAINTAINERS | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.mailmap b/.mailmap index 3f5bab26a8..2ff31b008f 100644 --- a/.mailmap +++ b/.mailmap

[PATCH] maintainers: update email address

2023-09-18 Thread Chenbo Xia
I am leaving Intel, so replace my Intel email with personal one temporarily. Signed-off-by: Chenbo Xia --- .mailmap| 2 +- MAINTAINERS | 12 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.mailmap b/.mailmap index 864d33ee46..8cb3c1e80f 100644 --- a/.mailmap

[PATCH] maintainers: update for PCI bus driver and library

2023-06-13 Thread Chenbo Xia
Add myself as maintainer of PCI bus driver and co-maintainer of PCI library. Signed-off-by: Chenbo Xia --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 906b31f97c..fea84b8cb9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -586,6 +586,7 @@ F

[PATCH] bus/pci: fix missing MMIO APIs in Windows

2023-06-08 Thread Chenbo Xia
MMIO read and write APIs were defined in PCI bus. But the corresponding implementations are not done in windows. This patch fixes this. Bugzilla ID: 1245 Fixes: 095cf6e68b28 ("bus/pci: introduce MMIO read/write") Cc: sta...@dpdk.org Signed-off-by: Chenbo Xia --- drivers/bus/pci/win

[RFC 4/4] bus/pci: add VFIO sparse mmap support

2023-04-17 Thread Chenbo Xia
This patch adds sparse mmap support in PCI bus. Sparse mmap is a capability defined in VFIO which allows multiple mmap areas in one VFIO region. Signed-off-by: Chenbo Xia --- drivers/baseband/acc/rte_acc100_pmd.c | 6 +- drivers/baseband/acc/rte_vrb_pmd.c| 6

[RFC 3/4] bus/pci: introduce helper for MMIO read and write

2023-04-17 Thread Chenbo Xia
The MMIO regions may not be mmap-able for VFIO-PCI devices. In this case, the driver should explicitly do read and write to access these regions. Signed-off-by: Chenbo Xia --- drivers/bus/pci/bsd/pci.c| 22 +++ drivers/bus/pci/linux/pci.c | 46

[RFC 1/4] bus/pci: introduce an internal representation of PCI device

2023-04-17 Thread Chenbo Xia
More fields will be added. Signed-off-by: Chenbo Xia --- drivers/bus/pci/bsd/pci.c| 13 - drivers/bus/pci/linux/pci.c | 28 drivers/bus/pci/pci_common.c | 12 ++-- drivers/bus/pci/private.h| 14 +- 4 files changed, 43 inser

[RFC 2/4] bus/pci: avoid depending on private value in kernel source

2023-04-17 Thread Chenbo Xia
The value 40 used in VFIO_GET_REGION_ADDR() is a private value (VFIO_PCI_OFFSET_SHIFT) defined in Linux kernel source [1]. It is not part of VFIO API, and we should not depend on it. [1] https://github.com/torvalds/linux/blob/v6.2/include/linux/vfio_pci_core.h Signed-off-by: Chenbo Xia

[RFC 0/4] Support VFIO sparse mmap in PCI bus

2023-04-17 Thread Chenbo Xia
driver choose which way it perfers since either option has its own Pros & Cons. Please share your comments, Thanks! Chenbo Xia (4): bus/pci: introduce an internal representation of PCI device bus/pci: avoid depending on private value in kernel source bus/pci: introduce helper for M

[dpdk-dev] [PATCH] examples/vhost: fix port init failure in mergeable mode

2021-11-03 Thread Chenbo Xia
fail. This patch checks the device's max mtu before setting the ethdev configuration. If the device has a max mtu, use that value to configure. Fixes: 1bb4a528c41f ("ethdev: fix max Rx packet length") Signed-off-by: Chenbo Xia Reported-by: Xingguang He --- examples/vhost/main.c |

[dpdk-dev] [PATCH] doc: remove deprecation notice for vhost

2021-11-02 Thread Chenbo Xia
Ten vhost APIs were announced to be stable and promoted in below commit, so remove the related deprecation notice. Fixes: 945ef8a04098 ("vhost: promote some APIs to stable") Signed-off-by: Chenbo Xia Reported-by: Maxime Coquelin --- doc/guides/rel_notes/deprecation.rst | 8 --

[dpdk-dev] [PATCH v2 7/7] bus/pci: remove ABIs in PCI bus

2021-09-17 Thread Chenbo Xia
-by: Chenbo Xia Acked-by: Ray Kinsella Acked-by: Rosen Xu --- app/test/virtual_pmd.c| 2 +- doc/guides/rel_notes/release_21_11.rst| 2 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers

[dpdk-dev] [PATCH v2 6/7] kni: replace unused variable definition with reserved bytes

2021-09-17 Thread Chenbo Xia
PCI ID and address in structure rte_kni_conf are never used. And in order not to break ABI, replace these variables with reserved bytes. Signed-off-by: Chenbo Xia --- lib/kni/rte_kni.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h

[dpdk-dev] [PATCH v2 5/7] kni: remove unused PCI info from test and example

2021-09-17 Thread Chenbo Xia
PCI device id and address in structure rte_kni_conf are never used in the test, example and kni library. So remove the related code. Fixes: ea6b39b5b847 ("kni: remove ethtool support") Cc: sta...@dpdk.org Signed-off-by: Chenbo Xia Acked-by: Ferruh Yigit --- app/test/test_kni.c

[dpdk-dev] [PATCH v2 4/7] examples/kni: remove unused PCI bus header

2021-09-17 Thread Chenbo Xia
The header rte_bus_pci.h is included in kni example but nothing in it is used. So remove it. Signed-off-by: Chenbo Xia Acked-by: Ferruh Yigit --- examples/kni/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/kni/main.c b/examples/kni/main.c index beabb3c848..6dc335c0b5 100644

[dpdk-dev] [PATCH v2 3/7] examples/ethtool: use PCI library API to get PCI address

2021-09-17 Thread Chenbo Xia
Currently ethtool example uses struct rte_pci_device to know PCI address of a device. As this API will be removed later in PCI bus, this patch uses PCI library API to get the PCI address. Signed-off-by: Chenbo Xia --- examples/ethtool/lib/rte_ethtool.c | 14 +- examples/ethtool

[dpdk-dev] [PATCH v2 2/7] app/testpmd: use PCI memory resource access APIs

2021-09-17 Thread Chenbo Xia
Currently testpmd uses struct rte_pci_device to access PCI memory resource. Since this structure will be internal later, this patch replaces use of rte_pci_device with new PCI memory resource access APIs to read/write BAR 0. Signed-off-by: Chenbo Xia --- app/test-pmd/config.c | 50

[dpdk-dev] [PATCH v2 1/7] bus/pci: add new memory resource access APIs

2021-09-17 Thread Chenbo Xia
Some applications wants to access PCI memory resource. Currently applications use struct rte_pci_device to access it. Since the structure will be made internal later, this patch adds two APIs for memory resource access. Signed-off-by: Chenbo Xia Acked-by: Ray Kinsella --- doc/guides/rel_notes

[dpdk-dev] [PATCH v2 0/7] Removal of PCI bus ABIs

2021-09-17 Thread Chenbo Xia
backport (David) Chenbo Xia (7): bus/pci: add new memory resource access APIs app/testpmd: use PCI memory resource access APIs examples/ethtool: use PCI library API to get PCI address examples/kni: remove unused PCI bus header kni: remove unused PCI info from test and example kni: replace

[dpdk-dev] [PATCH 8/8] bus/pci: remove ABIs in PCI bus

2021-09-09 Thread Chenbo Xia
-by: Chenbo Xia --- app/test/virtual_pmd.c| 2 +- doc/guides/rel_notes/release_21_11.rst| 2 + drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2

[dpdk-dev] [PATCH 7/8] kni: replace unused variable definition with reserved bytes

2021-09-09 Thread Chenbo Xia
PCI ID and address in structure rte_kni_conf are never used. And in order not to break ABI, replace these variables with reserved bytes. Signed-off-by: Chenbo Xia --- lib/kni/rte_kni.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/kni/rte_kni.h b/lib/kni/rte_kni.h

[dpdk-dev] [PATCH 6/8] examples/ip_pipeline: remove setting of PCI ID and address

2021-09-09 Thread Chenbo Xia
PCI ID and address in structure rte_kni_conf are never used and will be removed in kni library. So remove the setting of them first in the example. Signed-off-by: Chenbo Xia --- examples/ip_pipeline/kni.c | 16 1 file changed, 16 deletions(-) diff --git a/examples/ip_pipeline

[dpdk-dev] [PATCH 5/8] test/kni: remove setting of PCI ID and address

2021-09-09 Thread Chenbo Xia
PCI device id and address in structure rte_kni_conf are never used in the test and kni library. So remove the related code. Signed-off-by: Chenbo Xia --- app/test/test_kni.c | 57 - 1 file changed, 57 deletions(-) diff --git a/app/test/test_kni.c b

[dpdk-dev] [PATCH 4/8] examples/kni: remove unused PCI bus header

2021-09-09 Thread Chenbo Xia
The header rte_bus_pci.h is included in kni example but nothing in it is used. So remove it. Signed-off-by: Chenbo Xia --- examples/kni/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/kni/main.c b/examples/kni/main.c index beabb3c848..6dc335c0b5 100644 --- a/examples/kni

[dpdk-dev] [PATCH 3/8] examples/ethtool: use PCI library API to get PCI address

2021-09-09 Thread Chenbo Xia
Currently ethtool example uses struct rte_pci_device to know PCI address of a device. As this API will be removed later in PCI bus, this patch uses PCI library API to get the PCI address. Signed-off-by: Chenbo Xia --- examples/ethtool/lib/rte_ethtool.c | 14 +- examples/ethtool

[dpdk-dev] [PATCH 2/8] app/testpmd: use PCI memory resource access APIs

2021-09-09 Thread Chenbo Xia
Currently testpmd uses struct rte_pci_device to access PCI memory resource. Since this structure will be internal later, this patch replaces use of rte_pci_device with new PCI memory resource access APIs to read/write BAR 0. Signed-off-by: Chenbo Xia --- app/test-pmd/config.c | 38

[dpdk-dev] [PATCH 1/8] bus/pci: add new memory resource access APIs

2021-09-09 Thread Chenbo Xia
Some applications wants to access PCI memory resource. Currently applications use struct rte_pci_device to access it. Since the structure will be made internal later, this patch adds two APIs for memory resource access. Signed-off-by: Chenbo Xia --- doc/guides/rel_notes/release_21_11.rst | 5

[dpdk-dev] [PATCH 0/8] Removal of PCI bus ABIs

2021-09-09 Thread Chenbo Xia
bus header in examples. Patch 5-7 clean up the unused PCI related structure in kni library and related tests and examples. Patch 8 finally removes most of ABIs in PCI bus. Chenbo Xia (8): bus/pci: add new memory resource access APIs app/testpmd: use PCI memory resource access APIs examples

[dpdk-dev] [PATCH] vhost: promote some APIs to stable

2021-09-06 Thread Chenbo Xia
As reported by symbol bot, APIs listed in this patch have been experimental for more than two years. This patch promotes these 18 APIs to stable. Signed-off-by: Chenbo Xia --- lib/vhost/rte_vhost.h| 13 - lib/vhost/rte_vhost_crypto.h | 5 - lib/vhost/version.map

[dpdk-dev] [PATCH v2] vhost: announce experimental tag removal of vhost APIs

2021-07-30 Thread Chenbo Xia
This patch announces the experimental tag removal of 10 vhost APIs, which have been experimental for more than 2 years. All APIs could be made stable in DPDK 21.11. Signed-off-by: Chenbo Xia Acked-by: Maxime Coquelin --- doc/guides/rel_notes/deprecation.rst | 8 1 file changed, 8

[dpdk-dev] [PATCH] vhost: announce experimental tag removal of vhost APIs

2021-07-30 Thread Chenbo Xia
This patch announces the experimental tag removal of 10 vhost APIs, which have been experimental for more than 2 years. All APIs could be made stable in DPDK 21.11. Signed-off-by: Chenbo Xia Acked-by: Maxime Coquelin --- doc/guides/rel_notes/deprecation.rst | 8 1 file changed, 8

[dpdk-dev] [PATCH] net/virtio: fix uninitialized duplex mode

2021-07-26 Thread Chenbo Xia
when fron-end does not have the feature named VIRTIO_NET_F_SPEED_DUPLEX. Fixes: 1357b4b36246 ("net/virtio: support Virtio link speed feature") Cc: sta...@dpdk.org Signed-off-by: Chenbo Xia --- drivers/net/virtio/virtio_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/

[dpdk-dev] [PATCH] doc: announce removal of ABIs in PCI bus driver

2021-06-01 Thread Chenbo Xia
All ABIs in PCI bus driver, which are defined in rte_buc_pci.h, will be removed and the header will be made internal. Signed-off-by: Chenbo Xia --- doc/guides/rel_notes/deprecation.rst | 5 + 1 file changed, 5 insertions(+) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides

[dpdk-dev] [RFC v3 6/6] bus/pci: add sparse mmap support for mediated PCI devices

2021-05-31 Thread Chenbo Xia
This patch adds sparse mmap support in PCI bus. Sparse mmap is a capability defined in VFIO which allows multiple mmap areas in one VFIO region. Mediated pci devices could use this capability to let mdev parent driver have control over access of non-mmapable part of regions. Signed-off-by: Chenbo

[dpdk-dev] [RFC v3 5/6] bus/pci: add mdev support

2021-05-31 Thread Chenbo Xia
ce address; Signed-off-by: Cunming Liang Signed-off-by: Tiwei Bie Signed-off-by: Chenbo Xia --- drivers/bus/pci/linux/pci.c | 30 ++- drivers/bus/pci/linux/pci_init.h | 15 +- drivers/bus/pci/linux/pci_vfio.c | 147 -- drivers/bus/pci/linux/pci_vfio_md

[dpdk-dev] [RFC v3 4/6] eal: add a helper for reading string from sysfs

2021-05-31 Thread Chenbo Xia
From: Tiwei Bie This patch adds a helper for reading string from sysfs. Signed-off-by: Cunming Liang Signed-off-by: Tiwei Bie --- lib/eal/common/eal_filesystem.h | 10 ++ lib/eal/freebsd/eal.c | 22 ++ lib/eal/linux/eal.c | 22

[dpdk-dev] [RFC v3 3/6] bus/pci: introduce helper for MMIO read and write

2021-05-31 Thread Chenbo Xia
From: Tiwei Bie The MMIO regions may not be mmap-able for mediated PCI device. In this case, the application should explicitly do read and write to access these regions. Signed-off-by: Tiwei Bie --- drivers/bus/pci/bsd/pci.c| 22 +++ drivers/bus/pci/linux/pci.c | 46 ++

[dpdk-dev] [RFC v3 2/6] bus/pci: avoid depending on private value in kernel source

2021-05-31 Thread Chenbo Xia
From: Tiwei Bie The value 40 used in VFIO_GET_REGION_ADDR() is a private value (VFIO_PCI_OFFSET_SHIFT) defined in Linux kernel source [1]. It is not part of VFIO API, and we should not depend on it. [1] https://github.com/torvalds/linux/blob/v5.12/drivers/vfio/pci/vfio_pci_private.h Signed-off

[dpdk-dev] [RFC v3 1/6] bus/pci: introduce an internal representation of PCI device

2021-05-31 Thread Chenbo Xia
cture. More fields will be added in the coming patches. Suggested-by: David Marchand Signed-off-by: Tiwei Bie Signed-off-by: Chenbo Xia --- drivers/bus/pci/bsd/pci.c| 14 +- drivers/bus/pci/linux/pci.c | 27 --- drivers/bus/pci/pci_common.c | 2 +- driver

[dpdk-dev] [RFC v3 0/6] Add mdev (Mediated device) support in DPDK

2021-05-31 Thread Chenbo Xia
driver-api/vfio-mediated-device.rst Chenbo Xia (1): bus/pci: add sparse mmap support for mediated PCI devices Tiwei Bie (5): bus/pci: introduce an internal representation of PCI device bus/pci: avoid depending on private value in kernel source bus/pci: introduce helper for MMIO read and wri

[dpdk-dev] [PATCH] vhost: fix wrong IOTLB initialization

2021-05-13 Thread Chenbo Xia
disabled queues are not initialized. Fixes: 968bbc7e2e50 ("vhost: avoid IOTLB mempool allocation while IOMMU disabled") Signed-off-by: Chenbo Xia --- lib/vhost/vhost_user.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/vhost/vhost_user.c b

[dpdk-dev] [PATCH] examples/vhost: fix unchecked return value

2021-02-18 Thread Chenbo Xia
This patch fixes unchecked return value for rte_vhost_get_mem_table(), which is reported by coverity. Coverity issue: 364233 Fixes: ca059fa5e290 ("examples/vhost: demonstrate the new generic APIs") Cc: sta...@dpdk.org Signed-off-by: Chenbo Xia --- examples/vhost/virtio_net.c | 8 +

[dpdk-dev] [PATCH v3 8/8] doc: update release notes for iavf emudev driver

2021-01-13 Thread Chenbo Xia
Update release notes for emulated iavf driver. Signed-off-by: Chenbo Xia --- doc/guides/rel_notes/release_21_02.rst | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_21_02.rst b/doc/guides/rel_notes/release_21_02.rst index 9686930de3

[dpdk-dev] [PATCH v3 7/8] test/emudev: introduce functional test

2021-01-13 Thread Chenbo Xia
This patch introduces functional test for emudev. The implementation of iavf emudev selftest is also added. Signed-off-by: Miao Li Signed-off-by: Chenbo Xia --- app/test/meson.build | 5 +- app/test/test_emudev.c | 29 + drivers/emu/iavf/iavf_emu.c

[dpdk-dev] [PATCH v3 6/8] emu/iavf: add emudev operations to fit in emudev framework

2021-01-13 Thread Chenbo Xia
This patch implements emudev operations to make emulated iavf fit into rte_emudev framework. Lifecycle related and device resource related operations are both implemented. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- drivers/emu/iavf/iavf_emu.c | 229

[dpdk-dev] [PATCH v3 5/8] emu/iavf: add resource management and internal logic of iavf

2021-01-13 Thread Chenbo Xia
This patch adds the allocation and release of device resources. Device resources include PCI BARs' memory and interrupt related resources. Device internal logic is also added. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- drivers/emu/iavf/iavf_emu.c | 1 + drivers/emu

[dpdk-dev] [PATCH v3 4/8] emu/iavf: add vfio-user device register and unregister

2021-01-13 Thread Chenbo Xia
This patch adds vfio-user APIs call in driver probe and remove. rte_vfio_user_register() and rte_vfio_user_unregister() are called to create/destroy a vfio-user device. Notify callbacks that libvfio_user defines are also implemented. Signed-off-by: Chenbo Xia Signed-off-by: Miao Li --- drivers

[dpdk-dev] [PATCH v3 3/8] emu: introduce emulated iavf driver

2021-01-13 Thread Chenbo Xia
This patch introduces emulated iavf driver. It is a vdev driver emulating all iavf device behavior except data path handling. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- MAINTAINERS | 7 + drivers/emu/iavf/iavf_emu.c | 30 drivers/emu/iavf

[dpdk-dev] [PATCH v3 2/8] doc: add emudev library guide

2021-01-13 Thread Chenbo Xia
Add emudev library guide and update release notes. Signed-off-by: Chenbo Xia --- doc/guides/prog_guide/emudev.rst | 122 + doc/guides/prog_guide/index.rst| 1 + doc/guides/rel_notes/release_21_02.rst | 12 +++ 3 files changed, 135 insertions(+) create

[dpdk-dev] [PATCH v3 1/8] lib: introduce emudev library

2021-01-13 Thread Chenbo Xia
driver) to plug in its high performance data path. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu Signed-off-by: Miao Li --- MAINTAINERS | 5 + lib/librte_emudev/meson.build | 5 + lib/librte_emudev/rte_emudev.c | 502 lib

[dpdk-dev] [PATCH v3 0/8] Introduce emudev library and iavf emudev driver

2021-01-13 Thread Chenbo Xia
ng rawdev APIs could only cover lifecycle management APIs and some of backend facing APIs. Other APIs, even if added to rawdev API are not required by other rawdev applications. -- v3: - fix interrupt issue in iavf emudev driver (Jingjing) v2: - fix driver meson

[dpdk-dev] [PATCH v2 9/9] doc: add vfio-user library guide

2021-01-13 Thread Chenbo Xia
Add vfio-user library guide and update release notes. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- doc/guides/prog_guide/index.rst | 1 + doc/guides/prog_guide/vfio_user_lib.rst | 215 doc/guides/rel_notes/release_21_02.rst | 11 ++ 3 files

[dpdk-dev] [PATCH v2 8/9] test/vfio_user: introduce functional test

2021-01-13 Thread Chenbo Xia
This patch introduces functional test for vfio_user client and server. Note that the test can only be run with server and client both started and server should be started first. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- app/test/meson.build | 4 + app/test/test_vfio_user.c

[dpdk-dev] [PATCH v2 7/9] vfio_user: add client APIs of DMA/IRQ/region

2021-01-13 Thread Chenbo Xia
rte_vfio_user_set_irqs Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- lib/librte_vfio_user/rte_vfio_user.h| 177 ++ lib/librte_vfio_user/version.map| 9 + lib/librte_vfio_user/vfio_user_client.c | 419 3 files changed, 605 insertions(+) diff --git a/lib

[dpdk-dev] [PATCH v2 6/9] vfio_user: add client APIs of device attach/detach

2021-01-13 Thread Chenbo Xia
This patch implements two APIs, rte_vfio_user_attach_dev() and rte_vfio_user_detach_dev() for vfio-user client to connect to or disconnect from a vfio-user device on server side. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- lib/librte_vfio_user/meson.build| 3 +- lib

[dpdk-dev] [PATCH v2 5/9] vfio_user: implement interrupt related APIs

2021-01-13 Thread Chenbo Xia
This patch implements two interrupt related APIs, which are rte_vfio_user_get_irq() and rte_vfio_user_set_irq_info(). The former is for devices to get interrupt configuration (e.g., irqfds). The latter is for setting interrupt information before vfio-user starts. Signed-off-by: Chenbo Xia Signed

[dpdk-dev] [PATCH v2 4/9] vfio_user: implement DMA table and socket address API

2021-01-13 Thread Chenbo Xia
device ID and socket address in notify callbacks. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- lib/librte_vfio_user/rte_vfio_user.h| 77 - lib/librte_vfio_user/version.map| 2 + lib/librte_vfio_user/vfio_user_base.h | 2 + lib/librte_vfio_user/vfio_user_server.c

[dpdk-dev] [PATCH v2 3/9] vfio_user: implement device and region related APIs

2021-01-13 Thread Chenbo Xia
This patch introduces device and region related APIs, which are rte_vfio_user_set_dev_info() and rte_vfio_user_set_reg_info(). The corresponding vfio-user command handling is also added with the definition of all vfio-user command identity. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu

[dpdk-dev] [PATCH v2 2/9] vfio_user: implement lifecycle related APIs

2021-01-13 Thread Chenbo Xia
This patch implements three lifecycle related APIs for vfio-user server, which are rte_vfio_user_register(), rte_vfio_user_unregister() and rte_vfio_user_start(). Socket an device management is implemented along with the API introduction. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu

[dpdk-dev] [PATCH v2 1/9] lib: introduce vfio-user library

2021-01-13 Thread Chenbo Xia
This patch introduces vfio-user library, which follows vfio-user protocol v1.0. As vfio-user has server and client implementation, this patch introduces basic structures and internal functions that will be used by both server and client. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu

[dpdk-dev] [PATCH v2 0/9] Introduce vfio-user library

2021-01-13 Thread Chenbo Xia
de in vfio-user server APIs (Beilei) - Fix some typos Chenbo Xia (9): lib: introduce vfio-user library vfio_user: implement lifecycle related APIs vfio_user: implement device and region related APIs vfio_user: implement DMA table and socket address API vfio_user: implement interrupt re

[dpdk-dev] [PATCH v2 8/8] doc: update release notes for iavf emudev driver

2020-12-18 Thread Chenbo Xia
Update release notes for emulated iavf driver. Signed-off-by: Chenbo Xia --- doc/guides/rel_notes/release_21_02.rst | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/guides/rel_notes/release_21_02.rst b/doc/guides/rel_notes/release_21_02.rst index 3d26b6b580

[dpdk-dev] [PATCH v2 7/8] test/emudev: introduce functional test

2020-12-18 Thread Chenbo Xia
This patch introduces functional test for emudev. The implementation of iavf emudev selftest is also added. Signed-off-by: Miao Li Signed-off-by: Chenbo Xia --- app/test/meson.build | 5 +- app/test/test_emudev.c | 29 + drivers/emu/iavf/iavf_emu.c

[dpdk-dev] [PATCH v2 6/8] emu/iavf: add emudev operations to fit in emudev framework

2020-12-18 Thread Chenbo Xia
This patch implements emudev opertions to make emulated iavf fit into rte_emudev framework. Lifecycle related and device resource related operations are both implemented. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- drivers/emu/iavf/iavf_emu.c | 218

[dpdk-dev] [PATCH v2 5/8] emu/iavf: add resource management and internal logic of iavf

2020-12-18 Thread Chenbo Xia
This patch adds the allocation and release of device resources. Device resources include PCI BARs' memory and interrupt related resources. Device internal logic is also added. Signed-off-by: Chenbo Xia Signed-off-by: Xiuchun Lu --- drivers/emu/iavf/iavf_emu.c | 1 + drivers/emu

[dpdk-dev] [PATCH v2 4/8] emu/iavf: add vfio-user device register and unregister

2020-12-18 Thread Chenbo Xia
This patch adds vfio-user APIs call in driver probe and remove. rte_vfio_user_register() and rte_vfio_user_unregister() are called to create/destroy a vfio-user device. Notify callbacks that libvfio_user defines are also implemented. Signed-off-by: Chenbo Xia Signed-off-by: Miao Li --- drivers

  1   2   >