Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* Respected Sir/Madam
From: مايكروسوفت @ 2016-11-06 19:14 UTC (permalink / raw)
  To: INF-5s8wZthzITI

وقد ظهرت مايكروسوفت آسيا بك البريد الإلكتروني معرف الفائز من $ 900،000،00 دولار أمريكي ارسال
اسم:
رقم الهاتف المحمول:
الاحتلال :
عنوان:
الرد على هذا رقم البريد الإلكتروني: mox151@outlook.com

^ permalink raw reply

* Respected Sir/Madam
From: مايكروسوفت @ 2016-11-06 19:06 UTC (permalink / raw)
  To: INF-5s8wZthzITI

وقد ظهرت مايكروسوفت آسيا بك البريد الإلكتروني معرف الفائز من $ 900،000،00 دولار أمريكي ارسال
اسم:
رقم الهاتف المحمول:
الاحتلال :
عنوان:
الرد على هذا رقم البريد الإلكتروني: mox151@outlook.com

^ permalink raw reply

* Re: [PATCH rdma-rc 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing
From: jackm @ 2016-11-06 18:41 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Daniel Jurgens,
	Leon Romanovsky, eitan-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <d339ee5f-bf7e-dc35-3dd0-c6ff13a222b4-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On Sat, 5 Nov 2016 17:03:25 -0400
Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:

> Isn't the SA well-known GID the concatenation of the subnet prefix
> (which isn't necessarily the default link local one) and the GUID
> 0x0200000000000002 ?

You are correct regarding the subnet prefix (it should be the port's
current subnet prefix, and not the default subnet prefix).

Regarding the SM GUID, the version of the Virtualization Annex that I
worked with (v17 -- Feb 16, 2015) states:
SM GID	A well-known GID that is associated with the SM,
comprising the concatenation of the Subnet prefix and the GUID 0x2. The
SM GID is never present in any GID Table.

Has the SM GUID value changed (0x2 -->0x0200000000000002) in the Annex
since v17? (I'm not a member of the MGTWG workgroup, so I don't have
access to the most recent version).

-Jack 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: Crash in mlx4 shutdown with 4.9-rc3
From: Tariq Toukan @ 2016-11-06 16:12 UTC (permalink / raw)
  To: Leon Romanovsky, Steve Wise
  Cc: yishaih-VPRAkNaXOzVWk0Htik3J/w, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	Majd Dibbiny, Tariq Toukan
In-Reply-To: <20161105131513.GP3617-2ukJVAZIZ/Y@public.gmane.org>

Hi Steve,

On 05/11/2016 3:15 PM, Leon Romanovsky wrote:
> On Fri, Nov 04, 2016 at 09:29:47AM -0500, Steve Wise wrote:
>> Hey Yishai,  Is this by chance a known bug having a pending fix somewhere?  I'm
>> seeing it frequently when shutting down.  I'm using 4.9-rc3 with memory
>> debugging enabled...
> Hi Steve,
>
> We have a fix for this oops in our submission queue to netdev and
> it is now in final stages of verification. Tariq is planning to submit
> it on Sunday.
>
> Thanks
This crash happens because the lifetime of mlx4_en_priv->mdev is shorter 
than that of struct net_device.
One WA is to add a check of netif_device_present in dev_get_phys_port_id.

Something like this:

--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -6601,6 +6601,8 @@ int dev_get_phys_port_id(struct net_device *dev,

         if (!ops->ndo_get_phys_port_id)
                 return -EOPNOTSUPP;
+       if (!netif_device_present(dev))
+               return -ENODEV;
         return ops->ndo_get_phys_port_id(dev, ppid);
  }
  EXPORT_SYMBOL(dev_get_phys_port_id);

However, this causes other issues when combining with MTU change.
In MTU change, netif_device_present returns false for a while, causing 
an unexpected failure of dev_get_phys_port_id.

We're working on fixing this correctly, but that won't happen today.

Regards,
Tariq Toukan
>> [59984.502834] mlx4_core 0000:81:00.0: mlx4_shutdown was called
>> [59984.603599] mlx4_en 0000:81:00.0: removed PHC
>> [59985.145590] general protection fault: 0000 [#1] SMP DEBUG_PAGEALLOC
>> [59985.151990] Modules linked in: uio_pci_generic uio iw_cxgb4 cxgb4 nvmet_rdma
>> nvmet null_blk brd rpcrdma ib_isert iscsi_target_mod ib_iser libiscsi
>> scsi_transport_iscsi ib_srpt target_core_mod ib_srp scsi_transport_srp ib_ipoib
>> rdma_ucm ib_ucm ib_uverbs ib_umad rdma_cm ib_cm iw_cm dm_mirror dm_region_hash
>> dm_log dm_mod intel_rapl iosf_mbi sb_edac edac_core x86_pkg_temp_thermal
>> coretemp ext4 kvm jbd2 irqbypass crct10dif_pclmul crc32_pclmul
>> ghash_clmulni_intel mbcache aesni_intel lrw gf128mul iTCO_wdt glue_helper mei_me
>> iTCO_vendor_support ablk_helper cryptd mxm_wmi ipmi_si i2c_i801 lpc_ich mei sg
>> nfsd mfd_core i2c_smbus ipmi_msghandler pcspkr shpchp auth_rpcgss wmi nfs_acl
>> lockd grace sunrpc ip_tables xfs libcrc32c libcxgb mlx4_ib ib_core mlx4_en
>> sd_mod drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops ttm
>> mlx4_core igb drm ahci libahci ptp libata crc32c_intel pps_core dca nvme
>> i2c_algo_bit nvme_core i2c_core [last unloaded: cxgb4]
>> [59985.239258] CPU: 30 PID: 10937 Comm: kworker/30:1 Not tainted
>> 4.9.0-rc3-debug+ #2
>> [59985.246992] Hardware name: Supermicro X9DR3-F/X9DR3-F, BIOS 3.2a 07/09/2015
>> [59985.254098] Workqueue: events linkwatch_event
>> [59985.258600] task: ffff88105312c6c0 task.stack: ffffc90020204000
>> [59985.264657] RIP: 0010:[<ffffffffa05ae1ba>]  [<ffffffffa05ae1ba>]
>> mlx4_en_get_phys_port_id+0x1a/0x50 [mlx4_en]
>> [59985.274874] RSP: 0018:ffffc90020207c30  EFLAGS: 00010286
>> [59985.280312] RAX: 6b6b6b6b6b6b6b6b RBX: ffff881048c220c0 RCX: 0000000000000000
>> [59985.287582] RDX: 0000000000000001 RSI: ffffc90020207cb0 RDI: ffff881037020000
>> [59985.294844] RBP: ffffc90020207c30 R08: 00000000000005f0 R09: ffff88102017e752
>> [59985.302100] R10: ffff88085f4090c0 R11: ffff88102017e678 R12: ffff881037020000
>> [59985.309356] R13: ffff88102017e678 R14: 0000000000000000 R15: 0000000000000000
>> [59985.316608] FS:  0000000000000000(0000) GS:ffff881057580000(0000)
>> knlGS:0000000000000000
>> [59985.324936] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>> [59985.330805] CR2: 00007fff8fd82ff8 CR3: 0000000001c07000 CR4: 00000000000406e0
>> [59985.338072] Stack:
>> [59985.340219]  ffffc90020207c40 ffffffff81587a6e ffffc90020207d00
>> ffffffff815a36ce
>> [59985.347950]  ffff881048c220c0 ffffc90020207cd7 0000000000000000
>> 0000000000000010
>> [59985.355684]  02000000ffffffff 000003e820000000 00000000000005dc
>> 0000010000000000
>> [59985.363408] Call Trace:
>> [59985.365994]  [<ffffffff81587a6e>] dev_get_phys_port_id+0x1e/0x30
>> [59985.372123]  [<ffffffff815a36ce>] rtnl_fill_ifinfo+0x4be/0xff0
>> [59985.378076]  [<ffffffff815a53f3>] rtmsg_ifinfo_build_skb+0x73/0xe0
>> [59985.384377]  [<ffffffff815a5476>] rtmsg_ifinfo.part.27+0x16/0x50
>> [59985.390505]  [<ffffffff815a54c8>] rtmsg_ifinfo+0x18/0x20
>> [59985.395940]  [<ffffffff8158a6c6>] netdev_state_change+0x46/0x50
>> [59985.401983]  [<ffffffff815a5e78>] linkwatch_do_dev+0x38/0x50
>> [59985.407764]  [<ffffffff815a6165>] __linkwatch_run_queue+0xf5/0x170
>> [59985.414067]  [<ffffffff815a6205>] linkwatch_event+0x25/0x30
>> [59985.419764]  [<ffffffff81099a82>] process_one_work+0x152/0x400
>> [59985.425716]  [<ffffffff8109a325>] worker_thread+0x125/0x4b0
>> [59985.431409]  [<ffffffff8109a200>] ? rescuer_thread+0x350/0x350
>> [59985.437366]  [<ffffffff8109fc6a>] kthread+0xca/0xe0
>> [59985.442367]  [<ffffffff8109fba0>] ? kthread_park+0x60/0x60
>> [59985.447978]  [<ffffffff816a1285>] ret_from_fork+0x25/0x30
>> [59985.453497] Code: f0 5d c3 66 66 66 66 66 2e 0f 1f 84 00 00 00 00 00 66 66 66
>> 66 90 55 48 8b 87 c0 08 00 00 48 63 97 9c d5 00 00 48 89 e5 48 8b 00 <48> 8b 94
>> d0 58 02 00 00 48 85 d2 74 1c c6 46 20 08 31 c0 88 54
>> [59985.474081] RIP  [<ffffffffa05ae1ba>] mlx4_en_get_phys_port_id+0x1a/0x50
>> [mlx4_en]
>> [59985.481915]  RSP <ffffc90020207c30>
>> [59985.485910] ---[ end trace 317937c8890959b8 ]---
>> [59990.228721] Kernel panic - not syncing: Fatal exception
>> [59990.234181] Kernel Offset: disabled
>> [59990.239944] ---[ end Kernel panic - not syncing: Fatal exception
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH rdma-core 5/5] ibverbs: Update ibv_create_flow man page
From: Yishai Hadas @ 2016-11-06 14:42 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w,
	maorg-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <1478443369-8208-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

1) Add ibv_flow_spec_type enumeration description.
2) Introduce IBV_FLOW_ATTR_SNIFFER flow type.
3) Update NOTES with some clarifications.

Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 libibverbs/man/ibv_create_flow.3 | 41 ++++++++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/libibverbs/man/ibv_create_flow.3 b/libibverbs/man/ibv_create_flow.3
index df6ddd3..9e0377f 100644
--- a/libibverbs/man/ibv_create_flow.3
+++ b/libibverbs/man/ibv_create_flow.3
@@ -42,6 +42,7 @@ enum ibv_flow_attr_type {
 IBV_FLOW_ATTR_NORMAL		= 0x0,		/* Steering according to rule specifications */
 IBV_FLOW_ATTR_ALL_DEFAULT	= 0x1,		/* Default unicast and multicast rule - receive all Eth traffic which isn't steered to any QP */
 IBV_FLOW_ATTR_MC_DEFAULT 	= 0x2,		/* Default multicast rule - receive all Eth multicast traffic which isn't steered to any QP */
+IBV_FLOW_ATTR_SNIFFER		= 0x3,		/* Sniffer rule - receive all port traffic */
 .in -8
 };
 .sp
