linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Iouri Tarassov <iourit@linux.microsoft.com>
To: Greg KH <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org, iourit@microsoft.com,
	linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org
Subject: Re: [PATCH 1/4] drivers: hv: dxgkrnl: core code
Date: Thu, 27 Aug 2020 16:29:59 -0700	[thread overview]
Message-ID: <58011269-e910-b3e4-2a3c-552b08c90574@linux.microsoft.com> (raw)
In-Reply-To: <20200814125528.GA56456@kroah.com>

On 8/14/2020 5:55 AM, Greg KH wrote:
> On Fri, Aug 14, 2020 at 08:38:53AM -0400, Sasha Levin wrote:
> > Add support for a Hyper-V based vGPU implementation that exposes the
> > DirectX API to Linux userspace.
> > 
> > Signed-off-by: Sasha Levin <sashal@kernel.org>
>
> Better, but what is this mess:
>
> > +#define ISERROR(ret)					(ret < 0)

The VM bus messages return the NTSTATUS error code from the host. 
NTSTATUS is integer and the positive values indicate success.
The success error code needs to be returned by IOCTLs to the DxCore 
applications. The ISERROR() macro is used in places where the NTSTATUS 
success code could be returned from a function. "if (ret)" cannot be 
used. I will add a comment to the macro in the next patch.

>
> ?
>
> > +#define EINTERNALERROR					EINVAL
This macro will be removed in the next patch
> And that?
>
> > +
> > +#define DXGKRNL_ASSERT(exp)
> > +#define UNUSED(x) (void)(x)
The UNUSED macro will be removed.
The DXGKRNL_ASSERT() macro will be changed to generate a memory dump and 
BUG_ON when DXGDEBUG is enabled. It is used to catch internal errors in 
the debug code. There will be no bugcheck in the released driver.
>
> Ick, no, please.
>
> > +#undef pr_fmt
>
> In a .h file?
>
> > +#define pr_fmt(fmt)	"dxgk:err: " fmt
> > +#define pr_fmt1(fmt)	"dxgk: " fmt
> > +#define pr_fmt2(fmt)	"dxgk:    " fmt
This will be fixed in the next patch set.
> Why?
>
> > +
> > +#define DXGKDEBUG 1
> > +/* #define USEPRINTK 1 */
> > +
> > +#ifndef DXGKDEBUG
> > +#define TRACE_DEBUG(...)
> > +#define TRACE_DEFINE(...)
> > +#define TRACE_FUNC_ENTER(...)
> > +#define TRACE_FUNC_EXIT(...)
>
> No, please do not to custom "trace" printk messages, that is what ftrace
> is for, no individual driver should ever need to do that.
>
> Just use the normal dev_*() calls for error messages and the like, do
> not try to come up with a custom tracing framework for one tiny
> individual driver.  If every driver in kernel did that, we would have a
> nightmare...
I understand the concern. This will be fixed later when we learn and 
pick the final tracing technology for the driver. The current 
implementation allows the hardware vendors to quickly identify issues 
without learning about ftrace. They just need to enable the WSL debug 
console and mount debugfs.
> thanks,
>
> greg k-h
>
Thank you for your time and good comments.
Iouri


  reply	other threads:[~2020-08-27 23:30 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-14 12:38 [PATCH 0/4] drivers: hv: Microsoft Virtual GPU Driver Sasha Levin
2020-08-14 12:38 ` [PATCH 1/4] drivers: hv: dxgkrnl: core code Sasha Levin
2020-08-14 12:55   ` Greg KH
2020-08-27 23:29     ` Iouri Tarassov [this message]
2020-08-28  6:01       ` Greg KH
2020-08-14 12:57   ` Greg KH
2020-08-27 23:45     ` Iouri Tarassov
2020-08-28  6:15       ` Greg KH
2020-08-14 13:04   ` Greg KH
2020-08-28  0:05     ` Iouri Tarassov
2020-08-28  6:12       ` Greg KH
2020-09-03 18:55         ` Iouri Tarassov
2020-09-03 19:32           ` Greg KH
2020-08-14 13:18   ` Wei Liu
2020-08-26 20:20     ` Iouri Tarassov
2020-08-27  0:12     ` Iouri Tarassov
2020-08-27 19:09     ` Iouri Tarassov
2020-08-21 13:53   ` Pavel Machek
2020-08-28  0:25     ` Iouri Tarassov
2020-08-28  6:17       ` Greg KH
2020-08-28  6:18       ` Greg KH
2020-09-03 21:39         ` Iouri Tarassov
2020-09-04  5:18           ` Greg KH
2020-08-14 12:38 ` [PATCH 2/4] drivers: hv: dxgkrnl: hook up dxgkrnl Sasha Levin
2020-08-14 12:38 ` [PATCH 3/4] drivers: hv: vmbus: " Sasha Levin
2020-08-14 12:38 ` [PATCH 4/4] drivers: hv: dxgkrnl: create a MAINTAINERS entry Sasha Levin
2020-08-14 13:04   ` Greg KH

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=58011269-e910-b3e4-2a3c-552b08c90574@linux.microsoft.com \
    --to=iourit@linux.microsoft.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=iourit@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=wei.liu@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;
as well as URLs for NNTP newsgroup(s).