Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* [PATCH rdma-core] redhat/spec: add back strict librdmacm Requires
From: Jarod Wilson @ 2016-11-07 17:23 UTC (permalink / raw)
  To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
  Cc: Jarod Wilson, Jason Gunthorpe, Doug Ledford
In-Reply-To: <20161104004213.GA28485-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>

Per discussion on list with Doug and Jason, add back the strict librdmacm
Requires so that librdmacm and librdmacm-utils are as tightly coupled as
possible.

CC: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
CC: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Jarod Wilson <jarod-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 redhat/rdma-core.spec | 1 +
 1 file changed, 1 insertion(+)

diff --git a/redhat/rdma-core.spec b/redhat/rdma-core.spec
index f65a519..c3d8189 100644
--- a/redhat/rdma-core.spec
+++ b/redhat/rdma-core.spec
@@ -170,6 +170,7 @@ librdmacm provides a userspace RDMA Communication Managment API.
 
 %package -n librdmacm-utils
 Summary: Examples for the librdmacm library
+Requires: librdmacm%{?_isa} = %{version}-%{release}
 
 %description -n librdmacm-utils
 Example test programs for the librdmacm library.
-- 
2.10.0

--
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: rdma-core example spec file is broken
From: Jason Gunthorpe @ 2016-11-07 16:44 UTC (permalink / raw)
  To: Alaa Hleihel
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, leonro-VPRAkNaXOzVWk0Htik3J/w,
	yishaih-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <0e831337-e404-8973-b7fe-e176b3d688e8-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On Sun, Nov 06, 2016 at 02:01:20PM +0200, Alaa Hleihel wrote:
> 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..

Ah, interesting, in my test scripts the common spec file is
superceeded by the version in redhat/ for systemd systems, which is
why I did not notice it.

Jason

>From f2388d9d110ab43295d50d7345d5dda289a87a41 Mon Sep 17 00:00:00 2001
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
Date: Mon, 7 Nov 2016 09:37:38 -0700
Subject: [PATCH] Fix common rdma-core.spec for systemd systems

RPM needs the Requires lines for systemd to be earlier.

Signed-off-by: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
---
 rdma-core.spec | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/rdma-core.spec b/rdma-core.spec
index 35186c3271b8..bea2a2267d1d 100644
--- a/rdma-core.spec
+++ b/rdma-core.spec
@@ -46,6 +46,13 @@ BuildRequires: make
 %endif
 %endif
 
+# Detect if systemd is supported on this system
+%if 0%{?_unitdir:1}
+Requires(post): systemd-units
+Requires(preun): systemd-units
+Requires(postun): systemd-units
+%endif
+
 %description
 Temporary packaging
 
@@ -59,9 +66,6 @@ This is a simple example without the split sub packages to get things started.
 # Detect if systemd is supported on this system
 %if 0%{?_unitdir:1}
 %define my_unitdir %{_unitdir}
-Requires(post): systemd-units
-Requires(preun): systemd-units
-Requires(postun): systemd-units
 %else
 %define my_unitdir /tmp/
 %endif
-- 
2.1.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

* Re: [PATCH rdma-rc 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing
From: jackm @ 2016-11-07 14:42 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: Leon Romanovsky, dledford-H+wXaHxf7aLQT0dZR+AlfA,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA, Daniel Jurgens,
	Leon Romanovsky
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:

> 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

PLEASE DO NOT APPLY THIS PATCH. Hal is correct, and the patch needs
to be fixed. We will submit an updated (i.e. fixed) 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: [PATCH for-next 01/11] IB/hns: Add the interface for querying QP1
From: Salil Mehta @ 2016-11-07 11:45 UTC (permalink / raw)
  To: Anurup m, dledford@redhat.com
  Cc: linux-rdma@vger.kernel.org, netdev@vger.kernel.org,
	mehta.salil.lnk@gmail.com, linux-kernel@vger.kernel.org, Linuxarm
In-Reply-To: <582014FF.3070600@huawei.com>



> -----Original Message-----
> From: Anurup m
> Sent: Monday, November 07, 2016 5:46 AM
> To: Salil Mehta; dledford@redhat.com
> Cc: linux-rdma@vger.kernel.org; netdev@vger.kernel.org;
> mehta.salil.lnk@gmail.com; linux-kernel@vger.kernel.org; Linuxarm
> Subject: Re: [PATCH for-next 01/11] IB/hns: Add the interface for
> querying QP1
> 
> 
> 
> On 11/4/2016 10:06 PM, Salil Mehta wrote:
> > From: Lijun Ou <oulijun@huawei.com>
> >
> > In old code, It only added the interface for querying non-specific
> > QP. This patch mainly adds an interface for querying QP1.
> >
> > Signed-off-by: Lijun Ou <oulijun@huawei.com>
> > Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> > Signed-off-by: Salil Mehta  <salil.mehta@huawei.com>
> > ---
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |   87
> +++++++++++++++++++++++++++-
> >  drivers/infiniband/hw/hns/hns_roce_hw_v1.h |    6 +-
> >  2 files changed, 90 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > index 71232e5..ca8b784 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> > @@ -2630,8 +2630,82 @@ static int hns_roce_v1_query_qpc(struct
> hns_roce_dev *hr_dev,
> >  	return ret;
> >  }
> >
> > -int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr
> *qp_attr,
> > -			 int qp_attr_mask, struct ib_qp_init_attr
> *qp_init_attr)
> > +static int hns_roce_v1_q_sqp(struct ib_qp *ibqp, struct ib_qp_attr
> *qp_attr,
> > +			     int qp_attr_mask,
> > +			     struct ib_qp_init_attr *qp_init_attr)
> > +{
> > +	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
> > +	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
> > +	struct hns_roce_sqp_context *context;
> > +	u32 addr;
> > +
> > +	context = kzalloc(sizeof(*context), GFP_KERNEL);
> > +	if (!context)
> > +		return -ENOMEM;
> > +
> Do we really need dynamic alloc here as the size is fixed and this
> memory scope is
> only inside this function. I think better to use a static allocation.
Agreed. Somehow missed this in the internal review. Will change!

Thanks
Salil
> 
> > +	mutex_lock(&hr_qp->mutex);
> > +
> > +	if (hr_qp->state == IB_QPS_RESET) {
> I think alloc can be moved after this check (if dynamic alloc is really
> needed).
> > +		qp_attr->qp_state = IB_QPS_RESET;
> > +		goto done;
> > +	}
> > +
> > +	addr = ROCEE_QP1C_CFG0_0_REG + hr_qp->port * sizeof(*context);
> > +	context->qp1c_bytes_4 = roce_read(hr_dev, addr);
> > +	context->sq_rq_bt_l = roce_read(hr_dev, addr + 1);
> > +	context->qp1c_bytes_12 = roce_read(hr_dev, addr + 2);
> > +	context->qp1c_bytes_16 = roce_read(hr_dev, addr + 3);
> > +	context->qp1c_bytes_20 = roce_read(hr_dev, addr + 4);
> > +	context->cur_rq_wqe_ba_l = roce_read(hr_dev, addr + 5);
> > +	context->qp1c_bytes_28 = roce_read(hr_dev, addr + 6);
> > +	context->qp1c_bytes_32 = roce_read(hr_dev, addr + 7);
> > +	context->cur_sq_wqe_ba_l = roce_read(hr_dev, addr + 8);
> > +	context->qp1c_bytes_40 = roce_read(hr_dev, addr + 9);
> > +
> > +	hr_qp->state = roce_get_field(context->qp1c_bytes_4,
> > +				      QP1C_BYTES_4_QP_STATE_M,
> > +				      QP1C_BYTES_4_QP_STATE_S);
> > +	qp_attr->qp_state	= hr_qp->state;
> > +	qp_attr->path_mtu	= IB_MTU_256;
> > +	qp_attr->path_mig_state	= IB_MIG_ARMED;
> > +	qp_attr->qkey		= QKEY_VAL;
> > +	qp_attr->rq_psn		= 0;
> > +	qp_attr->sq_psn		= 0;
> > +	qp_attr->dest_qp_num	= 1;
> > +	qp_attr->qp_access_flags = 6;
> > +
> > +	qp_attr->pkey_index = roce_get_field(context->qp1c_bytes_20,
> > +					     QP1C_BYTES_20_PKEY_IDX_M,
> > +					     QP1C_BYTES_20_PKEY_IDX_S);
> > +	qp_attr->port_num = hr_qp->port + 1;
> > +	qp_attr->sq_draining = 0;
> > +	qp_attr->max_rd_atomic = 0;
> > +	qp_attr->max_dest_rd_atomic = 0;
> > +	qp_attr->min_rnr_timer = 0;
> > +	qp_attr->timeout = 0;
> > +	qp_attr->retry_cnt = 0;
> > +	qp_attr->rnr_retry = 0;
> > +	qp_attr->alt_timeout = 0;
> > +
> > +done:
> > +	qp_attr->cur_qp_state = qp_attr->qp_state;
> > +	qp_attr->cap.max_recv_wr = hr_qp->rq.wqe_cnt;
> > +	qp_attr->cap.max_recv_sge = hr_qp->rq.max_gs;
> > +	qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
> > +	qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;
> > +	qp_attr->cap.max_inline_data = 0;
> > +	qp_init_attr->cap = qp_attr->cap;
> > +	qp_init_attr->create_flags = 0;
> > +
> > +	mutex_unlock(&hr_qp->mutex);
> > +	kfree(context);
> > +
> > +	return 0;
> > +}
> > +
> > +static int hns_roce_v1_q_qp(struct ib_qp *ibqp, struct ib_qp_attr
> *qp_attr,
> > +			    int qp_attr_mask,
> > +			    struct ib_qp_init_attr *qp_init_attr)
> >  {
> >  	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
> >  	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
> > @@ -2767,6 +2841,15 @@ int hns_roce_v1_query_qp(struct ib_qp *ibqp,
> struct ib_qp_attr *qp_attr,
> >  	return ret;
> >  }
> >
> > +int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr
> *qp_attr,
> > +			 int qp_attr_mask, struct ib_qp_init_attr
> *qp_init_attr)
> > +{
> > +	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
> > +
> > +	return hr_qp->doorbell_qpn <= 1 ?
> > +		hns_roce_v1_q_sqp(ibqp, qp_attr, qp_attr_mask,
> qp_init_attr) :
> > +		hns_roce_v1_q_qp(ibqp, qp_attr, qp_attr_mask,
> qp_init_attr);
> > +}
> >  static void hns_roce_v1_destroy_qp_common(struct hns_roce_dev
> *hr_dev,
> >  					  struct hns_roce_qp *hr_qp,
> >  					  int is_user)
> > diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> > index 539b0a3b..2e1878b 100644
> > --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> > +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> > @@ -480,13 +480,17 @@ struct hns_roce_sqp_context {
> >  	u32 qp1c_bytes_12;
> >  	u32 qp1c_bytes_16;
> >  	u32 qp1c_bytes_20;
> > -	u32 qp1c_bytes_28;
> >  	u32 cur_rq_wqe_ba_l;
> > +	u32 qp1c_bytes_28;
> >  	u32 qp1c_bytes_32;
> >  	u32 cur_sq_wqe_ba_l;
> >  	u32 qp1c_bytes_40;
> >  };
> >
> > +#define QP1C_BYTES_4_QP_STATE_S 0
> > +#define QP1C_BYTES_4_QP_STATE_M   \
> > +	(((1UL << 3) - 1) << QP1C_BYTES_4_QP_STATE_S)
> > +
> >  #define QP1C_BYTES_4_SQ_WQE_SHIFT_S 8
> >  #define QP1C_BYTES_4_SQ_WQE_SHIFT_M   \
> >  	(((1UL << 4) - 1) << QP1C_BYTES_4_SQ_WQE_SHIFT_S)
> >