@@ -53,6 +54,31 @@ IBV_FLOW_ATTR_FLAGS_DONT_TRAP       = 1 << 1,	/* Rule doesn't trap received pack
 .in -8
 };
 .fi
+.nf
+.br
+
+enum ibv_flow_spec_type {
+.in +8
+IBV_FLOW_SPEC_ETH                       = 0x20,   /* Flow specification of L2 header */
+IBV_FLOW_SPEC_IPV4                      = 0x30,   /* Flow specification of IPv4 header */
+IBV_FLOW_SPEC_IPV6                      = 0x31,   /* Flow specification of IPv6 header */
+IBV_FLOW_SPEC_IPV4_EXT                  = 0x32,   /* Extended flow specification of IPv4 */
+IBV_FLOW_SPEC_TCP                       = 0x40,   /* Flow specification of TCP header */
+IBV_FLOW_SPEC_UDP                       = 0x41,   /* Flow specification of UDP header */
+.in -8
+};
+.br
+
+Flow specification general structure:
+.BR
+struct ibv_flow_spec_xxx {
+.in +8
+enum ibv_flow_spec_type  type;
+uint16_t  size;                  /* Flow specification size = sizeof(struct ibv_flow_spec_xxx) */
+struct ibv_flow_xxx_filter val;
+struct ibv_flow_xxx_filter mask; /* Defines which bits from the filter value are applicable when looking for a match in the incoming packet */
+.in -8
+};
 .PP
 Each spec struct holds the relevant network layer parameters for matching. To enforce the match, the user sets a mask for each parameter.
 .br
@@ -96,12 +122,21 @@ Device managed flow steering isn't currently supported
 .SS EPERM
 No permissions to add the flow steering rule
 .SH "NOTES"
-These verbs are available only for devices supporting
+1. These verbs are available only for devices supporting
 .br
-IBV_DEVICE_MANAGED_FLOW_STEERING and only for QPs of Transport Service Type
+   IBV_DEVICE_MANAGED_FLOW_STEERING and only for QPs of Transport Service Type
 .BR IBV_QPT_UD
 or
 .BR IBV_QPT_RAW_PACKET
+.br
+2. User must memset the spec struct with zeros before using it.
+.br
+3. ether_type field in ibv_flow_eth_filter is the ethertype following the last VLAN tag of the packet.
+.br
+4. Only rule type IBV_FLOW_ATTR_NORMAL supports IBV_FLOW_ATTR_FLAGS_DONT_TRAP flag.
+.br
+5. No specifications are needed for IBV_FLOW_ATTR_SNIFFER rule type.
+.br
 .PP
 .SH EXAMPLE
 .br
@@ -172,3 +207,5 @@ Hadar Hen Zion <hadarh-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
 Matan Barak <matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
 .TP
 Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
+.TP
+Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 4/5] ibverbs: Introduce sniffer flow steering rule type
From: Yishai Hadas @ 2016-11-06 14:42 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w,
	maorg-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <1478443369-8208-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Add support to receive all port traffic - both RX and TX.
