Re: mlx4 - query regarding PF VF functionality division

2014-06-26 Thread Bob Biloxi
 I see, by the nature of the mlx4 SRIOV architecture under which
 there's no dedicated/separated PF vs VF driver, this is indeed a
 non-trivial task, need to think how to make it easier for you
Thanks for considering. It would be really helpful. I actually
appreciate the mlx4 architecture wherein 3 separate drivers are part
of 1 integrated code base which I think is really difficult to
accomplish. I mean the dedicated driver, VF driver, PF driver are all
part of single code base which i think is good.

The only thing is when one wants to understand these pieces (VF or PF)
separately, it takes some effort(as in my case)

For e.g

there is this flow:

mlx4_en_get-qp()-mlx4_register_mac()-mlx4_slave_cmd()

after this the wrapper function gets called be it either for
master(PF) or for slave(VF)

Till now I was assuming that this makes sense only for the slave(VF)
because register_mac is supposed to be called by VF. But from the code
even the PF makes the call. So i was somewhat confused.

It would be of immense help if I could understand this somehow..


On Thu, Jun 26, 2014 at 2:13 AM, Or Gerlitz or.gerl...@gmail.com wrote:
 On Tue, Jun 24, 2014 at 4:42 PM, Bob Biloxi iambobbil...@gmail.com wrote:

  Not really, but let's take EIM approach, what's your goal/mission?
 Let's say I am going through code to understand only the PF related
 functionality without bothering about VF, what are the things I need
 to keep in mind.



 I see, by the nature of the mlx4 SRIOV architecture under which
 there's no dedicated/separated PF vs VF driver, this is indeed a
 non-trivial task, need to think how to make it easier for you

 Or.



 I mean do i need to :

 a. Go through all the files in mlx4
 b. If the code is not specifically under mlx4_is_master, I still need
 to understand it because it is also part of PF driver
 c. I can ignore the logic which executes if mlx4_is_master is false,
 because that would be the VF code

 Thanks for the help!!




 On Mon, Jun 23, 2014 at 5:30 PM, Or Gerlitz or.gerl...@gmail.com wrote:
  On Mon, Jun 23, 2014 at 12:33 PM, Bob Biloxi iambobbil...@gmail.com 
  wrote:
  [...]
  Is there any way we can clearly separate the files that are used by PF
  vs the files that are used by VF in the (drivers/net/ethernet/mlx4
  sub-directory)?
  [...]
 
  Not really, but let's take EIM approach, what's your goal/mission?
 
  Or.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: mlx5: Add driver for Mellanox Connect-IB adapters

2014-06-26 Thread Eli Cohen
On Fri, Jun 20, 2014 at 08:58:32PM +0300, Dan Carpenter wrote:
976
977err_create:
978if (qp-create_type == MLX5_QP_USER)
979destroy_qp_user(pd, qp);
 ^^^
 But we dereference it inside destroy_qp_user() unconditionally.
 
980else if (qp-create_type == MLX5_QP_KERNEL)
981destroy_qp_kernel(dev, qp);
 

When we get here we already updated create_type and since all
MLX5_QP_USER type QPs have PD the logic is not broken.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCHv1 2/4] RDMA/mlx5: add missing padding at end of struct mlx5_ib_create_srq

2014-06-26 Thread Eli Cohen
On Thu, Jun 05, 2014 at 09:38:03AM +0200, Yann Droneaud wrote:
 Le dimanche 11 mai 2014 à 10:12 +0300, Eli Cohen a écrit :
  Acked by: Eli Cohen e...@mellanox.com
 
 This Acked-by: tag was not applied on commit 43bc889380c2,
 in for-next branch (HEAD at ca846ce98ca3).
 
 PS: Eli, you've made a typo in your Acked-by :)
 

I forgot the hyphen... sorry :-)
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH opensm] osm_state_mgr.c: Improve error flow with wrong LIDs

2014-06-26 Thread Hal Rosenstock
From: Vladimir Koushnir vladim...@mellanox.com

In case of errors, setting NULL in the entry of port_lid_tbl
should be done only for LIDs assigned by lid manager in
order to avoid unnecessary expansion of port_lid_tbl and
further incorrect max_lid calculation that is based
on port_lid_tbl vector size.

Signed-off-by: Vladimir Koushnir vladim...@mellanox.com
Signed-off-by: Hal Rosenstock h...@mellanox.com
---
 opensm/osm_state_mgr.c |   15 +++
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/opensm/osm_state_mgr.c b/opensm/osm_state_mgr.c
index 11e8353..3c76f62 100644
--- a/opensm/osm_state_mgr.c
+++ b/opensm/osm_state_mgr.c
@@ -1438,7 +1438,7 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * 
sm)
 * same for this lid. Nothing to do. */