^ permalink raw reply

* Re: [PATCH 1/2] mm: add locked parameter to get_user_pages()
From: Lorenzo Stoakes @ 2016-11-07 11:00 UTC (permalink / raw)
  To: Jesper Nilsson
  Cc: devel, Rik van Riel, linux-ia64, linux-cris-kernel, kvm,
	linux-rdma, Linus Torvalds, Dave Hansen, Hugh Dickins,
	linux-kernel, dri-devel, Michal Hocko, linux-mm, Paolo Bonzini,
	Jan Kara, Andrew Morton, Mel Gorman, linux-media
In-Reply-To: <20161107104918.GQ30704@axis.com>

On Mon, Nov 07, 2016 at 11:49:18AM +0100, Jesper Nilsson wrote:
> For the cris-part:
> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

Thanks very much for that, however just to avoid any confusion, I realised this
series was not not the right way forward after discussion with Paolo and rather
it makes more sense to keep the API as it is and to update callers where it
makes sense to.

^ permalink raw reply

* Re: [PATCH 1/2] mm: add locked parameter to get_user_pages()
From: Jesper Nilsson @ 2016-11-07 10:49 UTC (permalink / raw)
  To: Lorenzo Stoakes
  Cc: devel, Rik van Riel, linux-ia64, linux-cris-kernel, kvm,
	linux-rdma, Linus Torvalds, Dave Hansen, Hugh Dickins,
	linux-kernel, dri-devel, Michal Hocko, linux-mm, Paolo Bonzini,
	Jan Kara, Andrew Morton, Mel Gorman, linux-media
In-Reply-To: <20161031100228.17917-2-lstoakes@gmail.com>

On Mon, Oct 31, 2016 at 10:02:27AM +0000, Lorenzo Stoakes wrote:
> This patch adds an int *locked parameter to get_user_pages() to allow
> VM_FAULT_RETRY faulting behaviour similar to get_user_pages_[un]locked().
> 
> It additionally clears the way for get_user_pages_locked() to be removed as its
> sole remaining useful characteristic was to allow for VM_FAULT_RETRY behaviour
> when faulting in pages.
> 
> It should not introduce any functional changes, however it does allow for
> subsequent changes to get_user_pages() callers to take advantage of
> VM_FAULT_RETRY.

For the cris-part:
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>

/^JN - Jesper Nilsson
-- 
               Jesper Nilsson -- jesper.nilsson@axis.com

^ permalink raw reply

* Re: [PATCH for-next 10/11] IB/hns: Implement the add_gid/del_gid and optimize the GIDs management
From: Shaobo Xu @ 2016-11-07 10:04 UTC (permalink / raw)
  To: Anurup M, Salil Mehta, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linuxarm-hv44wF8Li93QT0dZR+AlfA
In-Reply-To: <58203884.6040808-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>