In order to use sniffer, user should use IBV_FLOW_ATTR_SNIFFER
rule type.
No specifications are needed.

Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 libibverbs/verbs.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index de06edd..29f287b 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1172,6 +1172,8 @@ enum ibv_flow_attr_type {
 	 * receive all Eth multicast traffic which isn't steered to any QP
 	 */
 	IBV_FLOW_ATTR_MC_DEFAULT	= 0x2,
+	/* sniffer rule - receive all port traffic */
+	IBV_FLOW_ATTR_SNIFFER		= 0x3,
 };
 
 enum ibv_flow_spec_type {
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 3/5] ibverbs: Introduce IPv6 flow specification
From: Yishai Hadas @ 2016-11-06 14:42 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w,
	maorg-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <1478443369-8208-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Add IPv6 flow specification in order to support steering rules
of IPv6.

This flow specification includes:
1. Source and Destination address
2. Traffic Class
3. Next Header
4. Hop Limit
5. Flow Label

Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 libibverbs/cmd.c      | 21 +++++++++++++++++++++
 libibverbs/kern-abi.h | 20 +++++++++++++++++++-
 libibverbs/verbs.h    | 18 ++++++++++++++++++
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index c960f16..3806189 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -1615,6 +1615,14 @@ static int get_filters_size(struct ibv_flow_spec *ib_spec,
 		ib_spec_filter_mask = (void *)&ib_spec->ipv4_ext.val +
 			*ib_filter_size;
 		break;
+	case IBV_FLOW_SPEC_IPV6:
+		min_filter_size =
+			offsetof(struct ibv_kern_ipv6_filter, hop_limit) +
+			sizeof(kern_spec->ipv6.mask.hop_limit);
+		curr_kern_filter_size = min_filter_size;
+		ib_spec_filter_mask = (void *)&ib_spec->ipv6.val +
+			*ib_filter_size;
+		break;
 	default:
 		return EINVAL;
 	}
@@ -1671,6 +1679,19 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
 		memcpy(&kern_spec->ipv4_ext.mask, (void *)&ib_spec->ipv4_ext.val
 		       + ib_filter_size, kern_filter_size);
 		break;
+	case IBV_FLOW_SPEC_IPV6:
+		ret = get_filters_size(ib_spec, kern_spec,
+				       &ib_filter_size, &kern_filter_size,
+				       IBV_FLOW_SPEC_IPV6);
+		if (ret)
+			return ret;
+
+		kern_spec->ipv6.size = sizeof(struct ibv_kern_spec_ipv6);
+		memcpy(&kern_spec->ipv6.val, &ib_spec->ipv6.val,
+		       kern_filter_size);
+		memcpy(&kern_spec->ipv6.mask, (void *)&ib_spec->ipv6.val
+		       + ib_filter_size, kern_filter_size);
+		break;
 	case IBV_FLOW_SPEC_TCP:
 	case IBV_FLOW_SPEC_UDP:
 		kern_spec->tcp_udp.size = sizeof(struct ibv_kern_spec_tcp_udp);
diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h
index 3869e64..bb57495 100644
--- a/libibverbs/kern-abi.h
+++ b/libibverbs/kern-abi.h
@@ -869,6 +869,24 @@ struct ibv_kern_spec_ipv4_ext {
 	struct ibv_kern_ipv4_ext_filter mask;
 };
 
+struct ibv_kern_ipv6_filter {
+	__u8  src_ip[16];
+	__u8  dst_ip[16];
+	__u32 flow_label;
+	__u8  next_hdr;
+	__u8  traffic_class;
+	__u8  hop_limit;
+	__u8  reserved;
+};
+
+struct ibv_kern_spec_ipv6 {
+	__u32  type;
+	__u16  size;
+	__u16 reserved;
+	struct ibv_kern_ipv6_filter val;
+	struct ibv_kern_ipv6_filter mask;
+};
+
 struct ibv_kern_tcp_udp_filter {
 	__u16 dst_port;
 	__u16 src_port;
@@ -894,8 +912,8 @@ struct ibv_kern_spec {
 		struct ibv_kern_spec_ipv4 ipv4;
 		struct ibv_kern_spec_ipv4_ext ipv4_ext;
 		struct ibv_kern_spec_tcp_udp tcp_udp;
+		struct ibv_kern_spec_ipv6 ipv6;
 	};
-
 };
 
 struct ibv_kern_flow_attr {
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index a4e120b..de06edd 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1177,6 +1177,7 @@ enum ibv_flow_attr_type {
 enum ibv_flow_spec_type {
 	IBV_FLOW_SPEC_ETH	= 0x20,
 	IBV_FLOW_SPEC_IPV4	= 0x30,
+	IBV_FLOW_SPEC_IPV6	= 0x31,
 	IBV_FLOW_SPEC_IPV4_EXT	= 0x32,
 	IBV_FLOW_SPEC_TCP	= 0x40,
 	IBV_FLOW_SPEC_UDP	= 0x41,
@@ -1227,6 +1228,22 @@ struct ibv_flow_spec_ipv4_ext {
 	struct ibv_flow_ipv4_ext_filter mask;
 };
 
+struct ibv_flow_ipv6_filter {
+	uint8_t  src_ip[16];
+	uint8_t  dst_ip[16];
+	uint32_t flow_label;
+	uint8_t  next_hdr;
+	uint8_t  traffic_class;
+	uint8_t  hop_limit;
+};
+
+struct ibv_flow_spec_ipv6 {
+	enum ibv_flow_spec_type  type;
+	uint16_t  size;
+	struct ibv_flow_ipv6_filter val;
+	struct ibv_flow_ipv6_filter mask;
+};
+
 struct ibv_flow_tcp_udp_filter {
 	uint16_t dst_port;
 	uint16_t src_port;
@@ -1249,6 +1266,7 @@ struct ibv_flow_spec {
 		struct ibv_flow_spec_ipv4 ipv4;
 		struct ibv_flow_spec_tcp_udp tcp_udp;
 		struct ibv_flow_spec_ipv4_ext ipv4_ext;
+		struct ibv_flow_spec_ipv6 ipv6;
 	};
 };
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 2/5] ibverbs: Introduce IBV_FLOW_SPEC_IPV4_EXT flow specification
From: Yishai Hadas @ 2016-11-06 14:42 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w,
	maorg-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <1478443369-8208-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Introduce a new extended specification named IBV_FLOW_SPEC_IPV4_EXT
which extends the IBV_FLOW_SPEC_IPV4 specification with the following fields:
1. Type of Service
2. Time to Live
3. Flags
4. Protocol

The IBV_FLOW_SPEC_IPV4 specification itself can't be extended since
current code doesn't take into account the size of the specification
which the user provided, it uses internally the basic structure size
and as such is not extendable.

Changing the library code for IBV_FLOW_SPEC_IPV4 to use the input size
and add the above fields to this specification might cause few issues:

1) An application that would like to use the new fields and as such will be
   compiled over the new library but run over a legacy library will have no
   hint that the new fields were really ignored as of the usage of the fixed
   size inside the legacy library.

2) Existing applications which ignored this input size field will
   start to fail as of the new size checking in the library for this
   specification.

