From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <jianfeng.tan@intel.com>
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id 40F6BADA2
 for <dev@dpdk.org>; Tue, 16 Feb 2016 03:47:41 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by fmsmga104.fm.intel.com with ESMTP; 15 Feb 2016 18:47:40 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.22,453,1449561600"; d="scan'208";a="885659351"
Received: from tanjianf-mobl.ccr.corp.intel.com (HELO [10.239.201.32])
 ([10.239.201.32])
 by orsmga001.jf.intel.com with ESMTP; 15 Feb 2016 18:47:38 -0800
To: Tetsuya Mukawa <mukawa@igel.co.jp>, dev@dpdk.org
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>
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
Message-ID: <56C28DC9.4050303@intel.com>
Date: Tue, 16 Feb 2016 10:47:37 +0800
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101
 Thunderbird/38.5.1
MIME-Version: 1.0
In-Reply-To: <56B83CDA.7020106@igel.co.jp>
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
Subject: Re: [dpdk-dev] [PATCH v2 3/5] virtio/vdev: add embeded device
	emulation
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Tue, 16 Feb 2016 02:47:41 -0000

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 <huawei.xie@intel.com>
>> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
>> ---
>>  
>> +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
>