continue;
 
-   if (p_port_ref == NULL)
+   if (p_port_ref == NULL) {
/* There is an object in the subnet database for this
 * lid, but no such object exists in the reference
 * port_list_tbl. This can occur if we wanted to assign
@@ -1455,7 +1455,8 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * 
sm)
cl_ntoh64(osm_port_get_guid(p_port_stored)),
p_port_stored-p_node-print_desc,
p_port_stored-p_physp-port_num);
-   else if (p_port_stored == NULL)
+   cl_ptr_vector_set(p_port_lid_tbl, lid, NULL);
+   } else if (p_port_stored == NULL)
/* There is an object in the new database, but no
 * object in our subnet database. This is the matching
 * case of the prior check - the port still has its
@@ -1467,7 +1468,7 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t * 
sm)
cl_ntoh64(osm_port_get_guid(p_port_ref)),
p_port_ref-p_node-print_desc,
p_port_ref-p_physp-port_num, lid);
-   else
+   else {
/* if we reached here then p_port_stored != p_port_ref.
 * We were trying to set a lid to p_port_stored, but
 * it didn't reach it, and p_port_ref also didn't get
@@ -1483,11 +1484,9 @@ static void state_mgr_check_tbl_consistency(IN osm_sm_t 
* sm)
cl_ntoh64(osm_port_get_guid(p_port_stored)),
p_port_stored-p_node-print_desc,
p_port_stored-p_physp-port_num);
-
-   /* In any of these cases we want to set NULL in the
-* port_lid_tbl, since this entry is invalid. Also, make sure
-* we'll do another heavy sweep. */
-   cl_ptr_vector_set(p_port_lid_tbl, lid, NULL);
+   cl_ptr_vector_set(p_port_lid_tbl, lid, NULL);
+   }
+   /* Make sure we'll do another heavy sweep. */
sm-p_subn-subnet_initialization_error = TRUE;
}
 
-- 
1.7.8.2

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


[PATCH opensm] osm_drop_mgr.c: Add missing CR at end of log message in drop_mgr_check_node

2014-06-26 Thread Hal Rosenstock
From: Vladimir Koushnir vladim...@mellanox.com

Signed-off-by: Vladimir Koushnir vladim...@mellanox.com
Signed-off-by: Hal Rosenstock h...@mellanox.com
---
 opensm/osm_drop_mgr.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/opensm/osm_drop_mgr.c b/opensm/osm_drop_mgr.c
index 7eb174c..66c85b9 100644
--- a/opensm/osm_drop_mgr.c
+++ b/opensm/osm_drop_mgr.c
@@ -525,7 +525,7 @@ static void drop_mgr_check_node(osm_sm_t * sm, IN 
osm_node_t * p_node)
Unlinking local node 0x% PRIx64
, port %u
\n\t\t\t\tand remote node 0x% PRIx64
-   , port %u\n due to missing PortInfo,
+   , port %u due to missing PortInfo\n,
cl_ntoh64(osm_node_get_node_guid
  (p_node)), port_num,
