From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f182.google.com (mail-pf0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id 4FA32941C for ; Wed, 6 Jan 2016 04:57:05 +0100 (CET) Received: by mail-pf0-f182.google.com with SMTP id q63so195401482pfb.0 for ; Tue, 05 Jan 2016 19:57:05 -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=v0jcjdbseiHdrMPMl27E9T1ZKhstkglkC1ZHJ/h1+1c=; b=yULDqv+Ajycgl1WeF/l7A+BRXYnC0HZkbupATssfSM8mVrCmMv+mdjNt325o3UsXo6 +SA4kyjtD+ggwA925u7jzuBKz0n/XNU61ZH5NV5U45dbjEwxkk/hbJeH871hyXrprlwz gsfFJng5GGk31gohaA6ESxXn4GoSl0UNO67q/FvxYor5Kidu3wiQFQ/Q+WmbRsRcq7hD /EDvs5r9+ugBR6qfOtq6g4J2kCBhbpChjjiNXZu8rFD0VO3efUnJ+sm1IwBn626TAPEc ZOgm2Vsf4D1V57FVnEEIbeoCr1/AvvfZnnxiPX0HuIx4zFXk1G6rM+K76mTpVOseZpJW H0Vg== 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=v0jcjdbseiHdrMPMl27E9T1ZKhstkglkC1ZHJ/h1+1c=; b=jM3JoB4t2P/HQaL9OCb8iqSWtxWJ9XO+bJUzUiO/pYdU4Mlkia4SllQfrtE+GwVnvq tTBxYeyUuG1pS1/KZWd09JcO0sFoiTsQSbrPdkZXaIl4uVMYvnq4i/dG7quWS7Gnq0hr 8mvYii6m+kLt2sDZfxFnjzzqP3d0DQpsR1lk3ZKQZ89vBc+6U8UDVdLoN5YDptanSS9i tlJJ6bvDKuK9h/LO+J0je7lrAWaw0iB934tRmOCyhb55vjxnJSbqj+xL7YGo3S/xvMo0 lW+k5mAaUPcidzWcrsP3HIoHOeX4TVqGr5G/r5teFJCKouxznKSGdsy/OCx3+f8JeM6D 3RnA== X-Gm-Message-State: ALoCoQnNxNPeuAui3/Oxc25zaJ/l4RcNksij9IeN1Rz96vGktMTaaeGQ9SlbkO00iWdCEfqjCq6PWX0dwL3RDkwLBbjrvulsKw== X-Received: by 10.98.71.91 with SMTP id u88mr129336283pfa.30.1452052624770; Tue, 05 Jan 2016 19:57:04 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by smtp.googlemail.com with ESMTPSA id k65sm131394628pfj.57.2016.01.05.19.57.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jan 2016 19:57:04 -0800 (PST) To: Pavel Fedin , dev@dpdk.org References: <1447930650-26023-2-git-send-email-mukawa@igel.co.jp> <1450255049-2263-1-git-send-email-mukawa@igel.co.jp> <1450255049-2263-3-git-send-email-mukawa@igel.co.jp> <004a01d14166$f52be7e0$df83b7a0$@samsung.com> From: Tetsuya Mukawa X-Enigmail-Draft-Status: N1110 Message-ID: <568C9093.9020706@igel.co.jp> Date: Wed, 6 Jan 2016 12:57:07 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <004a01d14166$f52be7e0$df83b7a0$@samsung.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: nakajima.yoshihiro@lab.ntt.co.jp, mst@redhat.com Subject: Re: [dpdk-dev] [PATCH v1 2/2] virtio: Extend virtio-net PMD to support container environment 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: Wed, 06 Jan 2016 03:57:05 -0000 On 2015/12/28 20:57, Pavel Fedin wrote: > Hello! > >> diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h >> index 47f722a..d4ede73 100644 >> --- a/drivers/net/virtio/virtio_pci.h >> +++ b/drivers/net/virtio/virtio_pci.h >> @@ -165,6 +165,9 @@ struct virtqueue; >> >> struct virtio_hw { >> struct virtqueue *cvq; >> +#ifdef RTE_LIBRTE_VIRTIO_HOST_MODE >> + void *qsession; >> +#endif >> uint32_t io_base; >> uint32_t guest_features; >> uint32_t max_tx_queues; >> @@ -226,6 +229,26 @@ outl_p(unsigned int data, unsigned int port) >> } >> #endif >> >> +#ifdef RTE_LIBRTE_VIRTIO_HOST_MODE >> + >> +uint32_t virtio_ioport_read(struct virtio_hw *, uint64_t, char type); >> +void virtio_ioport_write(struct virtio_hw *, uint64_t, uint64_t, char type); >> + >> +#define VIRTIO_READ_REG_1(hw, reg) \ >> + virtio_ioport_read(hw, reg, 'b') >> +#define VIRTIO_WRITE_REG_1(hw, reg, value) \ >> + virtio_ioport_write(hw, reg, value, 'b') >> +#define VIRTIO_READ_REG_2(hw, reg) \ >> + virtio_ioport_read(hw, reg, 'w') >> +#define VIRTIO_WRITE_REG_2(hw, reg, value) \ >> + virtio_ioport_write(hw, reg, value, 'w') >> +#define VIRTIO_READ_REG_4(hw, reg) \ >> + virtio_ioport_read(hw, reg, 'l') >> +#define VIRTIO_WRITE_REG_4(hw, reg, value) \ >> + virtio_ioport_write(hw, reg, value, 'l') >> + >> +#else /* RTE_LIBRTE_VIRTIO_HOST_MODE */ >> + > I have a concern against such compile-time switches. What if we want the same code to work for both 'real' virtio and socket-based? > Shouldn't we introduce some function pointers here to be able to switch them at runtime? Hi Pavel, Thanks for commenting. In that case, you will run QEMU, then create containers in the guest. Do you have an use case for this usage? Anyway, such a feature depends on how to allocate share memory. So far, this patch allow you to run both virtio-net 'real' and 'virtual' PMDs on guest, but it will be changed to remove contiguous memory restriction. Could you please see an other thread that we talk about the restriction in? (I will add you to CC.) Thanks, Tetsuya