From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Tan, Jianfeng" Subject: Re: [PATCH v2 3/5] virtio/vdev: add embeded device emulation Date: Tue, 16 Feb 2016 10:47:37 +0800 Message-ID: <56C28DC9.4050303@intel.com> References: <1446748276-132087-1-git-send-email-jianfeng.tan@intel.com> <1454671228-33284-1-git-send-email-jianfeng.tan@intel.com> <1454671228-33284-4-git-send-email-jianfeng.tan@intel.com> <56B83CDA.7020106@igel.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Cc: nakajima.yoshihiro@lab.ntt.co.jp, mst@redhat.com, ann.zhuangyanying@huawei.com To: Tetsuya Mukawa , dev@dpdk.org Return-path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 40F6BADA2 for ; Tue, 16 Feb 2016 03:47:41 +0100 (CET) In-Reply-To: <56B83CDA.7020106@igel.co.jp> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Tetsuya, On 2/8/2016 2:59 PM, Tetsuya Mukawa wrote: > On 2016/02/05 20:20, Jianfeng Tan wrote: >> To implement virtio vdev, we need way to interract with vhost backend. >> And more importantly, needs way to emulate a device into DPDK. So this >> patch acts as embedded device emulation. >> >> Depends on the type of vhost file: vhost-user is used if the given >> path points to a unix socket; vhost-net is used if the given path >> points to a char device. >> >> Signed-off-by: Huawei Xie >> Signed-off-by: Jianfeng Tan >> --- >> >> +void >> +virtio_vdev_init(struct rte_eth_dev_data *data, char *path, >> + int nb_rx, int nb_tx, int nb_cq __attribute__ ((unused)), >> + int queue_num, char *mac, char *ifname) >> +{ >> + int i, r; >> + struct stat s; >> + uint32_t tmp[ETHER_ADDR_LEN]; >> + struct virtio_hw *hw = data->dev_private; >> + >> + hw->vtpci_ops = &vdev_ops; >> + hw->io_base = 0; >> + hw->use_msix = 0; >> + hw->modern = 0; >> + >> + hw->data = data; >> + hw->path = strdup(path); >> + hw->max_rx_queues = nb_rx; >> + hw->max_tx_queues = nb_tx; >> + hw->queue_num = queue_num; >> + hw->mac_specified = 0; >> + if (mac) { >> + r = sscanf(mac, "%x:%x:%x:%x:%x:%x", &tmp[0], >> + &tmp[1], &tmp[2], &tmp[3], &tmp[4], &tmp[5]); >> + if (r == ETHER_ADDR_LEN) { >> + for (i = 0; i < ETHER_ADDR_LEN; ++i) >> + hw->mac_addr[i] = (uint8_t)tmp[i]; >> + hw->mac_specified = 1; >> + } else >> + PMD_DRV_LOG(WARN, "wrong format of mac: %s", mac); > It seems you cannot use 'WARN' here. Thanks, I'll change it to ERR. Thanks, Jianfeng > > Thanks, > Tetsuya >