From patchwork Thu Mar 29 16:05:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chas Williams <3chas3@gmail.com> X-Patchwork-Id: 36675 X-Patchwork-Delegate: maxime.coquelin@redhat.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 17C972C01; Thu, 29 Mar 2018 18:05:17 +0200 (CEST) Received: from mail-qt0-f196.google.com (mail-qt0-f196.google.com [209.85.216.196]) by dpdk.org (Postfix) with ESMTP id 2BAA92965; Thu, 29 Mar 2018 18:05:15 +0200 (CEST) Received: by mail-qt0-f196.google.com with SMTP id f16so6759939qth.3; Thu, 29 Mar 2018 09:05:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=9PGW4yatTNfxvb1fUCumupf37CeDtE+eFuwdSI++a9Q=; b=LVtMt+t5eQkCO/J2TJdAY1k3CcC+pqfQ0bX0IiscnXuBU7kmjQdtt+3fEegb0E2dP2 bv++Pi+YiakQW5KVC0YAG9n7MSlssjqvGew5oV1RSHUK7kvwd+HOPmoGEiYnpIzQJPLZ I1+7S4ik1QEojbvWXJSrZmT0X4Q3SkDEyvDplnPc0l2AjWj7OZTzkrVMD26MntM5/Nu1 LvZUTQ67pgzkzHowo8c4qWI2HDhwr/2puj8bT1CMEQ7qNPmmmbVaW4JTcUuv9LLc1W1X J3ihTvyrDJL21aj/ed1+nMY61iekhaIXA71VBb8iuEQmhzCMIKVHK5l0Tq8+Javhe0nB 0EaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9PGW4yatTNfxvb1fUCumupf37CeDtE+eFuwdSI++a9Q=; b=KE8cPRq0tyhTtCxOIkSFwGN/oQXeS5jpvihGhJkanEmjIuu39HWQWDUuiBOKGjaF4e vvzxudhKpfRBI40uv2AVx58PBMBjpw9mzYe0Yq/vVbWuK1LhO8roN4H1WgQRaarq+Pid WBuJcFQM5PBqq9klsa5H6gXeFRvOItVzZcYr+kHR1tY27T1WCGsJz/0zk+ZDq3pmKpBV R52GbYfixhO3bFc3Ziijsiub4klcF5cJpjVrBSshBAvXqz6UOg3E96glCU3/g3kdlg5/ Z7CDiiR8Pwaz7SqCaheyh3/F7HBIRazIBLO3xiGSdQoa8NP7x+q/HDF2xyhohkLVcH15 eDCQ== X-Gm-Message-State: AElRT7HMi9mBvPBsTTgY2ZuZymbTBSYwOLvuQjOixa/4YG3H32BqVH4f +4RkK3zObTp5DlvqEqdiUzkoqou5 X-Google-Smtp-Source: AIpwx4/OHgCbzDHmf2z60EJZ88vfbB2Q/Pro2zhEySC7fTRUhl0THI+ZR4GXiufCQthQ25m/e4tTCg== X-Received: by 10.200.45.180 with SMTP id p49mr11705460qta.242.1522339513384; Thu, 29 Mar 2018 09:05:13 -0700 (PDT) Received: from monolith.home (pool-173-79-224-159.washdc.fios.verizon.net. [173.79.224.159]) by smtp.gmail.com with ESMTPSA id f3sm4678666qkj.7.2018.03.29.09.05.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Mar 2018 09:05:12 -0700 (PDT) From: Chas Williams <3chas3@gmail.com> To: dev@dpdk.org Cc: mtetsuyah@gmail.com, yliu@fridaylinux.org, maxime.coquelin@redhat.com, Robert Shearman , stable@dpdk.org, Chas Williams Date: Thu, 29 Mar 2018 12:05:06 -0400 Message-Id: <20180329160507.25081-1-3chas3@gmail.com> X-Mailer: git-send-email 2.13.6 Subject: [dpdk-dev] [PATCH 1/2] net/vhost: set the vq consistently X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Robert Shearman The vid and port of the vq were only set on queues created during initial device setup. Fixes: ee584e9710b9 ("vhost: add driver on top of the library") Cc: stable@dpdk.org Signed-off-by: Robert Shearman Signed-off-by: Chas Williams Reviewed-by: Maxime Coquelin --- drivers/net/vhost/rte_eth_vhost.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 3aae01c39..453d9bee1 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -118,6 +118,7 @@ struct pmd_internal { char *iface_name; uint16_t max_queues; rte_atomic32_t started; + int vid; }; struct internal_list { @@ -573,6 +574,7 @@ new_device(int vid) eth_dev = list->eth_dev; internal = eth_dev->data->dev_private; + internal->vid = vid; #ifdef RTE_LIBRTE_VHOST_NUMA newnode = rte_vhost_get_numa_node(vid); @@ -633,6 +635,7 @@ destroy_device(int vid) } eth_dev = list->eth_dev; internal = eth_dev->data->dev_private; + internal->vid = -1; rte_atomic32_set(&internal->dev_attached, 0); update_queuing_status(eth_dev); @@ -834,6 +837,9 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, struct rte_mempool *mb_pool) { struct vhost_queue *vq; + struct pmd_internal *internal; + + internal = dev->data->dev_private; vq = rte_zmalloc_socket(NULL, sizeof(struct vhost_queue), RTE_CACHE_LINE_SIZE, socket_id); @@ -844,6 +850,9 @@ eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t rx_queue_id, vq->mb_pool = mb_pool; vq->virtqueue_id = rx_queue_id * VIRTIO_QNUM + VIRTIO_TXQ; + vq->internal = internal; + vq->vid = internal->vid; + vq->port = dev->data->port_id; dev->data->rx_queues[rx_queue_id] = vq; return 0; @@ -856,6 +865,9 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, const struct rte_eth_txconf *tx_conf __rte_unused) { struct vhost_queue *vq; + struct pmd_internal *internal; + + internal = dev->data->dev_private; vq = rte_zmalloc_socket(NULL, sizeof(struct vhost_queue), RTE_CACHE_LINE_SIZE, socket_id); @@ -865,6 +877,9 @@ eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, } vq->virtqueue_id = tx_queue_id * VIRTIO_QNUM + VIRTIO_RXQ; + vq->internal = internal; + vq->vid = internal->vid; + vq->port = dev->data->port_id; dev->data->tx_queues[tx_queue_id] = vq; return 0;