Commit Graph

18 Commits

Author SHA1 Message Date
Graham Whaley
f8dbc896a1 devicemanager: qat: use klog for logging and debug
Move the framework, and the qat driver, to use `klog`
for logging and debug.

This has a some noticeable effects:

1) Our default log output gains a bunch of annotation:
From:
    QAT device plugin started in 'dpdk' mode
To:
    I0312 11:51:02.057728    6053 qat_plugin.go:64] QAT device plugin started in 'dpdk' mode

(there is now a command line option to drop those annotations if
necessary).

2) We gain a bunch of command line parameters from klog for controlling log
levels and output. We go from 5 arguments to 17:

---
Usage of ./cmd/qat_plugin/qat_plugin:
  -add_dir_header
        If true, adds the file directory to the header
  -alsologtostderr
        log to standard error as well as files
  -debug
        enable debug output
  -dpdk-driver string
        DPDK Device driver for configuring the QAT device (default "vfio-pci")
  -kernel-vf-drivers string
        Comma separated VF Device Driver of the QuickAssist Devices in the system. Devices supported: DH895xCC,C62x,C3xxx and D15xx (default "dh895xccvf,c6xxvf,c3xxxvf,d15xxvf")
  -log_backtrace_at value
        when logging hits line file:N, emit a stack trace
  -log_dir string
        If non-empty, write log files in this directory
  -log_file string
        If non-empty, use this log file
  -log_file_max_size uint
        Defines the maximum size a log file can grow to. Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
  -logtostderr
        log to standard error instead of files (default true)
  -max-num-devices int
        maximum number of QAT devices to be provided to the QuickAssist device plugin (default 32)
  -mode string
        plugin mode which can be either dpdk (default) or kernel (default "dpdk")
  -skip_headers
        If true, avoid header prefixes in the log messages
  -skip_log_headers
        If true, avoid headers when opening log files
  -stderrthreshold value
        logs at or above this threshold go to stderr (default 2)
  -v value
        number for the log level verbosity
  -vmodule value
        comma-separated list of pattern=N settings for file-filtered logging
---

3) Our `-debug` flag is now replaced by the `klog` `-v n` flag.

*NOTE:* This is potentially a minor breaking change. Applying
this debug overlay to any previous (pre-klog edit) images will
cause the container to fail to launch, as it will not recognise
the new `-v` arguments.

We also update the kustomize deployment to move from using
DEBUG env vars to adding a VERBOSITY var that controls both
the log verbosity and now the debug mode enabling.

Signed-off-by: Graham Whaley <graham.whaley@intel.com>
2020-03-19 11:20:48 +00:00
Dmitry Rozhkov
a2debf6fb4 qat: fix typo 2019-08-19 12:52:16 +03:00
Dmitry Rozhkov
da132f6584 qat: add kernel mode plugin 2019-04-25 14:15:32 +03:00
nolancon
52df9329e4 Re-order devices in scan loop
Fixes: #146

Removed whitespace
2019-01-23 13:41:22 +00:00
Dmitry Rozhkov
54332c5eea announce deviceplugin API public 2019-01-21 17:20:01 +02:00
Dmitry Rozhkov
7662cb9154 extend API to receive full specs instead of strings 2019-01-21 17:15:27 +02:00
Dmitry Rozhkov
58b62f579b qat: fix numbering of env vars
An `Allocate()` request can be used to allocate resources for many
containers thus `counter` needs to be reset for each container
response.
2018-12-12 13:42:05 +02:00
ssehgal
100ecf8340 Improving consumption of devices by updating the environment variable name based on number of devices requested in a container(e.g. QAT0, QAT1) 2018-12-05 15:11:23 +00:00
nolancon
1bb035cc64 PostAllocate implemented in QAT device plugin 2018-12-05 15:11:23 +00:00
Mikko Ylinen
187f8040f0 qat_plugin: use vfio-pci as the default driver
vfio-pci uses IOMMU memory protection and is a safer default.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2018-11-28 10:32:31 +02:00
ssehgal
8e37adfb42 Fixing minor bugs with QAT plugin
- To ensure that the device plugin continues to run in case a certain QAT device family is not detected on the node
- Updated the extended resource name to qat/generic in demo/crypto-perf-dpdk-pod-requesting-qat.yaml file
- Added explicit check for QAT device ID to avoid counting other DPDK bound devices as QAT devices
2018-09-03 14:27:27 +01:00
Dmitry Rozhkov
eccd70c600 replace glog with simpler home-grown debug logging 2018-08-16 17:40:16 +03:00
Dmitry Rozhkov
2ff6c5929a Use annotated errors for tracing 2018-08-16 17:31:19 +03:00
Ed Bartosh
a0b6651c1d QAT: fix spelling
Fixed misspell warning:
   Line 153: warning: "Unknwon" is a misspelling of "Unknown" (misspell)
2018-08-14 16:42:02 +03:00
Dmitry Rozhkov
b6894b8195 refactor QAT plugin 2018-07-30 15:29:33 +03:00
Mikko Ylinen
6c787ec658 qat: read maxNumdevice as integer 2018-07-26 14:20:44 +03:00
Ed Bartosh
a4b3f7f068 qat: fix formatting errors 2018-07-26 12:44:26 +03:00
ssehgal
3eb2b10f75 Enabling support for QuickAssist Devices 2018-07-23 17:35:37 +01:00