]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
9 years agoMerge branch 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek into...
Santosh Shilimkar [Thu, 8 Oct 2015 15:24:16 +0000 (08:24 -0700)]
Merge branch 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1

* 'topic/uek-4.1/rpm-build' of git://ca-git.us.oracle.com/linux-uek:
  uek-rpm: configs: sync up configs with v4.1.9
  uek-rpm: build: Update the base release to 9 with stable v4.1.9
  uek-rpm: configs: Rationalise CRYPTO config for OL6

9 years agoMerge branch 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek into uek...
Santosh Shilimkar [Thu, 8 Oct 2015 15:24:10 +0000 (08:24 -0700)]
Merge branch 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1

* 'topic/uek-4.1/ofed' of git://ca-git.us.oracle.com/linux-uek: (419 commits)
  uek-rpm: Enable config for OVN xsigo drivers
  Add Oracle virtual Networking Drivers for uek4 kernel
  ib_sdp/cma: readd SDP support to cma_save_net_info
  ib/sdp: Enable usermode FMR
  ib/sdp: fix null dereference of sk->sk_wq in sdp_rx_irq()
  sdp: fix keepalive functionality
  ib_sdp: fix deadlock when sdp_cma_handler is called while socket is being closed
  ib_sdp: add unhandled events to rdma_cm_event_str
  ib_sdp/uek-rpm: configs: enable compilation for sdp
  ib_sdp: porting sdp from uek2 to uek-4.1
  ib_sdp: remove APM code
  sdp: Kconfig and Makefile changes
  sdp: port the code to uek2
  sdp: added debug print for the event: RDMA_CM_EVENT_ALT_PATH_LOADED
  sdp: prepare support to kernel 2.6.39-200.1.1.el5uek: add macro to get sk_sleep
  sdp: add support to kernel 2.6.39-200.1.1.el5uek
  sdp: add [rt]x_bytes counters to sdpstats
  sdp: Fix Bug 114242 - Multi connection net_perf causes server to hang
  FMR: remove FMR failure messages
  sdp: make sdp memory leak print a debug
  ...

9 years agoMerge branch 'topic/uek-4.1/xen' of git://ca-git.us.oracle.com/linux-uek into uek...
Santosh Shilimkar [Thu, 8 Oct 2015 15:23:52 +0000 (08:23 -0700)]
Merge branch 'topic/uek-4.1/xen' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1

* 'topic/uek-4.1/xen' of git://ca-git.us.oracle.com/linux-uek:
  xen-netfront: respect user provided max_queues
  net/xen-netfront: only napi_synchronize() if running
  net/xen-netfront: only clean up queues if present
  xen-netback: respect user provided max_queues
  xen-netback: require fewer guest Rx slots when not using GSO
  xen-netback: add support for multicast control
  xen/netback: Wake dealloc thread after completing zerocopy work
  xen-netback: Allocate fraglist early to avoid complex rollback
  net/xen-netback: off by one in BUG_ON() condition
  xen-netback: remove duplicated function definition
  net/xen-netback: Don't mix hexa and decimal with 0x in the printf format
  net/xen-netback: Remove unused code in xenvif_rx_action

9 years agoMerge branch 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux...
Santosh Shilimkar [Thu, 8 Oct 2015 15:23:24 +0000 (08:23 -0700)]
Merge branch 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1

* 'topic/uek-4.1/stable-cherry-picks' of git://ca-git.us.oracle.com/linux-uek: (160 commits)
  Linux 4.1.9
  cxl: Don't remove AFUs/vPHBs in cxl_reset
  ipv4: off-by-one in continuation handling in /proc/net/route
  net: dsa: Do not override PHY interface if already configured
  inet: fix races with reqsk timers
  inet: fix possible request socket leak
  netlink: make sure -EBUSY won't escape from netlink_insert
  bna: fix interrupts storm caused by erroneous packets
  bridge: netlink: account for the IFLA_BRPORT_PROXYARP_WIFI attribute size and policy
  bridge: netlink: account for the IFLA_BRPORT_PROXYARP attribute size and policy
  udp: fix dst races with multicast early demux
  rds: fix an integer overflow test in rds_info_getsockopt()
  rocker: free netdevice during netdevice removal
  net: sched: fix refcount imbalance in actions
  act_bpf: fix memory leaks when replacing bpf programs
  packet: tpacket_snd(): fix signed/unsigned comparison
  packet: missing dev_put() in packet_do_bind()
  fib_trie: Drop unnecessary calls to leaf_pull_suffix
  net/mlx4_core: Fix wrong index in propagating port change event to VFs
  bridge: netlink: fix slave_changelink/br_setport race conditions
  ...

9 years agoMerge branch 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek into...
Santosh Shilimkar [Thu, 8 Oct 2015 15:21:54 +0000 (08:21 -0700)]
Merge branch 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1

* 'topic/uek-4.1/drivers' of git://ca-git.us.oracle.com/linux-uek: (33 commits)
  igb: bump version to igb-5.3.0
  igb: use ARRAY_SIZE to replace calculating sizeof(a)/sizeof(a[0])
  igb: report unsupported ethtool settings in set_coalesce
  igb: Fix i354 88E1112 PHY on RCC boards using AutoMediaDetect
  igb: Pull timestamp from fragment before adding it to skb
  igb: only report generic filters in get_ts_info
  igb: bump version of igb to 5.2.18
  igb: disable IPv6 extension header processing
  igb: Don't use NETDEV_FRAG_PAGE_MAX_SIZE in descriptor calculation
  igb: simplify and clean up igb_enable_mas()
  e1000e: Increase driver version number
  e1000e: Fix tight loop implementation of systime read algorithm
  e1000e: Fix incorrect ASPM locking
  e1000e: Cosmetic changes
  e1000e: Fix EEE in Sx implementation
  e1000e: Cleanup qos request in error handling of e1000_open
  e1000e: i219 - k1 workaround for LPT is not required for SPT
  e1000e: i219 - Increase minimum FIFO read/write min gap
  e1000e: i219 - increase IPG for speed 10/100 full duplex
  e1000e: i219 - fix to enable both ULP and EEE in Sx state
  ...

9 years agoMerge branch 'topic/uek-4.1/sparc' of git://ca-git.us.oracle.com/linux-uek into uek...
Santosh Shilimkar [Thu, 8 Oct 2015 15:21:43 +0000 (08:21 -0700)]
Merge branch 'topic/uek-4.1/sparc' of git://ca-git.us.oracle.com/linux-uek into uek/uek-4.1

* 'topic/uek-4.1/sparc' of git://ca-git.us.oracle.com/linux-uek:
  sparc/crypto: initialize blkcipher.ivsize

