From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Marvin Liu <yong.liu@intel.com>, tiwei.bie@intel.com
Cc: zhihong.wang@intel.com, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2 3/8] net/virtio-user: add mrg_rxbuf and in_order vdev parameters
Date: Wed, 27 Jun 2018 08:53:33 +0200 [thread overview]
Message-ID: <42496d13-3583-4ef4-a813-3157cdce48de@redhat.com> (raw)
In-Reply-To: <20180625151710.29437-4-yong.liu@intel.com>
On 06/25/2018 05:17 PM, Marvin Liu wrote:
> Add parameters for configuring VIRTIO_NET_F_MRG_RXBUF and
> VIRTIO_F_IN_ORDER feature bits. If feature is disabled, also update
> corresponding unsupported feature bit.
>
> Signed-off-by: Marvin Liu <yong.liu@intel.com>
>
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index 360a92eae..34a7f53ac 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -375,7 +375,8 @@ virtio_user_dev_setup(struct virtio_user_dev *dev)
>
> int
> virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
> - int cq, int queue_size, const char *mac, char **ifname)
> + int cq, int queue_size, const char *mac, char **ifname,
> + int mrg_rxbuf, int in_order)
> {
> pthread_mutex_init(&dev->mutex, NULL);
> snprintf(dev->path, PATH_MAX, "%s", path);
> @@ -420,6 +421,16 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
> dev->device_features = VIRTIO_USER_SUPPORTED_FEATURES;
> }
>
> + if (!mrg_rxbuf) {
> + dev->device_features &= ~(1ull << VIRTIO_NET_F_MRG_RXBUF);
> + dev->unmask_features |= (1ull << VIRTIO_NET_F_MRG_RXBUF);
> + }
> +
> + if (!in_order) {
> + dev->device_features &= ~(1ull << VIRTIO_F_IN_ORDER);
> + dev->unmask_features |= (1ull << VIRTIO_F_IN_ORDER);
> + }
> +
> if (dev->mac_specified)
> dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
> else {
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.h b/drivers/net/virtio/virtio_user/virtio_user_dev.h
> index a1da5f56c..b97eec075 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.h
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.h
> @@ -48,7 +48,8 @@ int is_vhost_user_by_type(const char *path);
> int virtio_user_start_device(struct virtio_user_dev *dev);
> int virtio_user_stop_device(struct virtio_user_dev *dev);
> int virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
> - int cq, int queue_size, const char *mac, char **ifname);
> + int cq, int queue_size, const char *mac, char **ifname,
> + int mrg_rxbuf, int in_order);
> void virtio_user_dev_uninit(struct virtio_user_dev *dev);
> void virtio_user_handle_cq(struct virtio_user_dev *dev, uint16_t queue_idx);
> uint8_t virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs);
> diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
> index 0c02c6851..e9a5039aa 100644
> --- a/drivers/net/virtio/virtio_user_ethdev.c
> +++ b/drivers/net/virtio/virtio_user_ethdev.c
> @@ -358,8 +358,12 @@ static const char *valid_args[] = {
> VIRTIO_USER_ARG_QUEUE_SIZE,
> #define VIRTIO_USER_ARG_INTERFACE_NAME "iface"
> VIRTIO_USER_ARG_INTERFACE_NAME,
> -#define VIRTIO_USER_ARG_SERVER_MODE "server"
> +#define VIRTIO_USER_ARG_SERVER_MODE "server"
> VIRTIO_USER_ARG_SERVER_MODE,
> +#define VIRTIO_USER_ARG_MRG_RXBUF "mrg_rxbuf"
> + VIRTIO_USER_ARG_MRG_RXBUF,
> +#define VIRTIO_USER_ARG_IN_ORDER "in_order"
> + VIRTIO_USER_ARG_IN_ORDER,
> NULL
> };
>
> @@ -462,6 +466,8 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
> uint64_t cq = VIRTIO_USER_DEF_CQ_EN;
> uint64_t queue_size = VIRTIO_USER_DEF_Q_SZ;
> uint64_t server_mode = VIRTIO_USER_DEF_SERVER_MODE;
> + uint64_t mrg_rxbuf = 1;
> + uint64_t in_order = 1;
> char *path = NULL;
> char *ifname = NULL;
> char *mac_addr = NULL;
> @@ -561,6 +567,24 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
> goto end;
> }
>
> + if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_MRG_RXBUF) == 1) {
> + if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_MRG_RXBUF,
> + &get_integer_arg, &mrg_rxbuf) < 0) {
> + PMD_INIT_LOG(ERR, "error to parse %s",
> + VIRTIO_USER_ARG_MRG_RXBUF);
> + goto end;
> + }
> + }
> +
> + if (rte_kvargs_count(kvlist, VIRTIO_USER_ARG_IN_ORDER) == 1) {
> + if (rte_kvargs_process(kvlist, VIRTIO_USER_ARG_IN_ORDER,
> + &get_integer_arg, &in_order) < 0) {
> + PMD_INIT_LOG(ERR, "error to parse %s",
> + VIRTIO_USER_ARG_IN_ORDER);
> + goto end;
> + }
> + }
> +
> if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> struct virtio_user_dev *vu_dev;
>
> @@ -577,7 +601,8 @@ virtio_user_pmd_probe(struct rte_vdev_device *dev)
> else
> vu_dev->is_server = false;
> if (virtio_user_dev_init(hw->virtio_user_dev, path, queues, cq,
> - queue_size, mac_addr, &ifname) < 0) {
> + queue_size, mac_addr, &ifname, mrg_rxbuf,
> + in_order) < 0) {
Doesn't the indent change looks weird here?
> PMD_INIT_LOG(ERR, "virtio_user_dev_init fails");
> virtio_user_eth_dev_free(eth_dev);
> goto end;
> @@ -655,4 +680,6 @@ RTE_PMD_REGISTER_PARAM_STRING(net_virtio_user,
> "cq=<int> "
> "queue_size=<int> "
> "queues=<int> "
> - "iface=<string>");
> + "iface=<string>"
> + "mrg_rxbuf=<0|1>"
> + "in_order=<0|1>");
>
Maybe the new options should be documented?
Regards,
Maxime
next prev parent reply other threads:[~2018-06-27 6:53 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 15:17 [dpdk-dev] [PATCH v2 0/8] support VIRTIO_F_IN_ORDER feature Marvin Liu
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 1/8] vhost: announce VIRTIO_F_IN_ORDER support Marvin Liu
2018-06-26 7:54 ` Maxime Coquelin
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 2/8] net/virtio: add VIRTIO_F_IN_ORDER definition Marvin Liu
2018-06-26 7:58 ` Maxime Coquelin
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 3/8] net/virtio-user: add mrg_rxbuf and in_order vdev parameters Marvin Liu
2018-06-27 6:53 ` Maxime Coquelin [this message]
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 4/8] net/virtio: free IN_ORDER descriptors before device start Marvin Liu
2018-06-27 6:58 ` Maxime Coquelin
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 5/8] net/virtio: extract common part for IN_ORDER functions Marvin Liu
2018-06-27 6:59 ` Maxime Coquelin
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 6/8] net/virtio: support IN_ORDER Rx and Tx Marvin Liu
2018-06-27 8:18 ` Maxime Coquelin
2018-06-27 14:27 ` Liu, Yong
2018-06-27 14:32 ` Maxime Coquelin
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 7/8] net/virtio: add IN_ORDER Rx/Tx into selection Marvin Liu
2018-06-27 8:19 ` Maxime Coquelin
2018-06-28 14:11 ` Liu, Yong
2018-06-25 15:17 ` [dpdk-dev] [PATCH v2 8/8] net/virtio: annouce VIRTIO_F_IN_ORDER support Marvin Liu
2018-06-27 8:20 ` Maxime Coquelin
2018-06-26 7:56 ` [dpdk-dev] [PATCH v2 0/8] support VIRTIO_F_IN_ORDER feature Maxime Coquelin
2018-06-26 8:01 ` Liu, Yong
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=42496d13-3583-4ef4-a813-3157cdce48de@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=tiwei.bie@intel.com \
--cc=yong.liu@intel.com \
--cc=zhihong.wang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).