From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by dpdk.org (Postfix) with ESMTP id 467F0568F for ; Fri, 28 Aug 2015 20:18:43 +0200 (CEST) Received: by padfo6 with SMTP id fo6so31778103pad.0 for ; Fri, 28 Aug 2015 11:18:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=1rxJBoLwBsMq6AUwPzn9ApB4P89SUbX3dcvtHMoYpls=; b=PHwuT8H/sd1N2QlRf62liSEZGEgUhg0AQ5mVpDC6pwPZaYAOZztXT7SicrzfNsS6aQ +92mVdUqmy1yPYbsDXbinGfpWjOSubxcGnlJe9RWJmdN4s7XJNCPlV4ab8guXCT6KG+P V1z8oq53rNNR40S7L9Zn2pcTa+pHOxdhD8JITrizuUVCCE+PIKnSCRrMF78xn70kcDgX E1Cdew+QJnHL0wZSTNX7/gJei3TkORj0rcisYhbzsamXeSAL4F7Sp7KMNDv+kM6ZZdSf kR+mxvenEfZLRYl+bjn0EOxiK7MbC+urmiFc5TTQc/v3LzoNnuYRd7GJhyID11LQxv/o jokw== X-Gm-Message-State: ALoCoQngvebDc9dLqNmSuub4I0I3ZkcduNPGq4BnG+D/PTCZmr0aMJtRaAhStMCIBKsH5NV3BJcr X-Received: by 10.66.120.75 with SMTP id la11mr17857172pab.14.1440785922504; Fri, 28 Aug 2015 11:18:42 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id yu2sm6480375pac.33.2015.08.28.11.18.42 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Aug 2015 11:18:42 -0700 (PDT) Date: Fri, 28 Aug 2015 11:18:52 -0700 From: Stephen Hemminger To: Tetsuya Mukawa Message-ID: <20150828111852.0802e9c6@urahara> In-Reply-To: <1440732101-18704-2-git-send-email-mukawa@igel.co.jp> References: <1440732101-18704-1-git-send-email-mukawa@igel.co.jp> <1440732101-18704-2-git-send-email-mukawa@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, ann.zhuangyanying@huawei.com Subject: Re: [dpdk-dev] [RFC PATCH] vhost: Add VHOST PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2015 18:18:43 -0000 On Fri, 28 Aug 2015 12:21:41 +0900 Tetsuya Mukawa wrote: > The patch introduces a new PMD. This PMD is implemented as thin wrapper > of librte_vhost. It means librte_vhost is also needed to compile the PMD. > The PMD can have 'iface' parameter like below to specify a path to connect > to a virtio-net device. > > $ ./testpmd -c f -n 4 --vdev 'eth_vhost0,iface=/tmp/sock0' -- -i > > To connect above testpmd, here is qemu command example. > > $ qemu-system-x86_64 \ > > -chardev socket,id=chr0,path=/tmp/sock0 \ > -netdev vhost-user,id=net0,chardev=chr0,vhostforce \ > -device virtio-net-pci,netdev=net0 > > Signed-off-by: Tetsuya Mukawa Lots of minor nits from checkpatch... ERROR: spaces required around that '=' (ctx:WxV) #248: FILE: drivers/net/vhost/rte_eth_vhost.c:54: + .addr_bytes ={ CHECK: Unnecessary parentheses around r->rx_pkts #313: FILE: drivers/net/vhost/rte_eth_vhost.c:119: + rte_atomic64_add(&(r->rx_pkts), nb_rx); CHECK: Unnecessary parentheses around r->tx_pkts #341: FILE: drivers/net/vhost/rte_eth_vhost.c:147: + rte_atomic64_add(&(r->tx_pkts), nb_tx); CHECK: Unnecessary parentheses around r->err_pkts #342: FILE: drivers/net/vhost/rte_eth_vhost.c:148: + rte_atomic64_add(&(r->err_pkts), nb_bufs - nb_tx); WARNING: void function return statements are not generally useful #371: FILE: drivers/net/vhost/rte_eth_vhost.c:177: + return; +} ERROR: space required after that ',' (ctx:VxV) #374: FILE: drivers/net/vhost/rte_eth_vhost.c:180: +eth_rx_queue_setup(struct rte_eth_dev *dev,uint16_t rx_queue_id, ^ CHECK: Alignment should match open parenthesis #375: FILE: drivers/net/vhost/rte_eth_vhost.c:181: +eth_rx_queue_setup(struct rte_eth_dev *dev,uint16_t rx_queue_id, + uint16_t nb_rx_desc __rte_unused, WARNING: line over 80 characters #377: FILE: drivers/net/vhost/rte_eth_vhost.c:183: + const struct rte_eth_rxconf *rx_conf __rte_unused, WARNING: Missing a blank line after declarations #381: FILE: drivers/net/vhost/rte_eth_vhost.c:187: + struct pmd_internal *internal = dev->data->dev_private; + internal->rx_vhost_queues[rx_queue_id].mb_pool = mb_pool; WARNING: line over 80 characters #382: FILE: drivers/net/vhost/rte_eth_vhost.c:188: + dev->data->rx_queues[rx_queue_id] = &internal->rx_vhost_queues[rx_queue_id]; CHECK: Alignment should match open parenthesis #388: FILE: drivers/net/vhost/rte_eth_vhost.c:194: +eth_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id, + uint16_t nb_tx_desc __rte_unused, WARNING: line over 80 characters #390: FILE: drivers/net/vhost/rte_eth_vhost.c:196: + const struct rte_eth_txconf *tx_conf __rte_unused) WARNING: line over 80 characters #393: FILE: drivers/net/vhost/rte_eth_vhost.c:199: + dev->data->tx_queues[tx_queue_id] = &internal->tx_vhost_queues[tx_queue_id]; WARNING: Missing a blank line after declarations #393: FILE: drivers/net/vhost/rte_eth_vhost.c:199: + struct pmd_internal *internal = dev->data->dev_private; + dev->data->tx_queues[tx_queue_id] = &internal->tx_vhost_queues[tx_queue_id]; CHECK: Please don't use multiple blank lines #397: FILE: drivers/net/vhost/rte_eth_vhost.c:203: + + CHECK: Alignment should match open parenthesis #400: FILE: drivers/net/vhost/rte_eth_vhost.c:206: +eth_dev_info(struct rte_eth_dev *dev, + struct rte_eth_dev_info *dev_info) WARNING: Missing a blank line after declarations #403: FILE: drivers/net/vhost/rte_eth_vhost.c:209: + struct pmd_internal *internal = dev->data->dev_private; + dev_info->driver_name = drivername; CHECK: Alignment should match open parenthesis #420: FILE: drivers/net/vhost/rte_eth_vhost.c:226: + for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && + i < internal->nb_rx_queues; i++) { WARNING: line over 80 characters #421: FILE: drivers/net/vhost/rte_eth_vhost.c:227: + igb_stats->q_ipackets[i] = internal->rx_vhost_queues[i].rx_pkts.cnt; CHECK: Alignment should match open parenthesis #426: FILE: drivers/net/vhost/rte_eth_vhost.c:232: + for (i = 0; i < RTE_ETHDEV_QUEUE_STAT_CNTRS && + i < internal->nb_tx_queues; i++) { WARNING: line over 80 characters #427: FILE: drivers/net/vhost/rte_eth_vhost.c:233: + igb_stats->q_opackets[i] = internal->tx_vhost_queues[i].tx_pkts.cnt; WARNING: line over 80 characters #428: FILE: drivers/net/vhost/rte_eth_vhost.c:234: + igb_stats->q_errors[i] = internal->tx_vhost_queues[i].err_pkts.cnt; WARNING: Missing a blank line after declarations #443: FILE: drivers/net/vhost/rte_eth_vhost.c:249: + struct pmd_internal *internal = dev->data->dev_private; + for (i = 0; i < internal->nb_rx_queues; i++) WARNING: 'failuer' may be misspelled - perhaps 'failure'? #527: FILE: drivers/net/vhost/rte_eth_vhost.c:333: + RTE_LOG(INFO, PMD, "failuer to find ethdev\n"); WARNING: 'failuer' may be misspelled - perhaps 'failure'? #570: FILE: drivers/net/vhost/rte_eth_vhost.c:376: + RTE_LOG(INFO, PMD, "failuer to find a ethdev\n"); WARNING: 'accesing' may be misspelled - perhaps 'accessing'? #576: FILE: drivers/net/vhost/rte_eth_vhost.c:382: + /* Wait until rx/tx_pkt_burst stops accesing vhost device */ WARNING: void function return statements are not generally useful #606: FILE: drivers/net/vhost/rte_eth_vhost.c:412: + return; +} ERROR: do not initialise statics to 0 or NULL #610: FILE: drivers/net/vhost/rte_eth_vhost.c:416: + static struct virtio_net_device_ops *vhost_ops = NULL; WARNING: Missing a blank line after declarations #611: FILE: drivers/net/vhost/rte_eth_vhost.c:417: + static struct virtio_net_device_ops *vhost_ops = NULL; + vhost_ops = rte_zmalloc(NULL, sizeof(*vhost_ops), 0); CHECK: Alignment should match open parenthesis #642: FILE: drivers/net/vhost/rte_eth_vhost.c:448: +eth_dev_vhost_create(const char *name, int index, + char *iface_name, CHECK: Alignment should match open parenthesis #654: FILE: drivers/net/vhost/rte_eth_vhost.c:460: + RTE_LOG(INFO, PMD, "Creating VHOST-USER backend on numa socket %u\n", + numa_node); CHECK: Comparison to NULL could be written "!data" #660: FILE: drivers/net/vhost/rte_eth_vhost.c:466: + if (data == NULL) WARNING: networking block comments don't use an empty /* line, use /* Comment... #716: FILE: drivers/net/vhost/rte_eth_vhost.c:522: + /* + * We'll replace the 'data' originally allocated by eth_dev. So the CHECK: Comparison to NULL could be written "!value" #747: FILE: drivers/net/vhost/rte_eth_vhost.c:553: + if (value == NULL) CHECK: Comparison to NULL could be written "!kvlist" #766: FILE: drivers/net/vhost/rte_eth_vhost.c:572: + if (kvlist == NULL) CHECK: Alignment should match open parenthesis #778: FILE: drivers/net/vhost/rte_eth_vhost.c:584: + ret = rte_kvargs_process(kvlist, ETH_VHOST_IFACE_ARG, + &open_iface, &iface_name);