On 2016/11/7 16:17, Anurup M wrote:
> 
> 
> On 11/4/2016 10:06 PM, Salil Mehta wrote:
>> From: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>>
>> IB core has implemented the calculation of GIDs and the management
>> of GID tables, and it is now responsible to supply query function
>> for GIDs. So the calculation of GIDs and the management of GID
>> tables in the RoCE driver is redundant.
>>
>> The patch is to implement the add_gid/del_gid to set the GIDs in
>> the RoCE driver, remove the redundant calculation and management of
>> GIDs in the notifier call of the net device and the inet, and
>> update the query_gid.
>>
>> Signed-off-by: Shaobo Xu <xushaobo2-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> Reviewed-by: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> Signed-off-by: Salil Mehta  <salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
>> ---
>>  drivers/infiniband/hw/hns/hns_roce_device.h |    2 -
>>  drivers/infiniband/hw/hns/hns_roce_main.c   |  270 +++++----------------------
>>  2 files changed, 48 insertions(+), 224 deletions(-)
>>
>> diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
>> index 593a42a..9ef1cc3 100644
>> --- a/drivers/infiniband/hw/hns/hns_roce_device.h
>> +++ b/drivers/infiniband/hw/hns/hns_roce_device.h
>> @@ -429,8 +429,6 @@ struct hns_roce_ib_iboe {
>>  	struct net_device      *netdevs[HNS_ROCE_MAX_PORTS];
>>  	struct notifier_block	nb;
>>  	struct notifier_block	nb_inet;
>> -	/* 16 GID is shared by 6 port in v1 engine. */
>> -	union ib_gid		gid_table[HNS_ROCE_MAX_GID_NUM];
>>  	u8			phy_port[HNS_ROCE_MAX_PORTS];
>>  };
>>  
>> diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
>> index 6770171..795ef97 100644
>> --- a/drivers/infiniband/hw/hns/hns_roce_main.c
>> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
>> @@ -35,52 +35,13 @@
>>  #include <rdma/ib_addr.h>
>>  #include <rdma/ib_smi.h>
>>  #include <rdma/ib_user_verbs.h>
>> +#include <rdma/ib_cache.h>
>>  #include "hns_roce_common.h"
>>  #include "hns_roce_device.h"
>>  #include "hns_roce_user.h"
>>  #include "hns_roce_hem.h"
>>  
>>  /**
>> - * hns_roce_addrconf_ifid_eui48 - Get default gid.
>> - * @eui: eui.
>> - * @vlan_id:  gid
>> - * @dev:  net device
>> - * Description:
>> - *    MAC convert to GID
>> - *        gid[0..7] = fe80 0000 0000 0000
>> - *        gid[8] = mac[0] ^ 2
>> - *        gid[9] = mac[1]
>> - *        gid[10] = mac[2]
>> - *        gid[11] = ff        (VLAN ID high byte (4 MS bits))
>> - *        gid[12] = fe        (VLAN ID low byte)
>> - *        gid[13] = mac[3]
>> - *        gid[14] = mac[4]
>> - *        gid[15] = mac[5]
>> - */
>> -static void hns_roce_addrconf_ifid_eui48(u8 *eui, u16 vlan_id,
>> -					 struct net_device *dev)
>> -{
>> -	memcpy(eui, dev->dev_addr, 3);
>> -	memcpy(eui + 5, dev->dev_addr + 3, 3);
>> -	if (vlan_id < 0x1000) {
>> -		eui[3] = vlan_id >> 8;
>> -		eui[4] = vlan_id & 0xff;
>> -	} else {
>> -		eui[3] = 0xff;
>> -		eui[4] = 0xfe;
>> -	}
>> -	eui[0] ^= 2;
>> -}
>> -
>> -static void hns_roce_make_default_gid(struct net_device *dev, union ib_gid *gid)
>> -{
>> -	memset(gid, 0, sizeof(*gid));
>> -	gid->raw[0] = 0xFE;
>> -	gid->raw[1] = 0x80;
>> -	hns_roce_addrconf_ifid_eui48(&gid->raw[8], 0xffff, dev);
>> -}
>> -
>> -/**
>>   * hns_get_gid_index - Get gid index.
>>   * @hr_dev: pointer to structure hns_roce_dev.
>>   * @port:  port, value range: 0 ~ MAX
>> @@ -96,30 +57,6 @@ int hns_get_gid_index(struct hns_roce_dev *hr_dev, u8 port, int gid_index)
>>  	return gid_index * hr_dev->caps.num_ports + port;
>>  }
>>  
>> -static int hns_roce_set_gid(struct hns_roce_dev *hr_dev, u8 port, int gid_index,
>> -		     union ib_gid *gid)
>> -{
>> -	struct device *dev = &hr_dev->pdev->dev;
>> -	u8 gid_idx = 0;
>> -
>> -	if (gid_index >= hr_dev->caps.gid_table_len[port]) {
>> -		dev_err(dev, "gid_index %d illegal, port %d gid range: 0~%d\n",
>> -			gid_index, port, hr_dev->caps.gid_table_len[port] - 1);
>> -		return -EINVAL;
>> -	}
>> -
>> -	gid_idx = hns_get_gid_index(hr_dev, port, gid_index);
>> -
>> -	if (!memcmp(gid, &hr_dev->iboe.gid_table[gid_idx], sizeof(*gid)))
>> -		return -EINVAL;
>> -
>> -	memcpy(&hr_dev->iboe.gid_table[gid_idx], gid, sizeof(*gid));
>> -
>> -	hr_dev->hw->set_gid(hr_dev, port, gid_index, gid);
>> -
>> -	return 0;
>> -}
>> -
>>  static void hns_roce_set_mac(struct hns_roce_dev *hr_dev, u8 port, u8 *addr)
>>  {
>>  	u8 phy_port;
>> @@ -147,15 +84,44 @@ static void hns_roce_set_mtu(struct hns_roce_dev *hr_dev, u8 port, int mtu)
>>  	hr_dev->hw->set_mtu(hr_dev, phy_port, tmp);
>>  }
>>  
>> -static void hns_roce_update_gids(struct hns_roce_dev *hr_dev, int port)
>> +static int hns_roce_add_gid(struct ib_device *device, u8 port_num,
>> +			    unsigned int index, const union ib_gid *gid,
>> +			    const struct ib_gid_attr *attr, void **context)
>> +{
>> +	struct hns_roce_dev *hr_dev = to_hr_dev(device);
>> +	u8 port = port_num - 1;
>> +	unsigned long flags;
>> +
>> +	if (port >= hr_dev->caps.num_ports)
>> +		return -EINVAL;
>> +
>> +	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
>> +
>> +	hr_dev->hw->set_gid(hr_dev, port, index, (union ib_gid *)gid);
>> +
>> +	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
>> +
>> +	return 0;
>> +}
>> +
>> +static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
>> +			    unsigned int index, void **context)
>>  {
>> -	struct ib_event event;
>> +	struct hns_roce_dev *hr_dev = to_hr_dev(device);
>> +	union ib_gid zgid = { {0} };
>> +	u8 port = port_num - 1;
>> +	unsigned long flags;
>> +
>> +	if (port >= hr_dev->caps.num_ports)
>> +		return -EINVAL;
>>  
>> -	/* Refresh gid in ib_cache */
>> -	event.device = &hr_dev->ib_dev;
>> -	event.element.port_num = port + 1;
>> -	event.event = IB_EVENT_GID_CHANGE;
>> -	ib_dispatch_event(&event);
>> +	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
>> +
>> +	hr_dev->hw->set_gid(hr_dev, port, index, &zgid);
> zgid has value zero. and after this call, where is zgid used?
While deleting the GIDs of the specified port, it needs to set zgid to the port GID configure register,
which means no GID to this port.

