Netdev List
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Loic Domaigne <loic.domaigne@googlemail.com>
Cc: Dan Williams <dcbw@redhat.com>, <netdev@vger.kernel.org>,
	<linux-usb@vger.kernel.org>
Subject: Re: RFC: [PATCH 1/3] usb: cdc_ncm: patch for VMware
Date: Mon, 11 Mar 2013 20:32:18 +0000	[thread overview]
Message-ID: <1363033938.2608.76.camel@bwh-desktop.uk.solarflarecom.com> (raw)
In-Reply-To: <20130310211227.GA2169@feynman.loic.net>

On Sun, 2013-03-10 at 22:12 +0100, Loic Domaigne wrote:
> On Fri, Mar 08, 2013 at 04:28:59PM -0600, Dan Williams wrote:
> > On Fri, 2013-03-08 at 22:03 +0100, Loic Domaigne wrote:
> > >  
> > > +/* maximum Rx URB size */
> > > +/*
> > > + * in the original Linux driver, the rx urb size can be up to
> > > + * CDC_NCM_NTB_MAX_SIZE_RX.
> > > + *
> > > + * Under VMware (as of wks9), URB size greater than 16kB is a problem,
> > > + * so simply adjust this define when the driver is compiled for a VMware
> > > + * environment.
> > > + *
> > > + */
> > > +#ifdef VMWARE_BUG
> > > +#warning "Compiling for VMware"
> > > +#define CDC_NCM_MAX_RX_URB_SIZE     16384
> > > +#else
> > > +#define CDC_NCM_MAX_RX_URB_SIZE     CDC_NCM_NTB_MAX_SIZE_RX
> > > +#endif
> > 
> > I can't see how that is going to get past any sort of review.  Either
> > there's some other way of detecting that the CPU is the VMWare emulated
> > one or you're stuck with the bug until VMWare fixes it.
> 
> Yeah, I know.
> 
> The kludge consists to (re)compile the kernel module on the VMWare guest with
> the VMWARE_BUG compiler flag set. 
> 
> We have a helper script for that task, but it's distros specific. We can 
> detect automatically a VMWare emulated CPU in some cases, but not always.
> As a result, we end up sometimes asking the user.
> 
> I am aware that it's not suitable as a generic solution. But waiting a fix
> from VMWare might not be practical for you either.
> 
> Any better ideas?

Example from drivers/misc/vmw_balloon.c:

#include <asm/hypervisor.h>
...
	/*
	 * Check if we are running on VMware's hypervisor and bail out
	 * if we are not.
	 */
	if (x86_hyper != &x86_hyper_vmware)
		return -ENODEV;

Obviously for a non-x86-specific driver this needs to be conditional on
#ifdef CONFIG_X86.

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

      reply	other threads:[~2013-03-11 20:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08 21:03 RFC: [PATCH 1/3] usb: cdc_ncm: patch for VMware Loic Domaigne
2013-03-08 22:28 ` Dan Williams
     [not found]   ` <1362781739.8581.5.camel-wKZy7rqYPVb5EHUCmHmTqw@public.gmane.org>
2013-03-10 21:12     ` Loic Domaigne
2013-03-11 20:32       ` Ben Hutchings [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363033938.2608.76.camel@bwh-desktop.uk.solarflarecom.com \
    --to=bhutchings@solarflare.com \
    --cc=dcbw@redhat.com \
    --cc=linux-usb@vger.kernel.org \
    --cc=loic.domaigne@googlemail.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox