aboutsummaryrefslogtreecommitdiff
path: root/drivers/infiniband/hw/qib
AgeCommit message (Collapse)AuthorFilesLines
2015-07-14IB/mad: Remove improper use of BUG_ONIra Weiny1-2/+3
We recently added BUG_ON's which were inappropriate for a condition which should never happen. Change these to be WARN_ON_ONCE as a debugging aid. Fixes: 4cd7c9479aff ('IB/mad: Add support for additional MAD info to/from drivers') Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-07-04Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull more vfs updates from Al Viro: "Assorted VFS fixes and related cleanups (IMO the most interesting in that part are f_path-related things and Eric's descriptor-related stuff). UFS regression fixes (it got broken last cycle). 9P fixes. fs-cache series, DAX patches, Jan's file_remove_suid() work" [ I'd say this is much more than "fixes and related cleanups". The file_table locking rule change by Eric Dumazet is a rather big and fundamental update even if the patch isn't huge. - Linus ] * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (49 commits) 9p: cope with bogus responses from server in p9_client_{read,write} p9_client_write(): avoid double p9_free_req() 9p: forgetting to cancel request on interrupted zero-copy RPC dax: bdev_direct_access() may sleep block: Add support for DAX reads/writes to block devices dax: Use copy_from_iter_nocache dax: Add block size note to documentation fs/file.c: __fget() and dup2() atomicity rules fs/file.c: don't acquire files->file_lock in fd_install() fs:super:get_anon_bdev: fix race condition could cause dev exceed its upper limitation vfs: avoid creation of inode number 0 in get_next_ino namei: make set_root_rcu() return void make simple_positive() public ufs: use dir_pages instead of ufs_dir_pages() pagemap.h: move dir_pages() over there remove the pointless include of lglock.h fs: cleanup slight list_entry abuse xfs: Correctly lock inode when removing suid and file capabilities fs: Call security_ops->inode_killpriv on truncate fs: Provide function telling whether file_remove_privs() will do anything ...
2015-06-23make simple_positive() publicAl Viro1-1/+1
Signed-off-by: Al Viro <[email protected]>
2015-06-12IB/mad: Add support for additional MAD info to/from driversIra Weiny2-2/+11
In order to support alternate sized MADs (and variable sized MADs on OPA devices) add in/out MAD size parameters to the process_mad core call. In addition, add an out_mad_pkey_index to communicate the pkey index the driver wishes the MAD stack to use when sending OPA MAD responses. The out MAD size and the out MAD PKey index are required by the MAD stack to generate responses on OPA devices. Furthermore, the in and out MAD parameters are made generic by specifying them as ib_mad_hdr rather than ib_mad. Drivers are modified as needed and are protected by BUG_ON flags if the MAD sizes passed to them is incorrect. Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-06-12IB/core: Add ability for drivers to report an alternate MAD size.Ira Weiny1-0/+1
Add max MAD size to the device immutable data set and have all drivers that support MADs report the current IB MAD size (IB_MGMT_MAD_SIZE) to the core. Verify MAD size data in both the MAD core and when reading the immutable data. OPA drivers will report alternate MAD sizes in subsequent patches. Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-06-12IB/mad: Support alternate Base Versions when creating MADsIra Weiny2-2/+4
In preparation to support the new OPA MAD Base version, add a base version parameter to ib_create_send_mad and set it to IB_MGMT_BASE_VERSION for current users. Definition of the new base version and it's processing will occur in later patches. Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-06-12IB/core: Pass hardware specific data in query_deviceMatan Barak1-2/+4
Vendors should be able to pass vendor specific data to/from user-space via query_device uverb. In order to do this, we need to pass the vendors' specific udata. Signed-off-by: Matan Barak <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-06-12IB/core: Change provider's API of create_cq to be extendibleMatan Barak2-5/+11
Add a new ib_cq_init_attr structure which contains the previous cqe (minimum number of CQ entries) and comp_vector (completion vector) in addition to a new flags field. All vendors' create_cq callbacks are changed in order to work with the new API. This commit does not change any functionality. Signed-off-by: Matan Barak <[email protected]> Signed-off-by: Or Gerlitz <[email protected]> Reviewed-By: Devesh Sharma <[email protected]> to patch #2 Signed-off-by: Doug Ledford <[email protected]>
2015-06-02IB/core cleanup: Add const on args - device->process_madIra Weiny2-7/+7
The process_mad device function declares some parameters as "in". Make those parameters const and adjust the call tree under process_mad in the various drivers accordingly. Signed-off-by: Ira Weiny <[email protected]> Reviewed-by: Hal Rosenstock <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-05-20IB/core: Convert core to use bitfield for capsIra Weiny1-7/+1
Remove query_protocol callback Use the new Core Capability bits for: rdma_protocol_* rdma_cap_ib_mad rdma_cap_ib_smi rdma_cap_ib_cm rdma_cap_iw_cm rdma_cap_ib_sa rdma_cap_ib_mcast rdma_cap_af_ib rdma_cap_eth_ah Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-05-20IB/core: Add per port immutable struct to ib_deviceIra Weiny1-0/+17
As of commit 5eb620c81ce3 "IB/core: Add helpers for uncached GID and P_Key searches"; pkey_tbl_len and gid_tbl_len are immutable data which are stored in the ib_device. The per port core capability flags to be added later are also immutable data to be stored in the ib_device object. In preparation for this create a structure for per port immutable data and place the pkey and gid table lengths within this structure. "get_port_immutable" is added as a mandatory device function to allow the drivers to fill in this data. Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-05-18IB/Verbs: Implement new callback query_protocol()Michael Wang1-0/+7
Add new callback query_protocol() and implement for each HW. Mapping List: node-type link-layer transport protocol nes RNIC ETH IWARP IWARP amso1100 RNIC ETH IWARP IWARP cxgb3 RNIC ETH IWARP IWARP cxgb4 RNIC ETH IWARP IWARP usnic USNIC_UDP ETH USNIC_UDP USNIC_UDP ocrdma IB_CA ETH IB IBOE mlx4 IB_CA IB/ETH IB IB/IBOE mlx5 IB_CA IB IB IB ehca IB_CA IB IB IB ipath IB_CA IB IB IB mthca IB_CA IB IB IB qib IB_CA IB IB IB Signed-off-by: Michael Wang <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Tested-by: Ira Weiny <[email protected]> Reviewed-by: Sean Hefty <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Tested-by: Doug Ledford <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-05-12IB/qib: fix test of unsigned variableMike Marciniszyn2-2/+3
Commit d4988623cc60 ("IB/qib: use arch_phys_wc_add()") adjusted mtrr inititialization to use the new interface. Unfortunately, the new interface returns a signed value and the patch tested the unsigned wc_cookie. Fix the issue by changing the type of wc_cookie to int. For the success case the ret left at zero to avoid a warning from the caller. For failure wc_cookie is used as the ret. Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-05-05IB/qib: use arch_phys_wc_add()Luis R. Rodriguez7-79/+39
This driver already makes use of ioremap_wc() on PIO buffers, so convert it to use arch_phys_wc_add(). The qib driver uses a mmap() special case for when PAT is not used, this behaviour used to be determined with a module parameter but since we have been asked to just remove that module parameter this checks for the WC cookie, if not set we can assume PAT was used. If its set we do what we used to do for the mmap for when MTRR was enabled. The removal of the module parameter is OK given that Andy notes that even if users of module parameter are still around it will not prevent loading of the module on recent kernels. Cc: Doug Ledford <[email protected]> Cc: Toshi Kani <[email protected]> Cc: Rickard Strandqvist <[email protected]> Cc: Mike Marciniszyn <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Sean Hefty <[email protected]> Cc: Hal Rosenstock <[email protected]> Cc: Dennis Dalessandro <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Suresh Siddha <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Juergen Gross <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Antonino Daplas <[email protected]> Cc: Jean-Christophe Plagniol-Villard <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Michael S. Tsirkin <[email protected]> Cc: Stefan Bader <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Roger Pau Monné <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-05-05IB/qib: add acounting for MTRRLuis R. Rodriguez1-1/+1
There is no good reason not to, we eventually delete it as well. Cc: Toshi Kani <[email protected]> Cc: Suresh Siddha <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Juergen Gross <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Dave Airlie <[email protected]> Cc: Antonino Daplas <[email protected]> Cc: Jean-Christophe Plagniol-Villard <[email protected]> Cc: Tomi Valkeinen <[email protected]> Cc: Mike Marciniszyn <[email protected]> Cc: Roland Dreier <[email protected]> Cc: Sean Hefty <[email protected]> Cc: Hal Rosenstock <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Luis R. Rodriguez <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
2015-04-15VFS: assorted weird filesystems: d_inode() annotationsDavid Howells1-10/+10
Signed-off-by: David Howells <[email protected]> Signed-off-by: Al Viro <[email protected]>
2015-04-11infinibad: weird APIs switched to ->write_iter()Al Viro1-8/+12
Things Not To Do When Writing A Driver, part 1001st: have writev() and write() on the same file doing completely different things. As in, "interpret very different sets of commands". We _can_ handle that, but it's a bloody bad idea. Don't do that in new drivers. Ever. Signed-off-by: Al Viro <[email protected]>
2015-04-11Merge branch 'iocb' into for-nextAl Viro1-1/+0
2015-03-25fs: move struct kiocb to fs.hChristoph Hellwig1-1/+0
struct kiocb now is a generic I/O container, so move it to fs.h. Also do a #include diet for aio.h while we're at it. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Al Viro <[email protected]>
2015-02-22Merge branch 'for-linus-2' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull more vfs updates from Al Viro: "Assorted stuff from this cycle. The big ones here are multilayer overlayfs from Miklos and beginning of sorting ->d_inode accesses out from David" * 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (51 commits) autofs4 copy_dev_ioctl(): keep the value of ->size we'd used for allocation procfs: fix race between symlink removals and traversals debugfs: leave freeing a symlink body until inode eviction Documentation/filesystems/Locking: ->get_sb() is long gone trylock_super(): replacement for grab_super_passive() fanotify: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions Cachefiles: Fix up scripted S_ISDIR/S_ISREG/S_ISLNK conversions VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) SELinux: Use d_is_positive() rather than testing dentry->d_inode Smack: Use d_is_positive() rather than testing dentry->d_inode TOMOYO: Use d_is_dir() rather than d_inode and S_ISDIR() Apparmor: Use d_is_positive/negative() rather than testing dentry->d_inode Apparmor: mediated_filesystem() should use dentry->d_sb not inode->i_sb VFS: Split DCACHE_FILE_TYPE into regular and special types VFS: Add a fallthrough flag for marking virtual dentries VFS: Add a whiteout dentry type VFS: Introduce inode-getting helpers for layered/unioned fs environments Infiniband: Fix potential NULL d_inode dereference posix_acl: fix reference leaks in posix_acl_create autofs4: Wrong format for printing dentry ...
2015-02-20IB/qib: Add blank line after declarationMike Marciniszyn17-6/+67
Upstream checkpatch now requires this. Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2015-02-20IB/qib: Fix checkpatch warningsMike Marciniszyn15-44/+42
Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2015-02-20Infiniband: Fix potential NULL d_inode dereferenceDavid Howells1-1/+1
Code that does this: if (!(d_unhashed(tmp) && tmp->d_inode)) { ... simple_unlink(parent->d_inode, tmp); } is broken because: !(d_unhashed(tmp) && tmp->d_inode) is equivalent to: !d_unhashed(tmp) || !tmp->d_inode so it is possible to get into simple_unlink() with tmp->d_inode == NULL. simple_unlink(), however, assumes tmp->d_inode cannot be NULL. I think that what was meant is this: !d_unhashed(tmp) && tmp->d_inode and that the logical-not operator or the final close-bracket was misplaced. Signed-off-by: David Howells <[email protected]> cc: Bryan O'Sullivan <[email protected]> cc: Roland Dreier <[email protected]> Signed-off-by: Al Viro <[email protected]>
2015-02-17IB/qib: Fix sizeof checkpatch warningsMike Marciniszyn17-63/+64
Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2015-02-17IB/qib: Replace rcu_assign_pointer() with RCU_INIT_POINTER() in qib_keys.cAndreea-Cristina Bernat1-2/+2
The uses of "rcu_assign_pointer()" are NULLing out the pointers. According to RCU_INIT_POINTER()'s block comment: "1. This use of RCU_INIT_POINTER() is NULLing out the pointer" it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. The following Coccinelle semantic patch was used: @@ @@ - rcu_assign_pointer + RCU_INIT_POINTER (..., NULL) [Derived from http://marc.info/?l=linux-rdma&m=140836519219236&w=2] Tested-by: Mike Marciniszyn <[email protected]> Signed-off-by: Andreea-Cristina Bernat <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2015-02-17IB/qib: Replace rcu_assign_pointer() with RCU_INIT_POINTER() in qib_qp.cAndreea-Cristina Bernat1-4/+4
According to RCU_INIT_POINTER()'s block comment 3.a, it can be used if "1. This use of RCU_INIT_POINTER() is NULLing out the pointer" it is better to use it instead of rcu_assign_pointer() because it has a smaller overhead. "3. The referenced data structure has already been exposed to readers either at compile time or via rcu_assign_pointer() -and- a. You have not made -any- reader-visible changes to this structure since then". These cases fulfill the conditions above because between the rcu_dereference_protected() call and the rcu_assign_pointer() call there is no update of that value. Therefore, this patch makes the replacement. The following Coccinelle semantic patch was used: @@ @@ - rcu_assign_pointer + RCU_INIT_POINTER (..., ( rtnl_dereference(...) | rcu_dereference_protected(...) ) ) [consolidated from http://marc.info/?l=linux-rdma&m=140836578119485&w=2 and http://marc.info/?l=linux-rdma&m=140906361403047&w=2] Tested-by: Mike Marciniszyn <[email protected]> Signed-off-by: Andreea-Cristina Bernat <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2015-02-16IB/qib: Add support for the new QMH7360 cardVinit Agnihotri1-0/+5
Add support to recognize another board variation named QMH7360. Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Vinit Agnihotri <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2015-02-16IB/qib: Do not write EEPROMMitko Haralanov7-220/+1
This changeset removes all the code that allows the driver to write to the EEPROM and update the recorded error counters and power on hours. These two stats are unused and writing them exposes a timing risk which could leave the EEPROM in a bad state preventing further normal operation of the HCA. Cc: <[email protected]> Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Mitko Haralanov <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-12-15IB/core: Replace ib_umem's offset field with a full addressHaggai Eran1-1/+1
In order to allow umems that do not pin memory, we need the umem to keep track of its region's address. This makes the offset field redundant, and so this patch removes it. Signed-off-by: Haggai Eran <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-10-09[infiniband] remove pointless assignmentsAl Viro1-1/+0
Signed-off-by: Al Viro <[email protected]>
2014-09-19IB/qib: Correct reference counting in debugfs qp_statsMike Marciniszyn2-9/+2
This particular reference count is not needed with the rcu protection, and the current code leaks a reference count, causing a hang in qib_qp_destroy(). Cc: <[email protected]> Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-09-19IB/qib: Change get_user_pages() usage to always NULL vmasMike Marciniszyn1-3/+3
The static helper routine, __qib_get_user_pages(), accepts a vma arg, but current use always passes NULL. This has caused some confusion associated with the correct use of this argument, but since the current use case doesn't require the flexiblity, the best thing to do is to simplfy the code to always pass NULL to get_user_pages(). Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-08-14Merge tag 'pci-v3.17-changes-2' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull DEFINE_PCI_DEVICE_TABLE removal from Bjorn Helgaas: "Part two of the PCI changes for v3.17: - Remove DEFINE_PCI_DEVICE_TABLE macro use (Benoit Taine) It's a mechanical change that removes uses of the DEFINE_PCI_DEVICE_TABLE macro. I waited until later in the merge window to reduce conflicts, but it's possible you'll still see a few" * tag 'pci-v3.17-changes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: Remove DEFINE_PCI_DEVICE_TABLE macro use
2014-08-12PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine1-1/+1
We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ - DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id i[] = z; // </smpl> [bhelgaas: add semantic patch] Signed-off-by: Benoit Taine <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]>
2014-08-10IB/mad: add new ioctl to ABI to support new registration optionsIra Weiny1-1/+1
Registrations options are specified through flags. Definitions of flags will be in subsequent patches. Signed-off-by: Ira Weiny <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-06-10Merge branches 'core', 'cxgb3', 'cxgb4', 'iser', 'iwpm', 'misc', 'mlx4', ↵Roland Dreier3-6/+7
'mlx5', 'noio', 'ocrdma', 'qib', 'srp' and 'usnic' into for-next
2014-06-02IB: Return error for unsupported QP creation flagsOr Gerlitz1-1/+2
Fix the usnic and thw qib drivers to err when QP creation flags that they don't understand are provided. Signed-off-by: Or Gerlitz <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-05-29IB/qib: Additional Intel branding changesVinit Agnihotri1-4/+4
This patches changes user visible function names containing "qlogic" in module init and cleanup. Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Vinit Agnihotri <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-05-27IB/qib: Fix port in pkey change eventMike Marciniszyn1-1/+1
The code used a literal 1 in dispatching an IB_EVENT_PKEY_CHANGE. As of the dual port qib QDR card, this is not necessarily correct. Change to use the port as specified in the call. Cc: <[email protected]> Reported-by: Alex Estrin <[email protected]> Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-04-10IB/qib: Use pci_enable_msix_range() instead of pci_enable_msix()Alexander Gordeev1-27/+28
As result of the deprecation of the 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]> Acked-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-04-03Merge branches 'core', 'cxgb4', 'ip-roce', 'iser', 'misc', 'mlx4', 'nes', ↵Roland Dreier16-144/+316
'ocrdma', 'qib', 'sgwrapper', 'srp' and 'usnic' into for-next
2014-04-01IB/qib: Remove ib_sg_dma_address() and ib_sg_dma_len() overloadsMike Marciniszyn1-17/+4
Remove the overload for .dma_len and .dma_address The removal of these methods is compensated for by code changes to .map_sg to insure that the vanilla sg_dma_address() and sg_dma_len() will do the same thing as the equivalent former ib_sg_dma_address() and ib_sg_dma_len() calls into the drivers. Suggested-by: Bart Van Assche <[email protected]> Reviewed-by: Dennis Dalessandro <[email protected]> Tested-by: Vinod Kumar <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-20IB/qib: Cleanup qib_register_observer()Dan Carpenter1-15/+10
Returning directly is easier to read than do-nothing gotos. Remove the duplicative check on "olp" and pull the code in one indent level. Signed-off-by: Dan Carpenter <[email protected]> Acked-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-20IB/qib: Change SDMA progression mode depending on single- or multi-railCQ Tang1-13/+123
Improve performance by changing the behavour of the driver when all SDMA descriptors are in use, and the processes adding new descriptors are single- or multi-rail. For single-rail processes, the driver will block the call and finish posting all SDMA descriptors onto the hardware queue before returning back to PSM. Repeated kernel calls are slower than blocking. For multi-rail processes, the driver will return to PSM as quick as possible so PSM can feed packets to other rail. If all hardware queues are full, PSM will buffer the remaining SDMA descriptors until notified by interrupt that space is available. This patch builds a red-black tree to track the number rails opened by a particular PID. If the number is more than one, it is a multi-rail PSM process, otherwise, it is a single-rail process. Reviewed-by: Dean Luick <[email protected]> Reviewed-by: John A Gregor <[email protected]> Reviewed-by: Mitko Haralanov <[email protected]> Signed-off-by: CQ Tang <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-17IB/qib: Remove duplicate check in get_a_ctxt()Dan Carpenter1-1/+1
We already know "pusable" is non-zero, no need to check again. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-17IB/qib: Fix memory leak of recv context when driver fails to initialize.Dennis Dalessandro1-8/+5
In qib_create_ctxts() we allocate an array to hold recv contexts. Then attempt to create data for those recv contexts. If that call to qib_create_ctxtdata() fails then an error is returned but the previously allocated memory is not freed. Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-17IB/qib: fixup indentation in qib_ib_rcv()Yann Droneaud1-2/+2
Commit af061a644a0e4d4778 add some code in qib_ib_rcv() which trigger a warning from coccicheck (coccinelle/spatch): $ make C=2 CHECK=scripts/coccicheck drivers/infiniband/hw/qib/ CHECK drivers/infiniband/hw/qib/qib_verbs.c drivers/infiniband/hw/qib/qib_verbs.c:679:5-32: code aligned with following code on line 681 CC [M] drivers/infiniband/hw/qib/qib_verbs.o In fact, according to similar code in qib_kreceive(), qib_ib_rcv() code is correct but improperly indented. This patch fix indentation for the misaligned portion. Link: http://marc.info/[email protected] Cc: Mike Marciniszyn <[email protected]> Cc: [email protected] Cc: Julia Lawall <[email protected]> Cc: [email protected] Signed-off-by: Yann Droneaud <[email protected]> Tested-by: Mike Marciniszyn <[email protected]> Acked-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-17IB/qib: add missing braces in do_qib_user_sdma_queue_create()Yann Droneaud1-1/+2
Commit c804f07248895ff9c moved qib_assign_ctxt() to do_qib_user_sdma_queue_create() but dropped the braces around the statements. This was spotted by coccicheck (coccinelle/spatch): $ make C=2 CHECK=scripts/coccicheck drivers/infiniband/hw/qib/ CHECK drivers/infiniband/hw/qib/qib_file_ops.c drivers/infiniband/hw/qib/qib_file_ops.c:1583:2-23: code aligned with following code on line 1587 This patch adds braces back. Link: http://marc.info/[email protected] Cc: Mike Marciniszyn <[email protected]> Cc: [email protected] Cc: Julia Lawall <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Yann Droneaud <[email protected]> Tested-by: Mike Marciniszyn <[email protected]> Acked-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-17IB/qib: Modify software pma counters to use percpu variablesMike Marciniszyn11-28/+83
The counters, unicast_xmit, unicast_rcv, multicast_xmit, multicast_rcv are now maintained as percpu variables. The mad code is modified to add a z_ latch so that the percpu counters monotonically increase with appropriate adjustments in the reset, read logic to maintain the z_ latch. This patch also corrects the fact the unitcast_xmit wasn't handled at all for UC and RC QPs. Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>
2014-03-17IB/qib: Add percpu counter replacing qib_devdata int_counterMike Marciniszyn6-34/+59
This patch replaces the dd->int_counter with a percpu counter. The maintanance of qib_stats.sps_ints and int_counter are combined into the new counter. There are two new functions added to read the counter: - qib_int_counter (for a particular qib_devdata) - qib_sps_ints (for all HCAs) A z_int_counter is added to allow the interrupt detection logic to determine if interrupts have occured since z_int_counter was "reset". Reviewed-by: Dennis Dalessandro <[email protected]> Signed-off-by: Mike Marciniszyn <[email protected]> Signed-off-by: Roland Dreier <[email protected]>