9 years agouek-rpm: configs: sync up configs with v4.1.9
Santosh Shilimkar [Thu, 8 Oct 2015 13:13:26 +0000 (06:13 -0700)]
uek-rpm: configs: sync up configs with v4.1.9

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
9 years agouek-rpm: Enable config for OVN xsigo drivers
Mukesh Kacker [Mon, 9 Feb 2015 02:54:50 +0000 (18:54 -0800)]
uek-rpm: Enable config for OVN xsigo drivers

Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
9 years agoMerge branch 'topic/uek-4.1/ofed.xsigo' into topic/uek-4.1/ofed
Mukesh Kacker [Wed, 7 Oct 2015 11:40:32 +0000 (04:40 -0700)]
Merge branch 'topic/uek-4.1/ofed.xsigo' into topic/uek-4.1/ofed

* topic/uek-4.1/ofed.xsigo:
  Add Oracle virtual Networking Drivers for uek4 kernel

9 years agoAdd Oracle virtual Networking Drivers for uek4 kernel
Pradeep Gopanapalli [Wed, 23 Sep 2015 01:56:41 +0000 (18:56 -0700)]
Add Oracle virtual Networking Drivers for uek4 kernel

This commit adds 4 kernel modules: xscore, xsvnic, xve
and xsvhba developed by Xsigo (acquired by Oracle) and used in the Oracle
virtual networking (OVN) products which provide provide virtual network and
storage adapter devices on the servers dynamically at runtime.

The heart of OVN product is the Fabric Interconnect (FI).
Hosts and IO modules connect to the FI using Infiniband fabric.
IO modules can be N/W card or/and FC card.

The "xscore" module is responsible for doing FI topology discovery
and establishing the connection with FI. It is involved in retrieving
virtual device management commands such as INSTALL, DELETE, etc.
This module provides wrapper for IB framework API's which will be used
by its client  modules "xsvnic", "xsvhba" and "xve".

The "xve" module supprots the Xsigo Virtual Ethernet(XVE) protocol.
The "xsvnic" module supports the Xsigo vNIC functinality. These modules
interface between kernel networking stack and the "xscore" module.
On the egress side, it processes the N/W packet sends it to "xscore"
module which is then wrapped into a IB packet.

On the ingress side, "xscore" receives the N/W packet which is
encapsulated inside IB packet and transfers it to "xsvnic" or "xve".
The modules "xsvnic"/"xve" process this packet and send it to the
kernel networking stack. The "xsvnic" interacts with N/W card gateway
connected to the FI whereas, "xve" interacts with another host in the
same IB fabric.

The "xsvhba" module support for the Xsigo virtual HBA allowing SAN
Connectivity. The "xsvhba" module interfaces with SCSI layer. It
communicates with the FC card gateway connected to the FI. It is
responsible for accepting/transporting the SCSI commands from/to
the specified SCSI target. The "xsvhba" module uses "xscore" to
wrap(unwrap) the commands in a IB packet and transmit(receive) it.

Signed-off-by: Pradeep Gopanapalli <pradeep.gopanapalli@oracle.com>
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>
9 years agoxen-netfront: respect user provided max_queues
Wei Liu [Thu, 10 Sep 2015 10:18:58 +0000 (11:18 +0100)]
xen-netfront: respect user provided max_queues

Originally that parameter was always reset to num_online_cpus during
module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not
provided a value.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Tested-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 32a844056fd43dda647e1c3c6b9983bdfa04d17d)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agonet/xen-netfront: only napi_synchronize() if running
Chas Williams [Thu, 27 Aug 2015 16:28:46 +0000 (12:28 -0400)]
net/xen-netfront: only napi_synchronize() if running

If an interface isn't running napi_synchronize() will hang forever.

[  392.248403] rmmod           R  running task        0   359    343 0x00000000
[  392.257671]  ffff88003760fc88 ffff880037193b40 ffff880037193160 ffff88003760fc88
[  392.267644]  ffff880037610000 ffff88003760fcd8 0000000100014c22 ffffffff81f75c40
[  392.277524]  0000000000bc7010 ffff88003760fca8 ffffffff81796927 ffffffff81f75c40
[  392.287323] Call Trace:
[  392.291599]  [<ffffffff81796927>] schedule+0x37/0x90
[  392.298553]  [<ffffffff8179985b>] schedule_timeout+0x14b/0x280
[  392.306421]  [<ffffffff810f91b9>] ? irq_free_descs+0x69/0x80
[  392.314006]  [<ffffffff811084d0>] ? internal_add_timer+0xb0/0xb0
[  392.322125]  [<ffffffff81109d07>] msleep+0x37/0x50
[  392.329037]  [<ffffffffa00ec79a>] xennet_disconnect_backend.isra.24+0xda/0x390 [xen_netfront]
[  392.339658]  [<ffffffffa00ecadc>] xennet_remove+0x2c/0x80 [xen_netfront]
[  392.348516]  [<ffffffff81481c69>] xenbus_dev_remove+0x59/0xc0
[  392.356257]  [<ffffffff814e7217>] __device_release_driver+0x87/0x120
[  392.364645]  [<ffffffff814e7cf8>] driver_detach+0xb8/0xc0
[  392.371989]  [<ffffffff814e6e69>] bus_remove_driver+0x59/0xe0
[  392.379883]  [<ffffffff814e84f0>] driver_unregister+0x30/0x70
[  392.387495]  [<ffffffff814814b2>] xenbus_unregister_driver+0x12/0x20
[  392.395908]  [<ffffffffa00ed89b>] netif_exit+0x10/0x775 [xen_netfront]
[  392.404877]  [<ffffffff81124e08>] SyS_delete_module+0x1d8/0x230
[  392.412804]  [<ffffffff8179a8ee>] system_call_fastpath+0x12/0x71

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Chas Williams <3chas3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 274b045509175db0405c784be85e8cce116e6f7d)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agonet/xen-netfront: only clean up queues if present
Chas Williams [Wed, 19 Aug 2015 23:14:20 +0000 (19:14 -0400)]
net/xen-netfront: only clean up queues if present

If you simply load and unload the module without starting the interfaces,
the queues are never created and you get a bad pointer dereference.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Chas Williams <3chas3@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 9a873c71e91cabf4c10fd9bbd8358c22deaf6c9e)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoxen-netback: respect user provided max_queues
Wei Liu [Thu, 10 Sep 2015 10:18:57 +0000 (11:18 +0100)]
xen-netback: respect user provided max_queues

Originally that parameter was always reset to num_online_cpus during
module initialisation, which renders it useless.