To prevent the above issues this patch introduces an extended new
IPV4 specification having the above new fields.

Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 libibverbs/cmd.c      | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++-
 libibverbs/kern-abi.h | 18 +++++++++++++++
 libibverbs/verbs.h    | 18 +++++++++++++++
 3 files changed, 98 insertions(+), 1 deletion(-)

diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index 496d27b..c960f16 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -42,7 +42,7 @@
 #include <string.h>
 
 #include "ibverbs.h"
-
+#include <ccan/minmax.h>
 
 int ibv_cmd_get_context(struct ibv_context *context, struct ibv_get_context *cmd,
 			size_t cmd_size, struct ibv_get_context_resp *resp,
@@ -1590,9 +1590,55 @@ int ibv_cmd_detach_mcast(struct ibv_qp *qp, const union ibv_gid *gid, uint16_t l
 	return 0;
 }
 
+static int buffer_is_zero(char *addr, ssize_t size)
+{
+	return addr[0] == 0 && !memcmp(addr, addr + 1, size - 1);
+}
+
+static int get_filters_size(struct ibv_flow_spec *ib_spec,
+			    struct ibv_kern_spec *kern_spec,
+			    int *ib_filter_size, int *kern_filter_size,
+			    enum ibv_flow_spec_type type)
+{
+	void *ib_spec_filter_mask;
+	int curr_kern_filter_size;
+	int min_filter_size;
+
+	*ib_filter_size = (ib_spec->hdr.size - sizeof(ib_spec->hdr)) / 2;
+
+	switch (type) {
+	case IBV_FLOW_SPEC_IPV4_EXT:
+		min_filter_size =
+			offsetof(struct ibv_kern_ipv4_ext_filter, flags) +
+			sizeof(kern_spec->ipv4_ext.mask.flags);
+		curr_kern_filter_size = min_filter_size;
+		ib_spec_filter_mask = (void *)&ib_spec->ipv4_ext.val +
+			*ib_filter_size;
+		break;
+	default:
+		return EINVAL;
+	}
+
+	if (*ib_filter_size < min_filter_size)
+		return EINVAL;
+
+	if (*ib_filter_size > curr_kern_filter_size &&
+	    !buffer_is_zero(ib_spec_filter_mask + curr_kern_filter_size,
+			    *ib_filter_size - curr_kern_filter_size))
+		return EOPNOTSUPP;
+
+	*kern_filter_size = min_t(int, curr_kern_filter_size, *ib_filter_size);
+
+	return 0;
+}
+
 static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
 				struct ibv_kern_spec *kern_spec)
 {
+	int kern_filter_size;
+	int ib_filter_size;
+	int ret;
+
 	kern_spec->hdr.type = ib_spec->hdr.type;
 
 	switch (ib_spec->hdr.type) {
@@ -1610,6 +1656,21 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
 		memcpy(&kern_spec->ipv4.mask, &ib_spec->ipv4.mask,
 		       sizeof(struct ibv_flow_ipv4_filter));
 		break;
+	case IBV_FLOW_SPEC_IPV4_EXT:
+		ret = get_filters_size(ib_spec, kern_spec,
+				       &ib_filter_size, &kern_filter_size,
+				       IBV_FLOW_SPEC_IPV4_EXT);
+		if (ret)
+			return ret;
+
+		kern_spec->hdr.type = IBV_FLOW_SPEC_IPV4;
+		kern_spec->ipv4_ext.size = sizeof(struct
+						  ibv_kern_spec_ipv4_ext);
+		memcpy(&kern_spec->ipv4_ext.val, &ib_spec->ipv4_ext.val,
+		       kern_filter_size);
+		memcpy(&kern_spec->ipv4_ext.mask, (void *)&ib_spec->ipv4_ext.val
+		       + ib_filter_size, kern_filter_size);
+		break;
 	case IBV_FLOW_SPEC_TCP:
 	case IBV_FLOW_SPEC_UDP:
 		kern_spec->tcp_udp.size = sizeof(struct ibv_kern_spec_tcp_udp);
diff --git a/libibverbs/kern-abi.h b/libibverbs/kern-abi.h
index 381fd50..3869e64 100644
--- a/libibverbs/kern-abi.h
+++ b/libibverbs/kern-abi.h
@@ -852,6 +852,23 @@ struct ibv_kern_spec_ipv4 {
 	struct ibv_kern_ipv4_filter mask;
 };
 
+struct ibv_kern_ipv4_ext_filter {
+	__u32 src_ip;
+	__u32 dst_ip;
+	__u8  proto;
+	__u8  tos;
+	__u8  ttl;
+	__u8  flags;
+};
+
+struct ibv_kern_spec_ipv4_ext {
+	__u32  type;
+	__u16  size;
+	__u16 reserved;
+	struct ibv_kern_ipv4_ext_filter val;
+	struct ibv_kern_ipv4_ext_filter mask;
+};
+
 struct ibv_kern_tcp_udp_filter {
 	__u16 dst_port;
 	__u16 src_port;
@@ -875,6 +892,7 @@ struct ibv_kern_spec {
 		} hdr;
 		struct ibv_kern_spec_eth eth;
 		struct ibv_kern_spec_ipv4 ipv4;
+		struct ibv_kern_spec_ipv4_ext ipv4_ext;
 		struct ibv_kern_spec_tcp_udp tcp_udp;
 	};
 
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index 67a44a7..a4e120b 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1177,6 +1177,7 @@ enum ibv_flow_attr_type {
 enum ibv_flow_spec_type {
 	IBV_FLOW_SPEC_ETH	= 0x20,
 	IBV_FLOW_SPEC_IPV4	= 0x30,
+	IBV_FLOW_SPEC_IPV4_EXT	= 0x32,
 	IBV_FLOW_SPEC_TCP	= 0x40,
 	IBV_FLOW_SPEC_UDP	= 0x41,
 };
@@ -1210,6 +1211,22 @@ struct ibv_flow_spec_ipv4 {
 	struct ibv_flow_ipv4_filter mask;
 };
 
+struct ibv_flow_ipv4_ext_filter {
+	uint32_t src_ip;
+	uint32_t dst_ip;
+	uint8_t  proto;
+	uint8_t  tos;
+	uint8_t  ttl;
+	uint8_t  flags;
+};
+
+struct ibv_flow_spec_ipv4_ext {
+	enum ibv_flow_spec_type  type;
+	uint16_t  size;
+	struct ibv_flow_ipv4_ext_filter val;
+	struct ibv_flow_ipv4_ext_filter mask;
+};
+
 struct ibv_flow_tcp_udp_filter {
 	uint16_t dst_port;
 	uint16_t src_port;
@@ -1231,6 +1248,7 @@ struct ibv_flow_spec {
 		struct ibv_flow_spec_eth eth;
 		struct ibv_flow_spec_ipv4 ipv4;
 		struct ibv_flow_spec_tcp_udp tcp_udp;
+		struct ibv_flow_spec_ipv4_ext ipv4_ext;
 	};
 };
 
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 1/5] ibverbs: Align ibv_create_flow with man page
From: Yishai Hadas @ 2016-11-06 14:42 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w,
	maorg-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <1478443369-8208-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Based on man page:
".. or NULL if the request fails. In case of an error, errno is updated".

Align some error flows with above statement.

Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Reviewed-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 libibverbs/cmd.c   | 6 ++++--
 libibverbs/verbs.h | 4 +++-
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/libibverbs/cmd.c b/libibverbs/cmd.c
index 06a017b..496d27b 100644
--- a/libibverbs/cmd.c
+++ b/libibverbs/cmd.c
@@ -1619,7 +1619,7 @@ static int ib_spec_to_kern_spec(struct ibv_flow_spec *ib_spec,
 		       sizeof(struct ibv_flow_tcp_udp_filter));
 		break;
 	default:
-		return -EINVAL;
+		return EINVAL;
 	}
 	return 0;
 }
