From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 8E568B3D4 for ; Wed, 4 Feb 2015 14:43:12 +0100 (CET) Received: by mail-wg0-f54.google.com with SMTP id b13so1734238wgh.13 for ; Wed, 04 Feb 2015 05:43:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=+qsYl7pdfnRfp60okwVSl1lCdNNRq0mHwRn/kSgl/WU=; b=Tk/FEwgvCgJqxHRVEplyrqfjaO9jw6qlJMGev4sZur6ll9QZSrZY3OMDCyM0q61970 ioKC7RBygl7ISgV2RV5H67SrYGLHEb+X9YfMr7VlLQsha599NqXyai2YBAQViLUe5WNc ktlJXVWWT0/yDRhaHtAhtfWHIirNn+8P/+u7PUogy6wcL5hnqgIK7jdFYv0z6pmBgQVs LcgSstPowUkZAvpfYDrht7lZ8NzuzYdf2UtyHI6sja5iIr/heWHXlMVHdxRXkEQ2sy/k z3iui1n7SHcBqS2XuY6AIDtZKAVFbIXwjoBQV0C6iwG8viDKUrLWC/P4H5nEXaIMvsyi t3Rw== X-Gm-Message-State: ALoCoQnGyqIpP0iBKqyPHjA0H7V0OgKCpg4zwiHSLmlNKQYAmcgecwB6jFqwEQRUBlaBzQWYSRj3 X-Received: by 10.194.110.69 with SMTP id hy5mr67342628wjb.121.1423057392043; Wed, 04 Feb 2015 05:43:12 -0800 (PST) Received: from xps13.localnet (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id k6sm6624926wia.6.2015.02.04.05.43.10 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Feb 2015 05:43:11 -0800 (PST) From: Thomas Monjalon To: stephen hemminger Date: Wed, 04 Feb 2015 14:42:43 +0100 Message-ID: <2084158.GG5mBQGd4q@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <20150203110345.15c38345@urahara> References: <20150203110345.15c38345@urahara> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, devel@linuxdriverproject.org, Haiyang Zhang , "K. Y. Srinivasan" , netdev@vger.kernel.org Subject: Re: [dpdk-dev] hyper-v: allow access to vmbus from userspace 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: Wed, 04 Feb 2015 13:43:13 -0000 Hi Stephen, 2015-02-03 11:03, stephen hemminger: > Brocade is submitting a hyper-v driver for DPDK > but this driver needs a hook in the hyper-v bus layer > to allow the additional hv_uio driver to access the shared vmbus > pages. The hv_uio driver lives in DPDK (like igb_uio) and provides > userspace access to raw network packets. > > Signed-off-by: Stas Egorov > Signed-off-by: Stephen Hemminger The hyper-v driver for DPDK has not been sent yet to http://dpdk.org/dev/patchwork but it would be interesting to better explain this uio mapping. Thanks -- Thomas > --- a/drivers/hv/connection.c 2015-02-03 10:58:51.751752450 -0800 > +++ b/drivers/hv/connection.c 2015-02-03 10:58:51.751752450 -0800 > @@ -64,6 +64,21 @@ static __u32 vmbus_get_next_version(__u3 > } > } > > +static const uuid_le HV_NET_GUID = { > + .b = { > + 0x63, 0x51, 0x61, 0xf8, 0x3e, 0xdf, 0xc5, 0x46, > + 0x91, 0x3f, 0xf2, 0xd2, 0xf9, 0x65, 0xed, 0x0e > + } > +}; > + > +void vmbus_get_pages(unsigned long *int_page, unsigned long monitor_pages[2]) > +{ > + *int_page = (unsigned long)vmbus_connection.int_page; > + monitor_pages[0] = (unsigned long)vmbus_connection.monitor_pages[0]; > + monitor_pages[1] = (unsigned long)vmbus_connection.monitor_pages[1]; > +} > +EXPORT_SYMBOL_GPL(vmbus_get_pages); > + > static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo, > __u32 version) > { > @@ -347,7 +362,8 @@ static void process_chn_event(u32 relid) > else > bytes_to_read = 0; > } while (read_state && (bytes_to_read != 0)); > - } else { > + } else if (!memcmp(&channel->device_obj->dev_type, &HV_NET_GUID, > + sizeof(uuid_le))) { > pr_err("no channel callback for relid - %u\n", relid); > } > > --- a/include/linux/hyperv.h 2015-02-03 10:58:51.751752450 -0800 > +++ b/include/linux/hyperv.h 2015-02-03 10:58:51.751752450 -0800 > @@ -868,6 +868,9 @@ extern int vmbus_recvpacket_raw(struct v > > extern void vmbus_ontimer(unsigned long data); > > +extern void vmbus_get_pages(unsigned long *int_page, > + unsigned long monitor_pages[2]); > + > /* Base driver object */ > struct hv_driver { > const char *name;