cl_ntoh64(osm_node_get_node_guid
-- 
1.7.8.2

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


RE: [PATCH 0/2] Fixes skb leak and connection clean up on ARP error

2014-06-26 Thread Steve Wise
Hey Roland,

These two are also good bug fixes for 3.16-rc3.

Thanks,

Steve.


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


Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread Bart Van Assche
On 06/11/14 11:09, Sagi Grimberg wrote:
 + return xfer_len + (xfer_len  ilog2(sector_size)) * 8;

Sorry that I just noticed this now, but why is a shift-right and ilog2()
used in the above expression instead of just dividing the transfer
length by the sector size ?

Thanks,

Bart.

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


Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread James Bottomley
On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote:
 On 06/11/14 11:09, Sagi Grimberg wrote:
  +   return xfer_len + (xfer_len  ilog2(sector_size)) * 8;
 
 Sorry that I just noticed this now, but why is a shift-right and ilog2()
 used in the above expression instead of just dividing the transfer
 length by the sector size ?

It's a performance thing.  Division is really slow on most CPUs.
However, we know the divisor is a power of two so we re-express the
division as a shift, which the processor can do really fast.

James


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


Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread Atchley, Scott
On Jun 26, 2014, at 10:55 AM, James Bottomley 
james.bottom...@hansenpartnership.com wrote:

 On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote:
 On 06/11/14 11:09, Sagi Grimberg wrote:
 +   return xfer_len + (xfer_len  ilog2(sector_size)) * 8;
 
 Sorry that I just noticed this now, but why is a shift-right and ilog2()
 used in the above expression instead of just dividing the transfer
 length by the sector size ?
 
 It's a performance thing.  Division is really slow on most CPUs.
 However, we know the divisor is a power of two so we re-express the
 division as a shift, which the processor can do really fast.
 
 James

I have done this in the past as well, but have you benchmarked it? Compilers 
typically do the right thing in this case (i.e replace division with shift).

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


Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread James Bottomley


On June 26, 2014 11:41:48 AM EDT, Atchley, Scott atchle...@ornl.gov wrote:
On Jun 26, 2014, at 10:55 AM, James Bottomley
james.bottom...@hansenpartnership.com wrote:

 On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote:
 On 06/11/14 11:09, Sagi Grimberg wrote:
 +  return xfer_len + (xfer_len  ilog2(sector_size)) * 8;
 
 Sorry that I just noticed this now, but why is a shift-right and
ilog2()
 used in the above expression instead of just dividing the transfer
 length by the sector size ?
 
 It's a performance thing.  Division is really slow on most CPUs.
 However, we know the divisor is a power of two so we re-express the
 division as a shift, which the processor can do really fast.
 
 James

I have done this in the past as well, but have you benchmarked it?
Compilers typically do the right thing in this case (i.e replace
division with shift).

The compiler can only do that for values which are reducible to constants at 
compile time. This is a runtime value, the compiler has no way of deducing that 
it will be a power of 2

James
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line unsubscribe linux-rdma in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Need help with strange mlx4_core error

2014-06-26 Thread Mark Lehrer
On Feb 28, 2014, Vasiliy Tolstov wrote:

 I'm update firmware to 2.7.200 (that is the latest from ftp
 supermicro). Now i'm try to test it.

Which type of HCA do you have?  The firmware I downloaded from
ftp.supermicro.com was 2.9.1000, and once I upgraded to this version
from 2.7.200 I was able to use mlx4_en.

lspci shows my card as: Mellanox Technologies MT26428 [ConnectX VPI
PCIe 2.0 5GT/s - IB QDR / 10GigE]


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


Re: help with IB_WC_MW_BIND_ERR

2014-06-26 Thread Shirley Ma
Hello Eli, Or,

Do you know who can help on this? NFSoRDMA hits this error case with Mellanox 
ConnectX-2 HCAs.

Thanks
Shirley

On 05/20/2014 11:55 AM, Chuck Lever wrote:
 Hi-
 
 What does it mean when a LOCAL_INV work request fails with a
 IB_WC_MW_BIND_ERR completion?
 
 --
 Chuck Lever
 chuck[dot]lever[at]oracle[dot]com
 
 
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-rdma in
 the body of a message to majord...@vger.kernel.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 majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] scsi_cmnd: Introduce scsi_transfer_length helper

2014-06-26 Thread Atchley, Scott
On Jun 26, 2014, at 12:38 PM, James Bottomley 
james.bottom...@hansenpartnership.com wrote:

 On June 26, 2014 11:41:48 AM EDT, Atchley, Scott atchle...@ornl.gov wrote:
 On Jun 26, 2014, at 10:55 AM, James Bottomley
 james.bottom...@hansenpartnership.com wrote:
 
 On Thu, 2014-06-26 at 16:53 +0200, Bart Van Assche wrote:
 On 06/11/14 11:09, Sagi Grimberg wrote:
 + return xfer_len + (xfer_len  ilog2(sector_size)) * 8;
 
 Sorry that I just noticed this now, but why is a shift-right and
 ilog2()
 used in the above expression instead of just dividing the transfer
 length by the sector size ?
 
 It's a performance thing.  Division is really slow on most CPUs.
 However, we know the divisor is a power of two so we re-express the
 division as a shift, which the processor can do really fast.
 
 James
 
 I have done this in the past as well, but have you benchmarked it?
 Compilers typically do the right thing in this case (i.e replace
 division with shift).
 
 The compiler can only do that for values which are reducible to constants at 
 compile time. This is a runtime value, the compiler has no way of deducing 
 that it will be a power of 2
 
 James

You're right, I should have said runtime.

However, gcc on Intel seems to choose the right algorithm at runtime. On a 
trivial app with -O0, I see the same performance for shift and division if the 
divisor is a power of two. Is see ~38% penalty if the divisor is not a power of 
2. With -O3, shift is faster than division by about ~17% when the divisor is a 
power of two.

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