When enabling MSI-X interrupts fails due to lack of memory
the call to pci_disable_msix() is missed and the device is
left with MSI-X interrupts enabled while the driver assumes
otherwise. This update fixes the described misbehaviour and
cleans up the code of skd_release_msix() function.
Signed-off-by: Alexander Gordeev <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
When enabling MSI-X, interrupts are requested for SKD_MAX_MSIX_COUNT
entries in skdev->msix_entries array, while the number of actually
allocated entries is skdev->msix_count. This might lead to an out of
boundary access in case number of allocated entries is less than
SKD_MAX_MSIX_COUNT. This update fixes the described misbehaviour.
Signed-off-by: Alexander Gordeev <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range() and pci_enable_msix_range()
interfaces.
Signed-off-by: Alexander Gordeev <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Asai Thambi S P <[email protected]>
Cc: [email protected]
Signed-off-by: Jens Axboe <[email protected]>
Right now every resource has exactly one connection. But we are preparing
for dynamic connections. I.e. in the future thre can be resources without
connections.
However smatch points this out as 'variable dereferenced before check',
which is correct.
This issue was introduced in
drbd: get_one_status(): Iterate over resource->devices instead of connection->peer_devices
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
After several experiments, deduced the the optimal number of unaligned
writes to be 2. Changing the value accordingly.
Signed-off-by: Asai Thambi S P <[email protected]>
Signed-off-by: Sam Bradshaw <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
In the drbd_thread "infrastructure" functions, only use the resource instead of
the connection. Make the connection field of drbd_thread optional. This will
allow to introduce threads which are not associated with a connection.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
in w_e_ (peer request) callbacks and in peer request I/O completion handlers
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
These functions are not used as drbd_work callbacks.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
The new function can flush any work queue, not just the work queue of the data
socket of a connection.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
drbd_device_work is a work item that has a reference to a device,
while drbd_work is a more generic work item that does not carry
a reference to a device.
All callbacks get a pointer to a drbd_work instance, those callbacks
that expect a drbd_device_work use the container_of macro to get it.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
Also move it to drbd_receiver.c and make it static.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
The new function returns a peer device, which allows us to eliminate a few
instances of first_peer_device().
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
Also fix drbd_calc_cpu_mask() to spread resources equally over all online cpus
independent of device minor numbers.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
Also change drbd_adm_connect() to expect a resource after it requested one.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
in drbd_adm_down(), drbd_create_device() and drbd_set_role()
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
The implicit dependency on a variable inside the macro is problematic.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
With the polymorphic drbd_() macros, we no longer need the connection
specific variants.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
This allows drbd_alert(), drbd_err(), drbd_warn(), and drbd_info() to work for
a resource, device, or connection so that we don't have to introduce three
separate sets of macros for that.
The drbd_printk() macro itself is pretty ugly, but that problem is limited to
one place in the code. Using drbd_printk() on an object type which it doesn't
understand results in an undefined drbd_printk_with_wrong_object_type symbol.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
DRBD was using dev_err() and similar all over the code; instead of having to
write dev_err(disk_to_dev(device->vdisk), ...) to convert a drbd_device into a
kernel device, a DEV macro was used which implicitly references the device
variable. This is terrible; introduce separate drbd_err() and similar macros
with an explicit device parameter instead.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
Let connection->peer_devices point to peer devices; connection->volumes was
pointing to devices.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
So far, connections and resources always come in pairs, but in the future with
multiple connections per resource, the names will stick with the resources.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
This allows to access the volumes of a resource by number.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>
In a first step, each resource has exactly one connection, and both objects are
allocated at the same time. The final result will be one resource and zero or
more connections.
Only allow to delete a resource if all its connections are C_STANDALONE.
Stop the worker threads of all connections early enough.
Signed-off-by: Andreas Gruenbacher <[email protected]>
Signed-off-by: Philipp Reisner <[email protected]>