From: Yuanhan Liu <yuanhan.liu@linux.intel.com>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org, Victor Kaplansky <vkaplans@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH 1/4] vhost: handle VHOST_USER_SET_LOG_BASE request
Date: Mon, 7 Dec 2015 10:00:35 +0800 [thread overview]
Message-ID: <20151207020035.GD29571@yliu-dev.sh.intel.com> (raw)
In-Reply-To: <2679675.c6cKM9bBsr@xps13>
On Mon, Dec 07, 2015 at 12:07:28AM +0100, Thomas Monjalon wrote:
> 2015-12-02 15:53, Panu Matilainen:
> > This (and other changes in patch 2 breaks the librte_vhost ABI again, so
> > you'd need to at least add a deprecation note to 2.2 to be able to do it
> > in 2.3 at all according to the ABI policy.
> >
> > Perhaps a better option would be adding some padding to the structs now
> > for 2.2 since the vhost ABI is broken there anyway. That would at least
> > give a chance to keep it compatible from 2.2 to 2.3.
>
> Please could you point where the vhost ABI is broken in 2.2?
Thomas, here are the changes to rte_virtio_net.h:
$ git diff 381316f6a225139d22d39b5ab8d50c40607924ca..19d4d7ef2a216b5418d8edb5b004d1a58bba3cc1 \
-- lib/librte_vhost/rte_virtio_net.h >
diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h
index e3a21e5..426a70d 100644
--- a/lib/librte_vhost/rte_virtio_net.h
+++ b/lib/librte_vhost/rte_virtio_net.h
@@ -89,6 +89,7 @@ struct vhost_virtqueue {
volatile uint16_t last_used_idx_res; /**< Used for multiple devices reserving buffers. */
int callfd; /**< Used to notify the guest (trigger interrupt). */
int kickfd; /**< Currently unused as polling mode is enabled. */
+ int enabled;
struct buf_vector buf_vec[BUF_VECTOR_MAX]; /**< for scatter RX. */
} __rte_cache_aligned;
@@ -96,7 +97,6 @@ struct vhost_virtqueue {
* Device structure contains all configuration information relating to the device.
*/
struct virtio_net {
- struct vhost_virtqueue *virtqueue[VIRTIO_QNUM]; /**< Contains all virtqueue information. */
struct virtio_memory *mem; /**< QEMU memory and memory region information. */
uint64_t features; /**< Negotiated feature set. */
uint64_t protocol_features; /**< Negotiated protocol feature set. */
@@ -104,7 +104,9 @@ struct virtio_net {
uint32_t flags; /**< Device flags. Only used to check if device is running on data core. */
#define IF_NAME_SZ (PATH_MAX > IFNAMSIZ ? PATH_MAX : IFNAMSIZ)
char ifname[IF_NAME_SZ]; /**< Name of the tap device or socket path. */
+ uint32_t virt_qp_nb; /**< number of queue pair we have allocated */
void *priv; /**< private context */
+ struct vhost_virtqueue *virtqueue[VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX]; /**< Contains all virtqueue information. */
} __rte_cache_aligned;
/**
@@ -131,7 +133,7 @@ struct virtio_memory {
};
/**
- * Device operations to add/remove device.
+ * Device and vring operations.
*
* Make sure to set VIRTIO_DEV_RUNNING to the device flags in new_device and
* remove it in destroy_device.
@@ -140,12 +142,18 @@ struct virtio_memory {
struct virtio_net_device_ops {
int (*new_device)(struct virtio_net *); /**< Add device. */
void (*destroy_device)(volatile struct virtio_net *); /**< Remove device. */
+
+ int (*vring_state_changed)(struct virtio_net *dev, uint16_t queue_id, int enable); /**< triggered when a vring is enabled or disabled */
};
static inline uint16_t __attribute__((always_inline))
rte_vring_available_entries(struct virtio_net *dev, uint16_t queue_id)
{
struct vhost_virtqueue *vq = dev->virtqueue[queue_id];
+
+ if (!vq->enabled)
+ return 0;
+
return *(volatile uint16_t *)&vq->avail->idx - vq->last_used_idx_res;
}
--yliu
next prev parent reply other threads:[~2015-12-07 1:59 UTC|newest]
Thread overview: 98+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 3:43 [PATCH 0/4 for 2.3] vhost-user live migration support Yuanhan Liu
2015-12-02 3:43 ` [PATCH 1/4] vhost: handle VHOST_USER_SET_LOG_BASE request Yuanhan Liu
2015-12-02 13:53 ` Panu Matilainen
2015-12-02 14:31 ` Yuanhan Liu
2015-12-02 14:48 ` Panu Matilainen
2015-12-02 15:09 ` Yuanhan Liu
2015-12-02 16:58 ` Panu Matilainen
2015-12-02 17:24 ` Michael S. Tsirkin
2015-12-02 16:38 ` Thomas Monjalon
2015-12-03 1:49 ` Yuanhan Liu
2015-12-06 23:07 ` Thomas Monjalon
2015-12-07 2:00 ` Yuanhan Liu [this message]
2015-12-07 2:03 ` Thomas Monjalon
2015-12-07 2:18 ` Yuanhan Liu
2015-12-07 2:49 ` Thomas Monjalon
2015-12-07 6:29 ` Panu Matilainen
2015-12-07 11:28 ` Thomas Monjalon
2015-12-07 11:41 ` Panu Matilainen
2015-12-07 13:55 ` Thomas Monjalon
2015-12-07 16:48 ` Panu Matilainen
2015-12-07 17:47 ` Thomas Monjalon
2015-12-08 5:57 ` Xie, Huawei
2015-12-08 7:25 ` Yuanhan Liu
2015-12-02 3:43 ` [PATCH 2/4] vhost: introduce vhost_log_write Yuanhan Liu
2015-12-02 13:53 ` Victor Kaplansky
2015-12-02 14:39 ` Yuanhan Liu
2015-12-09 3:33 ` Xie, Huawei
2015-12-09 3:42 ` Yuanhan Liu
2015-12-09 5:44 ` Xie, Huawei
2015-12-09 8:41 ` Yuanhan Liu
2015-12-02 3:43 ` [PATCH 3/4] vhost: log vring changes Yuanhan Liu
2015-12-02 14:07 ` Victor Kaplansky
2015-12-02 14:38 ` Yuanhan Liu
2015-12-02 15:58 ` Victor Kaplansky
2015-12-02 16:26 ` Michael S. Tsirkin
2015-12-03 2:31 ` Yuanhan Liu
2015-12-09 2:45 ` Xie, Huawei
2015-12-02 3:43 ` [PATCH 4/4] vhost: enable log_shmfd protocol feature Yuanhan Liu
2015-12-02 14:10 ` [PATCH 0/4 for 2.3] vhost-user live migration support Victor Kaplansky
2015-12-02 14:33 ` Yuanhan Liu
2015-12-09 3:41 ` Xie, Huawei
2015-12-17 3:11 ` [PATCH v2 0/6] " Yuanhan Liu
2015-12-17 3:11 ` [PATCH v2 1/6] vhost: handle VHOST_USER_SET_LOG_BASE request Yuanhan Liu
2015-12-21 15:32 ` Xie, Huawei
2015-12-22 2:25 ` Yuanhan Liu
2015-12-22 2:41 ` Xie, Huawei
2015-12-22 2:55 ` Yuanhan Liu
2015-12-17 3:11 ` [PATCH v2 2/6] vhost: introduce vhost_log_write Yuanhan Liu
2015-12-21 15:06 ` Xie, Huawei
2015-12-22 2:40 ` Yuanhan Liu
2015-12-22 2:45 ` Xie, Huawei
2015-12-22 3:04 ` Yuanhan Liu
2015-12-22 7:02 ` Xie, Huawei
2015-12-22 5:11 ` Peter Xu
2015-12-22 6:09 ` Yuanhan Liu
2015-12-17 3:11 ` [PATCH v2 3/6] vhost: log used vring changes Yuanhan Liu
2015-12-22 6:55 ` Peter Xu
2015-12-22 7:07 ` Xie, Huawei
2015-12-22 7:59 ` Peter Xu
2015-12-22 7:13 ` Yuanhan Liu
2015-12-22 8:01 ` Peter Xu
2015-12-17 3:11 ` [PATCH v2 4/6] vhost: log vring desc buffer changes Yuanhan Liu
2015-12-17 3:12 ` [PATCH v2 5/6] vhost: claim that we support GUEST_ANNOUNCE feature Yuanhan Liu
2015-12-22 8:11 ` Peter Xu
2015-12-22 8:21 ` Yuanhan Liu
2015-12-22 8:24 ` Pavel Fedin
2015-12-17 3:12 ` [PATCH v2 6/6] vhost: enable log_shmfd protocol feature Yuanhan Liu
2015-12-17 12:08 ` [PATCH v2 0/6] vhost-user live migration support Iremonger, Bernard
2015-12-17 12:45 ` Yuanhan Liu
2015-12-21 8:17 ` Pavel Fedin
2016-01-29 4:57 ` [PATCH v3 0/8] " Yuanhan Liu
2016-01-29 4:57 ` [PATCH v3 1/8] vhost: handle VHOST_USER_SET_LOG_BASE request Yuanhan Liu
2016-01-29 4:57 ` [PATCH v3 2/8] vhost: introduce vhost_log_write Yuanhan Liu
2016-02-19 14:26 ` Thomas Monjalon
2016-02-22 6:59 ` Yuanhan Liu
2016-01-29 4:57 ` [PATCH v3 3/8] vhost: log used vring changes Yuanhan Liu
2016-01-29 4:57 ` [PATCH v3 4/8] vhost: log vring desc buffer changes Yuanhan Liu
2016-01-29 4:58 ` [PATCH v3 5/8] vhost: claim that we support GUEST_ANNOUNCE feature Yuanhan Liu
2016-03-11 12:39 ` Olivier MATZ
2016-03-11 13:16 ` Thomas Monjalon
2016-03-11 13:22 ` Olivier MATZ
2016-01-29 4:58 ` [PATCH v3 6/8] vhost: handle VHOST_USER_SEND_RARP request Yuanhan Liu
2016-02-19 6:11 ` Tan, Jianfeng
2016-02-19 7:03 ` Yuanhan Liu
2016-02-19 8:55 ` Yuanhan Liu
2016-02-22 14:36 ` [PATCH] vhost: broadcast RARP pkt by injecting it to receiving mbuf array Yuanhan Liu
2016-02-24 8:15 ` Qiu, Michael
2016-02-24 8:28 ` Yuanhan Liu
2016-02-25 7:55 ` Qiu, Michael
2016-02-29 15:56 ` Thomas Monjalon
2016-01-29 4:58 ` [PATCH v3 7/8] vhost: enable log_shmfd protocol feature Yuanhan Liu
2016-01-29 4:58 ` [PATCH v3 8/8] vhost: remove duplicate header include Yuanhan Liu
2016-02-01 15:54 ` [PATCH v3 0/8] vhost-user live migration support Iremonger, Bernard
2016-02-02 1:53 ` Yuanhan Liu
2016-02-19 15:01 ` Thomas Monjalon
2016-02-22 7:08 ` Yuanhan Liu
2016-02-22 9:56 ` Thomas Monjalon
2016-02-22 14:24 ` Yuanhan Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151207020035.GD29571@yliu-dev.sh.intel.com \
--to=yuanhan.liu@linux.intel.com \
--cc=dev@dpdk.org \
--cc=mst@redhat.com \
--cc=thomas.monjalon@6wind.com \
--cc=vkaplans@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.