From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DATE_IN_FUTURE_06_12, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB788C352A3 for ; Tue, 11 Feb 2020 09:23:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9B022051A for ; Tue, 11 Feb 2020 09:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgBKJXR (ORCPT ); Tue, 11 Feb 2020 04:23:17 -0500 Received: from mga03.intel.com ([134.134.136.65]:26356 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbgBKJXQ (ORCPT ); Tue, 11 Feb 2020 04:23:16 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Feb 2020 01:23:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,428,1574150400"; d="scan'208";a="380377287" Received: from chaop.bj.intel.com (HELO localhost) ([10.240.192.106]) by orsmga004.jf.intel.com with ESMTP; 11 Feb 2020 01:23:13 -0800 Date: Tue, 11 Feb 2020 16:05:41 +0000 From: Chao Peng To: "Michael S. Tsirkin" Cc: Zha Bin , linux-kernel@vger.kernel.org, jasowang@redhat.com, slp@redhat.com, virtio-dev@lists.oasis-open.org, qemu-devel@nongnu.org, gerry@linux.alibaba.com, jing2.liu@linux.intel.com Subject: Re: [PATCH v2 0/5] virtio mmio specification enhancement Message-ID: <20200211160541.GA37446@chaop.bj.intel.com> Reply-To: Chao Peng References: <20200210062938-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200210062938-mutt-send-email-mst@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 10, 2020 at 06:44:50AM -0500, Michael S. Tsirkin wrote: > On Mon, Feb 10, 2020 at 05:05:16PM +0800, Zha Bin wrote: > > We have compared the number of files and the lines of code between > > virtio-mmio and virio-pci. > > > > Virtio-PCI Virtio-MMIO > > number of files(Linux) 161 1 > > lines of code(Linux) 78237 538 > > > > Something's very wrong here. virtio PCI is 161 files? > Are you counting the whole PCI subsystem? Right, that is just a rough statistics. Surely enough, some drivers will never get enabled in a typcial config. > Sure enough: > > $ find drivers/pci -name '*c' |wc -l > 150 and plus: $ find arch/x86/pci/ -name '*c' |wc -l 22 > > That's not reasonable, this includes a bunch of drivers that > never run on a typical hypervisor. > > MMIO is also not as small as you are trying to show: > > $ cloc drivers/virtio/virtio_mmio.c include/uapi/linux/virtio_mmio.h > 2 text files. > 2 unique files. > 0 files ignored. > > github.com/AlDanial/cloc v 1.82 T=0.01 s (230.7 files/s, 106126.5 lines/s) > ------------------------------------------------------------------------------- > Language files blank comment code > ------------------------------------------------------------------------------- > C 1 144 100 535 > C/C++ Header 1 39 66 36 > ------------------------------------------------------------------------------- > SUM: 2 183 166 571 > ------------------------------------------------------------------------------- > > > I don't doubt MMIO is smaller than PCI. Of course that's because it has > no features to speak of - just this patch already doubles it's size. If > we keep doing that because we want the features then they will reach > the same size in about 4 iterations. Since current virtio-mmio size is small enough, so adding any notable feature would easily double it. I have no objection that it may one day reach the same level of PCI, but in this patch some are actually generic changes and for MSI specific code we provide the option to confige away. Thanks, Chao > > > -- > MST