From patchwork Wed May 15 22:37:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Nicholas A. Bellinger" X-Patchwork-Id: 2574661 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D48773FC5A for ; Wed, 15 May 2013 22:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753415Ab3EOWed (ORCPT ); Wed, 15 May 2013 18:34:33 -0400 Received: from mail.linux-iscsi.org ([67.23.28.174]:44056 "EHLO linux-iscsi.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751872Ab3EOWec (ORCPT ); Wed, 15 May 2013 18:34:32 -0400 Received: from [192.168.1.68] (75-37-193-228.lightspeed.lsatca.sbcglobal.net [75.37.193.228]) (using SSLv3 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: nab) by linux-iscsi.org (Postfix) with ESMTPSA id 9971022D9D1; Wed, 15 May 2013 22:21:52 +0000 (UTC) Message-ID: <1368657450.6899.29.camel@haakon3.risingtidesystems.com> Subject: Re: [PATCH] vhost-scsi: Depend on NET for memcpy_fromiovec From: "Nicholas A. Bellinger" To: Rusty Russell Cc: Asias He , "Michael S. Tsirkin" , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, target-devel@vger.kernel.org, Stephen Rothwell , Randy Dunlap , linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Date: Wed, 15 May 2013 15:37:30 -0700 In-Reply-To: <8761yk254u.fsf@rustcorp.com.au> References: <20130515095558.918f2b29ba318a477eb5dde2@canb.auug.org.au> <1368579583-13097-1-git-send-email-asias@redhat.com> <8761yk254u.fsf@rustcorp.com.au> X-Mailer: Evolution 3.4.4-1 Mime-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Wed, 2013-05-15 at 14:47 +0930, Rusty Russell wrote: > Asias He writes: > > scsi.c includes vhost.c which uses memcpy_fromiovec. > > > > This patch fixes this build failure. > > > > From Randy Dunlap: > > ''' > > on x86_64: > > > > ERROR: "memcpy_fromiovec" [drivers/vhost/vhost_scsi.ko] undefined! > > > > It needs to depend on NET since net/core/ provides that function. > > ''' > > Proper fix please. > > Though I can't see why you thought this was a good idea. Nonetheless, I > shan't highlight why: I have far too much respect for your intellects > and abilities. > > No, don't thank me! Hi Rusty & Asias, I assume you mean something like the following patch to allow kbuild to work when VHOST_NET + VHOST_SCSI are both enabled and sharing vhost.o, yes..? Also included is dropping the now unnecessary vhost.c include, and allowing vhost_work_flush() to be accessed externally as scsi.c currently requires. MST, care to pick this up..? --nab Acked-by: David S. Miller --- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/vhost/Kconfig b/drivers/vhost/Kconfig index 8b9226d..016387f 100644 --- a/drivers/vhost/Kconfig +++ b/drivers/vhost/Kconfig @@ -1,3 +1,6 @@ +config VHOST + tristate + config VHOST_NET tristate "Host kernel accelerator for virtio net" depends on NET && EVENTFD && (TUN || !TUN) && (MACVTAP || !MACVTAP) @@ -12,7 +15,7 @@ config VHOST_NET config VHOST_SCSI tristate "VHOST_SCSI TCM fabric driver" - depends on TARGET_CORE && EVENTFD && m + depends on NET && EVENTFD && TARGET_CORE select VHOST_RING default n ---help--- diff --git a/drivers/vhost/Makefile b/drivers/vhost/Makefile index 654e9afb..e5b5f0b 100644 --- a/drivers/vhost/Makefile +++ b/drivers/vhost/Makefile @@ -1,7 +1,9 @@ +obj-$(CONFIG_VHOST) += vhost.o + obj-$(CONFIG_VHOST_NET) += vhost_net.o -vhost_net-y := vhost.o net.o +vhost_net-objs := net.o obj-$(CONFIG_VHOST_SCSI) += vhost_scsi.o -vhost_scsi-y := scsi.o +vhost_scsi-objs := scsi.o obj-$(CONFIG_VHOST_RING) += vringh.o diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index 7014202..b5836a2 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -49,7 +49,6 @@ #include #include -#include "vhost.c" #include "vhost.h" #define TCM_VHOST_VERSION "v0.1" diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index beee7f5..8cd1562 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -123,7 +123,7 @@ static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, return left <= 0; } -static void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work) +void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work) { unsigned seq; int flushing; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index a7ad635..50ee396 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -44,6 +44,7 @@ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, unsigned long mask, struct vhost_dev *dev); int vhost_poll_start(struct vhost_poll *poll, struct file *file); void vhost_poll_stop(struct vhost_poll *poll); +void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work); void vhost_poll_flush(struct vhost_poll *poll); void vhost_poll_queue(struct vhost_poll *poll);