-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vioscsi] New ProcessQueue() routine #1214
base: master
Are you sure you want to change the base?
[vioscsi] New ProcessQueue() routine #1214
Conversation
Elminates VioScsiMSInterruptWorker() by refactoring contents into new ProcessQueue() routine. This consolidates the child processes of: HW_INTERRUPT HW_MESSAGE_SIGNALLED_INTERRUPT_ROUTINE Implemented using new tracing functionality, including use of new ENTER_INL_FN and EXIT_INL_FN functions when FORCEINLINE is used. Implemented new VIRTIO_SCSI_MSI_CONTROL_Q_OFFSET definition, and updated QUEUE_TO_MESSAGE() and MESSAGE_TO_QUEUE() to use it. DispatchQueue() now returns a BOOLEAN and uses new tracing functionality, as above. Signed-off-by: benyamin-codez <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As always, I really like your approach to these changes, the whole thing seems good to me, but for the sake of being pedantic, I did add one nit.
LGTM otherwise
} | ||
return TRUE; | ||
if ((virtio_read_isr_status(&adaptExt->vdev) == 1) || adaptExt->dump_mode) { | ||
return ProcessQueue(DeviceExtension, VIRTIO_SCSI_REQUEST_QUEUE_0 + VIRTIO_SCSI_MSI_CONTROL_Q_OFFSET, "ProcessQueue"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
personal nit: can we wrap such long lines, like:
return blah(long_name_arg1,
long_name_arg2,
long_name_arg3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonKohler @kostyanf14
Clang formater is coming soon (already added for Balloon and FWCfg drivers).
The long list of parameters will be wrapped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@YanVugenfirer @JonKohler @kostyanf14
Clang formatter is coming soon ...
Will it also remove the indent on the logger macros, e.g. #if !defined(RUN_UNCHECKED)
...?
It would be good if it didn't.
Same for line / ASCII art as mentioned elsewhere...
It would seem I'm used to the wider screen...
...but can understand it helps to shrink the cols when using GitHub to review. ;^D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it also remove the indent on the logger macros, e.g. #if !defined(RUN_UNCHECKED)...?
Yes, and this is as MS does in driver examples.
Same for line / ASCII art as mentioned elsewhere...
clang-format will be disabled for these specific lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it also remove the indent on the logger macros, e.g.
#if !defined(RUN_UNCHECKED)
...?Yes, and this is as MS does in driver examples.
Technically correct, but so aesthetically displeasing... 8^(
Placeholder to kick off discussion re tracing issues... Hot path considerations. EDIT: I have raised PR #1228 to refactor tracing to use cold and hot paths. Please continue the discussion there. |
It is better to control debug level through the registry, similar to NetKVM. We haven't had a debug compilation option in the VS solution for a long time, so the printout will be only for very motivated developers. Also, there is a "regression" in behavior. Driver load printout was unconditional; now, it is not. |
Very interesting... I'll have another look with this example in mind. I had abandoned this because:
These two functions are IIRC, neither can be called until |
Just thought I'd best point out that these are compile-time conditional macros. I'm not proposing that it should be unprinted in "normal" operations. Using |
Just wanted to confirm my understanding was as above, i.e.:
Notwithstanding (1) above, to overcome the issue in (2) above, we could use a similar solution to That being said, we presently don't compile debug support, only ETW via the WPP compile-time mechanism. The driver currently supports a choice between the two at compile time only, and only via direct manipulation of the In any case, please note I have raised PR #1228 to refactor tracing to use cold and hot paths. This included changing It also introduces tracing and debug controls via compile-time environment variables. Please check it out. Best regards, |
Eliminates
VioScsiMSInterruptWorker()
by refactoring contents into newProcessQueue()
routine.This consolidates the child processes of:
HW_INTERRUPT
HW_MESSAGE_SIGNALLED_INTERRUPT_ROUTINE
Implemented using new tracing functionality.
This includes use of the new
ENTER_INL_FN
andEXIT_INL_FN
functions whenFORCEINLINE
is used.Implemented new
VIRTIO_SCSI_MSI_CONTROL_Q_OFFSET
definitionUpdated
QUEUE_TO_MESSAGE()
andMESSAGE_TO_QUEUE()
to use it.DispatchQueue()
now returns aBOOLEAN
and uses new tracing functionality, as above.