Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Michael Wang
On 04/13/2015 09:27 PM, Jason Gunthorpe wrote: On Mon, Apr 13, 2015 at 02:25:16PM +0200, Michael Wang wrote: dev_list = kmalloc(sizeof *dev_list, GFP_KERNEL); if (!dev_list) @@ -1673,13 +1671,19 @@ static void ipoib_add_one(struct ib_device *device) } for (p = s; p =

Re: [PATCH] IB/verbs: Check each operation of dma_ops individually

2015-04-14 Thread Yuval Shaia
ping On Sun, Feb 22, 2015 at 08:50:27PM -0800, Yuval Shaia wrote: Current approach force one to implement all ops even when some functions can use the default implementation. As a result, for new DMA ops (e.x new arch) many functions just wrap the default function. The fix is to check each

Re: [PATCH v3 10/28] IB/Verbs: Reform cm related part in IB-core cma

2015-04-14 Thread Michael Wang
On 04/13/2015 09:25 PM, Hefty, Sean wrote: @@ -1037,17 +1033,13 @@ void rdma_destroy_id(struct rdma_cm_id *id) mutex_unlock(id_priv-handler_mutex); if (id_priv-cma_dev) { -switch (rdma_node_get_transport(id_priv-id.device- node_type)) { -case

Re: [PATCH v3 04/28] IB/Verbs: Reform IB-core cm

2015-04-14 Thread Michael Wang
On 04/13/2015 08:12 PM, ira.weiny wrote: [snip] - -if (rdma_node_get_transport(ib_device-node_type) != RDMA_TRANSPORT_IB) -return; +int count = 0; I'm ok with this as an intermediate patch but going forward if we are going to have calls like static inline int

Re: [PATCH v3 05/28] IB/Verbs: Reform IB-core sa_query

2015-04-14 Thread Michael Wang
On 04/13/2015 08:45 PM, Hefty, Sean wrote: @@ -1153,9 +1153,7 @@ static void ib_sa_add_one(struct ib_device *device) { struct ib_sa_device *sa_dev; int s, e, i; - -if (rdma_node_get_transport(device-node_type) != RDMA_TRANSPORT_IB) -return; +int count = 0;

Re: CVE-2014-8159 kernel: infiniband: uverbs: unprotected physical memory access

2015-04-14 Thread Haggai Eran
On 13/04/2015 16:29, Yann Droneaud wrote: Le jeudi 02 avril 2015 à 18:12 +, Haggai Eran a écrit : ... I want to add that we would like to see users registering a very large memory region (perhaps the entire process address space) for local access, and then enabling remote access only to

Re: [PATCH] IB/verbs: Check each operation of dma_ops individually

2015-04-14 Thread Sagi Grimberg
On 2/23/2015 6:50 AM, Yuval Shaia wrote: Current approach force one to implement all ops even when some functions can use the default implementation. As a result, for new DMA ops (e.x new arch) many functions just wrap the default function. The fix is to check each DMA operation individually

Re: [PATCH v3 27/28] IB/Verbs: Clean up rdma_ib_or_iboe()

2015-04-14 Thread Michael Wang
On 04/13/2015 10:33 PM, Jason Gunthorpe wrote: On Mon, Apr 13, 2015 at 02:36:45PM +0200, Michael Wang wrote: We have finished introducing the cap_XX(), and raw helper rdma_ib_or_iboe() is no longer necessary, thus clean it up. So, the net result is not looking too bad, but I'm confused

Re: [PATCH v3 04/28] IB/Verbs: Reform IB-core cm

2015-04-14 Thread Michael Wang
On 04/13/2015 09:29 PM, Jason Gunthorpe wrote: On Mon, Apr 13, 2015 at 06:40:35PM +, Hefty, Sean wrote: - if (rdma_node_get_transport(ib_device-node_type) != RDMA_TRANSPORT_IB) - return; + int count = 0; I'm ok with this as an intermediate patch but going forward if we are

Re: [PATCH v1 2/2] IB/core: don't disallow registering region starting at 0x0

2015-04-14 Thread Sagi Grimberg
On 4/13/2015 3:56 PM, Yann Droneaud wrote: In a call to ib_umem_get(), if address is 0x0 and size is already page aligned, check added in commit 8494057ab5e4 (IB/uverbs: Prevent integer overflow in ib_umem_get address arithmetic) will refuse to register a memory region that could otherwise be

Re: [PATCH v1 2/2] IB/core: don't disallow registering region starting at 0x0

2015-04-14 Thread Yann Droneaud
Hi, Le mardi 14 avril 2015 à 12:20 +0300, Sagi Grimberg a écrit : On 4/13/2015 3:56 PM, Yann Droneaud wrote: In a call to ib_umem_get(), if address is 0x0 and size is already page aligned, check added in commit 8494057ab5e4 (IB/uverbs: Prevent integer overflow in ib_umem_get address

Re: Stepping down as maintainer (was Re: [PATCH for-next 0/9] mlx4 changes in virtual GID management)

2015-04-14 Thread Or Gerlitz
On Mon, Apr 13, 2015 at 8:53 PM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: Or, I was also a bit annoyed by your last email, the tone just seemed inappropriate/in-gracious for the situation. I made a full clarification and wait to see Sean's response. Sean is doing excellent work

Re: Stepping down as maintainer (was Re: [PATCH for-next 0/9] mlx4 changes in virtual GID management)

2015-04-14 Thread Or Gerlitz
On Mon, Apr 13, 2015 at 8:53 PM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: As far as patches go, you keep asking for reviews, but where are the reviews from Mellanox? I count 45 @mellanox folks who contributed to the kernel, but I wouldn't have guessed that based on mailing list

[PATCH amirv] IB/ipoib: Add cleanup to sendonly multicast objects [ib-next: handle_neigh_state_change() can be static

2015-04-14 Thread kbuild test robot
Signed-off-by: Fengguang Wu fengguang...@intel.com --- ipoib_multicast.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 856ed6e..f5c5f14 100644 ---

[amirv:for-upstream 52/62] drivers/infiniband/ulp/ipoib/ipoib_multicast.c:735:5: sparse: symbol 'handle_neigh_state_change' was not declared. Should it be static?

2015-04-14 Thread kbuild test robot
tree: git://flatbed.openfabrics.org/~amirv/linux.git for-upstream head: 66a75344a2e5a8e8483cfd6ab1db1c0fbcb56fda commit: cbaa5ae8702fea9670d77daf95f35b4d38822ad0 [52/62] IB/ipoib: Add cleanup to sendonly multicast objects [ib-next:ipoib-s1] reproduce: # apt-get install sparse git checkout

Re: Stepping down as maintainer (was Re: [PATCH for-next 0/9] mlx4 changes in virtual GID management)

2015-04-14 Thread Or Gerlitz
On Mon, Apr 13, 2015 at 7:10 PM, Hefty, Sean sean.he...@intel.com wrote: Unfortunately, Sean -- you haven't provided for 2 months any feedback on the patches to the CM/CMA modules which you own/maintain for supporting name-spaces and such which are part of enabling proper RDMA support for

Re: [PATCH v3 for-next 01/33] IB/core: Add RoCE GID cache

2015-04-14 Thread Matan Barak
On 4/14/2015 2:50 AM, Hefty, Sean wrote: Yes, this comment probably could use a reword.. + IB_GID_TYPE_IB= 0, + IB_GID_TYPE_ROCE_V2 = 1, + IB_GID_TYPE_SIZE +}; Can you explain the purpose of defining a 'GID type'. A GID is just a global address. Why does it

Re: [PATCH] ib_uverbs: Fix pages leak when using XRC SRQs

2015-04-14 Thread Sagi Grimberg
On 4/7/2015 2:22 PM, Sébastien Dugué wrote: Hello, When an application using XRCs abruptly terminates, the mmaped pages of the CQ buffers are leaked. This comes from the fact that when resources are released in ib_uverbs_cleanup_ucontext(), we fail to release the CQs because their

Re: [PATCH v3 for-next 02/33] IB/core: Add kref to IB devices

2015-04-14 Thread Matan Barak
On 3/26/2015 1:46 AM, Bart Van Assche wrote: On 03/25/2015 02:19 PM, Somnath Kotur wrote: +static void ib_device_complete_cb(struct kref *kref) +{ +struct ib_device *device = container_of(kref, struct ib_device, +refcount); + +if (device-reg_state =

[PATCH linux-next v2] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Honggang Li
1) Droped ipvlan/macvlan/dsa patches. 2) Do not check the pointer returned by netdev_priv. 3) Add the FIX tag. - console log --- ipoib_get_iflink dev = 88026eb1c000, priv = 88026eb1c7c0, priv-parent = (null) ipoib_get_iflink dev =

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Nicolas Dichtel
Le 14/04/2015 18:30, Erez Shitrit a écrit : On Tue, Apr 14, 2015 at 6:20 PM, Honggang Li ho...@redhat.com wrote: [snip] This will make parent interface to return 0 instead of its own ifindex. I would suggest write something like that: + /* parent interface */ + if

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Michael Wang
On 04/14/2015 04:18 PM, ira.weiny wrote: [snip] /** - * cap_ib_cm_dev - Check if any port of device has the capability Infiniband - * Communication Manager. + * cap_ib_cm_any_port - Check if any port of the device has Infiniband + * Communication Manager (CM) support. * * @device:

[patch v3 09/18] IB/iser: Get rid of struct iser_rdma_regd

2015-04-14 Thread Sagi Grimberg
This struct members other than struct iser_mem_reg are unused, so remove it altogether. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir Lev ad...@mellanox.com --- drivers/infiniband/ulp/iser/iscsi_iser.h | 21 +-

[patch v3 04/18] IB/iser: Remove redundant cmd_data_len calculation

2015-04-14 Thread Sagi Grimberg
This code was added before we had protection data length calculation (in iser_send_command), so we needed to calc the sg data length from the sg itself. This is not needed anymore. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir

[patch v3 08/18] IB/iser: Remove redundant assignments in iser_reg_page_vec

2015-04-14 Thread Sagi Grimberg
Buffer length was assigned twice, and no reason to set va to io_addr and then add the offset, just set va to io_addr + offset. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir Lev ad...@mellanox.com ---

[patch v3 05/18] IB/iser: Remove a redundant struct iser_data_buf

2015-04-14 Thread Sagi Grimberg
No need to keep two iser_data_buf structures just in case we use mem copy. We can avoid that just by adding a pointer to the original sg. So keep only two iser_data_buf per command (data and protection) and pass the relevant data_buf to bounce buffer routine. This patch does not change any

[patch v3 17/18] IB/iser: Bump version to 1.6

2015-04-14 Thread Sagi Grimberg
Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/infiniband/ulp/iser/iscsi_iser.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.h b/drivers/infiniband/ulp/iser/iscsi_iser.h index 5fd0963..a39645a 100644 ---

[patch v3 01/18] IB/iser: Fix unload during ep_poll wrong dereference

2015-04-14 Thread Sagi Grimberg
In case the user unloaded ib_iser while ep_connect is in progress, we need to destroy the endpoint although ep_disconnect wasn't invoked (we detect this by the iser conn state != DOWN). However, if we got an REJECTED/UNREACHABLE CM event we move the connection state to DOWN which will prevent us

[patch v3 02/18] IB/iser: Handle fastreg/local_inv completion errors

2015-04-14 Thread Sagi Grimberg
Fast registration and local invalidate work requests can also fail. We should call error completion handler for them. Reported-by: Roi Dayan r...@mellanox.com Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/infiniband/ulp/iser/iser_verbs.c | 11 ++- 1 files changed, 6

[patch v3 18/18] IB/iser: Rewrite bounce buffer code path

2015-04-14 Thread Sagi Grimberg
In some rare cases, IO operations may be not aligned to page boundaries. This prevents iser from performing fast memory registration. In order to overcome that iser uses a bounce buffer to carry the transaction. We basically allocate a buffer in the size of the transaction and perform a copy. The

[patch v3 03/18] IB/iser: Fix wrong calculation of protection buffer length

2015-04-14 Thread Sagi Grimberg
This length miss-calculation may cause a silent data corruption in the DIX case and cause the device to reference unmapped area. Fixes: d77e65350f2d ('libiscsi, iser: Adjust data_length to include protection information') Signed-off-by: Sagi Grimberg sa...@mellanox.com ---

[patch v3 15/18] IB/iser: Pass struct iser_mem_reg to iser_fast_reg_mr and iser_reg_sig_mr

2015-04-14 Thread Sagi Grimberg
Instead of passing ib_sge as output variable, we pass the mem_reg pointer to have the routines fill the rkey as well. This reduces code duplication and extra assignments. This is a preparation step to unify some registration logics together. Also, pass iser_fast_reg_mr the fastreg descriptor

[patch v3 16/18] IB/iser: Remove code duplication for a single DMA entry

2015-04-14 Thread Sagi Grimberg
In singleton scatterlists, DMA memory registration code is taken both for Fastreg and FMR code paths. Move it to a function. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir Lev ad...@mellanox.com ---

Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Nicolas Dichtel
Le 14/04/2015 17:26, Patrick McHardy a écrit : On 14.04, Honggang Li wrote: [snip] - return vlan-lowerdev-ifindex; + if (vlan vlan-lowerdev) + return vlan-lowerdev-ifindex; That is completely useless. vlan (=netdev_priv) can not be NULL as netdev_priv() never

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Yann Droneaud
related qib. In order to check upstream linux-next fix the race condition or not, I build linux-next-20150414 on two machines. Both machines panic at modprobe ib_ipoib. Do you means I need to report a bug? But I do not know report to who or where. Here is the tag: Fixes: 5aa7add8f14b

[PATCH] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Honggang Li
Starting monitoring for VG vg_rdma01: 3 logical volume(s) in volume group vg_rdma01 monitored [ OK ] Starting cgconfig service: Failed to parse /etc/cgconfig.conf or /etc/cgconfig.d[FAILED] Loading OpenIB kernel modules: BUG: unable to handle kernel NULL pointer dereference at 0120

RE: [PATCH v3 for-next 01/33] IB/core: Add RoCE GID cache

2015-04-14 Thread Hefty, Sean
This is a part of the GID meta info. The user should be able to choose between RoCE V1 (which is represented here by IB_GID_TYPE_IB) and RoCE V2 - just as a user could choose between IPv6 and IPv4. IPv4 and IPv6 are different protocols, not different formats for the same address. How does

Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread David Miller
From: Honggang Li ho...@redhat.com Date: Mon, 13 Apr 2015 17:21:58 +0800 If CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for x86 systems and physical memory is more than 4GB, dma_map_page may return a valid memory address which greater than 0x. As a result, the mlx5 device page allocator RB

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Nicolas Dichtel
-20150414 on two machines. Both machines panic at modprobe ib_ipoib. Do you means I need to report a bug? But I do not know report to who or where. Here is the tag: Fixes: 5aa7add8f14b (infiniband/ipoib: implement ndo_get_iflink) -- To unsubscribe from this list: send the line unsubscribe linux-rdma

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Eric Dumazet
today when I'm tracing a race condition issue related qib. In order to check upstream linux-next fix the race condition or not, I build linux-next-20150414 on two machines. Both machines panic at modprobe ib_ipoib. Do you means I need to report a bug? But I do not know report to who or where

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Erez Shitrit
On Tue, Apr 14, 2015 at 6:20 PM, Honggang Li ho...@redhat.com wrote: [...] Hi, diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 657b89b..11ea6e2 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Jason Gunthorpe
On Tue, Apr 14, 2015 at 01:43:11PM -0400, ira.weiny wrote: A failure to init port 2 ends up ends up killing port 1 and releasing the device associated resources. Yes, that is the only reasonable thing that could happen. init failure should only be possible under exceptional cases (OOM). The

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Nicolas Dichtel
Le 14/04/2015 18:01, Yann Droneaud a écrit : [snip] Here is the tag: Fixes: 5aa7add8f14b (infiniband/ipoib: implement ndo_get_iflink) Pardon me, but this patch was never submitted to linux-rdma@vger.kernel.org for review !? Sorry for that, I missed it. Only Roland Dreier was CCed. -- To

RE: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Hefty, Sean
But that moves us in the wrong direction. If we later support port 2 without port 1 that code will be broken. I agree that the code will be broken, but supporting that model requires a lot more work in how the ib_cm listens across devices. -- To unsubscribe from this list: send the line

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread ira.weiny
On Tue, Apr 14, 2015 at 11:25:15AM -0600, Jason Gunthorpe wrote: On Tue, Apr 14, 2015 at 10:18:07AM -0400, ira.weiny wrote: After more thought and reading other opinions, I must agree we should not have cap_foo_dev. I looked at it a bit, and I think Sean has also basically said, CM does

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Jason Gunthorpe
On Tue, Apr 14, 2015 at 10:18:07AM -0400, ira.weiny wrote: After more thought and reading other opinions, I must agree we should not have cap_foo_dev. I looked at it a bit, and I think Sean has also basically said, CM does not support certain mixed port combinations. iWarp and IB simply cannot

RE: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Hefty, Sean
Yes, that is the only reasonable thing that could happen. init failure should only be possible under exceptional cases (OOM). The only system response is to call ib_umad_add_one again - so of course the first call had to completely clean up everything it did. A reasonable follow up change

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Jason Gunthorpe
On Tue, Apr 14, 2015 at 06:02:47PM +, Hefty, Sean wrote: Yes, that is the only reasonable thing that could happen. init failure should only be possible under exceptional cases (OOM). The only system response is to call ib_umad_add_one again - so of course the first call had to

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread ira.weiny
On Mon, Apr 13, 2015 at 02:01:38PM -0600, Jason Gunthorpe wrote: On Mon, Apr 13, 2015 at 03:46:03PM -0400, ira.weiny wrote: This doesn't quite look right, it should be 'goto error1' Looks like you replied to the wrong patch. ?? I don't see error1 in ipoib_add_one. For the ib_cm

Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Honggang LI
On Tue, Apr 14, 2015 at 05:37:57PM +0200, Andrew Lunn wrote: And I suspect that it is the same for ipvlan and dsa. I agree about DSA. I don't see any way this could happen. Andrew I only keep the ipoib patch and drop the rest patches. thanks -- To unsubscribe from this list: send

Re: [PATCH linux-next 4/4] net/dsa: fix possible NULL pointer dereference in dsa_slave_get_iflink

2015-04-14 Thread Guenter Roeck
On Tue, Apr 14, 2015 at 11:20:17PM +0800, Honggang Li wrote: Signed-off-by: Honggang Li ho...@redhat.com --- net/dsa/slave.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 827cda56..070b599 100644 --- a/net/dsa/slave.c +++

Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Patrick McHardy
On 14.04, Honggang LI wrote: On Tue, Apr 14, 2015 at 04:26:27PM +0100, Patrick McHardy wrote: That is completely useless. vlan (=netdev_priv) can not be NULL as netdev_priv() never returns NULL and vlan-lowerdev is always valid because a macvlan wouldn't make much sense otherwise. OK,

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread Michael Wang
On 04/14/2015 05:40 PM, ira.weiny wrote: On Tue, Apr 14, 2015 at 04:32:57PM +0200, Michael Wang wrote: On 04/14/2015 04:18 PM, ira.weiny wrote: [snip] /** - * cap_ib_cm_dev - Check if any port of device has the capability Infiniband - * Communication Manager. + *

Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Patrick McHardy
On 14.04, Honggang Li wrote: Signed-off-by: Honggang Li ho...@redhat.com --- drivers/net/macvlan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index b227a13..1e59f39 100644 --- a/drivers/net/macvlan.c +++

Re: [PATCH v3 10/28] IB/Verbs: Reform cm related part in IB-core cma

2015-04-14 Thread Michael Wang
On 04/14/2015 05:50 PM, ira.weiny wrote: On Tue, Apr 14, 2015 at 10:35:34AM +0200, Michael Wang wrote: On 04/13/2015 09:25 PM, Hefty, Sean wrote: @@ -1037,17 +1033,13 @@ void rdma_destroy_id(struct rdma_cm_id *id) mutex_unlock(id_priv-handler_mutex); if (id_priv-cma_dev) { -

Re: Stepping down as maintainer (was Re: [PATCH for-next 0/9] mlx4 changes in virtual GID management)

2015-04-14 Thread Or Gerlitz
On Sun, Apr 12, 2015 at 1:51 AM, Or Gerlitz gerlitz...@gmail.com wrote: On Thu, Apr 9, 2015 at 8:41 PM, Roland Dreier rol...@kernel.org wrote: On Tue, Apr 7, 2015 at 10:12 AM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: I don't think you understand how deep the problem Or is

Re: [PATCH v1 2/2] IB/core: don't disallow registering region starting at 0x0

2015-04-14 Thread Haggai Eran
On 14/04/2015 15:50, Sagi Grimberg wrote: On 4/14/2015 3:00 PM, Yann Droneaud wrote: Le mardi 14 avril 2015 à 12:20 +0300, Sagi Grimberg a écrit : On 4/13/2015 3:56 PM, Yann Droneaud wrote: ... diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c index

Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Honggang LI
On Tue, Apr 14, 2015 at 04:26:27PM +0100, Patrick McHardy wrote: That is completely useless. vlan (=netdev_priv) can not be NULL as netdev_priv() never returns NULL and vlan-lowerdev is always valid because a macvlan wouldn't make much sense otherwise. OK, please drop this patch. thanks --

Re: [PATCH v3 10/28] IB/Verbs: Reform cm related part in IB-core cma

2015-04-14 Thread ira.weiny
On Tue, Apr 14, 2015 at 10:35:34AM +0200, Michael Wang wrote: On 04/13/2015 09:25 PM, Hefty, Sean wrote: @@ -1037,17 +1033,13 @@ void rdma_destroy_id(struct rdma_cm_id *id) mutex_unlock(id_priv-handler_mutex); if (id_priv-cma_dev) { - switch

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Honggang LI
to check upstream linux-next fix the race condition or not, I build linux-next-20150414 on two machines. Both machines panic at modprobe ib_ipoib. Do you means I need to report a bug? But I do not know report to who or where. Here is the tag: Fixes: 5aa7add8f14b (infiniband/ipoib: implement

[patch v3 06/18] IB/iser: Don't pass ib_device to fall_to_bounce_buff routine

2015-04-14 Thread Sagi Grimberg
No need to pass that, we can take it from the task. In a later stage, this function will be invoked according to a device capability. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir Lev ad...@mellanox.com ---

[patch v3 11/18] IB/iser: Move fastreg descriptor pool get/put to helper functions

2015-04-14 Thread Sagi Grimberg
Instead of open-coding connection fastreg pool get/put, we introduce iser_reg_desc[get|put] helpers. We aren't setting these static as this will be a per-device routine later on. Also, cleanup iser_unreg_rdma_mem_fastreg a bit. This patch does not change any functionality. Signed-off-by: Sagi

[patch v3 13/18] IB/iser: Make fastreg pool cache friendly

2015-04-14 Thread Sagi Grimberg
Memory regions are resources that are saved in the device caches. Increase the probability for a cache hit by adding the MRU descriptor to pool head. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/infiniband/ulp/iser/iser_memory.c |2 +- 1 files changed, 1 insertions(+), 1

[patch v3 12/18] IB/iser: Move PI context alloc/free to routines

2015-04-14 Thread Sagi Grimberg
Make iser_[create|destroy]_fastreg_desc shorter, more readable and easily extendable. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir Lev ad...@mellanox.com --- drivers/infiniband/ulp/iser/iser_verbs.c | 118

iser patches for kernel 4.1 [v3]

2015-04-14 Thread Sagi Grimberg
Hi Roland, This set contains bug fixes as well as code refactoring patches - Patches 1-3: Bug fixes (stable material) - Patches 4-6: Bounce buffer related code cleanups - Patches 7-12,16: Refactoring - Patches 13-15: Minor optimizations - Patch 17:Version bump - Patch 18:

[patch v3 14/18] IB/iser: Modify struct iser_mem_reg members

2015-04-14 Thread Sagi Grimberg
No need to keep lkey, va, len variables, we can keep them as struct ib_sge. This will help when we change the memory registration logic. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com Signed-off-by: Adir Lev ad...@mellanox.com ---

[patch v3 07/18] IB/iser: Move memory reg/dereg routines to iser_memory.c

2015-04-14 Thread Sagi Grimberg
As memory registration/de-registration methods, lets move them to their natural location. While we're at it, make iser_reg_page_vec routine static. This patch does not change any functionality. Signed-off-by: Sagi Grimberg sa...@mellanox.com --- drivers/infiniband/ulp/iser/iscsi_iser.h |4

[patch v3 10/18] IB/iser: Merge build page-vec into register page-vec

2015-04-14 Thread Sagi Grimberg
No need for these two separate. Keep it in a single routine like in the fastreg case. This will also make iser_reg_page_vec closer to iser_fast_reg_mr arguments. This is a preparation step for registration flow refactor. This patch does not change any functionality. Signed-off-by: Sagi Grimberg

[PATCH linux-next 2/4] ipvlan: fix possible NULL pointer dereference in ipvlan_get_iflink

2015-04-14 Thread Honggang Li
Signed-off-by: Honggang Li ho...@redhat.com --- drivers/net/ipvlan/ipvlan_main.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ipvlan/ipvlan_main.c b/drivers/net/ipvlan/ipvlan_main.c index 77b92a0..479fcf7 100644 --- a/drivers/net/ipvlan/ipvlan_main.c +++

[PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Honggang Li
Signed-off-by: Honggang Li ho...@redhat.com --- drivers/net/macvlan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index b227a13..1e59f39 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -998,7 +998,9 @@

[PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Honggang Li
Starting monitoring for VG vg_rdma01: 3 logical volume(s) in volume group vg_rdma01 monitored [ OK ] Starting cgconfig service: Failed to parse /etc/cgconfig.conf or /etc/cgconfig.d[FAILED] Loading OpenIB kernel modules: BUG: unable to handle kernel NULL pointer dereference at 0120

[PATCH linux-next 4/4] net/dsa: fix possible NULL pointer dereference in dsa_slave_get_iflink

2015-04-14 Thread Honggang Li
Signed-off-by: Honggang Li ho...@redhat.com --- net/dsa/slave.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 827cda56..070b599 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -59,7 +59,10 @@ static int

Re: [PATCH v3 for-next 01/33] IB/core: Add RoCE GID cache

2015-04-14 Thread Bart Van Assche
On 04/14/15 15:23, Matan Barak wrote: +mutex_lock(cache-lock); + +for (ix = 0; ix cache-sz; ix++) +if (cache-data_vec[ix].attr.ndev == ndev) +write_gid(ib_dev, port, cache, ix, zgid, zattr); + +mutex_unlock(cache-lock); +return 0; The traditional Linux

Re: [PATCH v3 07/28] IB/Verbs: Reform IB-ulp ipoib

2015-04-14 Thread ira.weiny
On Tue, Apr 14, 2015 at 04:32:57PM +0200, Michael Wang wrote: On 04/14/2015 04:18 PM, ira.weiny wrote: [snip] /** - * cap_ib_cm_dev - Check if any port of device has the capability Infiniband - * Communication Manager. + * cap_ib_cm_any_port - Check if any port of the device

Re: [PATCH linux-next 3/4] macvlan: fix possible NULL pointer dereference in macvlan_dev_get_iflink

2015-04-14 Thread Andrew Lunn
On Tue, Apr 14, 2015 at 05:35:12PM +0200, Nicolas Dichtel wrote: Le 14/04/2015 17:26, Patrick McHardy a écrit : On 14.04, Honggang Li wrote: [snip] - return vlan-lowerdev-ifindex; + if (vlan vlan-lowerdev) + return vlan-lowerdev-ifindex; That is completely useless. vlan

[PATCH linux-next 0/4] fix possile NULL pointer dereference in ndo_get_iflink callback functions

2015-04-14 Thread Honggang Li
The four callback functions deferference the pointers without test. As ipoib_get_iflink failed, it is a good reason to fix the other three functions. Those functions will return zero on error, as valid ifindex greater than zero. I understand that those simple patches should be emerged into a

[PATCH linux-next v3] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Honggang Li
If CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for x86 systems and physical memory is more than 4GB, dma_map_page may return a valid memory address which greater than 0x. As a result, the mlx5 device page allocator RB tree will be initialized with valid addresses greater than 0xfff. However,

Re: Stepping down as maintainer (was Re: [PATCH for-next 0/9] mlx4 changes in virtual GID management)

2015-04-14 Thread ira.weiny
On Mon, Apr 13, 2015 at 01:14:40PM -0400, Doug Ledford wrote: On Apr 13, 2015, at 12:42 PM, Jason Gunthorpe jguntho...@obsidianresearch.com wrote: On Sun, Apr 12, 2015 at 07:16:33PM +0200, Yann Droneaud wrote: That would make sense to have someone like Doug or Jason being the

Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Honggang LI
On Tue, Apr 14, 2015 at 10:23:16PM +0300, Eli Cohen wrote: On Mon, Apr 13, 2015 at 05:21:58PM +0800, Honggang Li wrote: @@ -241,7 +243,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr) static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id) { struct page

Re: [PATCH linux-next v3] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Or Gerlitz
On 4/15/2015 6:19 AM, Honggang Li wrote: Fix(bf0bf77 mlx5: Support communicating arbitrary host page size to firmware) This isn't the way to write the fix note, do it that way Fixes: bf0bf77f6519 ('mlx5: Support communicating arbitrary host page size to firmware') Signed-off-by: Honggang

Re: [PATCH linux-next v3] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Eli Cohen
Acked-by: Eli Cohen e...@mellanox.com On Wed, Apr 15, 2015 at 11:19:17AM +0800, Honggang Li wrote: If CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for x86 systems and physical memory is more than 4GB, dma_map_page may return a valid memory address which greater than 0x. As a result, the mlx5

Re: iser patches for kernel 4.1 [v3]

2015-04-14 Thread Or Gerlitz
On 4/14/2015 6:08 PM, Sagi Grimberg wrote: Hi Roland, This set contains bug fixes as well as code refactoring patches - Patches 1-3: Bug fixes (stable material) - Patches 4-6: Bounce buffer related code cleanups - Patches 7-12,16: Refactoring - Patches 13-15: Minor optimizations -

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Or Gerlitz
On 4/14/2015 11:41 PM, Jason Gunthorpe wrote: Erez, you basically rewrote this, please make a proper patch with the Fixes and Reported-By credit for Honggang. Lets merge this through Dave M's tree right away. Agree, Erez, add proper Fixes: XXX note and send a patch to netdev against

Re: Stepping down as maintainer (was Re: [PATCH for-next 0/9] mlx4 changes in virtual GID management)

2015-04-14 Thread Or Gerlitz
On 4/13/2015 8:14 PM, Doug Ledford wrote: Same here (having been asked privately to look into doing this). FWIW, Red Hat has agreed that they are willing to allow me to transition my job to a full time upstream focused position (as of now, I work on upstream around my deliverables inside the

RE: [PATCH v3 for-next 01/33] IB/core: Add RoCE GID cache

2015-04-14 Thread Somnath Kotur
-Original Message- From: Hefty, Sean [mailto:sean.he...@intel.com] Sent: Tuesday, April 14, 2015 11:02 PM To: Matan Barak; Somnath Kotur; rol...@kernel.org Cc: linux-rdma@vger.kernel.org Subject: RE: [PATCH v3 for-next 01/33] IB/core: Add RoCE GID cache This is a part of the

Re: [PATCH linux-next v2] mlx5: wrong page mask if CONFIG_ARCH_DMA_ADDR_T_64BIT enabled for 32Bit architectures

2015-04-14 Thread Eli Cohen
On Mon, Apr 13, 2015 at 05:21:58PM +0800, Honggang Li wrote: @@ -241,7 +243,7 @@ static void free_4k(struct mlx5_core_dev *dev, u64 addr) static int alloc_system_page(struct mlx5_core_dev *dev, u16 func_id) { struct page *page; - u64 addr; + u64 addr = 0; int err;

Re: [PATCH linux-next 1/4] infiniband/ipoib: fix possible NULL pointer dereference in ipoib_get_iflink

2015-04-14 Thread Jason Gunthorpe
On Tue, Apr 14, 2015 at 07:30:03PM +0300, Erez Shitrit wrote: diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 657b89b..11ea6e2 100644 +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -846,7 +846,10 @@ static int

Re: [PATCH] IB/verbs: Check each operation of dma_ops individually

2015-04-14 Thread Jason Gunthorpe
On Tue, Apr 14, 2015 at 11:52:11AM +0300, Sagi Grimberg wrote: On 2/23/2015 6:50 AM, Yuval Shaia wrote: Current approach force one to implement all ops even when some functions can use the default implementation. As a result, for new DMA ops (e.x new arch) many functions just wrap the

Re: [PATCH v3 for-next 01/33] IB/core: Add RoCE GID cache

2015-04-14 Thread Matan Barak
On 3/26/2015 1:42 AM, Bart Van Assche wrote: On 03/25/2015 02:19 PM, Somnath Kotur wrote: +if (cache-data_vec[ix].attr.ndev +cache-data_vec[ix].attr.ndev != old_net_dev) A few lines earlier the memory old_net_dev points at was freed. If two instances of this function run

Re: [PATCH v1 2/2] IB/core: don't disallow registering region starting at 0x0

2015-04-14 Thread Sagi Grimberg
On 4/14/2015 3:00 PM, Yann Droneaud wrote: Hi, Le mardi 14 avril 2015 à 12:20 +0300, Sagi Grimberg a écrit : On 4/13/2015 3:56 PM, Yann Droneaud wrote: In a call to ib_umem_get(), if address is 0x0 and size is already page aligned, check added in commit 8494057ab5e4 (IB/uverbs: Prevent