Best Regards,
>> +
>> +	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
>> +
>> +	return 0;
>>  }
>>  
>>  static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>> @@ -164,8 +130,6 @@ static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>>  	struct device *dev = &hr_dev->pdev->dev;
>>  	struct net_device *netdev;
>>  	unsigned long flags;
>> -	union ib_gid gid;
>> -	int ret = 0;
>>  
>>  	netdev = hr_dev->iboe.netdevs[port];
>>  	if (!netdev) {
>> @@ -181,10 +145,6 @@ static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>>  	case NETDEV_REGISTER:
>>  	case NETDEV_CHANGEADDR:
>>  		hns_roce_set_mac(hr_dev, port, netdev->dev_addr);
>> -		hns_roce_make_default_gid(netdev, &gid);
>> -		ret = hns_roce_set_gid(hr_dev, port, 0, &gid);
>> -		if (!ret)
>> -			hns_roce_update_gids(hr_dev, port);
>>  		break;
>>  	case NETDEV_DOWN:
>>  		/*
>> @@ -197,7 +157,7 @@ static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>>  	}
>>  
>>  	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  static int hns_roce_netdev_event(struct notifier_block *self,
>> @@ -224,118 +184,17 @@ static int hns_roce_netdev_event(struct notifier_block *self,
>>  	return NOTIFY_DONE;
>>  }
>>  
>> -static void hns_roce_addr_event(int event, struct net_device *event_netdev,
>> -				struct hns_roce_dev *hr_dev, union ib_gid *gid)
>> -{
>> -	struct hns_roce_ib_iboe *iboe = NULL;
>> -	int gid_table_len = 0;
>> -	unsigned long flags;
>> -	union ib_gid zgid;
>> -	u8 gid_idx = 0;
>> -	u8 port = 0;
>> -	int i = 0;
>> -	int free;
>> -	struct net_device *real_dev = rdma_vlan_dev_real_dev(event_netdev) ?
>> -				      rdma_vlan_dev_real_dev(event_netdev) :
>> -				      event_netdev;
>> -
>> -	if (event != NETDEV_UP && event != NETDEV_DOWN)
>> -		return;
>> -
>> -	iboe = &hr_dev->iboe;
>> -	while (port < hr_dev->caps.num_ports) {
>> -		if (real_dev == iboe->netdevs[port])
>> -			break;
>> -		port++;
>> -	}
>> -
>> -	if (port >= hr_dev->caps.num_ports) {
>> -		dev_dbg(&hr_dev->pdev->dev, "can't find netdev\n");
>> -		return;
>> -	}
>> -
>> -	memset(zgid.raw, 0, sizeof(zgid.raw));
>> -	free = -1;
>> -	gid_table_len = hr_dev->caps.gid_table_len[port];
>> -
>> -	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
>> -
>> -	for (i = 0; i < gid_table_len; i++) {
>> -		gid_idx = hns_get_gid_index(hr_dev, port, i);
>> -		if (!memcmp(gid->raw, iboe->gid_table[gid_idx].raw,
>> -			    sizeof(gid->raw)))
>> -			break;
>> -		if (free < 0 && !memcmp(zgid.raw,
>> -			iboe->gid_table[gid_idx].raw, sizeof(zgid.raw)))
>> -			free = i;
>> -	}
>> -
>> -	if (i >= gid_table_len) {
>> -		if (free < 0) {
>> -			spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
>> -			dev_dbg(&hr_dev->pdev->dev,
>> -				"gid_index overflow, port(%d)\n", port);
>> -			return;
>> -		}
>> -		if (!hns_roce_set_gid(hr_dev, port, free, gid))
>> -			hns_roce_update_gids(hr_dev, port);
>> -	} else if (event == NETDEV_DOWN) {
>> -		if (!hns_roce_set_gid(hr_dev, port, i, &zgid))
>> -			hns_roce_update_gids(hr_dev, port);
>> -	}
>> -
>> -	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
>> -}
>> -
>> -static int hns_roce_inet_event(struct notifier_block *self, unsigned long event,
>> -			       void *ptr)
>> -{
>> -	struct in_ifaddr *ifa = ptr;
>> -	struct hns_roce_dev *hr_dev;
>> -	struct net_device *dev = ifa->ifa_dev->dev;
>> -	union ib_gid gid;
>> -
>> -	ipv6_addr_set_v4mapped(ifa->ifa_address, (struct in6_addr *)&gid);
>> -
>> -	hr_dev = container_of(self, struct hns_roce_dev, iboe.nb_inet);
>> -
>> -	hns_roce_addr_event(event, dev, hr_dev, &gid);
>> -
>> -	return NOTIFY_DONE;
>> -}
>> -
>> -static int hns_roce_setup_mtu_gids(struct hns_roce_dev *hr_dev)
>> +static int hns_roce_setup_mtu_mac(struct hns_roce_dev *hr_dev)
>>  {
>> -	struct in_ifaddr *ifa_list = NULL;
>> -	union ib_gid gid = {{0} };
>> -	u32 ipaddr = 0;
>> -	int index = 0;
>> -	int ret = 0;
>> -	u8 i = 0;
>> +	u8 i;
>>  
>>  	for (i = 0; i < hr_dev->caps.num_ports; i++) {
>>  		hns_roce_set_mtu(hr_dev, i,
>>  				 ib_mtu_enum_to_int(hr_dev->caps.max_mtu));
>>  		hns_roce_set_mac(hr_dev, i, hr_dev->iboe.netdevs[i]->dev_addr);
>> -
>> -		if (hr_dev->iboe.netdevs[i]->ip_ptr) {
>> -			ifa_list = hr_dev->iboe.netdevs[i]->ip_ptr->ifa_list;
>> -			index = 1;
>> -			while (ifa_list) {
>> -				ipaddr = ifa_list->ifa_address;
>> -				ipv6_addr_set_v4mapped(ipaddr,
>> -						       (struct in6_addr *)&gid);
>> -				ret = hns_roce_set_gid(hr_dev, i, index, &gid);
>> -				if (ret)
>> -					break;
>> -				index++;
>> -				ifa_list = ifa_list->ifa_next;
>> -			}
>> -			hns_roce_update_gids(hr_dev, i);
>> -		}
>>  	}
>>  
>> -	return ret;
>> +	return 0;
>>  }
>>  
>>  static int hns_roce_query_device(struct ib_device *ib_dev,
>> @@ -444,31 +303,6 @@ static enum rdma_link_layer hns_roce_get_link_layer(struct ib_device *device,
>>  static int hns_roce_query_gid(struct ib_device *ib_dev, u8 port_num, int index,
>>  			      union ib_gid *gid)
>>  {
>> -	struct hns_roce_dev *hr_dev = to_hr_dev(ib_dev);
>> -	struct device *dev = &hr_dev->pdev->dev;
>> -	u8 gid_idx = 0;
>> -	u8 port;
>> -
>> -	if (port_num < 1 || port_num > hr_dev->caps.num_ports ||
>> -	    index >= hr_dev->caps.gid_table_len[port_num - 1]) {
>> -		dev_err(dev,
>> -			"port_num %d index %d illegal! correct range: port_num 1~%d index 0~%d!\n",
>> -			port_num, index, hr_dev->caps.num_ports,
>> -			hr_dev->caps.gid_table_len[port_num - 1] - 1);
>> -		return -EINVAL;
>> -	}
>> -
>> -	port = port_num - 1;
>> -	gid_idx = hns_get_gid_index(hr_dev, port, index);
>> -	if (gid_idx >= HNS_ROCE_MAX_GID_NUM) {
>> -		dev_err(dev, "port_num %d index %d illegal! total gid num %d!\n",
>> -			port_num, index, HNS_ROCE_MAX_GID_NUM);
>> -		return -EINVAL;
>> -	}
>> -
>> -	memcpy(gid->raw, hr_dev->iboe.gid_table[gid_idx].raw,
>> -	       HNS_ROCE_GID_SIZE);
>> -
>>  	return 0;
>>  }
>>  
>> @@ -646,6 +480,8 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
>>  	ib_dev->get_link_layer		= hns_roce_get_link_layer;
>>  	ib_dev->get_netdev		= hns_roce_get_netdev;
>>  	ib_dev->query_gid		= hns_roce_query_gid;
>> +	ib_dev->add_gid			= hns_roce_add_gid;
>> +	ib_dev->del_gid			= hns_roce_del_gid;
>>  	ib_dev->query_pkey		= hns_roce_query_pkey;
>>  	ib_dev->alloc_ucontext		= hns_roce_alloc_ucontext;
>>  	ib_dev->dealloc_ucontext	= hns_roce_dealloc_ucontext;
>> @@ -688,32 +524,22 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
>>  		return ret;
>>  	}
>>  
>> -	ret = hns_roce_setup_mtu_gids(hr_dev);
>> +	ret = hns_roce_setup_mtu_mac(hr_dev);
>>  	if (ret) {
>> -		dev_err(dev, "roce_setup_mtu_gids failed!\n");
>> -		goto error_failed_setup_mtu_gids;
>> +		dev_err(dev, "setup_mtu_mac failed!\n");
>> +		goto error_failed_setup_mtu_mac;
>>  	}
>>  
>>  	iboe->nb.notifier_call = hns_roce_netdev_event;
>>  	ret = register_netdevice_notifier(&iboe->nb);
>>  	if (ret) {
>>  		dev_err(dev, "register_netdevice_notifier failed!\n");
>> -		goto error_failed_setup_mtu_gids;
>> -	}
>> -
>> -	iboe->nb_inet.notifier_call = hns_roce_inet_event;
>> -	ret = register_inetaddr_notifier(&iboe->nb_inet);
>> -	if (ret) {
>> -		dev_err(dev, "register inet addr notifier failed!\n");
>> -		goto error_failed_register_inetaddr_notifier;
>> +		goto error_failed_setup_mtu_mac;
>>  	}
>>  
>>  	return 0;
>>  
>> -error_failed_register_inetaddr_notifier:
>> -	unregister_netdevice_notifier(&iboe->nb);
>> -
>> -error_failed_setup_mtu_gids:
>> +error_failed_setup_mtu_mac:
>>  	ib_unregister_device(ib_dev);
>>  
>>  	return ret;
>>
> 
> _______________________________________________
> linuxarm mailing list
> linuxarm-hv44wF8Li93QT0dZR+AlfA@public.gmane.org
> http://rnd-openeuler.huawei.com/mailman/listinfo/linuxarm
> 
> .
> 

--
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 for-next 10/11] IB/hns: Implement the add_gid/del_gid and optimize the GIDs management
From: Anurup M @ 2016-11-07  8:17 UTC (permalink / raw)
  To: Salil Mehta, dledford
  Cc: linux-rdma, netdev, mehta.salil.lnk, linux-kernel, linuxarm
In-Reply-To: <20161104163633.141880-11-salil.mehta@huawei.com>



On 11/4/2016 10:06 PM, Salil Mehta wrote:
> From: Shaobo Xu <xushaobo2@huawei.com>
> 
> IB core has implemented the calculation of GIDs and the management
> of GID tables, and it is now responsible to supply query function
> for GIDs. So the calculation of GIDs and the management of GID
> tables in the RoCE driver is redundant.
> 
> The patch is to implement the add_gid/del_gid to set the GIDs in
> the RoCE driver, remove the redundant calculation and management of
> GIDs in the notifier call of the net device and the inet, and
> update the query_gid.
> 
> Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
> Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
> Signed-off-by: Salil Mehta  <salil.mehta@huawei.com>
> ---
>  drivers/infiniband/hw/hns/hns_roce_device.h |    2 -
>  drivers/infiniband/hw/hns/hns_roce_main.c   |  270 +++++----------------------
>  2 files changed, 48 insertions(+), 224 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_device.h b/drivers/infiniband/hw/hns/hns_roce_device.h
> index 593a42a..9ef1cc3 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_device.h
> +++ b/drivers/infiniband/hw/hns/hns_roce_device.h
> @@ -429,8 +429,6 @@ struct hns_roce_ib_iboe {
>  	struct net_device      *netdevs[HNS_ROCE_MAX_PORTS];
>  	struct notifier_block	nb;
>  	struct notifier_block	nb_inet;
> -	/* 16 GID is shared by 6 port in v1 engine. */
> -	union ib_gid		gid_table[HNS_ROCE_MAX_GID_NUM];
>  	u8			phy_port[HNS_ROCE_MAX_PORTS];
>  };
>  
> diff --git a/drivers/infiniband/hw/hns/hns_roce_main.c b/drivers/infiniband/hw/hns/hns_roce_main.c
> index 6770171..795ef97 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_main.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_main.c
> @@ -35,52 +35,13 @@
>  #include <rdma/ib_addr.h>
>  #include <rdma/ib_smi.h>
>  #include <rdma/ib_user_verbs.h>
> +#include <rdma/ib_cache.h>
>  #include "hns_roce_common.h"
>  #include "hns_roce_device.h"
>  #include "hns_roce_user.h"
>  #include "hns_roce_hem.h"
>  
>  /**
> - * hns_roce_addrconf_ifid_eui48 - Get default gid.
> - * @eui: eui.
> - * @vlan_id:  gid
> - * @dev:  net device
> - * Description:
> - *    MAC convert to GID
> - *        gid[0..7] = fe80 0000 0000 0000
> - *        gid[8] = mac[0] ^ 2
> - *        gid[9] = mac[1]
> - *        gid[10] = mac[2]
> - *        gid[11] = ff        (VLAN ID high byte (4 MS bits))
> - *        gid[12] = fe        (VLAN ID low byte)
> - *        gid[13] = mac[3]
> - *        gid[14] = mac[4]
> - *        gid[15] = mac[5]
> - */
> -static void hns_roce_addrconf_ifid_eui48(u8 *eui, u16 vlan_id,
> -					 struct net_device *dev)
> -{
> -	memcpy(eui, dev->dev_addr, 3);
> -	memcpy(eui + 5, dev->dev_addr + 3, 3);
> -	if (vlan_id < 0x1000) {
> -		eui[3] = vlan_id >> 8;
> -		eui[4] = vlan_id & 0xff;
> -	} else {
> -		eui[3] = 0xff;
> -		eui[4] = 0xfe;
> -	}
> -	eui[0] ^= 2;
> -}
> -
> -static void hns_roce_make_default_gid(struct net_device *dev, union ib_gid *gid)
> -{
> -	memset(gid, 0, sizeof(*gid));
> -	gid->raw[0] = 0xFE;
> -	gid->raw[1] = 0x80;
> -	hns_roce_addrconf_ifid_eui48(&gid->raw[8], 0xffff, dev);
> -}
> -
> -/**
>   * hns_get_gid_index - Get gid index.
>   * @hr_dev: pointer to structure hns_roce_dev.
>   * @port:  port, value range: 0 ~ MAX
> @@ -96,30 +57,6 @@ int hns_get_gid_index(struct hns_roce_dev *hr_dev, u8 port, int gid_index)
>  	return gid_index * hr_dev->caps.num_ports + port;
>  }
>  
> -static int hns_roce_set_gid(struct hns_roce_dev *hr_dev, u8 port, int gid_index,
> -		     union ib_gid *gid)
> -{
> -	struct device *dev = &hr_dev->pdev->dev;
> -	u8 gid_idx = 0;
> -
> -	if (gid_index >= hr_dev->caps.gid_table_len[port]) {
> -		dev_err(dev, "gid_index %d illegal, port %d gid range: 0~%d\n",
> -			gid_index, port, hr_dev->caps.gid_table_len[port] - 1);
> -		return -EINVAL;
> -	}
> -
> -	gid_idx = hns_get_gid_index(hr_dev, port, gid_index);
> -
> -	if (!memcmp(gid, &hr_dev->iboe.gid_table[gid_idx], sizeof(*gid)))
> -		return -EINVAL;
> -
> -	memcpy(&hr_dev->iboe.gid_table[gid_idx], gid, sizeof(*gid));
> -
> -	hr_dev->hw->set_gid(hr_dev, port, gid_index, gid);
> -
> -	return 0;
> -}
> -
>  static void hns_roce_set_mac(struct hns_roce_dev *hr_dev, u8 port, u8 *addr)
>  {
>  	u8 phy_port;
> @@ -147,15 +84,44 @@ static void hns_roce_set_mtu(struct hns_roce_dev *hr_dev, u8 port, int mtu)
>  	hr_dev->hw->set_mtu(hr_dev, phy_port, tmp);
>  }
>  
> -static void hns_roce_update_gids(struct hns_roce_dev *hr_dev, int port)
> +static int hns_roce_add_gid(struct ib_device *device, u8 port_num,
> +			    unsigned int index, const union ib_gid *gid,
> +			    const struct ib_gid_attr *attr, void **context)
> +{
> +	struct hns_roce_dev *hr_dev = to_hr_dev(device);
> +	u8 port = port_num - 1;
> +	unsigned long flags;
> +
> +	if (port >= hr_dev->caps.num_ports)
> +		return -EINVAL;
> +
> +	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
> +
> +	hr_dev->hw->set_gid(hr_dev, port, index, (union ib_gid *)gid);
> +
> +	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
> +
> +	return 0;
> +}
> +
> +static int hns_roce_del_gid(struct ib_device *device, u8 port_num,
> +			    unsigned int index, void **context)
>  {
> -	struct ib_event event;
> +	struct hns_roce_dev *hr_dev = to_hr_dev(device);
> +	union ib_gid zgid = { {0} };
> +	u8 port = port_num - 1;
> +	unsigned long flags;
> +
> +	if (port >= hr_dev->caps.num_ports)
> +		return -EINVAL;
>  
> -	/* Refresh gid in ib_cache */
> -	event.device = &hr_dev->ib_dev;
> -	event.element.port_num = port + 1;
> -	event.event = IB_EVENT_GID_CHANGE;
> -	ib_dispatch_event(&event);
> +	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
> +
> +	hr_dev->hw->set_gid(hr_dev, port, index, &zgid);
zgid has value zero. and after this call, where is zgid used?
> +
> +	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
> +
> +	return 0;
>  }
>  
>  static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
> @@ -164,8 +130,6 @@ static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>  	struct device *dev = &hr_dev->pdev->dev;
>  	struct net_device *netdev;
>  	unsigned long flags;
> -	union ib_gid gid;
> -	int ret = 0;
>  
>  	netdev = hr_dev->iboe.netdevs[port];
>  	if (!netdev) {
> @@ -181,10 +145,6 @@ static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>  	case NETDEV_REGISTER:
>  	case NETDEV_CHANGEADDR:
>  		hns_roce_set_mac(hr_dev, port, netdev->dev_addr);
> -		hns_roce_make_default_gid(netdev, &gid);
> -		ret = hns_roce_set_gid(hr_dev, port, 0, &gid);
> -		if (!ret)
> -			hns_roce_update_gids(hr_dev, port);
>  		break;
>  	case NETDEV_DOWN:
>  		/*
> @@ -197,7 +157,7 @@ static int handle_en_event(struct hns_roce_dev *hr_dev, u8 port,
>  	}
>  
>  	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
> -	return ret;
> +	return 0;
>  }
>  
>  static int hns_roce_netdev_event(struct notifier_block *self,
> @@ -224,118 +184,17 @@ static int hns_roce_netdev_event(struct notifier_block *self,
>  	return NOTIFY_DONE;
>  }
>  
> -static void hns_roce_addr_event(int event, struct net_device *event_netdev,
> -				struct hns_roce_dev *hr_dev, union ib_gid *gid)
> -{
> -	struct hns_roce_ib_iboe *iboe = NULL;
> -	int gid_table_len = 0;
> -	unsigned long flags;
> -	union ib_gid zgid;
> -	u8 gid_idx = 0;
> -	u8 port = 0;
> -	int i = 0;
> -	int free;
> -	struct net_device *real_dev = rdma_vlan_dev_real_dev(event_netdev) ?
> -				      rdma_vlan_dev_real_dev(event_netdev) :
> -				      event_netdev;
> -
> -	if (event != NETDEV_UP && event != NETDEV_DOWN)
> -		return;
> -
> -	iboe = &hr_dev->iboe;
> -	while (port < hr_dev->caps.num_ports) {
> -		if (real_dev == iboe->netdevs[port])
> -			break;
> -		port++;
> -	}
> -
> -	if (port >= hr_dev->caps.num_ports) {
> -		dev_dbg(&hr_dev->pdev->dev, "can't find netdev\n");
> -		return;
> -	}
> -
> -	memset(zgid.raw, 0, sizeof(zgid.raw));
> -	free = -1;
> -	gid_table_len = hr_dev->caps.gid_table_len[port];
> -
> -	spin_lock_irqsave(&hr_dev->iboe.lock, flags);
> -
> -	for (i = 0; i < gid_table_len; i++) {
> -		gid_idx = hns_get_gid_index(hr_dev, port, i);
> -		if (!memcmp(gid->raw, iboe->gid_table[gid_idx].raw,
> -			    sizeof(gid->raw)))
> -			break;
> -		if (free < 0 && !memcmp(zgid.raw,
> -			iboe->gid_table[gid_idx].raw, sizeof(zgid.raw)))
> -			free = i;
> -	}
> -
> -	if (i >= gid_table_len) {
> -		if (free < 0) {
> -			spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
> -			dev_dbg(&hr_dev->pdev->dev,
> -				"gid_index overflow, port(%d)\n", port);
> -			return;
> -		}
> -		if (!hns_roce_set_gid(hr_dev, port, free, gid))
> -			hns_roce_update_gids(hr_dev, port);
> -	} else if (event == NETDEV_DOWN) {
> -		if (!hns_roce_set_gid(hr_dev, port, i, &zgid))
> -			hns_roce_update_gids(hr_dev, port);
> -	}
> -
> -	spin_unlock_irqrestore(&hr_dev->iboe.lock, flags);
> -}
> -
> -static int hns_roce_inet_event(struct notifier_block *self, unsigned long event,
> -			       void *ptr)
> -{
> -	struct in_ifaddr *ifa = ptr;
> -	struct hns_roce_dev *hr_dev;
> -	struct net_device *dev = ifa->ifa_dev->dev;
> -	union ib_gid gid;
> -
> -	ipv6_addr_set_v4mapped(ifa->ifa_address, (struct in6_addr *)&gid);
> -
> -	hr_dev = container_of(self, struct hns_roce_dev, iboe.nb_inet);
> -
> -	hns_roce_addr_event(event, dev, hr_dev, &gid);
> -
> -	return NOTIFY_DONE;
> -}
> -
> -static int hns_roce_setup_mtu_gids(struct hns_roce_dev *hr_dev)
> +static int hns_roce_setup_mtu_mac(struct hns_roce_dev *hr_dev)
>  {
> -	struct in_ifaddr *ifa_list = NULL;
> -	union ib_gid gid = {{0} };
> -	u32 ipaddr = 0;
> -	int index = 0;
> -	int ret = 0;
> -	u8 i = 0;
> +	u8 i;
>  
>  	for (i = 0; i < hr_dev->caps.num_ports; i++) {
>  		hns_roce_set_mtu(hr_dev, i,
>  				 ib_mtu_enum_to_int(hr_dev->caps.max_mtu));
>  		hns_roce_set_mac(hr_dev, i, hr_dev->iboe.netdevs[i]->dev_addr);
> -
> -		if (hr_dev->iboe.netdevs[i]->ip_ptr) {
> -			ifa_list = hr_dev->iboe.netdevs[i]->ip_ptr->ifa_list;
> -			index = 1;
> -			while (ifa_list) {
> -				ipaddr = ifa_list->ifa_address;
> -				ipv6_addr_set_v4mapped(ipaddr,
> -						       (struct in6_addr *)&gid);
> -				ret = hns_roce_set_gid(hr_dev, i, index, &gid);
> -				if (ret)
> -					break;
> -				index++;
> -				ifa_list = ifa_list->ifa_next;
> -			}
> -			hns_roce_update_gids(hr_dev, i);
> -		}
>  	}
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static int hns_roce_query_device(struct ib_device *ib_dev,
> @@ -444,31 +303,6 @@ static enum rdma_link_layer hns_roce_get_link_layer(struct ib_device *device,
>  static int hns_roce_query_gid(struct ib_device *ib_dev, u8 port_num, int index,
>  			      union ib_gid *gid)
>  {
> -	struct hns_roce_dev *hr_dev = to_hr_dev(ib_dev);
> -	struct device *dev = &hr_dev->pdev->dev;
> -	u8 gid_idx = 0;
> -	u8 port;
> -
> -	if (port_num < 1 || port_num > hr_dev->caps.num_ports ||
> -	    index >= hr_dev->caps.gid_table_len[port_num - 1]) {
> -		dev_err(dev,
> -			"port_num %d index %d illegal! correct range: port_num 1~%d index 0~%d!\n",
> -			port_num, index, hr_dev->caps.num_ports,
> -			hr_dev->caps.gid_table_len[port_num - 1] - 1);
> -		return -EINVAL;
> -	}
> -
> -	port = port_num - 1;
> -	gid_idx = hns_get_gid_index(hr_dev, port, index);
> -	if (gid_idx >= HNS_ROCE_MAX_GID_NUM) {
> -		dev_err(dev, "port_num %d index %d illegal! total gid num %d!\n",
> -			port_num, index, HNS_ROCE_MAX_GID_NUM);
> -		return -EINVAL;
> -	}
> -
> -	memcpy(gid->raw, hr_dev->iboe.gid_table[gid_idx].raw,
> -	       HNS_ROCE_GID_SIZE);
> -
>  	return 0;
>  }
>  
> @@ -646,6 +480,8 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
>  	ib_dev->get_link_layer		= hns_roce_get_link_layer;
>  	ib_dev->get_netdev		= hns_roce_get_netdev;
>  	ib_dev->query_gid		= hns_roce_query_gid;
> +	ib_dev->add_gid			= hns_roce_add_gid;
> +	ib_dev->del_gid			= hns_roce_del_gid;
>  	ib_dev->query_pkey		= hns_roce_query_pkey;
>  	ib_dev->alloc_ucontext		= hns_roce_alloc_ucontext;
>  	ib_dev->dealloc_ucontext	= hns_roce_dealloc_ucontext;
> @@ -688,32 +524,22 @@ static int hns_roce_register_device(struct hns_roce_dev *hr_dev)
>  		return ret;
>  	}
>  
> -	ret = hns_roce_setup_mtu_gids(hr_dev);
> +	ret = hns_roce_setup_mtu_mac(hr_dev);
>  	if (ret) {
> -		dev_err(dev, "roce_setup_mtu_gids failed!\n");
> -		goto error_failed_setup_mtu_gids;
> +		dev_err(dev, "setup_mtu_mac failed!\n");
> +		goto error_failed_setup_mtu_mac;
>  	}
>  
>  	iboe->nb.notifier_call = hns_roce_netdev_event;
>  	ret = register_netdevice_notifier(&iboe->nb);
>  	if (ret) {
>  		dev_err(dev, "register_netdevice_notifier failed!\n");
> -		goto error_failed_setup_mtu_gids;
> -	}
> -
> -	iboe->nb_inet.notifier_call = hns_roce_inet_event;
> -	ret = register_inetaddr_notifier(&iboe->nb_inet);
> -	if (ret) {
> -		dev_err(dev, "register inet addr notifier failed!\n");
> -		goto error_failed_register_inetaddr_notifier;
> +		goto error_failed_setup_mtu_mac;
>  	}
>  
>  	return 0;
>  
> -error_failed_register_inetaddr_notifier:
> -	unregister_netdevice_notifier(&iboe->nb);
> -
> -error_failed_setup_mtu_gids:
> +error_failed_setup_mtu_mac:
>  	ib_unregister_device(ib_dev);
>  
>  	return ret;
> 

^ permalink raw reply

* [RESEND REQEUST] consult with the libhns upstreaming into rdma-core
From: oulijun @ 2016-11-07  6:43 UTC (permalink / raw)
  To: Doug Ledford, linux-rdma; +Cc: Linuxarm

Hi Jason/Doug,
   Following your comments with I have fixed several issues.
   Thank you for pointing them out.
   Do I need to resend the PATCH v2 for libhns?

Lijun Ou

--
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 v4 10/10] IB/mlx5: Simplify completion into a wait_event
From: Binoy Jayan @ 2016-11-07  5:51 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Doug Ledford, Sean Hefty, Hal Rosenstock, Arnd Bergmann,
	linux-rdma@vger.kernel.org, Linux Kernel Mailing List
In-Reply-To: <CA+55aFxUA8r8_-yYtZfijWK_2WB+eCxMiHS-bVDN45-98V6Hdw@mail.gmail.com>

Hi Linus,

On 3 November 2016 at 21:07, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> This is wrong.

Will change it back.

> Since that "umr_context" variable is on the stack, and you are waiting
> for it to be fully done, it really should be a completion.

Thank you for sharing your insight with wait_event and completion.

-Binoy

^ permalink raw reply

* Re: [PATCH for-next 01/11] IB/hns: Add the interface for querying QP1
From: Anurup M @ 2016-11-07  5:45 UTC (permalink / raw)
  To: Salil Mehta, dledford-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	mehta.salil.lnk-Re5JQEeQqe8AvxtiuMwx3w,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linuxarm-hv44wF8Li93QT0dZR+AlfA
In-Reply-To: <20161104163633.141880-2-salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>



On 11/4/2016 10:06 PM, Salil Mehta wrote:
> From: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> 
> In old code, It only added the interface for querying non-specific
> QP. This patch mainly adds an interface for querying QP1.
> 
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Reviewed-by: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Salil Mehta  <salil.mehta-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.c |   87 +++++++++++++++++++++++++++-
>  drivers/infiniband/hw/hns/hns_roce_hw_v1.h |    6 +-
>  2 files changed, 90 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> index 71232e5..ca8b784 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> @@ -2630,8 +2630,82 @@ static int hns_roce_v1_query_qpc(struct hns_roce_dev *hr_dev,
>  	return ret;
>  }
>  
> -int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
> -			 int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr)
> +static int hns_roce_v1_q_sqp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
> +			     int qp_attr_mask,
> +			     struct ib_qp_init_attr *qp_init_attr)
> +{
> +	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
> +	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
> +	struct hns_roce_sqp_context *context;
> +	u32 addr;
> +
> +	context = kzalloc(sizeof(*context), GFP_KERNEL);
> +	if (!context)
> +		return -ENOMEM;
> +
Do we really need dynamic alloc here as the size is fixed and this memory scope is
only inside this function. I think better to use a static allocation.

> +	mutex_lock(&hr_qp->mutex);
> +
> +	if (hr_qp->state == IB_QPS_RESET) {
I think alloc can be moved after this check (if dynamic alloc is really needed).
> +		qp_attr->qp_state = IB_QPS_RESET;
> +		goto done;
> +	}
> +
> +	addr = ROCEE_QP1C_CFG0_0_REG + hr_qp->port * sizeof(*context);
> +	context->qp1c_bytes_4 = roce_read(hr_dev, addr);
> +	context->sq_rq_bt_l = roce_read(hr_dev, addr + 1);
> +	context->qp1c_bytes_12 = roce_read(hr_dev, addr + 2);
> +	context->qp1c_bytes_16 = roce_read(hr_dev, addr + 3);
> +	context->qp1c_bytes_20 = roce_read(hr_dev, addr + 4);
> +	context->cur_rq_wqe_ba_l = roce_read(hr_dev, addr + 5);
> +	context->qp1c_bytes_28 = roce_read(hr_dev, addr + 6);
> +	context->qp1c_bytes_32 = roce_read(hr_dev, addr + 7);
> +	context->cur_sq_wqe_ba_l = roce_read(hr_dev, addr + 8);
> +	context->qp1c_bytes_40 = roce_read(hr_dev, addr + 9);
> +
> +	hr_qp->state = roce_get_field(context->qp1c_bytes_4,
> +				      QP1C_BYTES_4_QP_STATE_M,
> +				      QP1C_BYTES_4_QP_STATE_S);
> +	qp_attr->qp_state	= hr_qp->state;
> +	qp_attr->path_mtu	= IB_MTU_256;
> +	qp_attr->path_mig_state	= IB_MIG_ARMED;
> +	qp_attr->qkey		= QKEY_VAL;
> +	qp_attr->rq_psn		= 0;
> +	qp_attr->sq_psn		= 0;
> +	qp_attr->dest_qp_num	= 1;
> +	qp_attr->qp_access_flags = 6;
> +
> +	qp_attr->pkey_index = roce_get_field(context->qp1c_bytes_20,
> +					     QP1C_BYTES_20_PKEY_IDX_M,
> +					     QP1C_BYTES_20_PKEY_IDX_S);
> +	qp_attr->port_num = hr_qp->port + 1;
> +	qp_attr->sq_draining = 0;
> +	qp_attr->max_rd_atomic = 0;
> +	qp_attr->max_dest_rd_atomic = 0;
> +	qp_attr->min_rnr_timer = 0;
> +	qp_attr->timeout = 0;
> +	qp_attr->retry_cnt = 0;
> +	qp_attr->rnr_retry = 0;
> +	qp_attr->alt_timeout = 0;
> +
> +done:
> +	qp_attr->cur_qp_state = qp_attr->qp_state;
> +	qp_attr->cap.max_recv_wr = hr_qp->rq.wqe_cnt;
> +	qp_attr->cap.max_recv_sge = hr_qp->rq.max_gs;
> +	qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
> +	qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;
> +	qp_attr->cap.max_inline_data = 0;
> +	qp_init_attr->cap = qp_attr->cap;
> +	qp_init_attr->create_flags = 0;
> +
> +	mutex_unlock(&hr_qp->mutex);
> +	kfree(context);
> +
> +	return 0;
> +}
> +
> +static int hns_roce_v1_q_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
> +			    int qp_attr_mask,
> +			    struct ib_qp_init_attr *qp_init_attr)
>  {
>  	struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
>  	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
> @@ -2767,6 +2841,15 @@ int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
>  	return ret;
>  }
>  
> +int hns_roce_v1_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
> +			 int qp_attr_mask, struct ib_qp_init_attr *qp_init_attr)
> +{
> +	struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
> +
> +	return hr_qp->doorbell_qpn <= 1 ?
> +		hns_roce_v1_q_sqp(ibqp, qp_attr, qp_attr_mask, qp_init_attr) :
> +		hns_roce_v1_q_qp(ibqp, qp_attr, qp_attr_mask, qp_init_attr);
> +}
>  static void hns_roce_v1_destroy_qp_common(struct hns_roce_dev *hr_dev,
>  					  struct hns_roce_qp *hr_qp,
>  					  int is_user)
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.h b/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> index 539b0a3b..2e1878b 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.h
> @@ -480,13 +480,17 @@ struct hns_roce_sqp_context {
>  	u32 qp1c_bytes_12;
>  	u32 qp1c_bytes_16;
>  	u32 qp1c_bytes_20;
> -	u32 qp1c_bytes_28;
>  	u32 cur_rq_wqe_ba_l;
> +	u32 qp1c_bytes_28;
>  	u32 qp1c_bytes_32;
>  	u32 cur_sq_wqe_ba_l;
>  	u32 qp1c_bytes_40;
>  };
>  
> +#define QP1C_BYTES_4_QP_STATE_S 0
> +#define QP1C_BYTES_4_QP_STATE_M   \
> +	(((1UL << 3) - 1) << QP1C_BYTES_4_QP_STATE_S)
> +
>  #define QP1C_BYTES_4_SQ_WQE_SHIFT_S 8
>  #define QP1C_BYTES_4_SQ_WQE_SHIFT_M   \
>  	(((1UL << 4) - 1) << QP1C_BYTES_4_SQ_WQE_SHIFT_S)
> 

--
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 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing
From: Or Gerlitz @ 2016-11-06 20:51 UTC (permalink / raw)
  To: jackm
  Cc: Hal Rosenstock, Leon Romanovsky, Doug Ledford,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Daniel Jurgens, Leon Romanovsky, eitan-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <CAJ3xEMjLvo+LVFS0WL-K=m34-_1Tc0=pArOgELXmxqdtN871TA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sun, Nov 6, 2016 at 10:46 PM, Or Gerlitz <gerlitz.or-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Sun, Nov 6, 2016 at 8:41 PM, jackm <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
>> 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, I see that in Linux we've picked the value Hal is mentioning,
> see Eli Cohen's commit a0c1b2a3 "IB/core: Support accessing SA in
> virtualized environment". You probably can talk to Eli to get where
> things stand.

yep, looking now on the annex I see the following:

SM GID -- A well-known GID that is associated with the SM, comprising
the concatenation of the Subnet prefix and the GUID
0x0200000000000002. The
SM GID is never present in any GID Table. If the SubnetPrefix is modified
by the SM, the SM GID is updated implicitly
--
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 5/9] IB/mlx4: Handle well-known-gid in mad_demux processing
From: Or Gerlitz @ 2016-11-06 20:46 UTC (permalink / raw)
  To: jackm
  Cc: Hal Rosenstock, Leon Romanovsky, Doug Ledford,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Daniel Jurgens, Leon Romanovsky, eitan-VPRAkNaXOzVWk0Htik3J/w
In-Reply-To: <20161106204107.00005742-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On Sun, Nov 6, 2016 at 8:41 PM, jackm <jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> 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, I see that in Linux we've picked the value Hal is mentioning,
see Eli Cohen's commit a0c1b2a3 "IB/core: Support accessing SA in
virtualized environment". You probably can talk to Eli to get where
things stand.

Or.
--
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

* 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


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