Jack Morgenstein [Thu, 10 Jul 2014 09:29:14 +0000 (12:29 +0300)]
mlx4_ib: Fix endianness in blueflame post_send.
qp object field doorbell_qpn was initialized using swab()
at qp creation.
swab() unconditionally swaps dword endianness. Thus, on
little-endian platforms the endianness of doorbell_qpn was
big endian; on big-endian platforms, doorbell_qpn is little-endian.
In post send blueflame, doorbell_qpn was taken as is (i.e., the
driver assumed that it was in big-endian format). This was OK
for little-endian hosts, but incorrect for big-endian hosts.
The fix is to use cpu_to_be32 when initializing doorbell_qpn (thus
guaranteeing that doorbell_qpn is in big-endian format on all
host types). This also requires modifying non-bf sends to
use __raw_writel (which does not do any endianness swapping)
instead of writel (which does endianness swapping on big-endian hosts).
The fix was developed by Shamir Rabinovitch of Oracle.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported by Mellanox OFED 2.4)
net/mlx4: Switching between sending commands via polling and events may results in hung tasks
When switching between those methonds of sending commands, it's
possbile that a task will keep waiting for the polling sempahore,
but may never be able to acquire it.
This is due to mlx4_cmd_use_events which "down"s the
sempahore back to 0.
Reproducing it involves in sending commands while changing
between mlx4_cmd_use_polling and mlx4_cmd_use_events.
Signed-off-by: Matan Barak <matanb@mellanox.com>
(Ported from Mellanox OFED 2.4)
Eli Cohen [Thu, 3 Jul 2014 13:39:00 +0000 (16:39 +0300)]
IB/mlx4: Put non zero value in max_ah
We put INT_MAX since this is the max value the in can hold.
Though hardware capability is unlimited, this is practically
a large enough number so we can use it.
Signed-off-by: Eli Cohen <eli@mellanox.com>
(Ported from Mellanox OFED 2.4)
Majd Dibbiny [Mon, 16 Jun 2014 07:18:41 +0000 (10:18 +0300)]
IB/core: add debugging prints to explain -EINVAL in ib_uverbs_reg_mr
Understanding why -EINVAL is returned from uverbs is difficult
as there are multiple code paths that can cause the value to be
returned. This patch adds some explainations as pr_debug prints.
Signed-off-by: Haggai Eran <haggaie@mellanox.com> Signed-off-by: Majd Dibbiny <majd@mellanox.com>
(Ported from Mellanox OFED 2.4)
We found that in some cases the kernel sends skb where the
gso field was damaged, and the size of that field was bigger
than the physical mtu, when the HW gets such size it flushes
the qp to error state and all traffic on that interface is
disabled.
In order to avoid such case, i added a check to that field
prior to the ib_send.
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)
Hadar Hen Zion [Tue, 11 Mar 2014 15:44:51 +0000 (17:44 +0200)]
mlx4_core: Fix resource tracker memory leak after Reset Flow
In case of non-responsive device mlx4_ACCESS_MEM fails and the
driver can't read qp_detach mailbox, which includes all the
rule information.
Since the driver doesn't get the rules attributes form the
qp_detach mailbox the master fails to detach his rules form
the resource tracker during driver unload sequence when the
device in in internal_error state.
Calling rem_slave_qp will remove those rules and the qps they are
attached to unconditionally.
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
(Ported from Mellanox OFED 2.4)
Moni Shoua [Mon, 3 Feb 2014 13:39:15 +0000 (15:39 +0200)]
IB/core: Fix QP attr mask when resolving smac
When rdma_accept() is called rdma_cm modifies the QP to RTR.
During this stage the source mac needs to be resolved and put
in the QP atrr. Before modifying the QP. This patch also adds
the flag IB_QP_SMAC to the atrr_mask which was missing.
Erez Shitrit [Sun, 8 Dec 2013 11:39:35 +0000 (13:39 +0200)]
rdma_cm/cma: Cache broadcast domain record.
Currently, rdma_cm waits for the IPoIB driver to complete
its join to the broadcast domain record; after IPoIB gets its
multicast, rdma_cm tries to obtain its own multicast. After an
IB_CLIENT reregister event, IPoIB may not succeed in its first
effort to reregister its multicast groups. In this case, the
backoff mechanism is applied, and IPoIB retries after a
backoff which starts at 2 seconds and can increase up to
16 seconds.
Since rdma_cm waits for the IPoIB multicast join to succeed,
it too will be delayed at least 2 seconds.
The fix is to detach rdma_cm's multicast operation from IPoIB's
broadcast record re-join. When rdma_cm executes a new join
request, it now tries (via the cma) to take parameters from a
cached broadcast record. If the join fails using the cached
values, the cma deletes the cached record and tries to get a new
one.
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)
Noa Osherovich [Thu, 5 Dec 2013 08:24:55 +0000 (10:24 +0200)]
ipoib: added an error message when trying to change mtu to 2K-4K
Max mtu defined by IB is 4K, but mcast_mtu is limited to 2K,
so any request to change mtu to a value between 2K-4K didn't
change the mtu, but also didn't show an error message.
An error value (-EINVAL) is now returned and an ipoib_warn
is issued in such cases.
Signed-off-by: Noa Osherovich <noaos@mellanox.com>
(Ported from Mellanox OFED 2.4)
Jack Morgenstein [Sun, 8 Dec 2013 08:41:07 +0000 (10:41 +0200)]
ib_core: Do not transition MC groups to error on SM_CHANGE event
Do not transition multicast groups to error on an SM_CHANGE
event. These events are not connected with mcast groups.
(When the SM wishes to have multicast groups reregistered,
it issues the CLIENT_REREG event).
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)
Saeed Mahameed [Wed, 27 Nov 2013 13:50:11 +0000 (15:50 +0200)]
mlx4_vnic: always remove child macs in vnic_parent_update remove request
Child macs are not removed in host admin vnics once the connection
is lost with BX. This caused a loss of connectivity for child vnics
in case of connection restored with the BX, since the BX is not
aware of the old child macs.
Solution is to always remove child macs when vnic_paren_update is
called with remove request.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)
Saeed Mahameed [Wed, 27 Nov 2013 09:55:07 +0000 (11:55 +0200)]
mlx4_vnic: set default moderation values in vnic_alloc_netdev
vnic_set_default_moder was called from _vnic_open, which caused
to reset all current moderation values to the default every time
the user opens/closes the vnic interface.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
(Ported from Mellanox OFED 2.4)
Shani Michaeli [Sun, 3 Jun 2012 12:48:32 +0000 (15:48 +0300)]
mlx4: Handle memory region deregistration failure
Memory region deregistration can fail when memory windows
are bound to it. We handle such failures by propagating them
to the user, or by printing a serious warning.
Signed-off-by: Haggai Eran <haggaie@mellanox.com> Signed-off-by: Shani Michaeli <shanim@mellanox.com>
(Ported from Mellanox OFED 2.4)
Jack Morgenstein [Thu, 14 Nov 2013 15:35:06 +0000 (17:35 +0200)]
ib_core: More fixes to ib_sa_add_one error flow
commit 0e7377eed fixed a resource leak of mad agents in
the ib_sa_add_one error flow. However, the fix allowed
ib_mad_unregister_agent to be called in a case where the
ib_mad_register_agent request failed (resulting in an
illegal pointer in the agent field). This caused a kernel
Oops in the error flow.
Fix this by calling ib_unregister_mad_agent only for cases where
ib_register_mad_agent succeeded.
In addition, separate the ib_register_event_handler() call error
flow from the loop error flow. If the call to
ib_register_event_handler fails, the client data must be reset
to NULL, (in case at some point ib_register_event_handler() is
modified so that it may return a non-zero (error) value).
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)
Majd Dibbiny [Mon, 19 Aug 2013 15:19:23 +0000 (18:19 +0300)]
ib_core: Safely unregister mad agent when necessary.
When the allocation of the receive buffer fails the driver
needs to unregister the mad agent. The function
ib_unregister_mad_agent doesn't check if the pointer of the
mad agent is valid and doesn't contain an error and causes a
Kernel Panic. Therefore, we need to check if the pointer of
the mad agent is valid by calling PTR_ERR and only then
unregister the agent.
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
(Ported from Mellanox OFED 2.4)
Majd Dibbiny [Tue, 27 Aug 2013 11:07:36 +0000 (14:07 +0300)]
mlx4_core: Extend num_mtt in dev caps to avoid overflow.
Some legitimate combinations of log_num_mtt and log_mtts_per_seg
cause overflow in the calculation of the num_mtt when initializing
the HCA which causes Kernel panic. Changed the variable to be 'u64'
instead of 'int' to avoid the overflow and made the needed changes
to support the new type.
Signed-off-by: Majd Dibbiny <majd@mellanox.com>
(Ported from Mellanox OFED 2.4)
mlx4_core: fix FMR unmapping to allow remapping afterward
The FMR common use flow (as implemented in fmr_pool) is:
- Allocate FMR (ib_alloc_fmr)
- Use the FMR to remap DMA memory until remaps limit
exceeded (ib_map_phys_fmr)
- Unmap the FMR (ib_unmap_fmr)
- Use the FMR to remap DMA memory until remaps limit
exceeded (ib_map_phys_fmr)
- ...
The current implementation of mlx4_fmr_unmap is not following
this use flow since it is using the HW2SW MPT command.
The HW2SW MPT command notifies the FW that the MPT entry is
not used by HW anymore. The FW may act according to this information,
therefore it is not safe for the driver to manipulate the MPT
directly. The patch fixes this by manipulating the MPT directly
to unmap the memory instead of using the HW2SW MPT command.
Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)
Moshe Lazer [Sun, 16 Jun 2013 08:04:17 +0000 (11:04 +0300)]
mlx4_core: resolvs kernel panic when connectx_port_config fail to set ports
When changing ports configutation (e.g. from ib,ib to eth,eth)
the device is disconnected from interfaces and catas error lists
than we change ports config and reconnecting the device.
In case ports config changing fails the device left disconnected.
If we try again to configure the ports the driver retry to
disconnect the device form its lists and crashes in list_del
function. To aviod this the list_del replaced by list_del_init
(to allow redeleting the device).
Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)
mlx4_core: sysfs, fix usage of log_num_mtt module parameter
When was auto calculated based on RAM size it wrongly includes
also log_mtts_per_seg.
It's wrong in 2 ways:
First, log_mtts_per_seg should be added by the application itself,
no reason to a have total in log_num_mtt itself.
Second, in case that an extra NIC exists it may get an invalid
value as it depends on a larger value.
Specifically, it may cause an overflow and later leads on to
kernel panic via mlx4_buddy_init.
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)
Yishai Hadas [Wed, 20 Mar 2013 16:00:02 +0000 (18:00 +0200)]
mlx4_core: fix ib_uverbs_get_context flow
Fix flow to prevent kernel panic in case of a failure in copy_to_user.
INIT_IB_EVENT_HANDLER must be called to initialize the event handler
list before releasing filp as part of fput.
Otherwise will get a kernel panic at ib_unregister_event_handler
when calling list_del.
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)
Moshe Lazer [Tue, 5 Mar 2013 12:08:47 +0000 (14:08 +0200)]
mlx4_core: use msi_x module param to limit num of MSI-X irqs
The msi_x module param usage is:
0 - don't use MSI-X
1 - use MSI-X (driver decide the num of MSI-X irqs)
>1 - limit number of MSI-X irqs to msi_x
In case of SRIOV the msi_x>1 treated as msi_x==1
Signed-off-by: Moshe Lazer <moshel@mellanox.com>
(Ported from Mellanox OFED 2.4)
Jack Morgenstein [Mon, 25 Feb 2013 12:04:18 +0000 (14:04 +0200)]
ib/core: change error prints in cm module to debug prints.
commit acd10b49 added prints to the cm module.
These, however, should really be debug prints, to be activated
when it is necessary to track down some cm problem.
To activate the debug mechanism, you need to do the following:
1. mount the debug fs (do this once)
mount -t debugfs none /sys/kernel/debug/
Jack Morgenstein [Thu, 19 Mar 2015 01:20:31 +0000 (18:20 -0700)]
mlx4_core: Add more info to mlx4_cmd_post failure error messages
To assist in debugging and support, add additional information
to output generated when fail to post a FW command. In addition,
add in_param, in_modifier, and op_modifier values to output
when commands are successfully posted but time out.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)
Jack Morgenstein [Wed, 20 Feb 2013 14:43:59 +0000 (16:43 +0200)]
mlx4_core: disable mlx4_QP_ATTACH calls from guests if master is doing flow steering.
Old upstream kernel guests do not detect if device-enabled flow
steering is activated by the master. If DMFS is activated,
the master should return error to guests which try to use
the B0-steering flow calls (mlx4_QP_ATTACH).
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)
Jack Morgenstein [Mon, 18 Feb 2013 10:34:59 +0000 (12:34 +0200)]
mlx4_core: change resource quotas to enable supporting upstream-kernel guests
The resource-quota code passed non-power-of-2 quotas to guests.
In the upstream kernel (bugs), resource quotas for MPTs and QPs
are assumed to be powers-of-2. In MPT case, mlx4_init_mr_table
checks for num_mpts being a power-of-2 before checking if it
is running as a slave.
In the QP case, procedure mlx4_qp_alloc() assumes that
(num_qps - 1) is a power-of-2 when calling radix_tree_insert()
and radix_tree_delete().
In the MPT case, mlx4_init_mr_table() failed on the guest,
causing abort of the guest driver bringup.
In the QP case, although create-qp succeeded on the
hypervisor, the radix_tree_insert() call failed, resulting
in failure to create QPs with certain qp numbers.
The fix, for both cases, is to round-up the quota to the
next power-of-2 for guests for MPTs and QPs. This does no
harm, as these two resources were not really meant to be
limited by an upper quota. The guaranteed resources for QPs
and MPTs per VF/PF are not affected by this change.
The only effect is that no guest will ever be able to
actually reach its max-quota for QPs and MPTs.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)
Yishai Hadas [Tue, 12 Feb 2013 13:53:46 +0000 (15:53 +0200)]
mlx4_core: device revision support
The device revision field returned by the NodeInfo MAD
is incorrect on ConnectX3 devices.
This patch is driver side handling to complete a FW fix
added at 2.11.1172. INIT_HCA - bit at offset 0x0C.12 is
set to 1 so that FW will report correct device revision.
Older FW versions won't be affected from turning on that bit,
no capability bit is needed.
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)
Jack Morgenstein [Wed, 30 Jan 2013 08:55:09 +0000 (10:55 +0200)]
IB/mlx4: deprecate "failed to alloc bf reg" message from err to debug
This message is not an error, and qp creation continues
normally -- only without use of blueflame.
For VFs attached to VMs, KVM disables write combining, so
performance is better without BF in this case. The host driver
therefore intentionally disables BF use for guests. (see upstream
kernel commit b91cb3ebcd).
The message notifying that BF is not available is therefore
deprecated from err to debug.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
(Ported from Mellanox OFED 2.4)
Erez Shitrit [Tue, 29 Jan 2013 15:00:49 +0000 (17:00 +0200)]
ib/ipoib: Fix deadlock between rmmod and set_mode
set_mod called from sys/fs, takes sys/fs lock and tries to
take rtnl_lock, rmmod takes rtnl_lock and now tries to take
sys/fs lock, that causes deadlock.
deadloc a->b, b->a
The problem starts when ipoib_set_mod free it's rtnl_lck and
tries to get it after that.
Erez Shitrit [Mon, 28 Jan 2013 14:43:06 +0000 (16:43 +0200)]
ib/ipoib: getout whenever failed to load port.
whenever add_one failed to load one of the port, call remove one
after that, otherwise it ends with panic, (many resources are
for all the ports and some actions will be aken over both of them
without considering that one of them failed to load)
Signed-off-by: Erez Shitrit <erezsh@mellanox.com>
(Ported from Mellanox OFED 2.4)
The Linux Kernel (Unlike the ESX Kernel ) is preemptable, which
means that the this sequence of actions is feasible.
1 flow 1
3 flow 2
4 flow 2
2 flow 1
Now the effect of this sequence is that line #4 has no defacto effect.
The work will be rescheduled and will run once again and only then
will see that the bit value has changed.
In the IPoIB driver this is benign because after each
"set and cancel" sequence, flush is called which waits until the
second run ends. This is not the case with the neigh_reap_task
which does cancel without flush.
Erez Shitrit [Thu, 29 Nov 2012 07:27:46 +0000 (09:27 +0200)]
ib/ipoib: Fix removing call for update_pmtu from spin-lock context.
The function ipoib_cm_send can call the function
ipoib_cm_skb_too_long under spin_lock_irq, the
ipoib_cm_skb_too_long function calls update_pmtu which also
tries to get spin_lock, that can cause to a deadlock.
In order to solve that I took update_pmtu to workqueue that
it is not under spin_lock.
Moshe Lazer [Sun, 4 Nov 2012 07:08:46 +0000 (09:08 +0200)]
mlx4_core: Update minimum size for log_num_qp to 18
The minimum number of QPs must exceed the number of
reserved QPs. The reserved QPs can be divided to 2 categories
reserved_from_bot and reserved_from_top.
reserved_from_bot is normally less than 2K QPs and can't
exceed 2^16 QPs.
reserved_from_top is the sum of reserved QPs for REGION_ETH_ADDR,
REGION_FC_ADDR and REGION_FC_EXCH.
reserved QPs for REGION_FC_EXCH is 2^16 and for REGION_FC_ADDR and
REGION_ETH_ADDR it can't exceed 2^15.
Dotan Barak [Tue, 21 Aug 2012 09:11:31 +0000 (12:11 +0300)]
net/mlx4_core: set used number of MTTs when using auto-detection
Issue 31158.
If we set the number of MTTs automatically by the driver (default
value or auto-detection, by the memory size in the machine), need
to set the used value of the MTTs, so the user will see this value.
Dotan Barak [Tue, 21 Aug 2012 08:56:46 +0000 (11:56 +0300)]
net/mlx4_core: the number of MTTs should consider log_mtts_per_seg
No matter how we decided how many MTTs will be used (calculation
from system memory or using default value), we need to consider
the number of MTTs per segment.
This will allow the user to specify how many MTTs will be used
(with log_num_mtt) and how many MTTs will be used per segment
(using log_mtts_per_seg).
Yishai Hadas [Mon, 19 Nov 2012 13:59:08 +0000 (15:59 +0200)]
net/mlx4_core: num mtt issues
consider num mtts per segment
use vmalloc only when kmalloc fails
V2: adjusted for kernel 3.7-rc4
use vmalloc only when kmalloc fails -- already in kernel:
see commit 89dd86db7 --mlx4_core: Allow large mlx4_buddy bitmaps
Signed-off-by: Yishai Hadas <yishaih@mellanox.com> Signed-off-by: Jack Morgenstein <jackm@mellanox.com>
(Ported from Mellanox OFED 2.4)
Also squash following porting commmits for compilation
of the integrated commit (without squashing they wont compile)
mlx4_vnic: adapt vnic to ofed2 mlx4 implementation
mlx4_vnic: align with OFED2 upstream 3.7 kernel
mlx4_vnic: Fix reference path to hw/mlx4 header files
mlx4_vnic: remove mlx4_vnic_helper module
mlx4_vnic: use ib_modify_cq() in upstream kernel
We modify code to use ib_modify_cq() in upstream kernel
(and not use a modified Mellanox version)
mlx4_vnic: removed reference to mlx4_ib_qp->rules_list in vnic_qp.c
Remove field introduced with Mellanox OFED 2.4 flow
steering patches which are not in upstream kernel.
mlx4_vnic: used an older version of mlx4_qp_reserve_range()
Use mlx4_qp_reserve_range() aligned with version
in Linux 3.18 (We can use the new API when it is
available upstream)
mlx4_vnic: port to Linux 3.18*
mlx4_vnic code is based on the original port
of mlx4_vnic in UEK3. Make changes to compile
on UEK4 (based on Linux 3.18). Use upstream APIs
-not Mellanox specific ones - where they are in
conflict and other changes to make it compile
on Linux 3.18
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com> Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com> Signed-off-by: Qing Huang <qing.huang@oracle.com>
(Ported from UEK3 and Mellanox OFED 2.4)
Eli Cohen [Mon, 19 Nov 2012 11:33:28 +0000 (13:33 +0200)]
mlx4_ib: add blue flame support for kernel consumers
Using blue flame can improve latency by allowing the HW to more
efficiently access the WQE. A consumer who wants to use blue flame,
has to create the QP with inline support. When posting a send WR,
the consumer has to set IB_SEND_INLINE in the send flags. This
approach is similar to that take in userspace; that is, in order
to use blue flame you must use inline. However, if the send WR is
too large for blue flame, it will only use inline.
A kernel consumer that creates a QP with inline support, will be
allocated a UAR and a blue flame register. All QP doorbells will
be set to the UAR and blue flame posts to the blue flame register.
We make use of all available registers in a blue flame page.
Signed-off-by: Eli Cohen <eli@mellanox.co.il> Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
(Ported from Mellanox OFED 2.4)
Dotan Barak [Tue, 12 Jun 2012 10:34:22 +0000 (13:34 +0300)]
ib_core: fix NULL pointer dereference
If there was a failure in the initial fill of the Pkey/GID cache,
and some other ULP/module will try to query a Pkey/GID, the NULL
pointer will be dereferenced, thing that will lead to the
following kernel panic:
Ralph Campbell [Wed, 17 Oct 2007 20:07:17 +0000 (13:07 -0700)]
IB/core - Don't modify outgoing DR SMP if first part is LID routed
The code in handle_outgoing_dr_smp() checks to see if the directed
route SMP has an initial LID routed part and correctly does not
modify the hop pointer but it then proceeds to process the packet
as if there was no initial LID routed part. Instead, if there
is an initial LID routed part, the packet should just be sent on
to the destination and not processed further since it can't be
destined for the local SM/SMA.
Signed-off-by: Ralph Campbell <ralph.campbell@qlogic.com> Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
(Ported from Mellanox OFED 2.4)
Dotan Barak [Wed, 16 May 2012 07:56:29 +0000 (10:56 +0300)]
IB/core: Control number of retries for SA to leave an MCG
Add a multicast leave maximum retry setting in:
sys/module/ib_sa/parameters/mcast_leave_retries.
Add a debug print when the maximum retry count is reached.
Signed-off-by: Nir Muchtar <nirm@voltaire.com> Reviewed-by: Moni Shoua <monis@voltaire.com> Signed-off-by: Vladimir Sokolovsky <vlad@mellanox.com>
Fixup by adding modifications to changed file from following
commit from Mellanox OFED-2.4 to account for kernel API change
so there are no compiler warnings: 19b33d488938e1667bcc16562a2405d632428db0
(core, srp, mlx4_en: Adjustments to patch set which rebased to kernel 3.7)
Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
(Ported from Mellanox OFED 2.4)