From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id D601E8DAF for ; Thu, 14 Jan 2016 07:43:44 +0100 (CET) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP; 13 Jan 2016 22:43:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,293,1449561600"; d="scan'208";a="726703779" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.66.49]) by orsmga003.jf.intel.com with ESMTP; 13 Jan 2016 22:43:42 -0800 Date: Thu, 14 Jan 2016 14:45:00 +0800 From: Yuanhan Liu To: "Tan, Jianfeng" Message-ID: <20160114064500.GK19531@yliu-dev.sh.intel.com> References: <1449719650-3482-1-git-send-email-yuanhan.liu@linux.intel.com> <1452581944-24838-1-git-send-email-yuanhan.liu@linux.intel.com> <569723B9.5080904@igel.co.jp> <56973B8E.6010808@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56973B8E.6010808@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: dev@dpdk.org, "Michael S. Tsirkin" Subject: Re: [dpdk-dev] [PATCH v2 0/7] virtio 1.0 enabling for virtio pmd driver 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: Thu, 14 Jan 2016 06:43:45 -0000 On Thu, Jan 14, 2016 at 02:09:18PM +0800, Tan, Jianfeng wrote: ... > I basically agree with you. We have two dimensions here: > > legacy modern > physical virtio device: Use virtio_read_caps_phys() to > distinguish > virtual virtio device (Tetsuya): Use virtio_read_caps_virt() to > distinguish > virtual virtio device (Jianfeng): does not need a "configuration space > layout", no need to distinguish I guess you meant to build a form or something, but seems you failed :) > > So in vtpci_init(), we needs to test "eth_dev->dev_type" firstly > > vtpci_init() { > if (eth_dev->dev_type == RTE_ETH_DEV_PCI) { > if (virtio_read_caps_phys()) { > // modern > } else { > // legacy > } > } else { > if (Tetsuya's way) { > if (virtio_read_caps_virt()) { > // modern > } else { > // legacy > } > } else { > // Jianfeng's way > } > } > } Normally, I'd like to hide the details inside virtio_read_caps(): I don't want similar codes to be appeared twice. And if it can be simply done by "if (eth_dev->dev_type == ...)", I'd like to do it in this way. If not, introducing another set of operation abstractions as suggested in my another email might be a better option. > And from Yuanhan's angle, I think he does not need to address this problem. Yep; it just has nothing to do with this patch set. --yliu