The fix is to only set max_queues to num_online_cpus when user has not
provided a value.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Reported-by: Johnny Strom <johnny.strom@linuxsolutions.fi>
Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 4c82ac3c37363e8c4ded6a5fe1ec5fa756b34df3)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoxen-netback: require fewer guest Rx slots when not using GSO
David Vrabel [Tue, 8 Sep 2015 13:25:14 +0000 (14:25 +0100)]
xen-netback: require fewer guest Rx slots when not using GSO

Commit f48da8b14d04ca87ffcffe68829afd45f926ec6a (xen-netback: fix
unlimited guest Rx internal queue and carrier flapping) introduced a
regression.

The PV frontend in IPXE only places 4 requests on the guest Rx ring.
Since netback required at least (MAX_SKB_FRAGS + 1) slots, IPXE could
not receive any packets.

a) If GSO is not enabled on the VIF, fewer guest Rx slots are required
   for the largest possible packet.  Calculate the required slots
   based on the maximum GSO size or the MTU.

   This calculation of the number of required slots relies on
   1650d5455bd2 (xen-netback: always fully coalesce guest Rx packets)
   which present in 4.0-rc1 and later.

b) Reduce the Rx stall detection to checking for at least one
   available Rx request.  This is fine since we're predominately
   concerned with detecting interfaces which are down and thus have
   zero available Rx requests.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 1d5d48523900a4b0f25d6b52f1a93c84bd671186)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoxen-netback: add support for multicast control
Paul Durrant [Wed, 2 Sep 2015 16:58:36 +0000 (17:58 +0100)]
xen-netback: add support for multicast control

Xen's PV network protocol includes messages to add/remove ethernet
multicast addresses to/from a filter list in the backend. This allows
the frontend to request the backend only forward multicast packets
which are of interest thus preventing unnecessary noise on the shared
ring.

The canonical netif header in git://xenbits.xen.org/xen.git specifies
the message format (two more XEN_NETIF_EXTRA_TYPEs) so the minimal
necessary changes have been pulled into include/xen/interface/io/netif.h.

To prevent the frontend from extending the multicast filter list
arbitrarily a limit (XEN_NETBK_MCAST_MAX) has been set to 64 entries.
This limit is not specified by the protocol and so may change in future.
If the limit is reached then the next XEN_NETIF_EXTRA_TYPE_MCAST_ADD
sent by the frontend will be failed with NETIF_RSP_ERROR.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 210c34dcd8d912dcc740f1f17625a7293af5cb56)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoxen/netback: Wake dealloc thread after completing zerocopy work
Ross Lagerwall [Tue, 4 Aug 2015 14:40:59 +0000 (15:40 +0100)]
xen/netback: Wake dealloc thread after completing zerocopy work

Waking the dealloc thread before decrementing inflight_packets is racy
because it means the thread may go to sleep before inflight_packets is
decremented. If kthread_stop() has already been called, the dealloc
thread may wait forever with nothing to wake it. Instead, wake the
thread only after decrementing inflight_packets.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 57b229063ae6dc65036209018dc7f4290cc026bb)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoxen-netback: Allocate fraglist early to avoid complex rollback
Ross Lagerwall [Mon, 3 Aug 2015 14:38:03 +0000 (15:38 +0100)]
xen-netback: Allocate fraglist early to avoid complex rollback

Determine if a fraglist is needed in the tx path, and allocate it if
necessary before setting up the copy and map operations.
Otherwise, undoing the copy and map operations is tricky.

This fixes a use-after-free: if allocating the fraglist failed, the copy
and map operations that had been set up were still executed, writing
over the data area of a freed skb.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 2475b22526d70234ecfe4a1ff88aed69badefba9)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agonet/xen-netback: off by one in BUG_ON() condition
Dan Carpenter [Sat, 11 Jul 2015 22:20:55 +0000 (01:20 +0300)]
net/xen-netback: off by one in BUG_ON() condition

The > should be >=.  I also added spaces around the '-' operations so
the code is a little more consistent and matches the condition better.

Fixes: f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping')
Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 50c2e4dd6749725338621fff456b26d3a592259f)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoxen-netback: remove duplicated function definition
Li, Liang Z [Mon, 6 Jul 2015 00:42:56 +0000 (08:42 +0800)]
xen-netback: remove duplicated function definition

There are two duplicated xenvif_zerocopy_callback() definitions.
Remove one of them.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Liang Li <liang.z.li@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6ab13b27699e5a71cca20d301c3c424653bd0841)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agonet/xen-netback: Don't mix hexa and decimal with 0x in the printf format
Julien Grall [Tue, 16 Jun 2015 19:10:48 +0000 (20:10 +0100)]
net/xen-netback: Don't mix hexa and decimal with 0x in the printf format

Append 0x to all %x in order to avoid while reading when there is other
decimal value in the log.

Also replace some of the hexadecimal print to decimal to uniformize the
format with netfront.

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 68946159da1b0b6791c5990242940950b9383cfc)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agonet/xen-netback: Remove unused code in xenvif_rx_action
Julien Grall [Tue, 16 Jun 2015 19:10:47 +0000 (20:10 +0100)]
net/xen-netback: Remove unused code in xenvif_rx_action

The variables old_req_cons and ring_slots_used are assigned but never
used since commit 1650d5455bd2dc6b5ee134bd6fc1a3236c266b5b "xen-netback:
always fully coalesce guest Rx packets".

Acked-by: Konrad Rzeszutek Wilk <Konrad.wilk@oracle>
Signed-off-by: Julien Grall <julien.grall@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 44f0764cfec9c607d43cad6a51e8592c7b2b9b84)
Signed-off-by: Annie Li <annie.li@oracle.com>
9 years agoMerge branch 'topic/uek-4.1/ofed.mlnx2.4-p3.orclFixes' into topic/uek-4.1/ofed
Mukesh Kacker [Tue, 6 Oct 2015 14:36:37 +0000 (07:36 -0700)]
Merge branch 'topic/uek-4.1/ofed.mlnx2.4-p3.orclFixes' into topic/uek-4.1/ofed

* topic/uek-4.1/ofed.mlnx2.4-p3.orclFixes:
  ib_sdp/cma: readd SDP support to cma_save_net_info

9 years agoib_sdp/cma: readd SDP support to cma_save_net_info
Qing Huang [Sat, 26 Sep 2015 00:47:19 +0000 (17:47 -0700)]
ib_sdp/cma: readd SDP support to cma_save_net_info

Upstream has removed SDP support from cma.c. Some applications may
not display addr/port information correctly without this change to
cma_save_net_info() function.