@@ -1656,8 +1656,10 @@ struct ibv_flow *ibv_cmd_create_flow(struct ibv_qp *qp,
 	ib_spec = flow_attr + 1;
 	for (i = 0; i < flow_attr->num_of_specs; i++) {
 		err = ib_spec_to_kern_spec(ib_spec, kern_spec);
-		if (err)
+		if (err) {
+			errno = err;
 			goto err;
+		}
 		cmd->flow_attr.size +=
 			((struct ibv_kern_spec *)kern_spec)->hdr.size;
 		kern_spec += ((struct ibv_kern_spec *)kern_spec)->hdr.size;
diff --git a/libibverbs/verbs.h b/libibverbs/verbs.h
index a2ccaaf..67a44a7 100644
--- a/libibverbs/verbs.h
+++ b/libibverbs/verbs.h
@@ -1590,8 +1590,10 @@ static inline struct ibv_flow *ibv_create_flow(struct ibv_qp *qp,
 {
 	struct verbs_context *vctx = verbs_get_ctx_op(qp->context,
 						      ibv_create_flow);
-	if (!vctx || !vctx->ibv_create_flow)
+	if (!vctx || !vctx->ibv_create_flow) {
+		errno = ENOSYS;
 		return NULL;
+	}
 
 	return vctx->ibv_create_flow(qp, flow);
 }
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-core 0/5] Flow steering enhancements
From: Yishai Hadas @ 2016-11-06 14:42 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	yishaih-VPRAkNaXOzVWk0Htik3J/w, majd-VPRAkNaXOzVWk0Htik3J/w,
	maorg-VPRAkNaXOzVWk0Htik3J/w

This patch set from Maor aligns libibverbs flow steering functionality
with the lastly accepted code in kernel 4.9.
As of that, a user space application can enjoy and activate the new
functionality.

It includes,
- Introducing IPV4 extended spec with some new fields as of protocol/tos/ttl.
- Introducing IPV6 extended flow spec.
- Introducing sniffer flow steering rule type.

The series was tested successfully with both CX3 and CX4.

Specifically,
Patch #1: Pre-patch for the series, fixes ibv_create_flow API to be aligned
          with its man page upon an error case.
Patch #2: Enables extended fields for IPV4 flow specification.
Patch #3: Introduces an IPv6 extended flow specification.
Patch #4: Introduces sniffer flow steering rule type.
patch #5  Man page update to describe the new functionality.
  
Pull request was sent:
https://github.com/linux-rdma/rdma-core/pull/34

Yishai

Maor Gottlieb (5):
  ibverbs: Align ibv_create_flow with man page
  ibverbs: Introduce IBV_FLOW_SPEC_IPV4_EXT flow specification
  ibverbs: Introduce IPv6 flow specification
  ibverbs: Introduce sniffer flow steering rule type
  ibverbs: Update ibv_create_flow man page

 libibverbs/cmd.c                 | 90 ++++++++++++++++++++++++++++++++++++++--
 libibverbs/kern-abi.h            | 38 ++++++++++++++++-
 libibverbs/man/ibv_create_flow.3 | 41 +++++++++++++++++-
 libibverbs/verbs.h               | 42 ++++++++++++++++++-
 4 files changed, 204 insertions(+), 7 deletions(-)

-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH 0/3] iopmem : A block device for PCIe memory
From: Stephen Bates @ 2016-11-06 14:05 UTC (permalink / raw)
  To: Dave Chinner
  Cc: Stephen Bates, Christoph Hellwig, Dan Williams,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-block-u79uwXL29TY76Z2rM5mHXA, Linux MM, Ross Zwisler,
	Matthew Wilcox, jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	haggaie-VPRAkNaXOzVWk0Htik3J/w, Jens Axboe, Jonathan Corbet,
	jim.macdonald-FgSLVYC75IpWk0Htik3J/w,
	sbates-Rgftl6RXld5BDgjK7y7TUQ, Logan Gunthorpe, David Woodhouse,
	Raj, Ashok
In-Reply-To: <20161025211903.GD14023@dastard>

On Tue, October 25, 2016 3:19 pm, Dave Chinner wrote:
> On Tue, Oct 25, 2016 at 05:50:43AM -0600, Stephen Bates wrote:
>>
>> Dave are you saying that even for local mappings of files on a DAX
>> capable system it is possible for the mappings to move on you unless the
>> FS supports locking?
>>
>
> Yes.
>
>
>> Does that not mean DAX on such FS is
>> inherently broken?
>
> No. DAX is accessed through a virtual mapping layer that abstracts
> the physical location from userspace applications.
>
> Example: think copy-on-write overwrites. It occurs atomically from
> the perspective of userspace and starts by invalidating any current
> mappings userspace has of that physical location. The location is changes,
> the data copied in, and then when the locks are released userspace can
> fault in a new page table mapping on the next access....

Dave

Thanks for the good input and for correcting some of my DAX
misconceptions! We will certainly be taking this into account as we
consider v1.

>
>>>> And at least for XFS we have such a mechanism :)  E.g. I have a
>>>> prototype of a pNFS layout that uses XFS+DAX to allow clients to do
>>>> RDMA directly to XFS files, with the same locking mechanism we use
>>>> for the current block and scsi layout in xfs_pnfs.c.
>>
>> Thanks for fixing this issue on XFS Christoph! I assume this problem
>> continues to exist on the other DAX capable FS?
>
> Yes, but it they implement the exportfs API that supplies this
> capability, they'll be able to use pNFS, too.
>
>> One more reason to consider a move to /dev/dax I guess ;-)...
>>
>
> That doesn't get rid of the need for sane access control arbitration
> across all machines that are directly accessing the storage. That's the
> problem pNFS solves, regardless of whether your direct access target is a
> filesystem, a block device or object storage...

Fair point. I am still hoping for a bit more discussion on the best choice
of user-space interface for this work. If/When that happens we will take
it into account when we look at spinning the patchset.


Stephen

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* rdma-core example spec file is broken
From: Alaa Hleihel @ 2016-11-06 12:01 UTC (permalink / raw)
  To: jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: leonro-VPRAkNaXOzVWk0Htik3J/w, yishaih-VPRAkNaXOzVWk0Htik3J/w

Hi Jason,

The example spec file is broken after commit ddd530be4622 ("Minor RPM spec file improvments").

