aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/i40iw/i40iw_cm.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-09-22i40iw: Add support for port reuse on active side connectionsShiraz Saleem1-76/+75
During OpenMPI scale up testing, we observe rdma_connect failures if ports are reused on multiple connections. This is because the Control Queue-Pair (CQP) command to add the reused port to Accelerated Port Bit VectorTable (APBVT) fails as there already exists an entry. Check for duplicate port before invoking the CQP command to add APBVT entry and delete the entry only if the port is not in use. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-09-22i40iw: Add missing VLAN priorityMustafa Ismail1-1/+2
Set the VLAN priority which is in the upper 3 bits of the VLAN tag field in the QP context. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-08-24RDMA/i40iw: Remove unused argumentYuval Shaia1-12/+6
None of the calls to i40iw_netdev_vlan_ipv6 are using mac so let's remove it from func's args-list. Signed-off-by: Yuval Shaia <yuval.shaia@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-08-18i40iw: Fixes for static checker warningsShiraz Saleem1-8/+1
Remove NULL check for cm_node->listener in i40iw_accept as listener is always present at this point. Remove the check for cm_node->accept_pend and related code in i40iw_cm_event_connected as the cm_node in this context is only pertinent to active node and cm_node->accept_pend is always 0. This fixes the following smatch warnings, drivers/infiniband/hw/i40iw/i40iw_cm.c:3691 i40iw_accept() error: we previously assumed 'cm_node->listener' could be null drivers/infiniband/hw/i40iw/i40iw_cm.c:4061 i40iw_cm_event_connected() error: we previously assumed 'cm_node->listener' could be null Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-07-20i40iw: Release cm_id ref on PCI function resetShiraz Saleem1-1/+4
On PCI function reset, cm_id reference is not released which causes an application hang, as it waits on the cm_id to be released on rdma_destroy. To fix this, call i40iw_cm_disconn during a PCI function reset to clean-up resources and release cm_id reference. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-06-01RDMA/i40iw: ACK MPA Reject frameTatyana Nikolova1-1/+1
Explicitly ACK the MPA Reject frame so the peer does not retransmit the frame. Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-06-01RDMA/i40iw: Don't set 0-length FULPDU RTR indication control flagTatyana Nikolova1-1/+0
Don't set control flag for 0-length FULPDU (Send) RTR indication in the enhanced MPA Request/Reply frames, because it isn't supported. Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-04-28IB/i40iw: use setup_timerGeliang Tang1-3/+2
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-14Merge branches 'chelsio', 'debug-cleanup', 'hns' and 'i40iw' into merge-testDoug Ledford1-87/+290
2016-12-12i40iw: Reorganize structures to align with HW capabilitiesHenry Orosco1-16/+20
Some resources are incorrectly organized and at odds with HW capabilities. Specifically, ILQ, IEQ, QPs, MSS, QOS and statistics belong in a VSI. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-12i40iw: Fix race condition in terminate timer's handlerShiraz Saleem1-1/+1
Add a QP reference when terminate timer is started to ensure the destroy QP doesn't race ahead to free the QP while it is being referenced in the terminate timer's handler. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-12i40iw: Fix double free of QPMustafa Ismail1-4/+16
A QP can be double freed if i40iw_cm_disconn() is called while it is currently being freed by i40iw_rem_ref(). The fix in i40iw_cm_disconn() will first check if the QP is already freed before making another request for the QP to be freed. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Correctly fail loopback connection if no listenerShiraz Saleem1-27/+35
Fail the connect and return the proper error code if a client is started with local IP address and there is no corresponding loopback listener. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Fill in IRD value when on connect requestShiraz Saleem1-0/+1
IRD is not populated on connect request and application is getting 0 for the value. Fill in the correct value on connect request. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Set TOS field in IP headerShiraz Saleem1-6/+19
Set the TOS field in IP header with the value passed in from application. If there is mismatch between the remote client's TOS and listener, set the listener Tos to the higher of the two values. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Add NULL check for ibqp event handlerShiraz Saleem1-1/+1
Add NULL check for ibqp event handler before calling it to report QP events, as it might not initialized. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Replace list_for_each_entry macro with safe versionMustafa Ismail1-2/+2
Use list_for_each_entry_safe macro for the IPv6 addr list as IPv6 addresses can be deleted while going through the list. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Add IP addr handling on netdev eventsMustafa Ismail1-3/+135
Disable listeners and disconnect all connected QPs on a netdev interface down event. On an interface up event, the listeners are re-enabled. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Add missing cleanup on device closeMustafa Ismail1-0/+31
On i40iw device close, disconnect all connected QPs by moving them to error state; and block further QPs, PDs and CQs from being created. Additionally, make sure all resources have been freed before deallocating the ibdev as part of the device close. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Use runtime check for IS_ENABLED(CONFIG_IPV6)Henry Orosco1-2/+2
To be consistent, use the runtime check instead of conditional compile. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-05i40iw: Remove NULL check for cm_node->iwdevHenry Orosco1-1/+1
It is not necessary to check cm_node->iwdev in i40iw_rem_ref_cm_node() as it can never be NULL after a successful call out of i40iw_make_cm_node(). Signed-off-by: Chien Tin Tung <chien.tin.tung@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-03i40iw: Remove workaround for pre-production errataHenry Orosco1-23/+3
Pre-production silicon incorrectly truncates 4 bytes of the MPA packet in UDP loopback case. Remove the workaround as it is no longer necessary. Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-03i40iw: Add Quality of Service supportHenry Orosco1-3/+27
Add support for QoS on QPs. Upon device initialization, a map is created from user priority to queue set handles. On QP creation, use ToS to look up the queue set handle for use with the QP. Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Henry Orosco <henry.orosco@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-12-03IB/i40iw: Remove debug prints after allocation failureLeon Romanovsky1-2/+0
The prints after [k|v][m|z|c]alloc() functions are not needed, because in case of failure, allocator will print their internal error prints anyway. Signed-off-by: Leon Romanovsky <leon@kernel.org> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-10-09Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdmaLinus Torvalds1-2/+5
Pull main rdma updates from Doug Ledford: "This is the main pull request for the rdma stack this release. The code has been through 0day and I had it tagged for linux-next testing for a couple days. Summary: - updates to mlx5 - updates to mlx4 (two conflicts, both minor and easily resolved) - updates to iw_cxgb4 (one conflict, not so obvious to resolve, proper resolution is to keep the code in cxgb4_main.c as it is in Linus' tree as attach_uld was refactored and moved into cxgb4_uld.c) - improvements to uAPI (moved vendor specific API elements to uAPI area) - add hns-roce driver and hns and hns-roce ACPI reset support - conversion of all rdma code away from deprecated create_singlethread_workqueue - security improvement: remove unsafe ib_get_dma_mr (breaks lustre in staging)" * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (75 commits) staging/lustre: Disable InfiniBand support iw_cxgb4: add fast-path for small REG_MR operations cxgb4: advertise support for FR_NSMR_TPTE_WR IB/core: correctly handle rdma_rw_init_mrs() failure IB/srp: Fix infinite loop when FMR sg[0].offset != 0 IB/srp: Remove an unused argument IB/core: Improve ib_map_mr_sg() documentation IB/mlx4: Fix possible vl/sl field mismatch in LRH header in QP1 packets IB/mthca: Move user vendor structures IB/nes: Move user vendor structures IB/ocrdma: Move user vendor structures IB/mlx4: Move user vendor structures IB/cxgb4: Move user vendor structures IB/cxgb3: Move user vendor structures IB/mlx5: Move and decouple user vendor structures IB/{core,hw}: Add constant for node_desc ipoib: Make ipoib_warn ratelimited IB/mlx4/alias_GUID: Remove deprecated create_singlethread_workqueue IB/ipoib_verbs: Remove deprecated create_singlethread_workqueue IB/ipoib: Remove deprecated create_singlethread_workqueue ...
2016-10-07i40iw_cm: Remove deprecated create_singlethread_workqueueBhaktipriya Shridhar1-2/+5
alloc_ordered_workqueue() with WQ_MEM_RECLAIM set, replaces deprecated create_singlethread_workqueue(). This is the identity conversion. The workqueue "event_wq" is involved in event handling and queues i40iw_cm_event_handler. The workqueue "disconn_wq" is involved in closing connection and queues i40iw_disconnect_worker. Both workqueues have been identity converted. WQ_MEM_RECLAIM has been set to ensure forward progress under memory pressure. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-08-25i40iw: Send last streaming mode message for loopback connectionsTatyana Nikolova1-21/+1
Send a zero length last streaming mode message for loopback connections to synchronize between accepting QP and connecting QP. This avoids data transfer to start on the accepting QP before the connecting QP is in RTS. Also remove function i40iw_loopback_nop() as it is no longer used. Fixes: f27b4746f378 ("i40iw: add connection management code") Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-08-24i40iw: Add missing NULL check for MPA private dataShiraz Saleem1-2/+2
Add NULL check for pdata and pdata->addr before the memcpy in i40iw_form_cm_frame(). This fixes a NULL pointer de-reference which occurs when the MPA private data pointer is NULL. Also only copy pdata->size bytes in the memcpy to prevent reading past the length of the private data buffer provided by upper layer. Fixes: f27b4746f378 ("i40iw: add connection management code") Reported-by: Stefan Assmann <sassmann@redhat.com> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-08-02i40iw: Do not access pointer after freeMustafa Ismail1-2/+2
Child_listen_node pointer is used in a debug print after kfree. Move the print before kfree. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Shiraz Saleem <shiraz.saleem@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-04-28RDMA/i40iw: Fix for removing quad hash entriesTatyana Nikolova1-1/+3
Fix for removing a quad hash entry when the corresponding quad hash entry hasn't been added, which is the case in loopback connections Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-04-28RDMA/i40iw: Fix endian issues and warningsIsmail, Mustafa1-28/+29
Fix endian warnings and errors due to u32 stored to u16. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-04-28RDMA/i40iw: Remove unused code and fix warningIsmail, Mustafa1-1/+1
Remove unused code and fix warning. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-04-28RDMA/i40iw: Fix refused connectionsIsmail, Mustafa1-41/+44
Make sure cm_node is setup before sending SYN packet and ORD/IRD negotiation. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-04-06i40iw: avoid potential uninitialized variable useArnd Bergmann1-7/+3
gcc finds that the i40iw_make_cm_node() function in the recently added i40iw driver uses an uninitilized variable as an index into an array if CONFIG_IPV6 is disabled and the driver uses IPv6 mode: drivers/infiniband/hw/i40iw/i40iw_cm.c: In function 'i40iw_make_cm_node': drivers/infiniband/hw/i40iw/i40iw_cm.c:2206:52: error: 'arpindex' may be used uninitialized in this function [-Werror=maybe-uninitialized] ether_addr_copy(cm_node->rem_mac, iwdev->arp_table[arpindex].mac_addr); As far as I can tell, this code path can not be used because the ipv4 variable is always set with CONFIG_IPV6 is disabled, but it's better to be sure and prevent the undefined behavior, as well as shut up that warning in a proper way. This adds an 'else' clause for the case we get the warning about, causing the function to return an error in a controlled way. To avoid adding extra mess with combined io()/#ifdef clauses, I'm also converting the existing #ifdef into a more readable if(IS_ENABLED()) check. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: f27b4746f378 ("i40iw: add connection management code") Acked-by: Mustafa Ismail <Mustafa.ismail@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-03-16i40iw: use shared code for port mapperFaisal Latif1-364/+63
Removei/change for port mapper code which has been moved to iwcm. Signed-off-by: Mustafa Ismail <mustafa.ismail@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
2016-02-29i40iw: add connection management codeFaisal Latif1-0/+4442
i40iw_cm.c i40iw_cm.h are used for connection management. changes since v2: Implemented interface changes as reg_phys_mr() is not part of inifiniband interface Done as Christoph Hellwig <hch@infradead.org> did for nes. Changes since v1: improved casts moved kmap() from i40iw_verbs.c to make them short lived. Acked-by: Anjali Singhai Jain <anjali.singhai@intel.com> Acked-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Faisal Latif <faisal.latif@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>