Signed-off-by: Qing Huang <qing.huang@oracle.com>
9 years agoMerge branch 'topic/uek-4.1/ofed.sdp' into topic/uek-4.1/ofed
Mukesh Kacker [Tue, 6 Oct 2015 12:49:07 +0000 (05:49 -0700)]
Merge branch 'topic/uek-4.1/ofed.sdp' into topic/uek-4.1/ofed

* topic/uek-4.1/ofed.sdp:
  ib/sdp: Enable usermode FMR
  ib/sdp: fix null dereference of sk->sk_wq in sdp_rx_irq()
  sdp: fix keepalive functionality
  ib_sdp: fix deadlock when sdp_cma_handler is called while socket is being closed
  ib_sdp: add unhandled events to rdma_cm_event_str

9 years agoib/sdp: Enable usermode FMR
Dotan Barak [Wed, 22 Feb 2012 12:59:56 +0000 (14:59 +0200)]
ib/sdp: Enable usermode FMR

Signed-off-by: Arun Kaimalettu <arun.kaimalettu@oracle.com>
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
9 years agoib/sdp: fix null dereference of sk->sk_wq in sdp_rx_irq()
Chuck Anderson [Thu, 8 Jan 2015 00:06:49 +0000 (17:06 -0700)]
ib/sdp: fix null dereference of sk->sk_wq in sdp_rx_irq()

Orabug: 20070989

BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
IP: [<ffffffffa02b639f>] sdp_rx_irq+0x4f/0x160 [ib_sdp]
PGD 1d7fd14067 PUD 190984b067 PMD 0
Oops: 0000 [#1] SMP
...
Pid: 61889, comm: oracle Not tainted 2.6.39-400.128.20.el5uek #1 Oracle
Corporation SUN FIRE X4170 M3     /ASSY,MOTHERBOARD,1U
RIP: 0010:[<ffffffffa02b639f>]  [<ffffffffa02b639f>] sdp_rx_irq+0x4f/0x160
[ib_sdp]
...

Crash occurs in the call to sdp_sk_sleep(sk) through waitqueue_active():

drivers/infiniband/ulp/sdp/sdp_rx.c
static void sdp_rx_irq(struct ib_cq *cq, void *cq_context)
        if (should_wake_up(sk)) {

drivers/infiniband/ulp/sdp/sdp_rx.c
static inline int should_wake_up(struct sock *sk)
{
        return sdp_sk_sleep(sk) && waitqueue_active(sdp_sk_sleep(sk)) &&
                (posts_handler(sdp_sk(sk)) || somebody_is_waiting(sk));
}

drivers/infiniband/ulp/sdp/sdp.h:
        #define sdp_sk_sleep(sk) sk_sleep(sk)

include/net/sock.h
static inline wait_queue_head_t *sk_sleep(struct sock *sk)
{
        BUILD_BUG_ON(offsetof(struct socket_wq, wait) != 0);
        return &rcu_dereference_raw(sk->sk_wq)->wait;
}

We know the first call to sdp_sk_sleep(sk) finds a non-null sk->sk_wq
because we don't crash:

0xffffffffa02b6388 <sdp_rx_irq+56>:     mov    0xb8(%rsi),%rax
0xffffffffa02b638f <sdp_rx_irq+63>:     test   %rax,%rax
*** struct sock sk+0xb8 == sk->sk_wq (sk_wq is at offset 0xb8)
*** we didn't crash at sdp_rx_irq+56 so sk->sk_wq was apparently valid
0xffffffffa02b6394 <sdp_rx_irq+68>:     mov    0xb8(%rsi),%rdx
0xffffffffa02b639b <sdp_rx_irq+75>:     lea    0x8(%rdx),%rax
0xffffffffa02b639f <sdp_rx_irq+79>:     cmp    %rax,0x8(%rdx)
*** RDX is NULL causing the null dereference of address 0x8 at sdp_rx_irq+79.

Fix is to check if sk->sk_wq is NULL before dereferencing it to get the
address of sk->sk_wq->wait.  Also, do the RCU dereference of sk->sk_wq
once, not twice as we may get a different answer (NULL) the second time.

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
Signed-off-by: John Sobecki <john.sobecki@oracle.com>
Acked-by: Chien Yen <chien.yen@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
9 years agosdp: fix keepalive functionality
shamir rabinovitch [Mon, 12 May 2014 15:34:02 +0000 (08:34 -0700)]
sdp: fix keepalive functionality

sdp keepalive functionality differ a bit from tcp socket functionality.
in sdp only accepted or connected socket can trigger this functionality
as the keepalive is implemented as rdma write with zero length and this
require ib connection. due to this sdp behaviour you cannot set keepalive
on listening server socket or on non connected client socket. apps can
use sdp in 2 ways. binary apps that use tcp sockets can use the libsdp
to direct all the socket calls to sdp and new apps can open and use sdp
sockets directly w/o the need for libsdp. when using sdp socket directly
please follow the below rules:

- define: AF_INET_SDP = SOL_SDP = 27
- create the socket as follow:
socket(AF_INET_SDP, SOCK_STREAM, 0)
- get the sdp socket keepalive as follow:
getsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &optval, &optlen)
- set the sdp socket keepalive as follow:
setsockopt(fd, SOL_SDP, SO_KEEPALIVE, &optval, optlen)

when you load the sdp module;
- set the keepalive time. this is the max period in sec of no data before
sdp start to send the probes. you should take to account that more
then one probe is needed till sdp detect that the remote hca is gone.
echo <time sec> > /sys/module/ib_sdp/parameters/sdp_keepalive_time
- zero the probes counter. this counter is incremented any time sdp send probe.
probes are sent only if there is no tx/rx on this queue pair for the
keepalive time period.
echo 0 > /sys/module/ib_sdp/parameters/sdp_keepalive_probes_sent

on server socket:
- set keepalive only on accepted socket

on client socket:
- set keepalive only on socket after connect

Orabug: 18728784

Signed-off-by: Shamir Rabinovitch <shamir.rabinovitch@oracle.com>
Signed-off-by: Vadim Makhervaks <vadim.makhervaks@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
9 years agoib_sdp: fix deadlock when sdp_cma_handler is called while socket is being closed
Saeed Mahameed [Sun, 17 Feb 2013 16:10:57 +0000 (18:10 +0200)]
ib_sdp: fix deadlock when sdp_cma_handler is called while socket is being closed

issue: 130280

sdp_close will grap sock_lock and while closing sdp_cma_handler can be called from cma context
under id_priv->qp_mutex and the sdp_cma_handler will wait for sock_lock to be available.
sdp_close will call rdma_disconnect which will need to grap id_priv->qp_mutex --> deadlock !

this patch fixes the following call trace :
Call Trace:
[<ffffffff813b4476>] lock_sock_nested+0x86/0xbf
[<ffffffff81077024>] ? autoremove_wake_function+0x0/0x3d
[<ffffffffa03ae65a>] sdp_cma_handler+0xe7/0x1529 [ib_sdp]
[<ffffffffa04ca060>] ? mlx4_free_cmd_mailbox+0x31/0x35 [mlx4_core]
[<ffffffffa04ca060>] ? mlx4_free_cmd_mailbox+0x31/0x35 [mlx4_core]
[<ffffffffa04dece6>] ? __mlx4_qp_modify+0x2c6/0x2eb [mlx4_core]
[<ffffffffa01d8408>] ? rdma_port_link_layer+0x1b/0x42 [ib_core]
[<ffffffffa0234de0>] ? mlx4_ib_modify_qp+0xd22/0xd46 [mlx4_ib]
[<ffffffffa0234df2>] ? mlx4_ib_modify_qp+0xd34/0xd46 [mlx4_ib]
[<ffffffffa038e1de>] cma_qp_set_alt_path+0x2b7/0x32c [rdma_cm]
[<ffffffffa0215792>] ? ib_post_send_mad+0x440/0x50f [ib_mad]
[<ffffffffa0390425>] cma_ib_handler+0x70f/0x9fc [rdma_cm]
[<ffffffffa01dbe60>] ? ib_find_cached_pkey+0xf0/0x105 [ib_core]
[<ffffffffa02a5a07>] cm_process_work+0x53/0x9b [ib_cm]
[<ffffffffa02a7352>] cm_work_handler+0x66e/0xdcd [ib_cm]
[<ffffffffa02a6ce4>] ? cm_work_handler+0x0/0xdcd [ib_cm]
[<ffffffff81072d5e>] worker_thread+0x14d/0x1ed
[<ffffffff81077024>] ? autoremove_wake_function+0x0/0x3d
[<ffffffff81072c11>] ? worker_thread+0x0/0x1ed
[<ffffffff81076c7b>] kthread+0x6e/0x76
[<ffffffff81012dea>] child_rip+0xa/0x20
[<ffffffff81076c0d>] ? kthread+0x0/0x76
[<ffffffff81012de0>] ? child_rip+0x0/0x20
INFO: task rdma_cm:24917 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
rdma_cm D 0000000000000000 0 24917 2 0x00000000
ffff8800ce4e7d20 0000000000000046 0000000000000000 000000008104cb48
ffff8800da5e83c0 ffffffff81aae4c0 ffff8800da5e8790 000000010319de96
0000000000000400 0000000000000000 0000000000000000 ffff880107864664
Call Trace:
[<ffffffff81456870>] __mutex_lock_common+0x12f/0x1a1
[<ffffffff81456931>] __mutex_lock_slowpath+0x19/0x1b
[<ffffffff8145699a>] mutex_lock+0x23/0x3a
[<ffffffffa038d03c>] cma_sap_work_handler+0x105/0x245 [rdma_cm]
[<ffffffff810432be>] ? need_resched+0x23/0x2d
[<ffffffff814560ab>] ? thread_return+0x99/0xb0
[<ffffffffa038ee11>] ? cma_work_handler+0x0/0x94 [rdma_cm]
[<ffffffffa038cf37>] ? cma_sap_work_handler+0x0/0x245 [rdma_cm]
[<ffffffff81072d5e>] worker_thread+0x14d/0x1ed
[<ffffffff81077024>] ? autoremove_wake_function+0x0/0x3d
[<ffffffff81072c11>] ? worker_thread+0x0/0x1ed
[<ffffffff81076c7b>] kthread+0x6e/0x76
[<ffffffff81012dea>] child_rip+0xa/0x20
[<ffffffff81076c0d>] ? kthread+0x0/0x76
[<ffffffff81012de0>] ? child_rip+0x0/0x20
INFO: task NPtcp:4326 blocked for more than 120 seconds.
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
NPtcp D 0000000000000000 0 4326 4319 0x00000000
ffff8800b66dfc78 0000000000000086 ffff8800d3ff03c0 0000000000000005
ffff8800b12b40c0 ffffffff81aae4c0 ffff8800b12b4490 0000000028210680
ffff8800b66dfd70 ffff8800b66dfde8 0000000000000000 ffff88010786461c

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Amir Vadai <amirv@mellanox.com>
9 years agoib_sdp: add unhandled events to rdma_cm_event_str
Saeed Mahameed [Mon, 11 Feb 2013 15:04:04 +0000 (17:04 +0200)]
ib_sdp: add unhandled events to rdma_cm_event_str

Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
9 years agoib_sdp/uek-rpm: configs: enable compilation for sdp
Qing Huang [Wed, 23 Sep 2015 00:30:07 +0000 (17:30 -0700)]
ib_sdp/uek-rpm: configs: enable compilation for sdp

Signed-off-by: Qing Huang <qing.huang@oracle.com>
9 years agoMerge branch 'topic/uek-4.1/ofed.sdp' into topic/uek-4.1/ofed
Mukesh Kacker [Tue, 6 Oct 2015 12:13:39 +0000 (05:13 -0700)]
Merge branch 'topic/uek-4.1/ofed.sdp' into topic/uek-4.1/ofed

* topic/uek-4.1/ofed.sdp: (408 commits)
  ib_sdp: porting sdp from uek2 to uek-4.1
  ib_sdp: remove APM code
  sdp: Kconfig and Makefile changes
  sdp: port the code to uek2
  sdp: added debug print for the event: RDMA_CM_EVENT_ALT_PATH_LOADED
  sdp: prepare support to kernel 2.6.39-200.1.1.el5uek: add macro to get sk_sleep
  sdp: add support to kernel 2.6.39-200.1.1.el5uek
  sdp: add [rt]x_bytes counters to sdpstats
  sdp: Fix Bug 114242 - Multi connection net_perf causes server to hang
  FMR: remove FMR failure messages
  sdp: make sdp memory leak print a debug
  sdp: changed memory accounting warning into debug
  sdp: Fix issues in sdpprf
  sdp: Remove protection before sleep on RX
  sdp: Enable automatic path migration support also in the passive side of the connection.
  sdp: Fixed some coverity issues
  Flatten the entire tree fixes
  sdp: Fixed compilation error on 2.6.18 RH5.5
  sdp: fix memory leak. sockets_allocated wasn't freed
  sdp: Removed spaces and tabs at end of lines
  ...

9 years agoib_sdp: porting sdp from uek2 to uek-4.1
Qing Huang [Fri, 25 Sep 2015 22:45:36 +0000 (15:45 -0700)]
ib_sdp: porting sdp from uek2 to uek-4.1

Perf result:

[root@ca-ibdev10 src]# ./iperf -c 192.168.220.117 -P 8 -p 6001 -l 4k -t 300 -w
16m
------------------------------------------------------------
Client connecting to 192.168.220.117, TCP port 6001
TCP window size: 2.10 MByte (WARNING: requested 16.0 MByte)
------------------------------------------------------------
[  7] local 192.168.220.110 port 28275 connected with 192.168.220.117 port 6001
[  9] local 192.168.220.110 port 16839 connected with 192.168.220.117 port 6001
[  4] local 192.168.220.110 port 13889 connected with 192.168.220.117 port 6001
[ 12] local 192.168.220.110 port 22535 connected with 192.168.220.117 port 6001
[ 13] local 192.168.220.110 port 33341 connected with 192.168.220.117 port 6001
[  6] local 192.168.220.110 port 9645 connected with 192.168.220.117 port 6001
[ 16] local 192.168.220.110 port 54091 connected with 192.168.220.117 port 6001
[ 19] local 192.168.220.110 port 22246 connected with 192.168.220.117 port 6001
[ ID] Interval       Transfer     Bandwidth
[  7]  0.0-300.0 sec   126 GBytes  3.59 Gbits/sec
[  9]  0.0-300.0 sec   126 GBytes  3.60 Gbits/sec
[  4]  0.0-300.0 sec   126 GBytes  3.60 Gbits/sec
[ 12]  0.0-300.0 sec   126 GBytes  3.59 Gbits/sec
[ 13]  0.0-300.0 sec   126 GBytes  3.60 Gbits/sec
[  6]  0.0-300.0 sec   126 GBytes  3.60 Gbits/sec
[ 16]  0.0-300.0 sec   126 GBytes  3.60 Gbits/sec
[ 19]  0.0-300.0 sec   126 GBytes  3.59 Gbits/sec
[SUM]  0.0-300.0 sec  1004 GBytes  28.8 Gbits/sec

Signed-off-by: Qing Huang <qing.huang@oracle.com>
9 years agoib_sdp: remove APM code
Qing Huang [Wed, 21 Jan 2015 23:17:06 +0000 (15:17 -0800)]
ib_sdp: remove APM code

In UEK4, APM support code in rdma_cm has been removed,
so we had to remove all the references to APM APIs in
SDP as well.

Signed-off-by: Qing Huang <qing.huang@oracle.com>
Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
9 years agosdp: Kconfig and Makefile changes
Ajaykumar Hotchandani [Thu, 22 Jan 2015 03:18:44 +0000 (19:18 -0800)]
sdp: Kconfig and Makefile changes

Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
9 years agosdp: port the code to uek2
Dotan Barak [Tue, 3 Jul 2012 10:09:47 +0000 (13:09 +0300)]
sdp: port the code to uek2

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
9 years agosdp: added debug print for the event: RDMA_CM_EVENT_ALT_PATH_LOADED
Dotan Barak [Sun, 14 Oct 2012 09:24:48 +0000 (11:24 +0200)]
sdp: added debug print for the event: RDMA_CM_EVENT_ALT_PATH_LOADED

Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
9 years agosdp: prepare support to kernel 2.6.39-200.1.1.el5uek: add macro to get sk_sleep
Dotan Barak [Tue, 3 Jul 2012 07:35:01 +0000 (10:35 +0300)]
sdp: prepare support to kernel 2.6.39-200.1.1.el5uek: add macro to get sk_sleep

This will ease up the porting to the new kernel.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
9 years agosdp: add support to kernel 2.6.39-200.1.1.el5uek
Dotan Barak [Tue, 3 Jul 2012 06:45:10 +0000 (09:45 +0300)]
sdp: add support to kernel 2.6.39-200.1.1.el5uek

Rename the MACROs inet_daddr and inet_rcv_saddr, since they exists in this
kernel.

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
9 years agosdp: add [rt]x_bytes counters to sdpstats
Amir Vadai [Tue, 3 Apr 2012 10:52:45 +0000 (13:52 +0300)]
sdp: add [rt]x_bytes counters to sdpstats

Those counter shows how many bytes actually rx/tx using SDP sockets.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
9 years agosdp: Fix Bug 114242 - Multi connection net_perf causes server to hang
Moran Perets [Mon, 26 Sep 2011 08:16:49 +0000 (11:16 +0300)]
sdp: Fix Bug 114242 - Multi connection net_perf causes server to hang

    Fix the soft lockup bug by changing the allocation flag in
    sdp_bcopy.c from 0 to gfp.

    Reviewed by: Amir Vadai

Signed-off-by: Moran Perets <moranp@mellanox.co.il>
9 years agoFMR: remove FMR failure messages
Eli Cohen [Mon, 23 May 2011 09:15:30 +0000 (12:15 +0300)]
FMR: remove FMR failure messages

remove the messages per Oracle's request. FMR is not yet supported in VMs.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
9 years agosdp: make sdp memory leak print a debug
Amir Vadai [Wed, 4 May 2011 06:30:24 +0000 (09:30 +0300)]
sdp: make sdp memory leak print a debug

Since this is probably an accounting error and not a real memory leak - should
be a debug only for now.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: changed memory accounting warning into debug
Amir Vadai [Thu, 21 Apr 2011 10:55:55 +0000 (13:55 +0300)]
sdp: changed memory accounting warning into debug

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix issues in sdpprf
Amir Vadai [Thu, 14 Apr 2011 11:27:43 +0000 (14:27 +0300)]
sdp: Fix issues in sdpprf

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Remove protection before sleep on RX
Amir Vadai [Tue, 12 Apr 2011 14:40:07 +0000 (17:40 +0300)]
sdp: Remove protection before sleep on RX

No need for this protection, it was needed because of a bug previously fixed.
Credit update could be sent even when credit reaches 2.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Enable automatic path migration support also in the passive side of the connection.
Moni Shoua [Tue, 5 Apr 2011 10:44:59 +0000 (13:44 +0300)]
sdp: Enable automatic path migration support also in the passive side of the connection.

Signed-off-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fixed some coverity issues
Amir Vadai [Tue, 5 Apr 2011 07:58:56 +0000 (10:58 +0300)]
sdp: Fixed some coverity issues

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agoFlatten the entire tree fixes
Eli Cohen [Sun, 3 Apr 2011 07:07:44 +0000 (10:07 +0300)]
Flatten the entire tree fixes

As from now we are going to avoid using patches to commit changes to the
driver. Instead, we will push directly to the source files. Backports are still
maintained but only for 2.6.18-EL5.5; backaports of 2.6.32 are completely
removed.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
9 years agosdp: Fixed compilation error on 2.6.18 RH5.5
Amir Vadai [Thu, 24 Mar 2011 08:46:06 +0000 (10:46 +0200)]
sdp: Fixed compilation error on 2.6.18 RH5.5

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix memory leak. sockets_allocated wasn't freed
Amir Vadai [Tue, 22 Mar 2011 14:20:34 +0000 (16:20 +0200)]
sdp: fix memory leak. sockets_allocated wasn't freed

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Removed spaces and tabs at end of lines
Amir Vadai [Sun, 20 Mar 2011 16:37:16 +0000 (18:37 +0200)]
sdp: Removed spaces and tabs at end of lines

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix sdpprf
Amir Vadai [Sun, 20 Mar 2011 16:32:23 +0000 (18:32 +0200)]
sdp: fix sdpprf

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fixed bcopy statistics
Amir Vadai [Sun, 20 Mar 2011 15:25:02 +0000 (17:25 +0200)]
sdp: Fixed bcopy statistics

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Bad behaviour when setting low rcvbuf size
Amir Vadai [Sun, 20 Mar 2011 13:34:33 +0000 (15:34 +0200)]
sdp: Bad behaviour when setting low rcvbuf size

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fixed a typo
Amir Vadai [Wed, 9 Mar 2011 08:35:15 +0000 (10:35 +0200)]
sdp: Fixed a typo

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Limit total memory consumed by rcvbuf
Amir Vadai [Tue, 8 Mar 2011 08:25:35 +0000 (10:25 +0200)]
sdp: Limit total memory consumed by rcvbuf

rcvbuf is already limited by the payload in the queue. But also need to limit
total memory consumption of it, since small packets received might have a very
large overhead to the payload.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix "sdpprf empty after a long run"
Amir Vadai [Tue, 8 Mar 2011 08:23:24 +0000 (10:23 +0200)]
sdp: fix "sdpprf empty after a long run"

sdpprf_log_count gets to a negative value after a long run.
This is only a quick fix - still might loose logs sometimes.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: make SDP_RX_SIZE a module parameter
Amir Vadai [Mon, 7 Mar 2011 11:11:59 +0000 (13:11 +0200)]
sdp: make SDP_RX_SIZE a module parameter

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Rollback credit limit during ZCopy transaction.
Amir Vadai [Sun, 6 Mar 2011 12:38:08 +0000 (14:38 +0200)]
sdp: Rollback credit limit during ZCopy transaction.

This limit was added at commit 2574b53 ("Abort rx SrcAvail when out of
credits")

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: get per socket memory statistics at socket's sysfs file
Amir Vadai [Sun, 6 Mar 2011 13:09:24 +0000 (15:09 +0200)]
sdp: get per socket memory statistics at socket's sysfs file

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix a hole in rx memory limit
Amir Vadai [Sun, 6 Mar 2011 12:33:00 +0000 (14:33 +0200)]
sdp: fix a hole in rx memory limit

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: make sure memory is reclaimed
Amir Vadai [Sun, 6 Mar 2011 12:31:27 +0000 (14:31 +0200)]
sdp: make sure memory is reclaimed

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: send packets without payload when credits=1
Amir Vadai [Sun, 6 Mar 2011 12:27:57 +0000 (14:27 +0200)]
sdp: send packets without payload when credits=1

This according to the SPEC, and prevent a deadlock in ZCopy. SrcAvailCancel
wasn't acked when credits got low.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: removed some prints to sdpprf
Amir Vadai [Sun, 6 Mar 2011 12:21:14 +0000 (14:21 +0200)]
sdp: removed some prints to sdpprf

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: remove unused rcvbuf_scale module parameter
Amir Vadai [Sun, 6 Mar 2011 12:19:26 +0000 (14:19 +0200)]
sdp: remove unused rcvbuf_scale module parameter

Was used when in slow start mechanism.
Not needed till having slow start again.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix memory socket accounting
Amir Vadai [Mon, 28 Feb 2011 09:57:18 +0000 (11:57 +0200)]
sdp: fix memory socket accounting

skb->truesize - total bytes allocated by skb, including fragments

Specific socket accounting:
* sk->sk_wmem_queued - send bytes currently in TX queue
* RX queue accounting is done by using seq
* sk->sk_rmem_alloc - bytes consumed by RX

Protocol accounting:
* sk->sk_forward_alloc - bytes that are available to be consumed
* prot->memory_allocated - bytes consumed by TX/RX

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix sdp_sendmsg counters in sdpstats
Amir Vadai [Mon, 28 Feb 2011 09:33:58 +0000 (11:33 +0200)]
sdp: fix sdp_sendmsg counters in sdpstats

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: make retry count a module parameter
Amir Vadai [Sun, 13 Feb 2011 10:08:24 +0000 (12:08 +0200)]
sdp: make retry count a module parameter

Setting a lower value means faster path migration in APM

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: BUG2217 - fix sdpstats negative values
Amir Vadai [Wed, 9 Feb 2011 11:06:23 +0000 (13:06 +0200)]
sdp: BUG2217 - fix sdpstats negative values

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: do not abort connection on RDMA_CM_EVENT_ADDR_CHANGE
Amir Vadai [Sun, 30 Jan 2011 17:01:15 +0000 (19:01 +0200)]
sdp: do not abort connection on RDMA_CM_EVENT_ADDR_CHANGE

This could happen when having a bonding device.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agordma_cm, sdp: bug fixes and some changes to APM logic
Amir Vadai [Thu, 27 Jan 2011 08:42:56 +0000 (10:42 +0200)]
rdma_cm, sdp: bug fixes and some changes to APM logic

- We no longer rely on the private data buffer of the LAP/APR messages for passive side LID improvement.
    Instead, we use the protocol defined LID improvement APR error code.
    - Two paths are allocated on id creation to simplify code.
    - Various small bug fixes.
    - Added a missing ref_count get
    - Some code cleanup.
    - Important: rdma_enable_apm may be called only upon receiving RDMA_CM_ROUTE_RESOLVED event.
      This was done to break symmetry on failover and possibly on other occasions.

Signed-off-by: Nir Muchtar <nirm@voltaire.com>
Signed-off-by: Moni Shoua <monis@voltaire.com>
Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: removed debug print
Amir Vadai [Tue, 25 Jan 2011 08:44:15 +0000 (10:44 +0200)]
sdp: removed debug print

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: use APM support in rdma_cm
Amir Vadai [Sun, 23 Jan 2011 09:26:40 +0000 (11:26 +0200)]
sdp: use APM support in rdma_cm

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: do not reenter sdp_abort_rx_srcavail
Amir Vadai [Tue, 18 Jan 2011 17:03:32 +0000 (19:03 +0200)]
sdp: do not reenter sdp_abort_rx_srcavail

SrcAvailCancel could be handled from within sdp_abort_rx_srcavail. This
shouldn't happen. To prevent it, ssk->rx_sa is set to NULL at the begining.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Abort rx SrcAvail when out of credits
Amir Vadai [Sun, 16 Jan 2011 16:32:38 +0000 (18:32 +0200)]
sdp: Abort rx SrcAvail when out of credits

SrcAvail sink side could run out of credits when having bcopy sends to the
other direction. Because of that no RdmaRdCompl could be sent nor SendSM.  This
could hang the sender side forever (No SendSM on SrcAvailCancel).

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fixed BUG2207 - EINVAL when connect after IPv6 bind
Amir Vadai [Tue, 11 Jan 2011 13:16:51 +0000 (15:16 +0200)]
sdp: Fixed BUG2207 - EINVAL when connect after IPv6 bind

Connect to IPv4 over IPv6 address need rdma id to be created with IPv4 address.
If bound before with IPv6 adderss, need to destroy and recreate the id.
Also, when connecting after bind, keep the same source port number.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: check address family before connecting
Amir Vadai [Thu, 6 Jan 2011 13:49:55 +0000 (15:49 +0200)]
sdp: check address family before connecting

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Do not ignore scope_id in IPv6
Amir Vadai [Thu, 6 Jan 2011 12:38:34 +0000 (14:38 +0200)]
sdp: Do not ignore scope_id in IPv6

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: make backport sk_inet()->xxx simpler
Amir Vadai [Wed, 5 Jan 2011 11:26:32 +0000 (13:26 +0200)]
sdp: make backport sk_inet()->xxx simpler

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix get getsockname/getpeername in IPv6
Amir Vadai [Wed, 5 Jan 2011 09:33:21 +0000 (11:33 +0200)]
sdp: Fix get getsockname/getpeername in IPv6

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Allow bind to address with family AF_INETx_SDP
Amir Vadai [Sun, 2 Jan 2011 11:31:12 +0000 (13:31 +0200)]
sdp: Allow bind to address with family AF_INETx_SDP

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Use %pI4 + %pI6 in new kernels
Amir Vadai [Thu, 30 Dec 2010 12:38:48 +0000 (14:38 +0200)]
sdp: Use %pI4 + %pI6 in new kernels

A patch in this subject was in the wrong backport. Moving it to a dedicated patch.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: fix connect to IPv4 over IPv6
Amir Vadai [Wed, 29 Dec 2010 15:23:07 +0000 (17:23 +0200)]
sdp: fix connect to IPv4 over IPv6

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix some issues in ipv6 support
Amir Vadai [Wed, 29 Dec 2010 10:40:52 +0000 (12:40 +0200)]
sdp: Fix some issues in ipv6 support

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: ipv6 support
Amir Vadai [Mon, 27 Dec 2010 09:58:26 +0000 (11:58 +0200)]
sdp: ipv6 support

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: move histogram allocation from stack to heap
Amir Vadai [Tue, 21 Dec 2010 11:38:37 +0000 (13:38 +0200)]
sdp: move histogram allocation from stack to heap

- Cause a kernel crash when accessing /proc/net/sdpstats on RH6

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: print error value when ib_umem_get fails
Amir Vadai [Tue, 21 Dec 2010 12:27:06 +0000 (14:27 +0200)]
sdp: print error value when ib_umem_get fails

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: remove 'reading beyond SKB' warning
Amir Vadai [Tue, 14 Dec 2010 12:41:12 +0000 (14:41 +0200)]
sdp: remove 'reading beyond SKB' warning

This is a good sanity check, but could print a warning when a
partially used SrcAvail skb is cancelled.
This should be fixed in a way that will leave the sanity check,
but need to make minimal changes before the GA.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: RdmaRdCompl not sent sometimes
Amir Vadai [Tue, 14 Dec 2010 06:48:42 +0000 (08:48 +0200)]
sdp: RdmaRdCompl not sent sometimes

When SrcAvailCancel is handled after RDMA finshed and before sending
RdmaRdCompl, RdmaRdCompl won't be sent, and a data corruption will occur.
Made sure that all sdp_abort_rx_srcavail will send RdmaRdCompl if needed.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: make sdp_prf index atomic
Amir Vadai [Tue, 14 Dec 2010 07:55:54 +0000 (09:55 +0200)]
sdp: make sdp_prf index atomic

Will make sdpprf more reliable - records won't override other records.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: handle failed RDMA read
Amir Vadai [Tue, 7 Dec 2010 07:32:50 +0000 (09:32 +0200)]
sdp: handle failed RDMA read

When RDMA read is failed, do not report those bytes as read, and
return error code to user.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Fix compilation error when SDP_DEBUG_DATA is off
Amir Vadai [Tue, 30 Nov 2010 06:48:33 +0000 (08:48 +0200)]
sdp: Fix compilation error when SDP_DEBUG_DATA is off

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Enable set zcopy threshold to 0 using setsockopt
Amir Vadai [Wed, 17 Nov 2010 09:03:03 +0000 (11:03 +0200)]
sdp: Enable set zcopy threshold to 0 using setsockopt

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: BUG2161 - hanging sockets are left
Amir Vadai [Tue, 16 Nov 2010 11:32:14 +0000 (13:32 +0200)]
sdp: BUG2161 - hanging sockets are left

When getting DREQ at TCP_CLOSE_WAIT state, CMA ref count is taken
and not returned. This happens because CMA timer is not started.

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Take into account HW inline capabilities
Amir Vadai [Sun, 14 Nov 2010 12:57:15 +0000 (14:57 +0200)]
sdp: Take into account HW inline capabilities

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Send small sends using inline
Amir Vadai [Mon, 8 Nov 2010 11:49:12 +0000 (13:49 +0200)]
sdp: Send small sends using inline

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: access socket history from debugfs
Amir Vadai [Wed, 3 Nov 2010 13:47:01 +0000 (15:47 +0200)]
sdp: access socket history from debugfs

Also moved sdpprf to /sys/kernel/debug/sdp - seems to be a better place
than /proc/net

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: use a macro to convert ssk into sk
Amir Vadai [Tue, 2 Nov 2010 10:43:21 +0000 (12:43 +0200)]
sdp: use a macro to convert ssk into sk

Instead of accessing &ssk->isk.sk cast the sdp socket into
sock. Do it from a macro sk_ssk(ssk)

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
9 years agosdp: Initialize remote credits when sending Hello
Amir Vadai [Wed, 27 Oct 2010 13:56:23 +0000 (15:56 +0200)]
sdp: Initialize remote credits when sending Hello

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>