rpmbuild fails with the following error:

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.7l0yoN
+ umask 022
+ cd /tmp/xxx/BUILD
+ cd rdma-core-11
/var/tmp/rpm-tmp.7l0yoN: line 31: syntax error near unexpected token `post'
error: Bad exit status from /var/tmp/rpm-tmp.7l0yoN (%build)


The issue is that the new "Requires" macros were added after the %prep and %build sections..

Regards,
Alaa

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH -next] IB/rxe: Use DEFINE_SPINLOCK() for spinlock
From: Moni Shoua @ 2016-11-06 10:05 UTC (permalink / raw)
  To: Wei Yongjun
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, Wei Yongjun, linux-rdma
In-Reply-To: <1477757973-32052-1-git-send-email-weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Sat, Oct 29, 2016 at 6:19 PM, Wei Yongjun <weiyj.lk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> From: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>
> spinlock can be initialized automatically with DEFINE_SPINLOCK()
> rather than explicitly calling spin_lock_init().
>
> Signed-off-by: Wei Yongjun <weiyongjun1-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/infiniband/sw/rxe/rxe_net.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/infiniband/sw/rxe/rxe_net.c b/drivers/infiniband/sw/rxe/rxe_net.c
> index b8258e4..4cb6378 100644
> --- a/drivers/infiniband/sw/rxe/rxe_net.c
> +++ b/drivers/infiniband/sw/rxe/rxe_net.c
> @@ -46,7 +46,7 @@
>  #include "rxe_loc.h"
>
>  static LIST_HEAD(rxe_dev_list);
> -static spinlock_t dev_list_lock; /* spinlock for device list */
> +static DEFINE_SPINLOCK(dev_list_lock); /* spinlock for device list */
>
>  struct rxe_dev *net_to_rxe(struct net_device *ndev)
>  {
> @@ -663,8 +663,6 @@ struct notifier_block rxe_net_notifier = {
>
>  int rxe_net_ipv4_init(void)
>  {
> -       spin_lock_init(&dev_list_lock);
> -
>         recv_sockets.sk4 = rxe_setup_udp_tunnel(&init_net,
>                                 htons(ROCE_V2_UDP_DPORT), false);
>         if (IS_ERR(recv_sockets.sk4)) {
> @@ -680,8 +678,6 @@ int rxe_net_ipv6_init(void)
>  {
>  #if IS_ENABLED(CONFIG_IPV6)
>
> -       spin_lock_init(&dev_list_lock);
> -
>         recv_sockets.sk6 = rxe_setup_udp_tunnel(&init_net,
>                                                 htons(ROCE_V2_UDP_DPORT), true);
>         if (IS_ERR(recv_sockets.sk6)) {
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reviewed-by: Moni Shoua <monis-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: nvmet_rdma crash - DISCONNECT event with NULL queue
From: Sagi Grimberg @ 2016-11-06  8:51 UTC (permalink / raw)
  To: Steve Wise, 'Christoph Hellwig'
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <01d601d2353d$e3d10810$ab731830$@opengridcomputing.com>

>> I'll also try and reproduce this on mlx4 to rule out
>> iwarp and cxgb4 anomolies.
>
> Running the same test over mlx4/roce, I hit a warning in list_debug, and then a
> stuck CPU...

Steve,

Does this patch help?
--
diff --git a/drivers/nvme/target/rdma.c b/drivers/nvme/target/rdma.c
index bafd9898b5f6..5946dac9564f 100644
--- a/drivers/nvme/target/rdma.c
+++ b/drivers/nvme/target/rdma.c
@@ -951,6 +951,7 @@ static int nvmet_rdma_create_queue_ib(struct 
nvmet_rdma_queue *queue)

  static void nvmet_rdma_destroy_queue_ib(struct nvmet_rdma_queue *queue)
  {
+       ib_drain_qp(queue->cm_id->qp);
         rdma_destroy_qp(queue->cm_id);
         ib_free_cq(queue->cq);
  }
@@ -1247,7 +1248,6 @@ static void __nvmet_rdma_queue_disconnect(struct 
nvmet_rdma_queue *queue)

         if (disconnect) {
                 rdma_disconnect(queue->cm_id);
-               ib_drain_qp(queue->cm_id->qp);
                 schedule_work(&queue->release_work);
         }
  }
--
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* Re: nvmet_rdma crash - DISCONNECT event with NULL queue
From: Sagi Grimberg @ 2016-11-06  7:35 UTC (permalink / raw)
  To: 'Christoph Hellwig', Steve Wise
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-nvme-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
In-Reply-To: <20161102151540.GB14825-jcswGhMUV9g@public.gmane.org>


> Btw, I want to actually make the ctrlid global for the target instead of
> per-subsystem to ease a few things, and debuggability is just one more
> on the list.

Sounds good
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-rc 6/9] IB/mlx4: Put non zero value in max_ah device attribute
From: Yuval Shaia @ 2016-11-06  7:33 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Maor Gottlieb, Daniel Jurgens,
	Leon Romanovsky
In-Reply-To: <1478375842-21513-7-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

FWIW
Reviewed-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

On Sat, Nov 05, 2016 at 09:57:19PM +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Use INT_MAX since this is the max value the attribute can hold, though
> hardware capability is unlimited.
> 
> Fixes: 225c7b1feef1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand
> adapters')
> Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 

Empty line

> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/main.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
> index b597e82..05ab3cb 100644
> --- a/drivers/infiniband/hw/mlx4/main.c
> +++ b/drivers/infiniband/hw/mlx4/main.c
> @@ -547,6 +547,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
>  	props->max_map_per_fmr = dev->dev->caps.max_fmr_maps;
>  	props->hca_core_clock = dev->dev->caps.hca_core_clock * 1000UL;
>  	props->timestamp_mask = 0xFFFFFFFFFFFFULL;
> +	props->max_ah = INT_MAX;
>  
>  	if (!mlx4_is_slave(dev->dev))
>  		err = mlx4_get_internal_clock_params(dev->dev, &clock_params);
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-rc 1/9] IB/mlx4: Set traffic class in ah
From: Yuval Shaia @ 2016-11-06  7:26 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Maor Gottlieb, Daniel Jurgens,
	Leon Romanovsky
In-Reply-To: <1478375842-21513-2-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Two extremely minor comments

On Sat, Nov 05, 2016 at 09:57:14PM +0200, Leon Romanovsky wrote:
> From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Set traffic class within sl_tclass_flowlabel when create iboe ah.
> Without this the tos value will be empty when running VLAN tagged
> traffic,  because the tos value is taken from the traffic class in the

Extra space

> address handle attributes.
> 
> Fixes: 9106c4106974 ('IB/mlx4: Fix SL to 802.1Q priority-bits mapping
> for IBoE')
> Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> 

Empty line

> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/ah.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
> index 5fc6233..6be7dc3 100644
> --- a/drivers/infiniband/hw/mlx4/ah.c
> +++ b/drivers/infiniband/hw/mlx4/ah.c
> @@ -111,7 +111,9 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
>  		       !(1 << ah->av.eth.stat_rate & dev->caps.stat_rate_support))
>  			--ah->av.eth.stat_rate;
>  	}
> -
> +	ah->av.eth.sl_tclass_flowlabel |=
> +			cpu_to_be32((ah_attr->grh.traffic_class << 20) |
> +				    ah_attr->grh.flow_label);
>  	/*
>  	 * HW requires multicast LID so we just choose one.
>  	 */
> @@ -119,7 +121,7 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
>  		ah->av.ib.dlid = cpu_to_be16(0xc000);
>  
>  	memcpy(ah->av.eth.dgid, ah_attr->grh.dgid.raw, 16);
> -	ah->av.eth.sl_tclass_flowlabel = cpu_to_be32(ah_attr->sl << 29);
> +	ah->av.eth.sl_tclass_flowlabel |= cpu_to_be32(ah_attr->sl << 29);
>  
>  	return &ah->ibah;
>  }
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-rc 2/9] IB/mlx4: Check gid_index return value
From: Yuval Shaia @ 2016-11-06  7:25 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Daniel Jurgens,
	Leon Romanovsky
In-Reply-To: <1478375842-21513-3-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

FWIW
Reviewed-by: Yuval Shaia <yuval.shaia-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

On Sat, Nov 05, 2016 at 09:57:15PM +0200, Leon Romanovsky wrote:
> From: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> 
> Check the returned gid index value and return an error if it is invalid.
> 
> Fixes: 5070cd2239bd('IB/mlx4: Replace mechanism for RoCE GID management')
> Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/ah.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/ah.c b/drivers/infiniband/hw/mlx4/ah.c
> index 6be7dc3..8dfc76f 100644
> --- a/drivers/infiniband/hw/mlx4/ah.c
> +++ b/drivers/infiniband/hw/mlx4/ah.c
> @@ -102,7 +102,10 @@ static struct ib_ah *create_iboe_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr
>  	if (vlan_tag < 0x1000)
>  		vlan_tag |= (ah_attr->sl & 7) << 13;
>  	ah->av.eth.port_pd = cpu_to_be32(to_mpd(pd)->pdn | (ah_attr->port_num << 24));
> -	ah->av.eth.gid_index = mlx4_ib_gid_index_to_real_index(ibdev, ah_attr->port_num, ah_attr->grh.sgid_index);
> +	ret = mlx4_ib_gid_index_to_real_index(ibdev, ah_attr->port_num, ah_attr->grh.sgid_index);
> +	if (ret < 0)
> +		return ERR_PTR(ret);
> +	ah->av.eth.gid_index = ret;
>  	ah->av.eth.vlan = cpu_to_be16(vlan_tag);
>  	ah->av.eth.hop_limit = ah_attr->grh.hop_limit;
>  	if (ah_attr->static_rate) {
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-core 0/8] libpvrdma: userspace library for PVRDMA
From: Adit Ranadive @ 2016-11-06  1:31 UTC (permalink / raw)
  To: Doug Ledford, Christoph Hellwig, Jason Gunthorpe
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, pv-drivers
In-Reply-To: <581E4E01.5020405-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

On Sat Nov 05 2016 14:24:17 GMT-0700 (PDT), Doug Ledford wrote:
> On 11/5/16 11:38 AM, Christoph Hellwig wrote:
> > On Sat, Nov 05, 2016 at 09:03:07AM -0600, Jason Gunthorpe wrote:
> > > Oh, I wanted to ask about the name - we have two 'pv' drivers now,
> > > should this be called pvrdma_vmware or something? Is there a
> > > convention for this in other parts of the kernel?
> > 
> > Yes, it should, even if we have no exact convention.
> > 
> 
> Agreed.  I hate how long the driver name will end up being, but pvrdma_
> as a prefix sounds appropriate.
> 

Hi Jason/Doug,

I wasn't aware that there was another paravirtual RDMA driver being upstreamed.
Maybe I missed it in the linux-rdma list?

Shouldn't this be a vendor choice since it would depend on how they want
to name their driver as long as it doesn't clash with any existing ones?

Thanks,
Adit
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH rdma-core 0/8] libpvrdma: userspace library for PVRDMA
From: Doug Ledford @ 2016-11-05 21:24 UTC (permalink / raw)
  To: Christoph Hellwig, Jason Gunthorpe
  Cc: Adit Ranadive, linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	pv-drivers
In-Reply-To: <20161105173815.GA28539-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>


[-- Attachment #1.1: Type: text/plain, Size: 636 bytes --]

On 11/5/16 11:38 AM, Christoph Hellwig wrote:
> On Sat, Nov 05, 2016 at 09:03:07AM -0600, Jason Gunthorpe wrote:
>> Oh, I wanted to ask about the name - we have two 'pv' drivers now,
>> should this be called pvrdma_vmware or something? Is there a
>> convention for this in other parts of the kernel?
> 
> Yes, it should, even if we have no exact convention.
> 

Agreed.  I hate how long the driver name will end up being, but pvrdma_
as a prefix sounds appropriate.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>    GPG Key ID: 0E572FDD
  Red Hat, Inc.
  100 E. Davie St
  Raleigh, NC 27601 USA


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 907 bytes --]

^ permalink raw reply

* Re: [PATCH rdma-rc 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing
From: Hal Rosenstock @ 2016-11-05 21:03 UTC (permalink / raw)
  To: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Jack Morgenstein,
	Daniel Jurgens, Leon Romanovsky
In-Reply-To: <1478375842-21513-6-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

On 11/5/2016 3:57 PM, Leon Romanovsky wrote:
> From: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> 
> If OpenSM runs over ConnectX-3, and there are ConnectIB VFs active
> on the network, the OpenSM will receive QP1 packets containing a GRH
> where the destination GID is the "Well-Known GID" -- which is not a GID
> in the HCA Port's GID Table.
> 
> This GID must be tested-for separately -- and packets which contain
> this destination GID should be routed to slave 0 (the PF).
> 
> Fixes: 37bfc7c1e83f ('IB/mlx4: SR-IOV multiplex and demultiplex MADs')
> Signed-off-by: Jack Morgenstein <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> ---
>  drivers/infiniband/hw/mlx4/mad.c | 16 ++++++++++++----
>  include/rdma/ib_verbs.h          |  1 +
>  2 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
> index b8e9013..f0b8272 100644
> --- a/drivers/infiniband/hw/mlx4/mad.c
> +++ b/drivers/infiniband/hw/mlx4/mad.c
> @@ -729,10 +729,18 @@ static int mlx4_ib_demux_mad(struct ib_device *ibdev, u8 port,
>  
>  	/* If a grh is present, we demux according to it */
>  	if (wc->wc_flags & IB_WC_GRH) {
> -		slave = mlx4_ib_find_real_gid(ibdev, port, grh->dgid.global.interface_id);
> -		if (slave < 0) {
> -			mlx4_ib_warn(ibdev, "failed matching grh\n");
> -			return -ENOENT;
> +		if (grh->dgid.global.interface_id ==
> +			cpu_to_be64(IB_SA_WELL_KNOWN_GUID) &&
> +		    grh->dgid.global.subnet_prefix ==
> +			cpu_to_be64(IB_SA_WELL_KNOWN_GID_PREFIX)) {
> +			slave = 0;
> +		} else {
> +			slave = mlx4_ib_find_real_gid(ibdev, port,
> +						      grh->dgid.global.interface_id);
> +			if (slave < 0) {
> +				mlx4_ib_warn(ibdev, "failed matching grh\n");
> +				return -ENOENT;
> +			}
>  		}
>  	}
>  	/* Class-specific handling */
> diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
> index 467a4b4..da5949f 100644
> --- a/include/rdma/ib_verbs.h
> +++ b/include/rdma/ib_verbs.h
> @@ -100,6 +100,7 @@ enum rdma_node_type {
>  
>  enum {
>  	/* set the local administered indication */
> +	IB_SA_WELL_KNOWN_GID_PREFIX = 0xfe80000000000000ull,
>  	IB_SA_WELL_KNOWN_GUID	= BIT_ULL(57) | 2,

Isn't the SA well-known GID the concatenation of the subnet prefix
(which isn't necessarily the default link local one) and the GUID
0x0200000000000002 ?

-- Hal

>  };
>  
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH rdma-rc 9/9] IB/mlx4: Check if GRH is available before using it in modify_qp
From: Leon Romanovsky @ 2016-11-05 19:57 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eran Ben Elisha,
	Daniel Jurgens, Leon Romanovsky
In-Reply-To: <1478375842-21513-1-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Eran Ben Elisha <eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Before reading GRH attributes, need to make sure ah contains GRH
and initialize GID type, while we are there,

Fixes: dbf727de7440 ('IB/core: Use GID table in AH creation and dmac resolution')
Signed-off-by: Eran Ben Elisha <eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/qp.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 570bc86..0914731 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -1764,14 +1764,14 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
 		u8 port_num = mlx4_is_bonded(to_mdev(ibqp->device)->dev) ? 1 :
 			attr_mask & IB_QP_PORT ? attr->port_num : qp->port;
 		union ib_gid gid;
-		struct ib_gid_attr gid_attr;
+		struct ib_gid_attr gid_attr = {.gid_type = IB_GID_TYPE_IB};
 		u16 vlan = 0xffff;
 		u8 smac[ETH_ALEN];
 		int status = 0;
 		int is_eth = rdma_cap_eth_ah(&dev->ib_dev, port_num) &&
 			attr->ah_attr.ah_flags & IB_AH_GRH;
 
-		if (is_eth) {
+		if (is_eth && attr->ah_attr.ah_flags & IB_AH_GRH) {
 			int index = attr->ah_attr.grh.sgid_index;
 
 			status = ib_get_cached_gid(ibqp->device, port_num,
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-rc 8/9] IB/mlx4: Add precondition for flow_steering_ib_uc_qp_range command
From: Leon Romanovsky @ 2016-11-05 19:57 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Eran Ben Elisha,
	Daniel Jurgens, Leon Romanovsky
In-Reply-To: <1478375842-21513-1-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Eran Ben Elisha <eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

FLOW_STEERING_IB_UC_QP_RANGE command is supported only if dmfs_ipoib bit is set.

If it isn't set we want to ensure allocating NET_IF QPs fail. We do so
by filling out the allocation bitmap. By thus, the NET_IF QPs allocating
function won't find any free QP and will fail.

Fixes: c1c98501121e ('IB/mlx4: Add support for steerable IB UD QPs')
Signed-off-by: Eran Ben Elisha <eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 4054a1b..4a67ffc 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -2823,14 +2823,19 @@ static void *mlx4_ib_add(struct mlx4_dev *dev)
 			goto err_steer_qp_release;
 		}
 
-		bitmap_zero(ibdev->ib_uc_qpns_bitmap, ibdev->steer_qpn_count);
-
-		err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE(
-				dev, ibdev->steer_qpn_base,
-				ibdev->steer_qpn_base +
-				ibdev->steer_qpn_count - 1);
-		if (err)
-			goto err_steer_free_bitmap;
+		if (dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_DMFS_IPOIB) {
+			bitmap_zero(ibdev->ib_uc_qpns_bitmap,
+				    ibdev->steer_qpn_count);
+			err = mlx4_FLOW_STEERING_IB_UC_QP_RANGE(
+					dev, ibdev->steer_qpn_base,
+					ibdev->steer_qpn_base +
+					ibdev->steer_qpn_count - 1);
+			if (err)
+				goto err_steer_free_bitmap;
+		} else {
+			bitmap_fill(ibdev->ib_uc_qpns_bitmap,
+				    ibdev->steer_qpn_count);
+		}
 	}
 
 	for (j = 1; j <= ibdev->dev->caps.num_ports; j++)
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-rc 7/9] IB/mlx4: Fix port query for 56Gb Ethernet links
From: Leon Romanovsky @ 2016-11-05 19:57 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Saeed Mahameed, Yishai Hadas,
	Daniel Jurgens, Leon Romanovsky
In-Reply-To: <1478375842-21513-1-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Report the correct speed in the port attributes when using a 56Gbps
ethernet link, without this change the field is incorrectly set to
10Gbps.

Fixes: a9c766bb75ee ('IB/mlx4: Fix info returned when querying IBoE ports')
Fixes: 2e96691c31ec ('IB: Use central enum for speed instead of hard-coded values')
Signed-off-by: Saeed Mahameed <saeedm-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index 05ab3cb..4054a1b 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -698,9 +698,11 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 	if (err)
 		goto out;
 
-	props->active_width	=  (((u8 *)mailbox->buf)[5] == 0x40) ?
-						IB_WIDTH_4X : IB_WIDTH_1X;
-	props->active_speed	= IB_SPEED_QDR;
+	props->active_width	=  (((u8 *)mailbox->buf)[5] == 0x40) ||
+				   (((u8 *)mailbox->buf)[5] == 0x20 /*56Gb*/) ?
+					   IB_WIDTH_4X : IB_WIDTH_1X;
+	props->active_speed	=  (((u8 *)mailbox->buf)[5] == 0x20 /*56Gb*/) ?
+					   IB_SPEED_FDR : IB_SPEED_QDR;
 	props->port_cap_flags	= IB_PORT_CM_SUP | IB_PORT_IP_BASED_GIDS;
 	props->gid_tbl_len	= mdev->dev->caps.gid_table_len[port];
 	props->max_msg_sz	= mdev->dev->caps.max_msg_sz;
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [PATCH rdma-rc 6/9] IB/mlx4: Put non zero value in max_ah device attribute
From: Leon Romanovsky @ 2016-11-05 19:57 UTC (permalink / raw)
  To: dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Maor Gottlieb, Daniel Jurgens,
	Leon Romanovsky
In-Reply-To: <1478375842-21513-1-git-send-email-leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

From: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Use INT_MAX since this is the max value the attribute can hold, though
hardware capability is unlimited.

Fixes: 225c7b1feef1 ('IB/mlx4: Add a driver Mellanox ConnectX InfiniBand
adapters')
Signed-off-by: Maor Gottlieb <maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Daniel Jurgens <danielj-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c
index b597e82..05ab3cb 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -547,6 +547,7 @@ static int mlx4_ib_query_device(struct ib_device *ibdev,
 	props->max_map_per_fmr = dev->dev->caps.max_fmr_maps;
 	props->hca_core_clock = dev->dev->caps.hca_core_clock * 1000UL;
 	props->timestamp_mask = 0xFFFFFFFFFFFFULL;
+	props->max_ah = INT_MAX;
 
 	if (!mlx4_is_slave(dev->dev))
 		err = mlx4_get_internal_clock_params(dev->dev, &clock_params);
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox