From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4D2EA04F6 for ; Tue, 7 Jan 2020 11:41:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98C621D67B; Tue, 7 Jan 2020 11:41:09 +0100 (CET) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id DA4581D67B for ; Tue, 7 Jan 2020 11:41:08 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id x184so28418580pfb.3 for ; Tue, 07 Jan 2020 02:41:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:cc:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tVPd3xLgD1TZ0Gj+7yg9SymUSaIEf5ZpzM0iiX1J+bk=; b=LNrv2KFNCctm38cqqZAt0OoPnakqX8teRZeF3LTRzW2MflTYc1aYRZygT2eMUk1HEe fawDMNKBtHcl09dnIH0ZO2HHKMLgaDa37AZE7VWSW64VV3j33KSGJqPK46hDoRJR6xgo VIGrX+65YtmS1MYg/NoxD4LzKb7IlFm5QdxDYYfap+cNN+ycTma2mfjBK2DwGI0/A3Ez WJRrdKXGBoCzjNyT4QQr9qer+D98Z8NfDVpBGZi0TQr+NGnZrKEYL2rAxcPJLNbOosHX 4BO2QgIv8+zPoqKuXTw9IShWnB2B9a6izq3eoSUGIHWenBAUZ2+KAnZYlsMZDFh/sacX CJqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:cc:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tVPd3xLgD1TZ0Gj+7yg9SymUSaIEf5ZpzM0iiX1J+bk=; b=DpcQsL0W1lIeZx7rTxAYBobUpoIK0pbeX6p2bwZN27Iz/x9L4sfH1sBOBZ3GXpOCi0 Gx5lOgd99iibrMcHUVteM8QVKIao64byyWxKNnz5pMW4fCTBtFy7fLga71Jt0z+o9fPC q95h3s1bJwp/e808ZNYvGiHisUbBDQ07deHaiD9rz7vBSuAZm2srTqnHMm09Zyarif4n nTfvfhPmAzWn9GI+e9kSQZBHGbd/xGh9Gi1gUgUL2kHajzYYGmvvXm9Li/h3EnbhBJYp yjleMZZ9LaN1TFE8YBwCfnOdS4Wn0Kua7a25EQNrYBn1Q62KCJaJEd6WzsAndmGdJs7T 4Ndg== X-Gm-Message-State: APjAAAXkKRyf1AnHXK/kutxAfF4o+rVLpRYxGfEB7h6OP4LQx/hXlk8F Ecc87aJs/8vbcF9BAoNNpYmC8hFN X-Google-Smtp-Source: APXvYqz+RDi2KjWpAMj82q3+cyQ1Eo0NmQKhFhk/YJ6/7H4ievBJ26SEOfpIv8FRW2p/JcOK+6NmWw== X-Received: by 2002:a63:214e:: with SMTP id s14mr96469582pgm.428.1578393667967; Tue, 07 Jan 2020 02:41:07 -0800 (PST) Received: from [172.30.202.27] ([192.47.164.146]) by smtp.gmail.com with ESMTPSA id q22sm83800707pfg.170.2020.01.07.02.41.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Jan 2020 02:41:07 -0800 (PST) To: Itsuro Oda References: <20191223050036.30765-1-oda@valinux.co.jp> <20191225044954.3600-1-oda@valinux.co.jp> <20191225044954.3600-2-oda@valinux.co.jp> From: Yasufumi Ogawa Cc: spp@dpdk.org, ferruh.yigit@intel.com Message-ID: Date: Tue, 7 Jan 2020 19:41:52 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191225044954.3600-2-oda@valinux.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [spp] [PATCH v2 01/12] drivers/vhost: add multi process supported vhost PMD for SPP X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spp-bounces@dpdk.org Sender: "spp" Hi, On 2019/12/25 13:49, Itsuro Oda wrote: > vhost PMD can not be used by secondary processes since DPDK 18.11. > SPP project decided to have own vhost PMD which can be used by > secondary processes at the moment. This vhost PMD is based on the > original vhost PMD but is simplified very much only to support > functions used by SPP. Thereby it becomes easy to fix the probrem. > > The main idea of the fix is that execution of vhost start/stop > is moved to eth_dev_start/stop from probe/remove. > > Note that only process which executes eth_dev_start can use the > vhost device although the vhost device is shared among the primary > process and secondary processes. Once eth_dev_stop is executed by > the process which used the vhost device, it is available to be > used by any process. It is user responsibility that multipul > processes don't use the vhost device at the same time. > > Signed-off-by: Itsuro Oda > --- > src/drivers/vhost/Makefile | 28 + > .../vhost/rte_pmd_spp_vhost_version.map | 4 + > src/drivers/vhost/rte_spp_vhost.c | 588 ++++++++++++++++++ > 3 files changed, 620 insertions(+) > create mode 100644 src/drivers/vhost/Makefile > create mode 100644 src/drivers/vhost/rte_pmd_spp_vhost_version.map > create mode 100644 src/drivers/vhost/rte_spp_vhost.c > > diff --git a/src/drivers/vhost/Makefile b/src/drivers/vhost/Makefile [...] > + > +static inline struct pmd_internal * > +find_internal_resource(int vid) > +{ > + struct pmd_internal *internal; > + int i; > + char ifname[PATH_MAX]; This variable is declared, but not used from anywhere. > + > + if (rte_vhost_get_ifname(vid, ifname, sizeof(ifname)) == -1) > + return NULL; [...] > +} > + > +static const struct eth_dev_ops ops = { > + .dev_start = eth_dev_start, > + .dev_stop = eth_dev_stop, > + .dev_configure = eth_dev_configure, > + .dev_infos_get = eth_dev_info, > + .rx_queue_setup = eth_rx_queue_setup, > + .tx_queue_setup = eth_tx_queue_setup, > + .rx_queue_release = eth_queue_release, > + .tx_queue_release = eth_queue_release, > + .link_update = eth_link_update, > + .stats_get = eth_stats_get, > + .stats_reset = eth_stats_reset, > +}; This struct causes compilation errors because of incompatible pointer types. $ make == src == drivers == vhost CC rte_spp_vhost.o rte_spp_vhost.c:371:19: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .dev_infos_get = eth_dev_info, ^~~~~~~~~~~~ rte_spp_vhost.c:371:19: note: (near initialization for ‘ops.dev_infos_get’) rte_spp_vhost.c:378:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .stats_reset = eth_stats_reset, ^~~~~~~~~~~~~~~ rte_spp_vhost.c:378:17: note: (near initialization for ‘ops.stats_reset’) cc1: error: unrecognized command line option ‘-Wno-address-of-packed-member’ [-Werror] cc1: all warnings being treated as errors From my understanding, eth_dev_info() and eth_stats_reset() are defined as void in your patch, but DPDK expects int by referring the definition of eth_dev_ops in lib/librte_ethdev/rte_ethdev_core.h:609. Regards, Yasufumi > + > +static int [...]