From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f173.google.com (mail-pf0-f173.google.com [209.85.192.173]) by dpdk.org (Postfix) with ESMTP id CAC2F8E6E for ; Tue, 19 Jan 2016 02:22:08 +0100 (CET) Received: by mail-pf0-f173.google.com with SMTP id 65so165872608pff.2 for ; Mon, 18 Jan 2016 17:22:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=igel-co-jp.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=kdm9LRov223j2nRrdj+ToCVwM3hod9P5r3kOT7jiMLI=; b=nD/GDgecTgL6Q3j7qX9XATVNN7KRhKVXGx/1RbhbYIJc7VgYm4ywkpxTGYKa+/aKyf 4VRMyEuemOT7CdyFyJigca46gzrTsFg9m7Qq0G3vwv+ka+1jEChEUUk8QagstafXunki iFaDfoqD3ZY1TWqNFNm6ikpD/BkyhPHmfK7E53FjE691qzDrkddcN9Ns7bgtxSKerzqY VB1jVEiWJK7SsrDzrZyibxY0oM7NOGVhO/AvhKlCLyy2P25yPBCUIKWK6Xxr6jF0Vmkf K6Y1jbGkmoRj1apkv6HIXCv9cDXLglggMpFhg06OEYS9++e7DdLqogXvTw3q0MK/WL8f WelA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=kdm9LRov223j2nRrdj+ToCVwM3hod9P5r3kOT7jiMLI=; b=CJhGijjGqhjaVPkgN4DMeEZqe3sq08Wj72qWhWrf9BHaneEDkTNV1rAlXcdjuPss+L 1iis9JLK+384EPXJhyWRHWcNA6YUsfPbKtoQf5AYe9RR3mQFXhTr1XOredyFyTkWx7vP uLP5nW4vQg8yR1v/Elcw3u/Cz2/bisg/1jPgfGqkpzWiji0kNfvcvoXKh3Mlp6TSnSAe y+hqp9j6Z3aTsdV5VpsfwJCdi9D30sxCRdiGSbZiZxU8MdE/ncJZKUT6xGAfx3niuJ2p BkdjbmAle71cesAP7xoQSy0iX/JoKBGdXrsq88JimWPqrcWnrr4B1hFqHaFKrqQc3wo7 FmyQ== X-Gm-Message-State: ALoCoQnyBfuk6LDziiaLZSBhDhh490OezfqLfTg/xJd60lDpoOAZd5WY9q0ZqiDRQLwRQi4rnHoQ8qCYDIukPPoTjFi463hWjw== X-Received: by 10.98.65.9 with SMTP id o9mr40204483pfa.114.1453166528127; Mon, 18 Jan 2016 17:22:08 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id oj9sm36983197pab.8.2016.01.18.17.22.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jan 2016 17:22:07 -0800 (PST) To: Yuanhan Liu References: <1453108389-21006-1-git-send-email-mukawa@igel.co.jp> <1453108389-21006-4-git-send-email-mukawa@igel.co.jp> <20160118134645.GC19531@yliu-dev.sh.intel.com> From: Tetsuya Mukawa Message-ID: <569D8FBF.5020000@igel.co.jp> Date: Tue, 19 Jan 2016 10:22:07 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160118134645.GC19531@yliu-dev.sh.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 3/3] virtio: Add a new layer to abstract pci access method 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: Tue, 19 Jan 2016 01:22:09 -0000 On 2016/01/18 22:46, Yuanhan Liu wrote: > On Mon, Jan 18, 2016 at 06:13:09PM +0900, Tetsuya Mukawa wrote: >> +struct virtio_pci_access_ops { >> + uint8_t (*legacy_read8)(struct virtio_hw *hw, uint8_t *addr); >> + uint16_t (*legacy_read16)(struct virtio_hw *hw, uint16_t *addr); >> + uint32_t (*legacy_read32)(struct virtio_hw *hw, uint32_t *addr); >> + void (*legacy_write8)(struct virtio_hw *hw, >> + uint8_t *addr, uint8_t val); >> + void (*legacy_write16)(struct virtio_hw *hw, >> + uint16_t *addr, uint16_t val); >> + void (*legacy_write32)(struct virtio_hw *hw, >> + uint32_t *addr, uint32_t val); >> + >> + uint8_t (*modern_read8)(struct virtio_hw *hw, uint8_t *addr); >> + uint16_t (*modern_read16)(struct virtio_hw *hw, uint16_t *addr); >> + uint32_t (*modern_read32)(struct virtio_hw *hw, uint32_t *addr); >> + void (*modern_write8)(struct virtio_hw *hw, >> + uint8_t *addr, uint8_t val); >> + void (*modern_write16)(struct virtio_hw *hw, >> + uint16_t *addr, uint16_t val); >> + void (*modern_write32)(struct virtio_hw *hw, >> + uint32_t *addr, uint32_t val); > One thing about abstraction is that you need define one set of operations, > instead of two similar sets. Thus, you need define following operations > only: > > - read8 > - read16 > - read32 > - write8 > - write16 > - write32 > > And make a proper assignment after the modern/legacy detection. Thanks for comments. Sure, will do. > >> + >> + int (*map_pci_cfg)(struct virtio_hw *hw); >> + void (*unmap_pci_cfg)(struct virtio_hw *hw); >> + void *(*get_cfg_addr)(struct virtio_hw *hw, >> + struct virtio_pci_cap *cap); >> + int (*read_pci_cfg)(struct virtio_hw *hw, >> + void *buf, size_t len, off_t offset); > It'd be good if you can post the patches that use above abstract > operations, so that people can tell if they are properly defined. > Yes, I will submit it again. Thanks, Tetsuya