Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
* Re: [PATCH mlx5-next v4 07/17] IB/mlx5: Support set qp counter
From: Saeed Mahameed @ 2019-06-18 18:49 UTC (permalink / raw)
  To: Jason Gunthorpe, leon@kernel.org, dledford@redhat.com
  Cc: Mark Zhang, Majd Dibbiny, Leon Romanovsky,
	linux-rdma@vger.kernel.org, netdev@vger.kernel.org
In-Reply-To: <20190618172625.13432-8-leon@kernel.org>

On Tue, 2019-06-18 at 20:26 +0300, Leon Romanovsky wrote:
> From: Mark Zhang <markz@mellanox.com>
> 
> Support bind a qp with counter. If counter is null then bind the qp
> to
> the default counter. Different QP state has different operation:
> - RESET: Set the counter field so that it will take effective
>   during RST2INIT change;
> - RTS: Issue an RTS2RTS change to update the QP counter;
> - Other: Set the counter field and mark the counter_pending flag,
>   when QP is moved to RTS state and this flag is set, then issue
>   an RTS2RTS modification to update the counter.
> 
> Signed-off-by: Mark Zhang <markz@mellanox.com>
> Reviewed-by: Majd Dibbiny <majd@mellanox.com>
> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
> ---
>  drivers/infiniband/hw/mlx5/mlx5_ib.h |  6 +++
>  drivers/infiniband/hw/mlx5/qp.c      | 76
> +++++++++++++++++++++++++++-
>  include/linux/mlx5/qp.h              |  1 +
>  3 files changed, 81 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h
> b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> index 35e2c8f5ae78..b7d36f4826c1 100644
> --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h
> +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h
> @@ -442,6 +442,10 @@ struct mlx5_ib_qp {
>  	u32			flags_en;
>  	/* storage for qp sub type when core qp type is IB_QPT_DRIVER
> */
>  	enum ib_qp_type		qp_sub_type;
> +	/* A flag to indicate if there's a new counter is configured
> +	 * but not take effective
> +	 */
> +	u32                     counter_pending;
>  };
> 
>  struct mlx5_ib_cq_buf {
> @@ -1442,4 +1446,6 @@ void mlx5_ib_put_xlt_emergency_page(void);
>  int bfregn_to_uar_index(struct mlx5_ib_dev *dev,
>  			struct mlx5_bfreg_info *bfregi, u32 bfregn,
>  			bool dyn_bfreg);
> +
> +int mlx5_ib_qp_set_counter(struct ib_qp *qp, struct rdma_counter
> *counter);
>  #endif /* MLX5_IB_H */
> diff --git a/drivers/infiniband/hw/mlx5/qp.c
> b/drivers/infiniband/hw/mlx5/qp.c
> index f6623c77443a..8dbbef843010 100644
> --- a/drivers/infiniband/hw/mlx5/qp.c
> +++ b/drivers/infiniband/hw/mlx5/qp.c
> @@ -34,6 +34,7 @@
>  #include <rdma/ib_umem.h>
>  #include <rdma/ib_cache.h>
>  #include <rdma/ib_user_verbs.h>
> +#include <rdma/rdma_counter.h>
>  #include <linux/mlx5/fs.h>
>  #include "mlx5_ib.h"
>  #include "ib_rep.h"
> @@ -3386,6 +3387,35 @@ static unsigned int get_tx_affinity(struct
> mlx5_ib_dev *dev,
>  	return tx_port_affinity;
>  }
> 
> +static int __mlx5_ib_qp_set_counter(struct ib_qp *qp,
> +				    struct rdma_counter *counter)
> +{
> +	struct mlx5_ib_dev *dev = to_mdev(qp->device);
> +	struct mlx5_ib_qp *mqp = to_mqp(qp);
> +	struct mlx5_qp_context context = {};
> +	struct mlx5_ib_port *mibport = NULL;
> +	struct mlx5_ib_qp_base *base;
> +	u32 set_id;
> +
> +	if (!MLX5_CAP_GEN(dev->mdev, rts2rts_qp_counters_set_id))
> +		return 0;
> +
> +	if (counter) {
> +		set_id = counter->id;
> +	} else {
> +		mibport = &dev->port[mqp->port - 1];
> +		set_id = mibport->cnts.set_id;
> +	}
> +
> +	base = &mqp->trans_qp.base;
> +	context.qp_counter_set_usr_page &= cpu_to_be32(0xffffff);
> +	context.qp_counter_set_usr_page |= cpu_to_be32(set_id << 24);
> +	return mlx5_core_qp_modify(dev->mdev,
> +				   MLX5_CMD_OP_RTS2RTS_QP,
> +				   MLX5_QP_OPTPAR_COUNTER_SET_ID,
> +				   &context, &base->mqp);
> +}
> +
>  static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
>  			       const struct ib_qp_attr *attr, int
> attr_mask,
>  			       enum ib_qp_state cur_state,
> @@ -3439,6 +3469,7 @@ static int __mlx5_ib_modify_qp(struct ib_qp
> *ibqp,
>  	struct mlx5_ib_port *mibport = NULL;
>  	enum mlx5_qp_state mlx5_cur, mlx5_new;
>  	enum mlx5_qp_optpar optpar;
> +	u32 set_id = 0;
>  	int mlx5_st;
>  	int err;
>  	u16 op;
> @@ -3601,8 +3632,12 @@ static int __mlx5_ib_modify_qp(struct ib_qp
> *ibqp,
>  			port_num = 0;
> 
>  		mibport = &dev->port[port_num];
> +		if (ibqp->counter)
> +			set_id = ibqp->counter->id;
> +		else
> +			set_id = mibport->cnts.set_id;
>  		context->qp_counter_set_usr_page |=
> -			cpu_to_be32((u32)(mibport->cnts.set_id) << 24);
> +			cpu_to_be32(set_id << 24);
>  	}
> 
>  	if (!ibqp->uobject && cur_state == IB_QPS_RESET && new_state ==
> IB_QPS_INIT)
> @@ -3630,7 +3665,7 @@ static int __mlx5_ib_modify_qp(struct ib_qp
> *ibqp,
> 
>  		raw_qp_param.operation = op;
>  		if (cur_state == IB_QPS_RESET && new_state ==
> IB_QPS_INIT) {
> -			raw_qp_param.rq_q_ctr_id = mibport-
> >cnts.set_id;
> +			raw_qp_param.rq_q_ctr_id = set_id;
>  			raw_qp_param.set_mask |=
> MLX5_RAW_QP_MOD_SET_RQ_Q_CTR_ID;
>  		}
> 
> @@ -3707,6 +3742,12 @@ static int __mlx5_ib_modify_qp(struct ib_qp
> *ibqp,
>  		qp->db.db[MLX5_SND_DBR] = 0;
>  	}
> 
> +	if ((new_state == IB_QPS_RTS) && qp->counter_pending) {
> +		err = __mlx5_ib_qp_set_counter(ibqp, ibqp->counter);
> +		if (!err)
> +			qp->counter_pending = 0;
> +	}
> +
>  out:
>  	kfree(context);
>  	return err;
> @@ -6367,3 +6408,34 @@ void mlx5_ib_drain_rq(struct ib_qp *qp)
> 
>  	handle_drain_completion(cq, &rdrain, dev);
>  }
> +
> +/**
> + * Bind a qp to a counter. If @counter is NULL then bind the qp to
> + * the default counter
> + */
> +int mlx5_ib_qp_set_counter(struct ib_qp *qp, struct rdma_counter
> *counter)
> +{
> +	struct mlx5_ib_qp *mqp = to_mqp(qp);
> +	int err = 0;
> +
> +	mutex_lock(&mqp->mutex);
> +	if (mqp->state == IB_QPS_RESET) {
> +		qp->counter = counter;
> +		goto out;
> +	}
> +
> +	if (mqp->state == IB_QPS_RTS) {
> +		err = __mlx5_ib_qp_set_counter(qp, counter);
> +		if (!err)
> +			qp->counter = counter;
> +
> +		goto out;
> +	}
> +
> +	mqp->counter_pending = 1;
> +	qp->counter = counter;
> +
> +out:
> +	mutex_unlock(&mqp->mutex);
> +	return err;
> +}
> diff --git a/include/linux/mlx5/qp.h b/include/linux/mlx5/qp.h
> index 3ba4edbd17a6..787c5fabdc07 100644
> --- a/include/linux/mlx5/qp.h
> +++ b/include/linux/mlx5/qp.h
> @@ -70,6 +70,7 @@ enum mlx5_qp_optpar {
>  	MLX5_QP_OPTPAR_CQN_RCV			= 1 << 19,
>  	MLX5_QP_OPTPAR_DC_HS			= 1 << 20,
>  	MLX5_QP_OPTPAR_DC_KEY			= 1 << 21,
> +	MLX5_QP_OPTPAR_COUNTER_SET_ID		= 1 << 25,
>  };
> 

Acked-by: Saeed Mahameed <saeedm@mellanox.com>

>  enum mlx5_qp_state {
> --
> 2.20.1
> 

^ permalink raw reply

* Re: [PATCH rdma-next v1 00/12] DEVX asynchronous events
From: Saeed Mahameed @ 2019-06-18 18:51 UTC (permalink / raw)
  To: Jason Gunthorpe, leon@kernel.org, dledford@redhat.com
  Cc: Yishai Hadas, netdev@vger.kernel.org, Leon Romanovsky,
	linux-rdma@vger.kernel.org
In-Reply-To: <20190618171540.11729-1-leon@kernel.org>

On Tue, 2019-06-18 at 20:15 +0300, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@mellanox.com>
> 
> Changelog:
>  v0 -> v1:

Normally 1st submission is V1 and 2nd is V2.
so this should have been v1->v2.

For mlx5-next patches:

Acked-by: Saeed Mahameed <saeedm@mellanox.com>


>  * Fix the unbind / hot unplug flows to work properly.
>  * Fix Ref count handling on the eventfd mode in some flow.
>  * Rebased to latest rdma-next
> 
> Thanks
> 
> -------------------------------------------------------------------
> -----------------
> From Yishai:
> 
> This series enables RDMA applications that use the DEVX interface to
> subscribe and read device asynchronous events.
> 
> The solution is designed to allow extension of events in the future
> without need to perform any changes in the driver code.
> 
> To enable that few changes had been done in mlx5_core, it includes:
>  * Reading device event capabilities that are user related
>    (affiliated and un-affiliated) and set the matching mask upon
>    creating the matching EQ.
>  * Enable DEVX/mlx5_ib to register for ANY event instead of the
> option to
>    get some hard-coded ones.
>  * Enable DEVX/mlx5_ib to get the device raw data for CQ completion
> events.
>  * Enhance mlx5_core_create/destroy CQ to enable DEVX using them so
> that CQ
>    events will be reported as well.
> 
> In mlx5_ib layer the below changes were done:
>  * A new DEVX API was introduced to allocate an event channel by
> using
>    the uverbs FD object type.
>  * Implement the FD channel operations to enable read/poo/close over
> it.
>  * A new DEVX API was introduced to subscribe for specific events
> over an
>    event channel.
>  * Manage an internal data structure  over XA(s) to
> subscribe/dispatch events
>    over the different event channels.
>  * Use from DEVX the mlx5_core APIs to create/destroy a CQ to be able
> to
>    get its relevant events.
> 
> Yishai
> 
> Yishai Hadas (12):
>   net/mlx5: Fix mlx5_core_destroy_cq() error flow
>   net/mlx5: Use event mask based on device capabilities
>   net/mlx5: Expose the API to register for ANY event
>   net/mlx5: mlx5_core_create_cq() enhancements
>   net/mlx5: Report a CQ error event only when a handler was set
>   net/mlx5: Report EQE data upon CQ completion
>   net/mlx5: Expose device definitions for object events
>   IB/mlx5: Introduce MLX5_IB_OBJECT_DEVX_ASYNC_EVENT_FD
>   IB/mlx5: Register DEVX with mlx5_core to get async events
>   IB/mlx5: Enable subscription for device events over DEVX
>   IB/mlx5: Implement DEVX dispatching event
>   IB/mlx5: Add DEVX support for CQ events
> 
>  drivers/infiniband/hw/mlx5/cq.c               |    5 +-
>  drivers/infiniband/hw/mlx5/devx.c             | 1082
> ++++++++++++++++-
>  drivers/infiniband/hw/mlx5/main.c             |   10 +-
>  drivers/infiniband/hw/mlx5/mlx5_ib.h          |   12 +
>  drivers/infiniband/hw/mlx5/odp.c              |    3 +-
>  drivers/infiniband/hw/mlx5/qp.c               |    2 +-
>  drivers/net/ethernet/mellanox/mlx5/core/cq.c  |   21 +-
>  drivers/net/ethernet/mellanox/mlx5/core/en.h  |    2 +-
>  .../net/ethernet/mellanox/mlx5/core/en_main.c |    3 +-
>  .../net/ethernet/mellanox/mlx5/core/en_txrx.c |    2 +-
>  drivers/net/ethernet/mellanox/mlx5/core/eq.c  |   68 +-
>  .../ethernet/mellanox/mlx5/core/fpga/conn.c   |    6 +-
>  drivers/net/ethernet/mellanox/mlx5/core/fw.c  |    6 +
>  .../net/ethernet/mellanox/mlx5/core/lib/eq.h  |    5 +-
>  include/linux/mlx5/cq.h                       |    6 +-
>  include/linux/mlx5/device.h                   |    6 +-
>  include/linux/mlx5/driver.h                   |    2 +
>  include/linux/mlx5/eq.h                       |    4 +-
>  include/linux/mlx5/mlx5_ifc.h                 |   34 +-
>  include/uapi/rdma/mlx5_user_ioctl_cmds.h      |   19 +
>  include/uapi/rdma/mlx5_user_ioctl_verbs.h     |    9 +
>  21 files changed, 1237 insertions(+), 70 deletions(-)
> 
> --
> 2.20.1
> 

^ permalink raw reply

* Re: [PATCH v3 hmm 04/12] mm/hmm: Simplify hmm_get_or_create and make it reliable
From: Jason Gunthorpe @ 2019-06-18 18:55 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Andrea Arcangeli, Philip Yang, Ralph Campbell, linux-rdma,
	John Hubbard, Felix.Kuehling, dri-devel, linux-mm, Jerome Glisse,
	amd-gfx, Ira Weiny, Ben Skeggs
In-Reply-To: <20190615141211.GD17724@infradead.org>

On Sat, Jun 15, 2019 at 07:12:11AM -0700, Christoph Hellwig wrote:
> > +	spin_lock(&mm->page_table_lock);
> > +	if (mm->hmm) {
> > +		if (kref_get_unless_zero(&mm->hmm->kref)) {
> > +			spin_unlock(&mm->page_table_lock);
> > +			return mm->hmm;
> > +		}
> > +	}
> > +	spin_unlock(&mm->page_table_lock);
> 
> This could become:
> 
> 	spin_lock(&mm->page_table_lock);
> 	hmm = mm->hmm
> 	if (hmm && kref_get_unless_zero(&hmm->kref))
> 		goto out_unlock;
> 	spin_unlock(&mm->page_table_lock);
> 
> as the last two lines of the function already drop the page_table_lock
> and then return hmm.  Or drop the "hmm = mm->hmm" asignment above and
> return mm->hmm as that should be always identical to hmm at the end
> to save another line.
> 
> > +	/*
> > +	 * The mm->hmm pointer is kept valid while notifier ops can be running
> > +	 * so they don't have to deal with a NULL mm->hmm value
> > +	 */
> 
> The comment confuses me.  How does the page_table_lock relate to
> possibly running notifiers, as I can't find that we take
> page_table_lock?  Or is it just about the fact that we only clear
> mm->hmm in the free callback, and not in hmm_free?

Revised with:

From bdc02a1d502db08457823e6b2b983861a3574a76 Mon Sep 17 00:00:00 2001
From: Jason Gunthorpe <jgg@mellanox.com>
Date: Thu, 23 May 2019 10:24:13 -0300
Subject: [PATCH] mm/hmm: Simplify hmm_get_or_create and make it reliable

As coded this function can false-fail in various racy situations. Make it
reliable and simpler by running under the write side of the mmap_sem and
avoiding the false-failing compare/exchange pattern. Due to the mmap_sem
this no longer has to avoid racing with a 2nd parallel
hmm_get_or_create().

Unfortunately this still has to use the page_table_lock as the
non-sleeping lock protecting mm->hmm, since the contexts where we free the
hmm are incompatible with mmap_sem.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: John Hubbard <jhubbard@nvidia.com>
Reviewed-by: Ralph Campbell <rcampbell@nvidia.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Tested-by: Philip Yang <Philip.Yang@amd.com>
---
v2:
- Fix error unwind of mmgrab (Jerome)
- Use hmm local instead of 2nd container_of (Jerome)
v3:
- Can't use mmap_sem in the SRCU callback, keep using the
  page_table_lock (Philip)
v4:
- Put the mm->hmm = NULL in the kref release, reduce LOC
  in hmm_get_or_create() (Christoph)
---
 mm/hmm.c | 77 ++++++++++++++++++++++----------------------------------
 1 file changed, 30 insertions(+), 47 deletions(-)

diff --git a/mm/hmm.c b/mm/hmm.c
index 080b17a2e87e2d..0423f4ca3a7e09 100644
--- a/mm/hmm.c
+++ b/mm/hmm.c
@@ -31,16 +31,6 @@
 #if IS_ENABLED(CONFIG_HMM_MIRROR)
 static const struct mmu_notifier_ops hmm_mmu_notifier_ops;
 
-static inline struct hmm *mm_get_hmm(struct mm_struct *mm)
-{
-	struct hmm *hmm = READ_ONCE(mm->hmm);
-
-	if (hmm && kref_get_unless_zero(&hmm->kref))
-		return hmm;
-
-	return NULL;
-}
-
 /**
  * hmm_get_or_create - register HMM against an mm (HMM internal)
  *
@@ -55,11 +45,16 @@ static inline struct hmm *mm_get_hmm(struct mm_struct *mm)
  */
 static struct hmm *hmm_get_or_create(struct mm_struct *mm)
 {
-	struct hmm *hmm = mm_get_hmm(mm);
-	bool cleanup = false;
+	struct hmm *hmm;
+
+	lockdep_assert_held_exclusive(&mm->mmap_sem);
 
-	if (hmm)
-		return hmm;
+	/* Abuse the page_table_lock to also protect mm->hmm. */
+	spin_lock(&mm->page_table_lock);
+	hmm = mm->hmm;
+	if (mm->hmm && kref_get_unless_zero(&mm->hmm->kref))
+		goto out_unlock;
+	spin_unlock(&mm->page_table_lock);
 
 	hmm = kmalloc(sizeof(*hmm), GFP_KERNEL);
 	if (!hmm)
@@ -74,57 +69,45 @@ static struct hmm *hmm_get_or_create(struct mm_struct *mm)
 	hmm->notifiers = 0;
 	hmm->dead = false;
 	hmm->mm = mm;
-	mmgrab(hmm->mm);
 
-	spin_lock(&mm->page_table_lock);
-	if (!mm->hmm)
-		mm->hmm = hmm;
-	else
-		cleanup = true;
-	spin_unlock(&mm->page_table_lock);
+	hmm->mmu_notifier.ops = &hmm_mmu_notifier_ops;
+	if (__mmu_notifier_register(&hmm->mmu_notifier, mm)) {
+		kfree(hmm);
+		return NULL;
+	}
 
-	if (cleanup)
-		goto error;
+	mmgrab(hmm->mm);
 
 	/*
-	 * We should only get here if hold the mmap_sem in write mode ie on
-	 * registration of first mirror through hmm_mirror_register()
+	 * We hold the exclusive mmap_sem here so we know that mm->hmm is
+	 * still NULL or 0 kref, and is safe to update.
 	 */
-	hmm->mmu_notifier.ops = &hmm_mmu_notifier_ops;
-	if (__mmu_notifier_register(&hmm->mmu_notifier, mm))
-		goto error_mm;
-
-	return hmm;
-
-error_mm:
 	spin_lock(&mm->page_table_lock);
-	if (mm->hmm == hmm)
-		mm->hmm = NULL;
+	mm->hmm = hmm;
+
+out_unlock:
 	spin_unlock(&mm->page_table_lock);
-error:
-	mmdrop(hmm->mm);
-	kfree(hmm);
-	return NULL;
+	return hmm;
 }
 
 static void hmm_free_rcu(struct rcu_head *rcu)
 {
-	kfree(container_of(rcu, struct hmm, rcu));
+	struct hmm *hmm = container_of(rcu, struct hmm, rcu);
+
+	mmdrop(hmm->mm);
+	kfree(hmm);
 }
 
 static void hmm_free(struct kref *kref)
 {
 	struct hmm *hmm = container_of(kref, struct hmm, kref);
-	struct mm_struct *mm = hmm->mm;
 
-	mmu_notifier_unregister_no_release(&hmm->mmu_notifier, mm);
+	spin_lock(&hmm->mm->page_table_lock);
+	if (hmm->mm->hmm == hmm)
+		hmm->mm->hmm = NULL;
+	spin_unlock(&hmm->mm->page_table_lock);
 
-	spin_lock(&mm->page_table_lock);
-	if (mm->hmm == hmm)
-		mm->hmm = NULL;
-	spin_unlock(&mm->page_table_lock);
-
-	mmdrop(hmm->mm);
+	mmu_notifier_unregister_no_release(&hmm->mmu_notifier, hmm->mm);
 	mmu_notifier_call_srcu(&hmm->rcu, hmm_free_rcu);
 }
 
-- 
2.21.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related

* Re: [PATCH v3 hmm 08/12] mm/hmm: Remove racy protection against double-unregistration
From: Jason Gunthorpe @ 2019-06-18 18:57 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Andrea Arcangeli, Philip Yang, Ralph Campbell, linux-rdma,
	John Hubbard, Felix.Kuehling, dri-devel, linux-mm, Jerome Glisse,
	amd-gfx, Ben Skeggs
In-Reply-To: <20190618132722.GA1633@infradead.org>

On Tue, Jun 18, 2019 at 06:27:22AM -0700, Christoph Hellwig wrote:
> On Tue, Jun 18, 2019 at 10:13:24AM -0300, Jason Gunthorpe wrote:
> > > I don't even think we even need to bother with the POISON, normal list
> > > debugging will already catch a double unregistration anyway.
> > 
> > mirror->hmm isn't a list so list debugging won't help.
> > 
> > My concern when I wrote this was that one of the in flight patches I
> > can't see might be depending on this double-unregister-is-safe
> > behavior, so I wanted them to crash reliably.
> > 
> > It is a really overly conservative thing to do..
> 
> mirror->list is a list, and if we do a list_del on it during the
> second unregistration it will trip up on the list poisoning.

With the previous loose coupling of the mirror and the range some code
might rance to try to create a range without a mirror, which will now
reliably crash with the poison.

It isn't so much the double unregister that worries me, but racing
unregister with range functions.

Jason
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: [PATCH][next] net/mlx5: add missing void argument to function mlx5_devlink_alloc
From: Saeed Mahameed @ 2019-06-18 19:02 UTC (permalink / raw)
  To: linux-rdma@vger.kernel.org, colin.king@canonical.com,
	davem@davemloft.net, leon@kernel.org, netdev@vger.kernel.org
  Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20190618151510.18672-1-colin.king@canonical.com>

On Tue, 2019-06-18 at 16:15 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Function mlx5_devlink_alloc is missing a void argument, add it
> to clean up the non-ANSI function declaration.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/devlink.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> index ed4202e883f0..1533c657220b 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/devlink.c
> @@ -37,7 +37,7 @@ static const struct devlink_ops mlx5_devlink_ops =
> {
>  	.flash_update = mlx5_devlink_flash_update,
>  };
>  
> -struct devlink *mlx5_devlink_alloc()
> +struct devlink *mlx5_devlink_alloc(void)
>  {
>  	return devlink_alloc(&mlx5_devlink_ops, sizeof(struct
> mlx5_core_dev));
>  }

Acked-by: Saeed Mahameed <saeedm@mellanox.com>

Dave, this one can go to net-next.

Thanks,
Saeed.

^ permalink raw reply

* Re: [PATCH] [v2] net/mlx5e: reduce stack usage in mlx5_eswitch_termtbl_create
From: Saeed Mahameed @ 2019-06-18 20:05 UTC (permalink / raw)
  To: arnd@arndb.de, leon@kernel.org
  Cc: linux-rdma@vger.kernel.org, Or Gerlitz, Oz Shlomo, Paul Blakey,
	Mark Bloch, Maor Gottlieb, linux-kernel@vger.kernel.org,
	davem@davemloft.net, Eli Britstein, netdev@vger.kernel.org
In-Reply-To: <20190618111621.3030135-1-arnd@arndb.de>

On Tue, 2019-06-18 at 13:15 +0200, Arnd Bergmann wrote:
> Putting an empty 'mlx5_flow_spec' structure on the stack is a bit
> wasteful and causes a warning on 32-bit architectures when building
> with clang -fsanitize-coverage:
> 
> drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c:
> In function 'mlx5_eswitch_termtbl_create':
> drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c:90
> :1: error: the frame size of 1032 bytes is larger than 1024 bytes [-
> Werror=frame-larger-than=]
> 
> Since the structure is never written to, we can statically allocate
> it to avoid the stack usage. To be on the safe side, mark all
> subsequent function arguments that we pass it into as 'const'
> as well.
> 
> Fixes: 10caabdaad5a ("net/mlx5e: Use termination table for VLAN push
> actions")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Saeed Mahameed <saeedm@mellanox.com>
> Acked-by: Mark Bloch <markb@mellanox.com>

Applied to net-next-mlx5 and will be submitted to net-next soon.

Thanks,
Saeed.

^ permalink raw reply

* [PATCH v1 02/22] docs: ioctl-number.txt: convert it to ReST format
From: Mauro Carvalho Chehab @ 2019-06-18 21:05 UTC (permalink / raw)
  To: Linux Doc Mailing List
  Cc: Mauro Carvalho Chehab, Mauro Carvalho Chehab, linux-kernel,
	Jonathan Corbet, Federico Vaga, Harry Wei, Alex Shi, Doug Ledford,
	Jason Gunthorpe, linux-rdma
In-Reply-To: <cover.1560891322.git.mchehab+samsung@kernel.org>

The conversion itself is simple: add a markup for the
title of this file and add markups for both tables.

Yet, the big table here with IOCTL numbers is badly formatted:
on several lines, the "Include File" column has some values that
are bigger than the reserved space there.

Also, on several places, a comment was misplaced at the "Include
File" space.

So, most of the work here is to actually ensure that each field
will be properly fixed.

Also worth to mention that some URLs have the asterisk character
on it. Well, Sphinx has an issue with asterisks in the middle
of an string. As this is URL, use the alternate format: %2A.

As a side effect of this patch, it is now a lot easier to see that
some reserved ioctl numbers are missing the include files
where it is supposed to be used.

PS.: While this is part of a subdir, I opted to convert this
single file alone, as this file has a potential of conflicts,
as most subsystem maintainers touch it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
---
 .../{ioctl-number.txt => ioctl-number.rst}    | 588 +++++++++---------
 Documentation/process/submit-checklist.rst    |   2 +-
 .../it_IT/process/submit-checklist.rst        |   2 +-
 .../zh_CN/process/submit-checklist.rst        |   2 +-
 include/uapi/rdma/rdma_user_ioctl_cmds.h      |   2 +-
 5 files changed, 304 insertions(+), 292 deletions(-)
 rename Documentation/ioctl/{ioctl-number.txt => ioctl-number.rst} (11%)

diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.rst
similarity index 11%
rename from Documentation/ioctl/ioctl-number.txt
rename to Documentation/ioctl/ioctl-number.rst
index c9558146ac58..e6d07badafb1 100644
--- a/Documentation/ioctl/ioctl-number.txt
+++ b/Documentation/ioctl/ioctl-number.rst
@@ -1,15 +1,23 @@
+:orphan:
+
+=============
 Ioctl Numbers
+=============
+
 19 October 1999
+
 Michael Elizabeth Chastain
 <mec@shout.net>
 
 If you are adding new ioctl's to the kernel, you should use the _IO
 macros defined in <linux/ioctl.h>:
 
+    ====== == ============================================
     _IO    an ioctl with no parameters
     _IOW   an ioctl with write parameters (copy_from_user)
     _IOR   an ioctl with read parameters  (copy_to_user)
     _IOWR  an ioctl with both write and read parameters.
+    ====== == ============================================
 
 'Write' and 'read' are from the user's point of view, just like the
 system calls 'write' and 'read'.  For example, a SET_FOO ioctl would
@@ -60,291 +68,295 @@ This table lists ioctls visible from user land for Linux/x86.  It contains
 most drivers up to 2.6.31, but I know I am missing some.  There has been
 no attempt to list non-X86 architectures or ioctls from drivers/staging/.
 
-Code  Seq#(hex)	Include File		Comments
-========================================================
-0x00	00-1F	linux/fs.h		conflict!
-0x00	00-1F	scsi/scsi_ioctl.h	conflict!
-0x00	00-1F	linux/fb.h		conflict!
-0x00	00-1F	linux/wavefront.h	conflict!
-0x02	all	linux/fd.h
-0x03	all	linux/hdreg.h
-0x04	D2-DC	linux/umsdos_fs.h	Dead since 2.6.11, but don't reuse these.
-0x06	all	linux/lp.h
-0x09	all	linux/raid/md_u.h
-0x10	00-0F	drivers/char/s390/vmcp.h
-0x10	10-1F	arch/s390/include/uapi/sclp_ctl.h
-0x10	20-2F	arch/s390/include/uapi/asm/hypfs.h
-0x12	all	linux/fs.h
-		linux/blkpg.h
-0x1b	all	InfiniBand Subsystem	<http://infiniband.sourceforge.net/>
-0x20	all	drivers/cdrom/cm206.h
-0x22	all	scsi/sg.h
-'!'	00-1F	uapi/linux/seccomp.h
-'#'	00-3F	IEEE 1394 Subsystem	Block for the entire subsystem
-'$'	00-0F	linux/perf_counter.h, linux/perf_event.h
-'%'	00-0F	include/uapi/linux/stm.h
-					System Trace Module subsystem
-					<mailto:alexander.shishkin@linux.intel.com>
-'&'	00-07	drivers/firewire/nosy-user.h
-'1'	00-1F	<linux/timepps.h>	PPS kit from Ulrich Windl
-					<ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
-'2'	01-04	linux/i2o.h
-'3'	00-0F	drivers/s390/char/raw3270.h	conflict!
-'3'	00-1F	linux/suspend_ioctls.h	conflict!
-		and kernel/power/user.c
-'8'	all				SNP8023 advanced NIC card
-					<mailto:mcr@solidum.com>
-';'	64-7F	linux/vfio.h
-'@'	00-0F	linux/radeonfb.h	conflict!
-'@'	00-0F	drivers/video/aty/aty128fb.c	conflict!
-'A'	00-1F	linux/apm_bios.h	conflict!
-'A'	00-0F	linux/agpgart.h		conflict!
-		and drivers/char/agp/compat_ioctl.h
-'A'	00-7F	sound/asound.h		conflict!
-'B'	00-1F	linux/cciss_ioctl.h	conflict!
-'B'	00-0F	include/linux/pmu.h	conflict!
-'B'	C0-FF				advanced bbus
-					<mailto:maassen@uni-freiburg.de>
-'C'	all	linux/soundcard.h	conflict!
-'C'	01-2F	linux/capi.h		conflict!
-'C'	F0-FF	drivers/net/wan/cosa.h	conflict!
-'D'	all	arch/s390/include/asm/dasd.h
-'D'	40-5F	drivers/scsi/dpt/dtpi_ioctl.h
-'D'	05	drivers/scsi/pmcraid.h
-'E'	all	linux/input.h		conflict!
-'E'	00-0F	xen/evtchn.h		conflict!
-'F'	all	linux/fb.h		conflict!
-'F'	01-02	drivers/scsi/pmcraid.h	conflict!
-'F'	20	drivers/video/fsl-diu-fb.h	conflict!
-'F'	20	drivers/video/intelfb/intelfb.h	conflict!
-'F'	20	linux/ivtvfb.h		conflict!
-'F'	20	linux/matroxfb.h	conflict!
-'F'	20	drivers/video/aty/atyfb_base.c	conflict!
-'F'	00-0F	video/da8xx-fb.h	conflict!
-'F'	80-8F	linux/arcfb.h		conflict!
-'F'	DD	video/sstfb.h		conflict!
-'G'	00-3F	drivers/misc/sgi-gru/grulib.h	conflict!
-'G'	00-0F	linux/gigaset_dev.h	conflict!
-'H'	00-7F	linux/hiddev.h		conflict!
-'H'	00-0F	linux/hidraw.h		conflict!
-'H'	01	linux/mei.h		conflict!
-'H'	02	linux/mei.h		conflict!
-'H'	03	linux/mei.h		conflict!
-'H'	00-0F	sound/asound.h		conflict!
-'H'	20-40	sound/asound_fm.h	conflict!
-'H'	80-8F	sound/sfnt_info.h	conflict!
-'H'	10-8F	sound/emu10k1.h		conflict!
-'H'	10-1F	sound/sb16_csp.h	conflict!
-'H'	10-1F	sound/hda_hwdep.h	conflict!
-'H'	40-4F	sound/hdspm.h		conflict!
-'H'	40-4F	sound/hdsp.h		conflict!
-'H'	90	sound/usb/usx2y/usb_stream.h
-'H'	A0	uapi/linux/usb/cdc-wdm.h
-'H'	C0-F0	net/bluetooth/hci.h	conflict!
-'H'	C0-DF	net/bluetooth/hidp/hidp.h	conflict!
-'H'	C0-DF	net/bluetooth/cmtp/cmtp.h	conflict!
-'H'	C0-DF	net/bluetooth/bnep/bnep.h	conflict!
-'H'	F1	linux/hid-roccat.h	<mailto:erazor_de@users.sourceforge.net>
-'H'	F8-FA	sound/firewire.h
-'I'	all	linux/isdn.h		conflict!
-'I'	00-0F	drivers/isdn/divert/isdn_divert.h	conflict!
-'I'	40-4F	linux/mISDNif.h		conflict!
-'J'	00-1F	drivers/scsi/gdth_ioctl.h
-'K'	all	linux/kd.h
-'L'	00-1F	linux/loop.h		conflict!
-'L'	10-1F	drivers/scsi/mpt3sas/mpt3sas_ctl.h	conflict!
-'L'	20-2F	linux/lightnvm.h
-'L'	E0-FF	linux/ppdd.h		encrypted disk device driver
-					<http://linux01.gwdg.de/~alatham/ppdd.html>
-'M'	all	linux/soundcard.h	conflict!
-'M'	01-16	mtd/mtd-abi.h		conflict!
-		and drivers/mtd/mtdchar.c
-'M'	01-03	drivers/scsi/megaraid/megaraid_sas.h
-'M'	00-0F	drivers/video/fsl-diu-fb.h	conflict!
-'N'	00-1F	drivers/usb/scanner.h
-'N'	40-7F	drivers/block/nvme.c
-'O'     00-06   mtd/ubi-user.h		UBI
-'P'	all	linux/soundcard.h	conflict!
-'P'	60-6F	sound/sscape_ioctl.h	conflict!
-'P'	00-0F	drivers/usb/class/usblp.c	conflict!
-'P'	01-09	drivers/misc/pci_endpoint_test.c	conflict!
-'Q'	all	linux/soundcard.h
-'R'	00-1F	linux/random.h		conflict!
-'R'	01	linux/rfkill.h		conflict!
-'R'	C0-DF	net/bluetooth/rfcomm.h
-'S'	all	linux/cdrom.h		conflict!
-'S'	80-81	scsi/scsi_ioctl.h	conflict!
-'S'	82-FF	scsi/scsi.h		conflict!
-'S'	00-7F	sound/asequencer.h	conflict!
-'T'	all	linux/soundcard.h	conflict!
-'T'	00-AF	sound/asound.h		conflict!
-'T'	all	arch/x86/include/asm/ioctls.h	conflict!
-'T'	C0-DF	linux/if_tun.h		conflict!
-'U'	all	sound/asound.h		conflict!
-'U'	00-CF	linux/uinput.h		conflict!
-'U'	00-EF	linux/usbdevice_fs.h
-'U'	C0-CF	drivers/bluetooth/hci_uart.h
-'V'	all	linux/vt.h		conflict!
-'V'	all	linux/videodev2.h	conflict!
-'V'	C0	linux/ivtvfb.h		conflict!
-'V'	C0	linux/ivtv.h		conflict!
-'V'	C0	media/davinci/vpfe_capture.h	conflict!
-'V'	C0	media/si4713.h		conflict!
-'W'	00-1F	linux/watchdog.h	conflict!
-'W'	00-1F	linux/wanrouter.h	conflict!		(pre 3.9)
-'W'	00-3F	sound/asound.h		conflict!
-'W'	40-5F   drivers/pci/switch/switchtec.c
-'X'	all	fs/xfs/xfs_fs.h		conflict!
-		and fs/xfs/linux-2.6/xfs_ioctl32.h
-		and include/linux/falloc.h
-		and linux/fs.h
-'X'	all	fs/ocfs2/ocfs_fs.h	conflict!
-'X'	01	linux/pktcdvd.h		conflict!
-'Y'	all	linux/cyclades.h
-'Z'	14-15	drivers/message/fusion/mptctl.h
-'['	00-3F	linux/usb/tmc.h		USB Test and Measurement Devices
-					<mailto:gregkh@linuxfoundation.org>
-'a'	all	linux/atm*.h, linux/sonet.h	ATM on linux
-					<http://lrcwww.epfl.ch/>
-'a'	00-0F	drivers/crypto/qat/qat_common/adf_cfg_common.h	conflict! qat driver
-'b'	00-FF				conflict! bit3 vme host bridge
-					<mailto:natalia@nikhefk.nikhef.nl>
-'c'	all	linux/cm4000_cs.h	conflict!
-'c'	00-7F	linux/comstats.h	conflict!
-'c'	00-7F	linux/coda.h		conflict!
-'c'	00-1F	linux/chio.h		conflict!
-'c'	80-9F	arch/s390/include/asm/chsc.h	conflict!
-'c'	A0-AF   arch/x86/include/asm/msr.h	conflict!
-'d'	00-FF	linux/char/drm/drm.h	conflict!
-'d'	02-40	pcmcia/ds.h		conflict!
-'d'	F0-FF	linux/digi1.h
-'e'	all	linux/digi1.h		conflict!
-'f'	00-1F	linux/ext2_fs.h		conflict!
-'f'	00-1F	linux/ext3_fs.h		conflict!
-'f'	00-0F	fs/jfs/jfs_dinode.h	conflict!
-'f'	00-0F	fs/ext4/ext4.h		conflict!
-'f'	00-0F	linux/fs.h		conflict!
-'f'	00-0F	fs/ocfs2/ocfs2_fs.h	conflict!
-'g'	00-0F	linux/usb/gadgetfs.h
-'g'	20-2F	linux/usb/g_printer.h
-'h'	00-7F				conflict! Charon filesystem
-					<mailto:zapman@interlan.net>
-'h'	00-1F	linux/hpet.h		conflict!
-'h'	80-8F	fs/hfsplus/ioctl.c
-'i'	00-3F	linux/i2o-dev.h		conflict!
-'i'	0B-1F	linux/ipmi.h		conflict!
-'i'	80-8F	linux/i8k.h
-'j'	00-3F	linux/joystick.h
-'k'	00-0F	linux/spi/spidev.h	conflict!
-'k'	00-05	video/kyro.h		conflict!
-'k'	10-17	linux/hsi/hsi_char.h	HSI character device
-'l'	00-3F	linux/tcfs_fs.h		transparent cryptographic file system
-					<http://web.archive.org/web/*/http://mikonos.dia.unisa.it/tcfs>
-'l'	40-7F	linux/udf_fs_i.h	in development:
-					<http://sourceforge.net/projects/linux-udf/>
-'m'	00-09	linux/mmtimer.h		conflict!
-'m'	all	linux/mtio.h		conflict!
-'m'	all	linux/soundcard.h	conflict!
-'m'	all	linux/synclink.h	conflict!
-'m'	00-19	drivers/message/fusion/mptctl.h	conflict!
-'m'	00	drivers/scsi/megaraid/megaraid_ioctl.h	conflict!
-'n'	00-7F	linux/ncp_fs.h and fs/ncpfs/ioctl.c
-'n'	80-8F	uapi/linux/nilfs2_api.h	NILFS2
-'n'	E0-FF	linux/matroxfb.h	matroxfb
-'o'	00-1F	fs/ocfs2/ocfs2_fs.h	OCFS2
-'o'     00-03   mtd/ubi-user.h		conflict! (OCFS2 and UBI overlaps)
-'o'     40-41   mtd/ubi-user.h		UBI
-'o'     01-A1   linux/dvb/*.h		DVB
-'p'	00-0F	linux/phantom.h		conflict! (OpenHaptics needs this)
-'p'	00-1F	linux/rtc.h		conflict!
-'p'	00-3F	linux/mc146818rtc.h	conflict!
-'p'	40-7F	linux/nvram.h
-'p'	80-9F	linux/ppdev.h		user-space parport
-					<mailto:tim@cyberelk.net>
-'p'	A1-A5	linux/pps.h		LinuxPPS
-					<mailto:giometti@linux.it>
-'q'	00-1F	linux/serio.h
-'q'	80-FF	linux/telephony.h	Internet PhoneJACK, Internet LineJACK
-		linux/ixjuser.h		<http://web.archive.org/web/*/http://www.quicknet.net>
-'r'	00-1F	linux/msdos_fs.h and fs/fat/dir.c
-'s'	all	linux/cdk.h
-'t'	00-7F	linux/ppp-ioctl.h
-'t'	80-8F	linux/isdn_ppp.h
-'t'	90-91	linux/toshiba.h		toshiba and toshiba_acpi SMM
-'u'	00-1F	linux/smb_fs.h		gone
-'u'	20-3F	linux/uvcvideo.h	USB video class host driver
-'u'	40-4f	linux/udmabuf.h		userspace dma-buf misc device
-'v'	00-1F	linux/ext2_fs.h		conflict!
-'v'	00-1F	linux/fs.h		conflict!
-'v'	00-0F	linux/sonypi.h		conflict!
-'v'	00-0F	media/v4l2-subdev.h	conflict!
-'v'	C0-FF	linux/meye.h		conflict!
-'w'	all				CERN SCI driver
-'y'	00-1F				packet based user level communications
-					<mailto:zapman@interlan.net>
-'z'	00-3F				CAN bus card	conflict!
-					<mailto:hdstich@connectu.ulm.circular.de>
-'z'	40-7F				CAN bus card	conflict!
-					<mailto:oe@port.de>
-'z'	10-4F	drivers/s390/crypto/zcrypt_api.h	conflict!
-'|'	00-7F	linux/media.h
-0x80	00-1F	linux/fb.h
-0x89	00-06	arch/x86/include/asm/sockios.h
-0x89	0B-DF	linux/sockios.h
-0x89	E0-EF	linux/sockios.h		SIOCPROTOPRIVATE range
-0x89	E0-EF	linux/dn.h		PROTOPRIVATE range
-0x89	F0-FF	linux/sockios.h		SIOCDEVPRIVATE range
-0x8B	all	linux/wireless.h
-0x8C	00-3F				WiNRADiO driver
-					<http://www.winradio.com.au/>
-0x90	00	drivers/cdrom/sbpcd.h
-0x92	00-0F	drivers/usb/mon/mon_bin.c
-0x93	60-7F	linux/auto_fs.h
-0x94	all	fs/btrfs/ioctl.h	Btrfs filesystem
-		and linux/fs.h		some lifted to vfs/generic
-0x97	00-7F	fs/ceph/ioctl.h		Ceph file system
-0x99	00-0F				537-Addinboard driver
-					<mailto:buk@buks.ipn.de>
-0xA0	all	linux/sdp/sdp.h		Industrial Device Project
-					<mailto:kenji@bitgate.com>
-0xA1	0	linux/vtpm_proxy.h	TPM Emulator Proxy Driver
-0xA3	80-8F	Port ACL		in development:
-					<mailto:tlewis@mindspring.com>
-0xA3	90-9F	linux/dtlk.h
-0xA4	00-1F	uapi/linux/tee.h	Generic TEE subsystem
-0xAA	00-3F	linux/uapi/linux/userfaultfd.h
-0xAB	00-1F	linux/nbd.h
-0xAC	00-1F	linux/raw.h
-0xAD	00	Netfilter device	in development:
-					<mailto:rusty@rustcorp.com.au>
-0xAE	all	linux/kvm.h		Kernel-based Virtual Machine
-					<mailto:kvm@vger.kernel.org>
-0xAF	00-1F	linux/fsl_hypervisor.h	Freescale hypervisor
-0xB0	all	RATIO devices		in development:
-					<mailto:vgo@ratio.de>
-0xB1	00-1F	PPPoX			<mailto:mostrows@styx.uwaterloo.ca>
-0xB3	00	linux/mmc/ioctl.h
-0xB4	00-0F	linux/gpio.h		<mailto:linux-gpio@vger.kernel.org>
-0xB5	00-0F	uapi/linux/rpmsg.h	<mailto:linux-remoteproc@vger.kernel.org>
-0xB6	all	linux/fpga-dfl.h
-0xC0	00-0F	linux/usb/iowarrior.h
-0xCA	00-0F	uapi/misc/cxl.h
-0xCA	10-2F	uapi/misc/ocxl.h
-0xCA	80-BF	uapi/scsi/cxlflash_ioctl.h
-0xCB	00-1F	CBM serial IEC bus	in development:
-					<mailto:michael.klein@puffin.lb.shuttle.de>
-0xCC	00-0F	drivers/misc/ibmvmc.h    pseries VMC driver
-0xCD	01	linux/reiserfs_fs.h
-0xCF	02	fs/cifs/ioctl.c
-0xDB	00-0F	drivers/char/mwave/mwavepub.h
-0xDD	00-3F	ZFCP device driver	see drivers/s390/scsi/
-					<mailto:aherrman@de.ibm.com>
-0xE5	00-3F	linux/fuse.h
-0xEC	00-01	drivers/platform/chrome/cros_ec_dev.h	ChromeOS EC driver
-0xF3	00-3F	drivers/usb/misc/sisusbvga/sisusb.h	sisfb (in development)
-					<mailto:thomas@winischhofer.net>
-0xF4	00-1F	video/mbxfb.h		mbxfb
-					<mailto:raph@8d.com>
-0xF6	all	LTTng			Linux Trace Toolkit Next Generation
-					<mailto:mathieu.desnoyers@efficios.com>
-0xFD	all	linux/dm-ioctl.h
+====  =====  ======================================================= ================================================================
+Code  Seq#    Include File                                           Comments
+      (hex)
+====  =====  ======================================================= ================================================================
+0x00  00-1F  linux/fs.h                                              conflict!
+0x00  00-1F  scsi/scsi_ioctl.h                                       conflict!
+0x00  00-1F  linux/fb.h                                              conflict!
+0x00  00-1F  linux/wavefront.h                                       conflict!
+0x02  all    linux/fd.h
+0x03  all    linux/hdreg.h
+0x04  D2-DC  linux/umsdos_fs.h                                       Dead since 2.6.11, but don't reuse these.
+0x06  all    linux/lp.h
+0x09  all    linux/raid/md_u.h
+0x10  00-0F  drivers/char/s390/vmcp.h
+0x10  10-1F  arch/s390/include/uapi/sclp_ctl.h
+0x10  20-2F  arch/s390/include/uapi/asm/hypfs.h
+0x12  all    linux/fs.h
+             linux/blkpg.h
+0x1b  all                                                            InfiniBand Subsystem
+                                                                     <http://infiniband.sourceforge.net/>
+0x20  all    drivers/cdrom/cm206.h
+0x22  all    scsi/sg.h
+'!'   00-1F  uapi/linux/seccomp.h
+'#'   00-3F                                                          IEEE 1394 Subsystem
+                                                                     Block for the entire subsystem
+'$'   00-0F  linux/perf_counter.h, linux/perf_event.h
+'%'   00-0F  include/uapi/linux/stm.h                                System Trace Module subsystem
+                                                                     <mailto:alexander.shishkin@linux.intel.com>
+'&'   00-07  drivers/firewire/nosy-user.h
+'1'   00-1F  linux/timepps.h                                         PPS kit from Ulrich Windl
+                                                                     <ftp://ftp.de.kernel.org/pub/linux/daemons/ntp/PPS/>
+'2'   01-04  linux/i2o.h
+'3'   00-0F  drivers/s390/char/raw3270.h                             conflict!
+'3'   00-1F  linux/suspend_ioctls.h,                                 conflict!
+             kernel/power/user.c
+'8'   all                                                            SNP8023 advanced NIC card
+                                                                     <mailto:mcr@solidum.com>
+';'   64-7F  linux/vfio.h
+'@'   00-0F  linux/radeonfb.h                                        conflict!
+'@'   00-0F  drivers/video/aty/aty128fb.c                            conflict!
+'A'   00-1F  linux/apm_bios.h                                        conflict!
+'A'   00-0F  linux/agpgart.h,                                        conflict!
+             drivers/char/agp/compat_ioctl.h
+'A'   00-7F  sound/asound.h                                          conflict!
+'B'   00-1F  linux/cciss_ioctl.h                                     conflict!
+'B'   00-0F  include/linux/pmu.h                                     conflict!
+'B'   C0-FF  advanced bbus                                           <mailto:maassen@uni-freiburg.de>
+'C'   all    linux/soundcard.h                                       conflict!
+'C'   01-2F  linux/capi.h                                            conflict!
+'C'   F0-FF  drivers/net/wan/cosa.h                                  conflict!
+'D'   all    arch/s390/include/asm/dasd.h
+'D'   40-5F  drivers/scsi/dpt/dtpi_ioctl.h
+'D'   05     drivers/scsi/pmcraid.h
+'E'   all    linux/input.h                                           conflict!
+'E'   00-0F  xen/evtchn.h                                            conflict!
+'F'   all    linux/fb.h                                              conflict!
+'F'   01-02  drivers/scsi/pmcraid.h                                  conflict!
+'F'   20     drivers/video/fsl-diu-fb.h                              conflict!
+'F'   20     drivers/video/intelfb/intelfb.h                         conflict!
+'F'   20     linux/ivtvfb.h                                          conflict!
+'F'   20     linux/matroxfb.h                                        conflict!
+'F'   20     drivers/video/aty/atyfb_base.c                          conflict!
+'F'   00-0F  video/da8xx-fb.h                                        conflict!
+'F'   80-8F  linux/arcfb.h                                           conflict!
+'F'   DD     video/sstfb.h                                           conflict!
+'G'   00-3F  drivers/misc/sgi-gru/grulib.h                           conflict!
+'G'   00-0F  linux/gigaset_dev.h                                     conflict!
+'H'   00-7F  linux/hiddev.h                                          conflict!
+'H'   00-0F  linux/hidraw.h                                          conflict!
+'H'   01     linux/mei.h                                             conflict!
+'H'   02     linux/mei.h                                             conflict!
+'H'   03     linux/mei.h                                             conflict!
+'H'   00-0F  sound/asound.h                                          conflict!
+'H'   20-40  sound/asound_fm.h                                       conflict!
+'H'   80-8F  sound/sfnt_info.h                                       conflict!
+'H'   10-8F  sound/emu10k1.h                                         conflict!
+'H'   10-1F  sound/sb16_csp.h                                        conflict!
+'H'   10-1F  sound/hda_hwdep.h                                       conflict!
+'H'   40-4F  sound/hdspm.h                                           conflict!
+'H'   40-4F  sound/hdsp.h                                            conflict!
+'H'   90     sound/usb/usx2y/usb_stream.h
+'H'   A0     uapi/linux/usb/cdc-wdm.h
+'H'   C0-F0  net/bluetooth/hci.h                                     conflict!
+'H'   C0-DF  net/bluetooth/hidp/hidp.h                               conflict!
+'H'   C0-DF  net/bluetooth/cmtp/cmtp.h                               conflict!
+'H'   C0-DF  net/bluetooth/bnep/bnep.h                               conflict!
+'H'   F1     linux/hid-roccat.h                                      <mailto:erazor_de@users.sourceforge.net>
+'H'   F8-FA  sound/firewire.h
+'I'   all    linux/isdn.h                                            conflict!
+'I'   00-0F  drivers/isdn/divert/isdn_divert.h                       conflict!
+'I'   40-4F  linux/mISDNif.h                                         conflict!
+'J'   00-1F  drivers/scsi/gdth_ioctl.h
+'K'   all    linux/kd.h
+'L'   00-1F  linux/loop.h                                            conflict!
+'L'   10-1F  drivers/scsi/mpt3sas/mpt3sas_ctl.h                      conflict!
+'L'   20-2F  linux/lightnvm.h
+'L'   E0-FF  linux/ppdd.h                                            encrypted disk device driver
+                                                                     <http://linux01.gwdg.de/~alatham/ppdd.html>
+'M'   all    linux/soundcard.h                                       conflict!
+'M'   01-16  mtd/mtd-abi.h                                           conflict!
+      and    drivers/mtd/mtdchar.c
+'M'   01-03  drivers/scsi/megaraid/megaraid_sas.h
+'M'   00-0F  drivers/video/fsl-diu-fb.h                              conflict!
+'N'   00-1F  drivers/usb/scanner.h
+'N'   40-7F  drivers/block/nvme.c
+'O'   00-06  mtd/ubi-user.h                                          UBI
+'P'   all    linux/soundcard.h                                       conflict!
+'P'   60-6F  sound/sscape_ioctl.h                                    conflict!
+'P'   00-0F  drivers/usb/class/usblp.c                               conflict!
+'P'   01-09  drivers/misc/pci_endpoint_test.c                        conflict!
+'Q'   all    linux/soundcard.h
+'R'   00-1F  linux/random.h                                          conflict!
+'R'   01     linux/rfkill.h                                          conflict!
+'R'   C0-DF  net/bluetooth/rfcomm.h
+'S'   all    linux/cdrom.h                                           conflict!
+'S'   80-81  scsi/scsi_ioctl.h                                       conflict!
+'S'   82-FF  scsi/scsi.h                                             conflict!
+'S'   00-7F  sound/asequencer.h                                      conflict!
+'T'   all    linux/soundcard.h                                       conflict!
+'T'   00-AF  sound/asound.h                                          conflict!
+'T'   all    arch/x86/include/asm/ioctls.h                           conflict!
+'T'   C0-DF  linux/if_tun.h                                          conflict!
+'U'   all    sound/asound.h                                          conflict!
+'U'   00-CF  linux/uinput.h                                          conflict!
+'U'   00-EF  linux/usbdevice_fs.h
+'U'   C0-CF  drivers/bluetooth/hci_uart.h
+'V'   all    linux/vt.h                                              conflict!
+'V'   all    linux/videodev2.h                                       conflict!
+'V'   C0     linux/ivtvfb.h                                          conflict!
+'V'   C0     linux/ivtv.h                                            conflict!
+'V'   C0     media/davinci/vpfe_capture.h                            conflict!
+'V'   C0     media/si4713.h                                          conflict!
+'W'   00-1F  linux/watchdog.h                                        conflict!
+'W'   00-1F  linux/wanrouter.h                                       conflict! (pre 3.9)
+'W'   00-3F  sound/asound.h                                          conflict!
+'W'   40-5F  drivers/pci/switch/switchtec.c
+'X'   all    fs/xfs/xfs_fs.h,                                        conflict!
+             fs/xfs/linux-2.6/xfs_ioctl32.h,
+             include/linux/falloc.h,
+             linux/fs.h,
+'X'   all    fs/ocfs2/ocfs_fs.h                                      conflict!
+'X'   01     linux/pktcdvd.h                                         conflict!
+'Y'   all    linux/cyclades.h
+'Z'   14-15  drivers/message/fusion/mptctl.h
+'['   00-3F  linux/usb/tmc.h                                         USB Test and Measurement Devices
+                                                                     <mailto:gregkh@linuxfoundation.org>
+'a'   all    linux/atm*.h, linux/sonet.h                             ATM on linux
+                                                                     <http://lrcwww.epfl.ch/>
+'a'   00-0F  drivers/crypto/qat/qat_common/adf_cfg_common.h          conflict! qat driver
+'b'   00-FF                                                          conflict! bit3 vme host bridge
+                                                                     <mailto:natalia@nikhefk.nikhef.nl>
+'c'   all    linux/cm4000_cs.h                                       conflict!
+'c'   00-7F  linux/comstats.h                                        conflict!
+'c'   00-7F  linux/coda.h                                            conflict!
+'c'   00-1F  linux/chio.h                                            conflict!
+'c'   80-9F  arch/s390/include/asm/chsc.h                            conflict!
+'c'   A0-AF  arch/x86/include/asm/msr.h conflict!
+'d'   00-FF  linux/char/drm/drm.h                                    conflict!
+'d'   02-40  pcmcia/ds.h                                             conflict!
+'d'   F0-FF  linux/digi1.h
+'e'   all    linux/digi1.h                                           conflict!
+'f'   00-1F  linux/ext2_fs.h                                         conflict!
+'f'   00-1F  linux/ext3_fs.h                                         conflict!
+'f'   00-0F  fs/jfs/jfs_dinode.h                                     conflict!
+'f'   00-0F  fs/ext4/ext4.h                                          conflict!
+'f'   00-0F  linux/fs.h                                              conflict!
+'f'   00-0F  fs/ocfs2/ocfs2_fs.h                                     conflict!
+'g'   00-0F  linux/usb/gadgetfs.h
+'g'   20-2F  linux/usb/g_printer.h
+'h'   00-7F                                                          conflict! Charon filesystem
+                                                                     <mailto:zapman@interlan.net>
+'h'   00-1F  linux/hpet.h                                            conflict!
+'h'   80-8F  fs/hfsplus/ioctl.c
+'i'   00-3F  linux/i2o-dev.h                                         conflict!
+'i'   0B-1F  linux/ipmi.h                                            conflict!
+'i'   80-8F  linux/i8k.h
+'j'   00-3F  linux/joystick.h
+'k'   00-0F  linux/spi/spidev.h                                      conflict!
+'k'   00-05  video/kyro.h                                            conflict!
+'k'   10-17  linux/hsi/hsi_char.h                                    HSI character device
+'l'   00-3F  linux/tcfs_fs.h                                         transparent cryptographic file system
+                                                                     <http://web.archive.org/web/%2A/http://mikonos.dia.unisa.it/tcfs>
+'l'   40-7F  linux/udf_fs_i.h                                        in development:
+                                                                     <http://sourceforge.net/projects/linux-udf/>
+'m'   00-09  linux/mmtimer.h                                         conflict!
+'m'   all    linux/mtio.h                                            conflict!
+'m'   all    linux/soundcard.h                                       conflict!
+'m'   all    linux/synclink.h                                        conflict!
+'m'   00-19  drivers/message/fusion/mptctl.h                         conflict!
+'m'   00     drivers/scsi/megaraid/megaraid_ioctl.h                  conflict!
+'n'   00-7F  linux/ncp_fs.h and fs/ncpfs/ioctl.c
+'n'   80-8F  uapi/linux/nilfs2_api.h                                 NILFS2
+'n'   E0-FF  linux/matroxfb.h                                        matroxfb
+'o'   00-1F  fs/ocfs2/ocfs2_fs.h                                     OCFS2
+'o'   00-03  mtd/ubi-user.h                                          conflict! (OCFS2 and UBI overlaps)
+'o'   40-41  mtd/ubi-user.h                                          UBI
+'o'   01-A1  `linux/dvb/*.h`                                         DVB
+'p'   00-0F  linux/phantom.h                                         conflict! (OpenHaptics needs this)
+'p'   00-1F  linux/rtc.h                                             conflict!
+'p'   00-3F  linux/mc146818rtc.h                                     conflict!
+'p'   40-7F  linux/nvram.h
+'p'   80-9F  linux/ppdev.h                                           user-space parport
+                                                                     <mailto:tim@cyberelk.net>
+'p'   A1-A5  linux/pps.h                                             LinuxPPS
+                                                                     <mailto:giometti@linux.it>
+'q'   00-1F  linux/serio.h
+'q'   80-FF  linux/telephony.h                                       Internet PhoneJACK, Internet LineJACK
+             linux/ixjuser.h                                         <http://web.archive.org/web/%2A/http://www.quicknet.net>
+'r'   00-1F  linux/msdos_fs.h and fs/fat/dir.c
+'s'   all    linux/cdk.h
+'t'   00-7F  linux/ppp-ioctl.h
+'t'   80-8F  linux/isdn_ppp.h
+'t'   90-91  linux/toshiba.h                                         toshiba and toshiba_acpi SMM
+'u'   00-1F  linux/smb_fs.h                                          gone
+'u'   20-3F  linux/uvcvideo.h                                        USB video class host driver
+'u'   40-4f  linux/udmabuf.h                                         userspace dma-buf misc device
+'v'   00-1F  linux/ext2_fs.h                                         conflict!
+'v'   00-1F  linux/fs.h                                              conflict!
+'v'   00-0F  linux/sonypi.h                                          conflict!
+'v'   00-0F  media/v4l2-subdev.h                                     conflict!
+'v'   C0-FF  linux/meye.h                                            conflict!
+'w'   all                                                            CERN SCI driver
+'y'   00-1F                                                          packet based user level communications
+                                                                     <mailto:zapman@interlan.net>
+'z'   00-3F                                                          CAN bus card conflict!
+                                                                     <mailto:hdstich@connectu.ulm.circular.de>
+'z'   40-7F                                                          CAN bus card conflict!
+                                                                     <mailto:oe@port.de>
+'z'   10-4F  drivers/s390/crypto/zcrypt_api.h                        conflict!
+'|'   00-7F  linux/media.h
+0x80  00-1F  linux/fb.h
+0x89  00-06  arch/x86/include/asm/sockios.h
+0x89  0B-DF  linux/sockios.h
+0x89  E0-EF  linux/sockios.h                                         SIOCPROTOPRIVATE range
+0x89  E0-EF  linux/dn.h                                              PROTOPRIVATE range
+0x89  F0-FF  linux/sockios.h                                         SIOCDEVPRIVATE range
+0x8B  all    linux/wireless.h
+0x8C  00-3F                                                          WiNRADiO driver
+                                                                     <http://www.winradio.com.au/>
+0x90  00     drivers/cdrom/sbpcd.h
+0x92  00-0F  drivers/usb/mon/mon_bin.c
+0x93  60-7F  linux/auto_fs.h
+0x94  all    fs/btrfs/ioctl.h                                        Btrfs filesystem
+             and linux/fs.h                                          some lifted to vfs/generic
+0x97  00-7F  fs/ceph/ioctl.h                                         Ceph file system
+0x99  00-0F                                                          537-Addinboard driver
+                                                                     <mailto:buk@buks.ipn.de>
+0xA0  all    linux/sdp/sdp.h                                         Industrial Device Project
+                                                                     <mailto:kenji@bitgate.com>
+0xA1  0      linux/vtpm_proxy.h                                      TPM Emulator Proxy Driver
+0xA3  80-8F                                                          Port ACL  in development:
+                                                                     <mailto:tlewis@mindspring.com>
+0xA3  90-9F  linux/dtlk.h
+0xA4  00-1F  uapi/linux/tee.h                                        Generic TEE subsystem
+0xAA  00-3F  linux/uapi/linux/userfaultfd.h
+0xAB  00-1F  linux/nbd.h
+0xAC  00-1F  linux/raw.h
+0xAD  00                                                             Netfilter device in development:
+                                                                     <mailto:rusty@rustcorp.com.au>
+0xAE  all    linux/kvm.h                                             Kernel-based Virtual Machine
+                                                                     <mailto:kvm@vger.kernel.org>
+0xAF  00-1F  linux/fsl_hypervisor.h                                  Freescale hypervisor
+0xB0  all                                                            RATIO devices in development:
+                                                                     <mailto:vgo@ratio.de>
+0xB1  00-1F                                                          PPPoX
+                                                                     <mailto:mostrows@styx.uwaterloo.ca>
+0xB3  00     linux/mmc/ioctl.h
+0xB4  00-0F  linux/gpio.h                                            <mailto:linux-gpio@vger.kernel.org>
+0xB5  00-0F  uapi/linux/rpmsg.h                                      <mailto:linux-remoteproc@vger.kernel.org>
+0xB6  all    linux/fpga-dfl.h
+0xC0  00-0F  linux/usb/iowarrior.h
+0xCA  00-0F  uapi/misc/cxl.h
+0xCA  10-2F  uapi/misc/ocxl.h
+0xCA  80-BF  uapi/scsi/cxlflash_ioctl.h
+0xCB  00-1F                                                          CBM serial IEC bus in development:
+                                                                     <mailto:michael.klein@puffin.lb.shuttle.de>
+0xCC  00-0F  drivers/misc/ibmvmc.h                                   pseries VMC driver
+0xCD  01     linux/reiserfs_fs.h
+0xCF  02     fs/cifs/ioctl.c
+0xDB  00-0F  drivers/char/mwave/mwavepub.h
+0xDD  00-3F                                                          ZFCP device driver see drivers/s390/scsi/
+                                                                     <mailto:aherrman@de.ibm.com>
+0xE5  00-3F  linux/fuse.h
+0xEC  00-01  drivers/platform/chrome/cros_ec_dev.h                   ChromeOS EC driver
+0xF3  00-3F  drivers/usb/misc/sisusbvga/sisusb.h                     sisfb (in development)
+                                                                     <mailto:thomas@winischhofer.net>
+0xF4  00-1F  video/mbxfb.h                                           mbxfb
+                                                                     <mailto:raph@8d.com>
+0xF6  all                                                            LTTng Linux Trace Toolkit Next Generation
+                                                                     <mailto:mathieu.desnoyers@efficios.com>
+0xFD  all    linux/dm-ioctl.h
+====  =====  ======================================================= ================================================================
diff --git a/Documentation/process/submit-checklist.rst b/Documentation/process/submit-checklist.rst
index 365efc9e4aa8..8e56337d422d 100644
--- a/Documentation/process/submit-checklist.rst
+++ b/Documentation/process/submit-checklist.rst
@@ -107,7 +107,7 @@ and elsewhere regarding submitting Linux kernel patches.
     and why.
 
 26) If any ioctl's are added by the patch, then also update
-    ``Documentation/ioctl/ioctl-number.txt``.
+    ``Documentation/ioctl/ioctl-number.rst``.
 
 27) If your modified source code depends on or uses any of the kernel
     APIs or features that are related to the following ``Kconfig`` symbols,
diff --git a/Documentation/translations/it_IT/process/submit-checklist.rst b/Documentation/translations/it_IT/process/submit-checklist.rst
index ea74cae958d7..995ee69fab11 100644
--- a/Documentation/translations/it_IT/process/submit-checklist.rst
+++ b/Documentation/translations/it_IT/process/submit-checklist.rst
@@ -117,7 +117,7 @@ sottomissione delle patch, in particolare
     sorgenti che ne spieghi la logica: cosa fanno e perché.
 
 25) Se la patch aggiunge nuove chiamate ioctl, allora aggiornate
-    ``Documentation/ioctl/ioctl-number.txt``.
+    ``Documentation/ioctl/ioctl-number.rst``.
 
 26) Se il codice che avete modificato dipende o usa una qualsiasi interfaccia o
     funzionalità del kernel che è associata a uno dei seguenti simboli
diff --git a/Documentation/translations/zh_CN/process/submit-checklist.rst b/Documentation/translations/zh_CN/process/submit-checklist.rst
index f4785d2b0491..8738c55e42a2 100644
--- a/Documentation/translations/zh_CN/process/submit-checklist.rst
+++ b/Documentation/translations/zh_CN/process/submit-checklist.rst
@@ -97,7 +97,7 @@ Linux内核补丁提交清单
 24) 所有内存屏障例如 ``barrier()``, ``rmb()``, ``wmb()`` 都需要源代码中的注
     释来解释它们正在执行的操作及其原因的逻辑。
 
-25) 如果补丁添加了任何ioctl,那么也要更新 ``Documentation/ioctl/ioctl-number.txt``
+25) 如果补丁添加了任何ioctl,那么也要更新 ``Documentation/ioctl/ioctl-number.rst``
 
 26) 如果修改后的源代码依赖或使用与以下 ``Kconfig`` 符号相关的任何内核API或
     功能,则在禁用相关 ``Kconfig`` 符号和/或 ``=m`` (如果该选项可用)的情况
diff --git a/include/uapi/rdma/rdma_user_ioctl_cmds.h b/include/uapi/rdma/rdma_user_ioctl_cmds.h
index 26213f49f5c8..54e16a589472 100644
--- a/include/uapi/rdma/rdma_user_ioctl_cmds.h
+++ b/include/uapi/rdma/rdma_user_ioctl_cmds.h
@@ -36,7 +36,7 @@
 #include <linux/types.h>
 #include <linux/ioctl.h>
 
-/* Documentation/ioctl/ioctl-number.txt */
+/* Documentation/ioctl/ioctl-number.rst */
 #define RDMA_IOCTL_MAGIC	0x1b
 #define RDMA_VERBS_IOCTL \
 	_IOWR(RDMA_IOCTL_MAGIC, 1, struct ib_uverbs_ioctl_hdr)
-- 
2.21.0

^ permalink raw reply related

* Re: [PATCH bpf-next] samples: bpf: Remove bpf_debug macro in favor of bpf_printk
From: Andrii Nakryiko @ 2019-06-18 23:14 UTC (permalink / raw)
  To: Michal Rostecki
  Cc: Doug Ledford, Jason Gunthorpe, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	linux-rdma, Networking, bpf, open list
In-Reply-To: <20190618181338.24145-1-mrostecki@opensuse.org>

On Tue, Jun 18, 2019 at 11:13 AM Michal Rostecki <mrostecki@opensuse.org> wrote:
>
> ibumad example was implementing the bpf_debug macro which is exactly the
> same as the bpf_printk macro available in bpf_helpers.h. This change
> makes use of bpf_printk instead of bpf_debug.
>
> Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
> ---

Acked-by: Andrii Nakryiko <andriin@fb.com>

>  samples/bpf/ibumad_kern.c | 18 ++++++------------
>  1 file changed, 6 insertions(+), 12 deletions(-)
>

<snip>

^ permalink raw reply

* Re: [PATCH v3 hmm 11/12] mm/hmm: Remove confusing comment and logic from hmm_release
From: Kuehling, Felix @ 2019-06-19  0:53 UTC (permalink / raw)
  To: Christoph Hellwig, Jason Gunthorpe
  Cc: Andrea Arcangeli, Yang, Philip, Ralph Campbell,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, John Hubbard,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, Jerome Glisse,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Ben Skeggs
In-Reply-To: <20190618053733.GA25048-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>

On 2019-06-18 1:37, Christoph Hellwig wrote:
> On Mon, Jun 17, 2019 at 09:45:09PM -0300, Jason Gunthorpe wrote:
>> Am I looking at the wrong thing? Looks like it calls it through a work
>> queue should should be OK..
> Yes, it calls it through a work queue.  I guess that is fine because
> it needs to take the lock again.
>
>> Though very strange that amdgpu only destroys the mirror via release,
>> that cannot be right.
> As said the whole things looks rather odd to me.

This code is derived from our old MMU notifier code. Before HMM we used 
to register a single MMU notifier per mm_struct and look up virtual 
address ranges that had been registered for mirroring via driver API 
calls. The idea was to reuse a single MMU notifier for the life time of 
the process. It would remain registered until we got a notifier_release.

hmm_mirror took the place of that when we converted the code to HMM.

I suppose we could destroy the mirror earlier, when we have no more 
registered virtual address ranges, and create a new one if needed later.

Regards,
   Felix


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply

* Re: [PATCH][next] net/mlx5: add missing void argument to function mlx5_devlink_alloc
From: David Miller @ 2019-06-19  2:30 UTC (permalink / raw)
  To: colin.king
  Cc: saeedm, leon, netdev, linux-rdma, kernel-janitors, linux-kernel
In-Reply-To: <20190618151510.18672-1-colin.king@canonical.com>

From: Colin King <colin.king@canonical.com>
Date: Tue, 18 Jun 2019 16:15:10 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> Function mlx5_devlink_alloc is missing a void argument, add it
> to clean up the non-ANSI function declaration.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied.

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Jianbo Liu @ 2019-06-19  4:44 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan, Mark Bloch
In-Reply-To: <20190618101928.GE4690@mtr-leonro.mtl.com>

The 06/18/2019 18:19, Leon Romanovsky wrote:
> On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
> > From: Jianbo Liu <jianbol@mellanox.com>
> >
> > If vport metadata matching is enabled in eswitch, the rule created
> > must be changed to match on the metadata, instead of source port.
> >
> > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > ---
> >  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
> >  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
> >  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
> >  3 files changed, 63 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> > index 22e651cb5534..d4ed611de35d 100644
> > --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> > +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> > @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
> >  	return mlx5_eswitch_vport_rep(esw, vport);
> >  }
> >
> > +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
> > +{
> > +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
> > +}
> > +
> > +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
> > +						 u16 vport)
> > +{
> > +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
> > +}
> 
> 1. There is no need to introduce one line functions, call to that code directly.

No. They are in IB, and we don't want them be mixed up by the original
functions in eswitch. Please ask Mark more about it.

> 2. It should be bool and not u32.
> 
> Thanks

-- 

^ permalink raw reply

* Re: [PATCH rdma-next v1 00/12] DEVX asynchronous events
From: Leon Romanovsky @ 2019-06-19  4:45 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: Jason Gunthorpe, dledford@redhat.com, Yishai Hadas,
	netdev@vger.kernel.org, linux-rdma@vger.kernel.org
In-Reply-To: <19107c92279cf4ad4d870fa54514423c5e46b748.camel@mellanox.com>

On Tue, Jun 18, 2019 at 06:51:45PM +0000, Saeed Mahameed wrote:
> On Tue, 2019-06-18 at 20:15 +0300, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro@mellanox.com>
> >
> > Changelog:
> >  v0 -> v1:
>
> Normally 1st submission is V1 and 2nd is V2.
> so this should have been v1->v2.

"Normally" depends on the language you are using. In C, everything
starts from 0, including version of patches :).

>
> For mlx5-next patches:
>
> Acked-by: Saeed Mahameed <saeedm@mellanox.com>

Thanks

^ permalink raw reply

* Re: [PATCH mlx5-next 14/15] {IB, net}/mlx5: E-Switch, Use index of rep for vport to IB port mapping
From: Leon Romanovsky @ 2019-06-19  5:00 UTC (permalink / raw)
  To: Saeed Mahameed
  Cc: Parav Pandit, Mark Bloch, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Bodong Wang
In-Reply-To: <7b098b42a51e5b96eca99c024719eebafa775f7a.camel@mellanox.com>

On Tue, Jun 18, 2019 at 06:25:46PM +0000, Saeed Mahameed wrote:
> On Tue, 2019-06-18 at 10:47 +0000, Parav Pandit wrote:
> > Hi Leon,
> >
> > > -----Original Message-----
> > > From: Leon Romanovsky
> > > Sent: Tuesday, June 18, 2019 4:12 PM
> > > To: Saeed Mahameed <saeedm@mellanox.com>
> > > Cc: netdev@vger.kernel.org; linux-rdma@vger.kernel.org; Bodong Wang
> > > <bodong@mellanox.com>; Parav Pandit <parav@mellanox.com>; Mark
> > > Bloch
> > > <markb@mellanox.com>
> > > Subject: Re: [PATCH mlx5-next 14/15] {IB, net}/mlx5: E-Switch, Use
> > > index of rep
> > > for vport to IB port mapping
> > >
> > > On Mon, Jun 17, 2019 at 07:23:37PM +0000, Saeed Mahameed wrote:
> > > > From: Bodong Wang <bodong@mellanox.com>
> > > >
> > > > In the single IB device mode, the mapping between vport number
> > > > and rep
> > > > relies on a counter. However for dynamic vport allocation, it is
> > > > desired to keep consistent map of eswitch vport and IB port.
> > > >
> > > > Hence, simplify code to remove the free running counter and
> > > > instead
> > > > use the available vport index during load/unload sequence from
> > > > the
> > > > eswitch.
> > > >
> > > > Signed-off-by: Bodong Wang <bodong@mellanox.com>
> > > > Suggested-by: Parav Pandit <parav@mellanox.com>
> > > > Reviewed-by: Parav Pandit <parav@mellanox.com>
> > >
> > > We are not adding multiple "*-by" for same user, please choose one.
> > >
> > Suggested-by was added by Bodong during our discussion. Later on when
> > I did gerrit +1, RB tag got added.
> >
>
> Is there a rule against having multiple "*-by" ? i don't think so  and
> there shouldn't be, users need to get the exact amount of recognition
> as the amount of work they put into this patch, if they reviewed and
> tested a patch they deserve two tags ..

Not everything in the world has and needs rules, sometimes common sense
is enough. It goes without saying that during internal review process,
developer suggested something. Recognition comes in many ways in the
kernel but definitely not by number of tags with specific developer
name on it, especially if this developer comes from same company
as patch author.

If we extend your claim, both you and me should add this type of
signature block for almost every patch which we submit:

Reviewed-by: ....
Tested-by:  ....
Suggested-by: ...
Signed-by: ...

Thanks

>
>

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Leon Romanovsky @ 2019-06-19  5:04 UTC (permalink / raw)
  To: Jianbo Liu
  Cc: Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan, Mark Bloch
In-Reply-To: <20190619044420.GA30694@mellanox.com>

On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
> The 06/18/2019 18:19, Leon Romanovsky wrote:
> > On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
> > > From: Jianbo Liu <jianbol@mellanox.com>
> > >
> > > If vport metadata matching is enabled in eswitch, the rule created
> > > must be changed to match on the metadata, instead of source port.
> > >
> > > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > > ---
> > >  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
> > >  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
> > >  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
> > >  3 files changed, 63 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> > > index 22e651cb5534..d4ed611de35d 100644
> > > --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> > > +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> > > @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
> > >  	return mlx5_eswitch_vport_rep(esw, vport);
> > >  }
> > >
> > > +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
> > > +{
> > > +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
> > > +}
> > > +
> > > +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
> > > +						 u16 vport)
> > > +{
> > > +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
> > > +}
> >
> > 1. There is no need to introduce one line functions, call to that code directly.
>
> No. They are in IB, and we don't want them be mixed up by the original
> functions in eswitch. Please ask Mark more about it.

Please enlighten me.

>
> > 2. It should be bool and not u32.
> >
> > Thanks
>
> --

^ permalink raw reply

* Re: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with vport number in VF vports and uplink ingress ACLs
From: Jianbo Liu @ 2019-06-19  5:12 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Saeed Mahameed, Leon Romanovsky, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Eli Britstein, Roi Dayan, Mark Bloch
In-Reply-To: <AM0PR05MB48664868E0B89E582807830BD1EA0@AM0PR05MB4866.eurprd05.prod.outlook.com>

The 06/18/2019 18:31, Parav Pandit wrote:
> 
> 
> > -----Original Message-----
> > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > Behalf Of Saeed Mahameed
> > Sent: Tuesday, June 18, 2019 12:53 AM
> > To: Saeed Mahameed <saeedm@mellanox.com>; Leon Romanovsky
> > <leonro@mellanox.com>
> > Cc: netdev@vger.kernel.org; linux-rdma@vger.kernel.org; Jianbo Liu
> > <jianbol@mellanox.com>; Eli Britstein <elibr@mellanox.com>; Roi Dayan
> > <roid@mellanox.com>; Mark Bloch <markb@mellanox.com>
> > Subject: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with vport
> > number in VF vports and uplink ingress ACLs
> > 
> > From: Jianbo Liu <jianbol@mellanox.com>
> > 
> > When a dual-port VHCA sends a RoCE packet on its non-native port, and the
> > packet arrives to its affiliated vport FDB, a mismatch might occur on the rules
> > that match the packet source vport as it is not represented by single VHCA only
> > in this case. So we change to match on metadata instead of source vport.
> > To do that, a rule is created in all vports and uplink ingress ACLs, to save the
> > source vport number and vhca id in the packet's metadata in order to match on
> > it later.
> > The metadata register used is the first of the 32-bit type C registers. It can be
> > used for matching and header modify operations. The higher 16 bits of this
> > register are for vhca id, and the lower 16 ones is for vport number.
> > This change is not for dual-port RoCE only. If HW and FW allow, the vport
> > metadata matching is enabled by default.
> > 
> > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > Reviewed-by: Eli Britstein <elibr@mellanox.com>
> > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > ---
> >  .../net/ethernet/mellanox/mlx5/core/eswitch.c |   2 +
> >  .../net/ethernet/mellanox/mlx5/core/eswitch.h |   9 +
> >  .../mellanox/mlx5/core/eswitch_offloads.c     | 183 ++++++++++++++----
> >  include/linux/mlx5/eswitch.h                  |   3 +
> >  4 files changed, 161 insertions(+), 36 deletions(-)
> > 
> > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > index a42a23e505df..1235fd84ae3a 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > @@ -1168,6 +1168,8 @@ void esw_vport_cleanup_ingress_rules(struct
> > mlx5_eswitch *esw,
> > 
> >  	vport->ingress.drop_rule = NULL;
> >  	vport->ingress.allow_rule = NULL;
> > +
> > +	esw_vport_del_ingress_acl_modify_metadata(esw, vport);
> >  }
> > 
> >  void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw, diff --git
> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > index 8b9f2cf58e91..4417a195832e 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > @@ -68,6 +68,8 @@ struct vport_ingress {
> >  	struct mlx5_flow_group *allow_spoofchk_only_grp;
> >  	struct mlx5_flow_group *allow_untagged_only_grp;
> >  	struct mlx5_flow_group *drop_grp;
> > +	int                      modify_metadata_id;
> No need for random alignment. Just have one white space after int.

Not random. It's to align with other lines in the this structure.
There are also other fileds with more than one spaces after type.
It looks ugly if there are different styles in the same structure.

> 
> > +	struct mlx5_flow_handle  *modify_metadata_rule;
> >  	struct mlx5_flow_handle  *allow_rule;
> >  	struct mlx5_flow_handle  *drop_rule;
> >  	struct mlx5_fc           *drop_counter;
> > @@ -196,6 +198,10 @@ struct mlx5_esw_functions {
> >  	u16			num_vfs;
> >  };
> > 
> > +enum {
> > +	MLX5_ESWITCH_VPORT_MATCH_METADATA = BIT(0), };
> > +
> >  struct mlx5_eswitch {
> >  	struct mlx5_core_dev    *dev;
> >  	struct mlx5_nb          nb;
> > @@ -203,6 +209,7 @@ struct mlx5_eswitch {
> >  	struct hlist_head       mc_table[MLX5_L2_ADDR_HASH_SIZE];
> >  	struct workqueue_struct *work_queue;
> >  	struct mlx5_vport       *vports;
> > +	u32                     flags;
> Same as above, no need for extra aligment.

Same reason.

> 
> >  	int                     total_vports;
> >  	int                     enabled_vports;
> >  	/* Synchronize between vport change events @@ -240,6 +247,8 @@
> > void esw_vport_disable_egress_acl(struct mlx5_eswitch *esw,
> >  				  struct mlx5_vport *vport);
> >  void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw,
> >  				   struct mlx5_vport *vport);
> > +void esw_vport_del_ingress_acl_modify_metadata(struct mlx5_eswitch *esw,
> > +					       struct mlx5_vport *vport);
> > 
> >  /* E-Switch API */
> >  int mlx5_eswitch_init(struct mlx5_core_dev *dev); diff --git
> > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > index 17abb98b48af..871ae44dc132 100644
> > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c

...

> > +static int esw_create_offloads_acl_tables(struct mlx5_eswitch *esw) {
> > +	struct mlx5_vport *vport;
> > +	int i, j;
> > +	int err;
> > +
> > +	mlx5_esw_for_all_vports(esw, i, vport) {
> > +		err = esw_vport_ingress_common_config(esw, vport);
> >  		if (err)
> > -			goto err_egress;
> > +			goto err_ingress;
> > +
> > +		if (vport->vport >= MLX5_VPORT_FIRST_VF &&
> > +		    vport->vport <= esw->dev->priv.sriov.num_vfs) {
> Add an helper API mlx5_esw_is_vport(const struct mlx5_esw *esw, const struct mlx5_vport *vport) 
> and use at two places in ingress and egress config.

It's very simple logic, but new API make things complicated. If adding
mlx5_esw_is_vport() as you suggested, no one can know what's the meaning
of this function from name, and need to check the implementation again,
which will waste too much time.

> 

^ permalink raw reply

* RE: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with vport number in VF vports and uplink ingress ACLs
From: Parav Pandit @ 2019-06-19  5:42 UTC (permalink / raw)
  To: Jianbo Liu
  Cc: Saeed Mahameed, Leon Romanovsky, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Eli Britstein, Roi Dayan, Mark Bloch
In-Reply-To: <20190619051143.GB30694@mellanox.com>



> -----Original Message-----
> From: Jianbo Liu
> Sent: Wednesday, June 19, 2019 10:42 AM
> To: Parav Pandit <parav@mellanox.com>
> Cc: Saeed Mahameed <saeedm@mellanox.com>; Leon Romanovsky
> <leonro@mellanox.com>; netdev@vger.kernel.org; linux-
> rdma@vger.kernel.org; Eli Britstein <elibr@mellanox.com>; Roi Dayan
> <roid@mellanox.com>; Mark Bloch <markb@mellanox.com>
> Subject: Re: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with
> vport number in VF vports and uplink ingress ACLs
> 
> The 06/18/2019 18:31, Parav Pandit wrote:
> >
> >
> > > -----Original Message-----
> > > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > > Behalf Of Saeed Mahameed
> > > Sent: Tuesday, June 18, 2019 12:53 AM
> > > To: Saeed Mahameed <saeedm@mellanox.com>; Leon Romanovsky
> > > <leonro@mellanox.com>
> > > Cc: netdev@vger.kernel.org; linux-rdma@vger.kernel.org; Jianbo Liu
> > > <jianbol@mellanox.com>; Eli Britstein <elibr@mellanox.com>; Roi
> > > Dayan <roid@mellanox.com>; Mark Bloch <markb@mellanox.com>
> > > Subject: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with
> > > vport number in VF vports and uplink ingress ACLs
> > >
> > > From: Jianbo Liu <jianbol@mellanox.com>
> > >
> > > When a dual-port VHCA sends a RoCE packet on its non-native port,
> > > and the packet arrives to its affiliated vport FDB, a mismatch might
> > > occur on the rules that match the packet source vport as it is not
> > > represented by single VHCA only in this case. So we change to match on
> metadata instead of source vport.
> > > To do that, a rule is created in all vports and uplink ingress ACLs,
> > > to save the source vport number and vhca id in the packet's metadata
> > > in order to match on it later.
> > > The metadata register used is the first of the 32-bit type C
> > > registers. It can be used for matching and header modify operations.
> > > The higher 16 bits of this register are for vhca id, and the lower 16 ones is
> for vport number.
> > > This change is not for dual-port RoCE only. If HW and FW allow, the
> > > vport metadata matching is enabled by default.
> > >
> > > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > > Reviewed-by: Eli Britstein <elibr@mellanox.com>
> > > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > > ---
> > >  .../net/ethernet/mellanox/mlx5/core/eswitch.c |   2 +
> > >  .../net/ethernet/mellanox/mlx5/core/eswitch.h |   9 +
> > >  .../mellanox/mlx5/core/eswitch_offloads.c     | 183 ++++++++++++++----
> > >  include/linux/mlx5/eswitch.h                  |   3 +
> > >  4 files changed, 161 insertions(+), 36 deletions(-)
> > >
> > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > index a42a23e505df..1235fd84ae3a 100644
> > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > @@ -1168,6 +1168,8 @@ void esw_vport_cleanup_ingress_rules(struct
> > > mlx5_eswitch *esw,
> > >
> > >  	vport->ingress.drop_rule = NULL;
> > >  	vport->ingress.allow_rule = NULL;
> > > +
> > > +	esw_vport_del_ingress_acl_modify_metadata(esw, vport);
> > >  }
> > >
> > >  void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw, diff
> > > --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > index 8b9f2cf58e91..4417a195832e 100644
> > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > @@ -68,6 +68,8 @@ struct vport_ingress {
> > >  	struct mlx5_flow_group *allow_spoofchk_only_grp;
> > >  	struct mlx5_flow_group *allow_untagged_only_grp;
> > >  	struct mlx5_flow_group *drop_grp;
> > > +	int                      modify_metadata_id;
> > No need for random alignment. Just have one white space after int.
> 
> Not random. It's to align with other lines in the this structure.
> There are also other fileds with more than one spaces after type.
> It looks ugly if there are different styles in the same structure.
> 
Whatever was done in past was done.
There will be mixed alignment anyway.

> >
> > > +	struct mlx5_flow_handle  *modify_metadata_rule;
> > >  	struct mlx5_flow_handle  *allow_rule;
> > >  	struct mlx5_flow_handle  *drop_rule;
> > >  	struct mlx5_fc           *drop_counter;
> > > @@ -196,6 +198,10 @@ struct mlx5_esw_functions {
> > >  	u16			num_vfs;
> > >  };
> > >
> > > +enum {
> > > +	MLX5_ESWITCH_VPORT_MATCH_METADATA = BIT(0), };
> > > +
> > >  struct mlx5_eswitch {
> > >  	struct mlx5_core_dev    *dev;
> > >  	struct mlx5_nb          nb;
> > > @@ -203,6 +209,7 @@ struct mlx5_eswitch {
> > >  	struct hlist_head       mc_table[MLX5_L2_ADDR_HASH_SIZE];
> > >  	struct workqueue_struct *work_queue;
> > >  	struct mlx5_vport       *vports;
> > > +	u32                     flags;
> > Same as above, no need for extra aligment.
> 
> Same reason.
> 
> >
> > >  	int                     total_vports;
> > >  	int                     enabled_vports;
> > >  	/* Synchronize between vport change events @@ -240,6 +247,8 @@
> > > void esw_vport_disable_egress_acl(struct mlx5_eswitch *esw,
> > >  				  struct mlx5_vport *vport);
> > >  void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw,
> > >  				   struct mlx5_vport *vport);
> > > +void esw_vport_del_ingress_acl_modify_metadata(struct mlx5_eswitch
> *esw,
> > > +					       struct mlx5_vport *vport);
> > >
> > >  /* E-Switch API */
> > >  int mlx5_eswitch_init(struct mlx5_core_dev *dev); diff --git
> > > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > > index 17abb98b48af..871ae44dc132 100644
> > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> 
> ...
> 
> > > +static int esw_create_offloads_acl_tables(struct mlx5_eswitch *esw) {
> > > +	struct mlx5_vport *vport;
> > > +	int i, j;
> > > +	int err;
> > > +
> > > +	mlx5_esw_for_all_vports(esw, i, vport) {
> > > +		err = esw_vport_ingress_common_config(esw, vport);
> > >  		if (err)
> > > -			goto err_egress;
> > > +			goto err_ingress;
> > > +
> > > +		if (vport->vport >= MLX5_VPORT_FIRST_VF &&
> > > +		    vport->vport <= esw->dev->priv.sriov.num_vfs) {
> > Add an helper API mlx5_esw_is_vport(const struct mlx5_esw *esw, const
> > struct mlx5_vport *vport) and use at two places in ingress and egress config.
> 
> It's very simple logic, but new API make things complicated.

No. it doesn't. Right API name is,
mlx5_esw_is_vf_vport().
mlx5_esw_is_vf_rep()...
etc.

> If adding mlx5_esw_is_vport() as you suggested, no one can know what's the meaning of
> this function from name, and need to check the implementation again, which
> will waste too much time.
> 
mlx5_esw_is_vf_vport() is self-explanatory name which won't waste time.

I am already having this API in my two series, but since yours is already out, it make sense to introduce in this patch.

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Jianbo Liu @ 2019-06-19  6:40 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan, Mark Bloch
In-Reply-To: <20190619050412.GC11611@mtr-leonro.mtl.com>

The 06/19/2019 13:04, Leon Romanovsky wrote:
> On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
> > The 06/18/2019 18:19, Leon Romanovsky wrote:
> > > On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
> > > > From: Jianbo Liu <jianbol@mellanox.com>
> > > >
> > > > If vport metadata matching is enabled in eswitch, the rule created
> > > > must be changed to match on the metadata, instead of source port.
> > > >
> > > > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > > > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > > > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > > > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > > > ---
> > > >  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
> > > >  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
> > > >  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
> > > >  3 files changed, 63 insertions(+), 9 deletions(-)
> > > >
> > > > diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> > > > index 22e651cb5534..d4ed611de35d 100644
> > > > --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> > > > +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> > > > @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
> > > >  	return mlx5_eswitch_vport_rep(esw, vport);
> > > >  }
> > > >
> > > > +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
> > > > +{
> > > > +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
> > > > +}
> > > > +
> > > > +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
> > > > +						 u16 vport)
> > > > +{
> > > > +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
> > > > +}
> > >
> > > 1. There is no need to introduce one line functions, call to that code directly.
> >
> > No. They are in IB, and we don't want them be mixed up by the original
> > functions in eswitch. Please ask Mark more about it.
> 
> Please enlighten me.

It was suggested by Mark in prevouis review.
I think it's because there are in different modules, and better to with
different names, so introduce there extra one line functions.
Please correct me if I'm wrong, Mark...

> 
> >
> > > 2. It should be bool and not u32.
> > >
> > > Thanks
> >
> > --

-- 

^ permalink raw reply

* Re: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with vport number in VF vports and uplink ingress ACLs
From: Jianbo Liu @ 2019-06-19  6:45 UTC (permalink / raw)
  To: Parav Pandit
  Cc: Saeed Mahameed, Leon Romanovsky, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Eli Britstein, Roi Dayan, Mark Bloch
In-Reply-To: <AM0PR05MB48663F4F6C7CCA9F2DA37074D1E50@AM0PR05MB4866.eurprd05.prod.outlook.com>

The 06/19/2019 13:42, Parav Pandit wrote:
> 
> 
> > -----Original Message-----
> > From: Jianbo Liu
> > Sent: Wednesday, June 19, 2019 10:42 AM
> > To: Parav Pandit <parav@mellanox.com>
> > Cc: Saeed Mahameed <saeedm@mellanox.com>; Leon Romanovsky
> > <leonro@mellanox.com>; netdev@vger.kernel.org; linux-
> > rdma@vger.kernel.org; Eli Britstein <elibr@mellanox.com>; Roi Dayan
> > <roid@mellanox.com>; Mark Bloch <markb@mellanox.com>
> > Subject: Re: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with
> > vport number in VF vports and uplink ingress ACLs
> > 
> > The 06/18/2019 18:31, Parav Pandit wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: netdev-owner@vger.kernel.org <netdev-owner@vger.kernel.org> On
> > > > Behalf Of Saeed Mahameed
> > > > Sent: Tuesday, June 18, 2019 12:53 AM
> > > > To: Saeed Mahameed <saeedm@mellanox.com>; Leon Romanovsky
> > > > <leonro@mellanox.com>
> > > > Cc: netdev@vger.kernel.org; linux-rdma@vger.kernel.org; Jianbo Liu
> > > > <jianbol@mellanox.com>; Eli Britstein <elibr@mellanox.com>; Roi
> > > > Dayan <roid@mellanox.com>; Mark Bloch <markb@mellanox.com>
> > > > Subject: [PATCH mlx5-next 05/15] net/mlx5: E-Switch, Tag packet with
> > > > vport number in VF vports and uplink ingress ACLs
> > > >
> > > > From: Jianbo Liu <jianbol@mellanox.com>
> > > >
> > > > When a dual-port VHCA sends a RoCE packet on its non-native port,
> > > > and the packet arrives to its affiliated vport FDB, a mismatch might
> > > > occur on the rules that match the packet source vport as it is not
> > > > represented by single VHCA only in this case. So we change to match on
> > metadata instead of source vport.
> > > > To do that, a rule is created in all vports and uplink ingress ACLs,
> > > > to save the source vport number and vhca id in the packet's metadata
> > > > in order to match on it later.
> > > > The metadata register used is the first of the 32-bit type C
> > > > registers. It can be used for matching and header modify operations.
> > > > The higher 16 bits of this register are for vhca id, and the lower 16 ones is
> > for vport number.
> > > > This change is not for dual-port RoCE only. If HW and FW allow, the
> > > > vport metadata matching is enabled by default.
> > > >
> > > > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > > > Reviewed-by: Eli Britstein <elibr@mellanox.com>
> > > > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > > > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > > > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > > > ---
> > > >  .../net/ethernet/mellanox/mlx5/core/eswitch.c |   2 +
> > > >  .../net/ethernet/mellanox/mlx5/core/eswitch.h |   9 +
> > > >  .../mellanox/mlx5/core/eswitch_offloads.c     | 183 ++++++++++++++----
> > > >  include/linux/mlx5/eswitch.h                  |   3 +
> > > >  4 files changed, 161 insertions(+), 36 deletions(-)
> > > >
> > > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > > index a42a23e505df..1235fd84ae3a 100644
> > > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.c
> > > > @@ -1168,6 +1168,8 @@ void esw_vport_cleanup_ingress_rules(struct
> > > > mlx5_eswitch *esw,
> > > >
> > > >  	vport->ingress.drop_rule = NULL;
> > > >  	vport->ingress.allow_rule = NULL;
> > > > +
> > > > +	esw_vport_del_ingress_acl_modify_metadata(esw, vport);
> > > >  }
> > > >
> > > >  void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw, diff
> > > > --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > > index 8b9f2cf58e91..4417a195832e 100644
> > > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> > > > @@ -68,6 +68,8 @@ struct vport_ingress {
> > > >  	struct mlx5_flow_group *allow_spoofchk_only_grp;
> > > >  	struct mlx5_flow_group *allow_untagged_only_grp;
> > > >  	struct mlx5_flow_group *drop_grp;
> > > > +	int                      modify_metadata_id;
> > > No need for random alignment. Just have one white space after int.
> > 
> > Not random. It's to align with other lines in the this structure.
> > There are also other fileds with more than one spaces after type.
> > It looks ugly if there are different styles in the same structure.
> > 
> Whatever was done in past was done.
> There will be mixed alignment anyway.
> 
> > >
> > > > +	struct mlx5_flow_handle  *modify_metadata_rule;
> > > >  	struct mlx5_flow_handle  *allow_rule;
> > > >  	struct mlx5_flow_handle  *drop_rule;
> > > >  	struct mlx5_fc           *drop_counter;
> > > > @@ -196,6 +198,10 @@ struct mlx5_esw_functions {
> > > >  	u16			num_vfs;
> > > >  };
> > > >
> > > > +enum {
> > > > +	MLX5_ESWITCH_VPORT_MATCH_METADATA = BIT(0), };
> > > > +
> > > >  struct mlx5_eswitch {
> > > >  	struct mlx5_core_dev    *dev;
> > > >  	struct mlx5_nb          nb;
> > > > @@ -203,6 +209,7 @@ struct mlx5_eswitch {
> > > >  	struct hlist_head       mc_table[MLX5_L2_ADDR_HASH_SIZE];
> > > >  	struct workqueue_struct *work_queue;
> > > >  	struct mlx5_vport       *vports;
> > > > +	u32                     flags;
> > > Same as above, no need for extra aligment.
> > 
> > Same reason.
> > 
> > >
> > > >  	int                     total_vports;
> > > >  	int                     enabled_vports;
> > > >  	/* Synchronize between vport change events @@ -240,6 +247,8 @@
> > > > void esw_vport_disable_egress_acl(struct mlx5_eswitch *esw,
> > > >  				  struct mlx5_vport *vport);
> > > >  void esw_vport_disable_ingress_acl(struct mlx5_eswitch *esw,
> > > >  				   struct mlx5_vport *vport);
> > > > +void esw_vport_del_ingress_acl_modify_metadata(struct mlx5_eswitch
> > *esw,
> > > > +					       struct mlx5_vport *vport);
> > > >
> > > >  /* E-Switch API */
> > > >  int mlx5_eswitch_init(struct mlx5_core_dev *dev); diff --git
> > > > a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > > > b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > > > index 17abb98b48af..871ae44dc132 100644
> > > > --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > > > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
> > 
> > ...
> > 
> > > > +static int esw_create_offloads_acl_tables(struct mlx5_eswitch *esw) {
> > > > +	struct mlx5_vport *vport;
> > > > +	int i, j;
> > > > +	int err;
> > > > +
> > > > +	mlx5_esw_for_all_vports(esw, i, vport) {
> > > > +		err = esw_vport_ingress_common_config(esw, vport);
> > > >  		if (err)
> > > > -			goto err_egress;
> > > > +			goto err_ingress;
> > > > +
> > > > +		if (vport->vport >= MLX5_VPORT_FIRST_VF &&
> > > > +		    vport->vport <= esw->dev->priv.sriov.num_vfs) {
> > > Add an helper API mlx5_esw_is_vport(const struct mlx5_esw *esw, const
> > > struct mlx5_vport *vport) and use at two places in ingress and egress config.
> > 
> > It's very simple logic, but new API make things complicated.
> 
> No. it doesn't. Right API name is,
> mlx5_esw_is_vf_vport().
> mlx5_esw_is_vf_rep()...
> etc.
> 
> > If adding mlx5_esw_is_vport() as you suggested, no one can know what's the meaning of
> > this function from name, and need to check the implementation again, which
> > will waste too much time.
> > 
> mlx5_esw_is_vf_vport() is self-explanatory name which won't waste time.
> 
> I am already having this API in my two series, but since yours is already out, it make sense to introduce in this patch.

Could you please send me? I will add to this series. Thanks!

-- 

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Leon Romanovsky @ 2019-06-19  6:51 UTC (permalink / raw)
  To: Jianbo Liu
  Cc: Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan, Mark Bloch
In-Reply-To: <20190619063941.GA5176@mellanox.com>

On Wed, Jun 19, 2019 at 06:40:16AM +0000, Jianbo Liu wrote:
> The 06/19/2019 13:04, Leon Romanovsky wrote:
> > On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
> > > The 06/18/2019 18:19, Leon Romanovsky wrote:
> > > > On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
> > > > > From: Jianbo Liu <jianbol@mellanox.com>
> > > > >
> > > > > If vport metadata matching is enabled in eswitch, the rule created
> > > > > must be changed to match on the metadata, instead of source port.
> > > > >
> > > > > Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> > > > > Reviewed-by: Roi Dayan <roid@mellanox.com>
> > > > > Reviewed-by: Mark Bloch <markb@mellanox.com>
> > > > > Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> > > > > ---
> > > > >  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
> > > > >  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
> > > > >  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
> > > > >  3 files changed, 63 insertions(+), 9 deletions(-)
> > > > >
> > > > > diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> > > > > index 22e651cb5534..d4ed611de35d 100644
> > > > > --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> > > > > +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> > > > > @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
> > > > >  	return mlx5_eswitch_vport_rep(esw, vport);
> > > > >  }
> > > > >
> > > > > +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
> > > > > +{
> > > > > +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
> > > > > +}
> > > > > +
> > > > > +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
> > > > > +						 u16 vport)
> > > > > +{
> > > > > +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
> > > > > +}
> > > >
> > > > 1. There is no need to introduce one line functions, call to that code directly.
> > >
> > > No. They are in IB, and we don't want them be mixed up by the original
> > > functions in eswitch. Please ask Mark more about it.
> >
> > Please enlighten me.
>
> It was suggested by Mark in prevouis review.
> I think it's because there are in different modules, and better to with
> different names, so introduce there extra one line functions.
> Please correct me if I'm wrong, Mark...

mlx5_ib is full of direct function calls to mlx5_core and it is done on
purpose for at least two reasons. First is to control in one place
all compilation options and expose proper API interface with and without
specific kernel config is on. Second is to emphasize that this is core
function and save us time in refactoring and reviewing.

>
> >
> > >
> > > > 2. It should be bool and not u32.
> > > >
> > > > Thanks
> > >
> > > --
>
> --

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Mark Bloch @ 2019-06-19  7:26 UTC (permalink / raw)
  To: Leon Romanovsky, Jianbo Liu
  Cc: Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan
In-Reply-To: <20190619065125.GF11611@mtr-leonro.mtl.com>



On 6/18/2019 23:51, Leon Romanovsky wrote:
> On Wed, Jun 19, 2019 at 06:40:16AM +0000, Jianbo Liu wrote:
>> The 06/19/2019 13:04, Leon Romanovsky wrote:
>>> On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
>>>> The 06/18/2019 18:19, Leon Romanovsky wrote:
>>>>> On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
>>>>>> From: Jianbo Liu <jianbol@mellanox.com>
>>>>>>
>>>>>> If vport metadata matching is enabled in eswitch, the rule created
>>>>>> must be changed to match on the metadata, instead of source port.
>>>>>>
>>>>>> Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
>>>>>> Reviewed-by: Roi Dayan <roid@mellanox.com>
>>>>>> Reviewed-by: Mark Bloch <markb@mellanox.com>
>>>>>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
>>>>>> ---
>>>>>>  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
>>>>>>  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
>>>>>>  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
>>>>>>  3 files changed, 63 insertions(+), 9 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
>>>>>> index 22e651cb5534..d4ed611de35d 100644
>>>>>> --- a/drivers/infiniband/hw/mlx5/ib_rep.c
>>>>>> +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
>>>>>> @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
>>>>>>  	return mlx5_eswitch_vport_rep(esw, vport);
>>>>>>  }
>>>>>>
>>>>>> +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
>>>>>> +{
>>>>>> +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
>>>>>> +}
>>>>>> +
>>>>>> +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
>>>>>> +						 u16 vport)
>>>>>> +{
>>>>>> +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
>>>>>> +}
>>>>>
>>>>> 1. There is no need to introduce one line functions, call to that code directly.
>>>>
>>>> No. They are in IB, and we don't want them be mixed up by the original
>>>> functions in eswitch. Please ask Mark more about it.
>>>
>>> Please enlighten me.
>>
>> It was suggested by Mark in prevouis review.
>> I think it's because there are in different modules, and better to with
>> different names, so introduce there extra one line functions.
>> Please correct me if I'm wrong, Mark...
> 
> mlx5_ib is full of direct function calls to mlx5_core and it is done on
> purpose for at least two reasons. First is to control in one place
> all compilation options and expose proper API interface with and without
> specific kernel config is on. Second is to emphasize that this is core
> function and save us time in refactoring and reviewing.

This was done in order to avoid #ifdef CONFIG_MLX5_ESWITCH,
I want to hide (as much as possible) the interactions with the eswitch level in ib_rep.c/ib_rep.h
so ib_rep.h will provide the stubs needed in case CONFIG_MLX5_ESWITCH isn't defined.
(Today include/linux/mlx5/eswitch.h) doesn't provide any stubs, mlx5_eswitch_get_encap_mode()
should have probably done the same.

As my long term goal is to break drivers/infiniband/hw/mlx5/main.c (that file is already 7000 LOC)
I want to group together stuff in separate files.

If you prefer direct calls that's okay as well.

Mark

> 
>>
>>>
>>>>
>>>>> 2. It should be bool and not u32.
>>>>>
>>>>> Thanks
>>>>
>>>> --
>>
>> --

^ permalink raw reply

* Re: [PATCH v1 02/22] docs: ioctl-number.txt: convert it to ReST format
From: Federico Vaga @ 2019-06-19  7:32 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Doc Mailing List, Mauro Carvalho Chehab, linux-kernel,
	Jonathan Corbet, Harry Wei, Alex Shi, Doug Ledford,
	Jason Gunthorpe, linux-rdma
In-Reply-To: <e8f1c925c5d118717eb38455e8f9dacf340cc35e.1560891322.git.mchehab+samsung@kernel.org>

On Tuesday, June 18, 2019 11:05:26 PM CEST Mauro Carvalho Chehab wrote:
> The conversion itself is simple: add a markup for the
> title of this file and add markups for both tables.
> 
> Yet, the big table here with IOCTL numbers is badly formatted:
> on several lines, the "Include File" column has some values that
> are bigger than the reserved space there.
> 
> Also, on several places, a comment was misplaced at the "Include
> File" space.
> 
> So, most of the work here is to actually ensure that each field
> will be properly fixed.
> 
> Also worth to mention that some URLs have the asterisk character
> on it. Well, Sphinx has an issue with asterisks in the middle
> of an string. As this is URL, use the alternate format: %2A.
> 
> As a side effect of this patch, it is now a lot easier to see that
> some reserved ioctl numbers are missing the include files
> where it is supposed to be used.
> 
> PS.: While this is part of a subdir, I opted to convert this
> single file alone, as this file has a potential of conflicts,
> as most subsystem maintainers touch it.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
> ---
>  .../{ioctl-number.txt => ioctl-number.rst}    | 588 +++++++++---------
>  Documentation/process/submit-checklist.rst    |   2 +-
>  .../it_IT/process/submit-checklist.rst        |   2 +-
>  .../zh_CN/process/submit-checklist.rst        |   2 +-
>  include/uapi/rdma/rdma_user_ioctl_cmds.h      |   2 +-

Acked-by: Federico Vaga <federico.vaga@vaga.pv.it>

-- 
Federico Vaga
http://www.federicovaga.it/

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Leon Romanovsky @ 2019-06-19  7:43 UTC (permalink / raw)
  To: Mark Bloch
  Cc: Jianbo Liu, Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan
In-Reply-To: <4e01d326-db6c-f746-acd6-06f65f311f5b@mellanox.com>

On Wed, Jun 19, 2019 at 07:26:54AM +0000, Mark Bloch wrote:
>
>
> On 6/18/2019 23:51, Leon Romanovsky wrote:
> > On Wed, Jun 19, 2019 at 06:40:16AM +0000, Jianbo Liu wrote:
> >> The 06/19/2019 13:04, Leon Romanovsky wrote:
> >>> On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
> >>>> The 06/18/2019 18:19, Leon Romanovsky wrote:
> >>>>> On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
> >>>>>> From: Jianbo Liu <jianbol@mellanox.com>
> >>>>>>
> >>>>>> If vport metadata matching is enabled in eswitch, the rule created
> >>>>>> must be changed to match on the metadata, instead of source port.
> >>>>>>
> >>>>>> Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> >>>>>> Reviewed-by: Roi Dayan <roid@mellanox.com>
> >>>>>> Reviewed-by: Mark Bloch <markb@mellanox.com>
> >>>>>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> >>>>>> ---
> >>>>>>  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
> >>>>>>  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
> >>>>>>  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
> >>>>>>  3 files changed, 63 insertions(+), 9 deletions(-)
> >>>>>>
> >>>>>> diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> >>>>>> index 22e651cb5534..d4ed611de35d 100644
> >>>>>> --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> >>>>>> +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> >>>>>> @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
> >>>>>>  	return mlx5_eswitch_vport_rep(esw, vport);
> >>>>>>  }
> >>>>>>
> >>>>>> +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
> >>>>>> +{
> >>>>>> +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
> >>>>>> +}
> >>>>>> +
> >>>>>> +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
> >>>>>> +						 u16 vport)
> >>>>>> +{
> >>>>>> +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
> >>>>>> +}
> >>>>>
> >>>>> 1. There is no need to introduce one line functions, call to that code directly.
> >>>>
> >>>> No. They are in IB, and we don't want them be mixed up by the original
> >>>> functions in eswitch. Please ask Mark more about it.
> >>>
> >>> Please enlighten me.
> >>
> >> It was suggested by Mark in prevouis review.
> >> I think it's because there are in different modules, and better to with
> >> different names, so introduce there extra one line functions.
> >> Please correct me if I'm wrong, Mark...
> >
> > mlx5_ib is full of direct function calls to mlx5_core and it is done on
> > purpose for at least two reasons. First is to control in one place
> > all compilation options and expose proper API interface with and without
> > specific kernel config is on. Second is to emphasize that this is core
> > function and save us time in refactoring and reviewing.
>
> This was done in order to avoid #ifdef CONFIG_MLX5_ESWITCH,
> I want to hide (as much as possible) the interactions with the eswitch level in ib_rep.c/ib_rep.h
> so ib_rep.h will provide the stubs needed in case CONFIG_MLX5_ESWITCH isn't defined.
> (Today include/linux/mlx5/eswitch.h) doesn't provide any stubs, mlx5_eswitch_get_encap_mode()
> should have probably done the same.

This is exactly the problem, eswitch.h should provide stubs for all
exported functions, so other clients of eswitch won't need to deal with
various unrelated config options.

>
> As my long term goal is to break drivers/infiniband/hw/mlx5/main.c (that file is already 7000 LOC)
> I want to group together stuff in separate files.

Yes, it is right thing to do.

>
> If you prefer direct calls that's okay as well.

Yes, please.

>
> Mark
>
> >
> >>
> >>>
> >>>>
> >>>>> 2. It should be bool and not u32.
> >>>>>
> >>>>> Thanks
> >>>>
> >>>> --
> >>
> >> --

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Mark Bloch @ 2019-06-19  7:58 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: Jianbo Liu, Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan
In-Reply-To: <20190619074338.GG11611@mtr-leonro.mtl.com>



On 6/19/2019 00:43, Leon Romanovsky wrote:
> On Wed, Jun 19, 2019 at 07:26:54AM +0000, Mark Bloch wrote:
>>
>>
>> On 6/18/2019 23:51, Leon Romanovsky wrote:
>>> On Wed, Jun 19, 2019 at 06:40:16AM +0000, Jianbo Liu wrote:
>>>> The 06/19/2019 13:04, Leon Romanovsky wrote:
>>>>> On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
>>>>>> The 06/18/2019 18:19, Leon Romanovsky wrote:
>>>>>>> On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
>>>>>>>> From: Jianbo Liu <jianbol@mellanox.com>
>>>>>>>>
>>>>>>>> If vport metadata matching is enabled in eswitch, the rule created
>>>>>>>> must be changed to match on the metadata, instead of source port.
>>>>>>>>
>>>>>>>> Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
>>>>>>>> Reviewed-by: Roi Dayan <roid@mellanox.com>
>>>>>>>> Reviewed-by: Mark Bloch <markb@mellanox.com>
>>>>>>>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
>>>>>>>> ---
>>>>>>>>  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
>>>>>>>>  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
>>>>>>>>  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
>>>>>>>>  3 files changed, 63 insertions(+), 9 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
>>>>>>>> index 22e651cb5534..d4ed611de35d 100644
>>>>>>>> --- a/drivers/infiniband/hw/mlx5/ib_rep.c
>>>>>>>> +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
>>>>>>>> @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
>>>>>>>>  	return mlx5_eswitch_vport_rep(esw, vport);
>>>>>>>>  }
>>>>>>>>
>>>>>>>> +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
>>>>>>>> +{
>>>>>>>> +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
>>>>>>>> +}
>>>>>>>> +
>>>>>>>> +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
>>>>>>>> +						 u16 vport)
>>>>>>>> +{
>>>>>>>> +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
>>>>>>>> +}
>>>>>>>
>>>>>>> 1. There is no need to introduce one line functions, call to that code directly.
>>>>>>
>>>>>> No. They are in IB, and we don't want them be mixed up by the original
>>>>>> functions in eswitch. Please ask Mark more about it.
>>>>>
>>>>> Please enlighten me.
>>>>
>>>> It was suggested by Mark in prevouis review.
>>>> I think it's because there are in different modules, and better to with
>>>> different names, so introduce there extra one line functions.
>>>> Please correct me if I'm wrong, Mark...
>>>
>>> mlx5_ib is full of direct function calls to mlx5_core and it is done on
>>> purpose for at least two reasons. First is to control in one place
>>> all compilation options and expose proper API interface with and without
>>> specific kernel config is on. Second is to emphasize that this is core
>>> function and save us time in refactoring and reviewing.
>>
>> This was done in order to avoid #ifdef CONFIG_MLX5_ESWITCH,
>> I want to hide (as much as possible) the interactions with the eswitch level in ib_rep.c/ib_rep.h
>> so ib_rep.h will provide the stubs needed in case CONFIG_MLX5_ESWITCH isn't defined.
>> (Today include/linux/mlx5/eswitch.h) doesn't provide any stubs, mlx5_eswitch_get_encap_mode()
>> should have probably done the same.
> 
> This is exactly the problem, eswitch.h should provide stubs for all
> exported functions, so other clients of eswitch won't need to deal with
> various unrelated config options.

The way it works today, code in drivers/infiniband/hw/mlx5/main.c doesn't call eswitch layer directly
but the functions in ib_rep.{c,h} as most often there is additional logic we must do before calling
the eswitch layer.

If you look at drivers/infiniband/hw/mlx5/Makefile you will see ib_rep is complied only when
CONFIG_MLX5_ESWITCH id defined.

so instead of having to deal with two places that contain stubs, we need to deal with only one (ib_rep.h).
For me it makes it easier to follow, but I can adept if you don't like it.

Mark

> 
>>
>> As my long term goal is to break drivers/infiniband/hw/mlx5/main.c (that file is already 7000 LOC)
>> I want to group together stuff in separate files.
> 
> Yes, it is right thing to do.
> 
>>
>> If you prefer direct calls that's okay as well.
> 
> Yes, please.
> 
>>
>> Mark
>>
>>>
>>>>
>>>>>
>>>>>>
>>>>>>> 2. It should be bool and not u32.
>>>>>>>
>>>>>>> Thanks
>>>>>>
>>>>>> --
>>>>
>>>> --

^ permalink raw reply

* Re: [PATCH v3 hmm 11/12] mm/hmm: Remove confusing comment and logic from hmm_release
From: Christoph Hellwig @ 2019-06-19  8:07 UTC (permalink / raw)
  To: Kuehling, Felix
  Cc: Andrea Arcangeli, Yang, Philip, Ralph Campbell,
	linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, John Hubbard,
	dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Christoph Hellwig, Jason Gunthorpe, Jerome Glisse,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Ben Skeggs
In-Reply-To: <be4f8573-6284-04a6-7862-23bb357bfe3c-5C7GfCeVMHo@public.gmane.org>

On Wed, Jun 19, 2019 at 12:53:55AM +0000, Kuehling, Felix wrote:
> This code is derived from our old MMU notifier code. Before HMM we used 
> to register a single MMU notifier per mm_struct and look up virtual 
> address ranges that had been registered for mirroring via driver API 
> calls. The idea was to reuse a single MMU notifier for the life time of 
> the process. It would remain registered until we got a notifier_release.
> 
> hmm_mirror took the place of that when we converted the code to HMM.
> 
> I suppose we could destroy the mirror earlier, when we have no more 
> registered virtual address ranges, and create a new one if needed later.

I didn't write the code, but if you look at hmm_mirror it already is
a multiplexer over the mmu notifier, and the intent clearly seems that
you register one per range that you want to mirror, and not multiplex
it once again.  In other words - I think each amdgpu_mn_node should
probably have its own hmm_mirror.  And while the amdgpu_mn_node objects
are currently stored in an interval tree it seems like they are only
linearly iterated anyway, so a list actually seems pretty suitable.  If
not we need to improve the core data structures instead of working
around them.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply

* Re: [PATCH mlx5-next 11/15] RDMA/mlx5: Add vport metadata matching for IB representors
From: Leon Romanovsky @ 2019-06-19  8:12 UTC (permalink / raw)
  To: Mark Bloch
  Cc: Jianbo Liu, Saeed Mahameed, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, Roi Dayan
In-Reply-To: <ac23c3ea-3ea7-2a5b-5fc6-aece0aed0b54@mellanox.com>

On Wed, Jun 19, 2019 at 07:58:51AM +0000, Mark Bloch wrote:
>
>
> On 6/19/2019 00:43, Leon Romanovsky wrote:
> > On Wed, Jun 19, 2019 at 07:26:54AM +0000, Mark Bloch wrote:
> >>
> >>
> >> On 6/18/2019 23:51, Leon Romanovsky wrote:
> >>> On Wed, Jun 19, 2019 at 06:40:16AM +0000, Jianbo Liu wrote:
> >>>> The 06/19/2019 13:04, Leon Romanovsky wrote:
> >>>>> On Wed, Jun 19, 2019 at 04:44:26AM +0000, Jianbo Liu wrote:
> >>>>>> The 06/18/2019 18:19, Leon Romanovsky wrote:
> >>>>>>> On Mon, Jun 17, 2019 at 07:23:30PM +0000, Saeed Mahameed wrote:
> >>>>>>>> From: Jianbo Liu <jianbol@mellanox.com>
> >>>>>>>>
> >>>>>>>> If vport metadata matching is enabled in eswitch, the rule created
> >>>>>>>> must be changed to match on the metadata, instead of source port.
> >>>>>>>>
> >>>>>>>> Signed-off-by: Jianbo Liu <jianbol@mellanox.com>
> >>>>>>>> Reviewed-by: Roi Dayan <roid@mellanox.com>
> >>>>>>>> Reviewed-by: Mark Bloch <markb@mellanox.com>
> >>>>>>>> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> >>>>>>>> ---
> >>>>>>>>  drivers/infiniband/hw/mlx5/ib_rep.c | 11 +++++++
> >>>>>>>>  drivers/infiniband/hw/mlx5/ib_rep.h | 16 ++++++++++
> >>>>>>>>  drivers/infiniband/hw/mlx5/main.c   | 45 +++++++++++++++++++++++------
> >>>>>>>>  3 files changed, 63 insertions(+), 9 deletions(-)
> >>>>>>>>
> >>>>>>>> diff --git a/drivers/infiniband/hw/mlx5/ib_rep.c b/drivers/infiniband/hw/mlx5/ib_rep.c
> >>>>>>>> index 22e651cb5534..d4ed611de35d 100644
> >>>>>>>> --- a/drivers/infiniband/hw/mlx5/ib_rep.c
> >>>>>>>> +++ b/drivers/infiniband/hw/mlx5/ib_rep.c
> >>>>>>>> @@ -131,6 +131,17 @@ struct mlx5_eswitch_rep *mlx5_ib_vport_rep(struct mlx5_eswitch *esw, int vport)
> >>>>>>>>  	return mlx5_eswitch_vport_rep(esw, vport);
> >>>>>>>>  }
> >>>>>>>>
> >>>>>>>> +u32 mlx5_ib_eswitch_vport_match_metadata_enabled(struct mlx5_eswitch *esw)
> >>>>>>>> +{
> >>>>>>>> +	return mlx5_eswitch_vport_match_metadata_enabled(esw);
> >>>>>>>> +}
> >>>>>>>> +
> >>>>>>>> +u32 mlx5_ib_eswitch_get_vport_metadata_for_match(struct mlx5_eswitch *esw,
> >>>>>>>> +						 u16 vport)
> >>>>>>>> +{
> >>>>>>>> +	return mlx5_eswitch_get_vport_metadata_for_match(esw, vport);
> >>>>>>>> +}
> >>>>>>>
> >>>>>>> 1. There is no need to introduce one line functions, call to that code directly.
> >>>>>>
> >>>>>> No. They are in IB, and we don't want them be mixed up by the original
> >>>>>> functions in eswitch. Please ask Mark more about it.
> >>>>>
> >>>>> Please enlighten me.
> >>>>
> >>>> It was suggested by Mark in prevouis review.
> >>>> I think it's because there are in different modules, and better to with
> >>>> different names, so introduce there extra one line functions.
> >>>> Please correct me if I'm wrong, Mark...
> >>>
> >>> mlx5_ib is full of direct function calls to mlx5_core and it is done on
> >>> purpose for at least two reasons. First is to control in one place
> >>> all compilation options and expose proper API interface with and without
> >>> specific kernel config is on. Second is to emphasize that this is core
> >>> function and save us time in refactoring and reviewing.
> >>
> >> This was done in order to avoid #ifdef CONFIG_MLX5_ESWITCH,
> >> I want to hide (as much as possible) the interactions with the eswitch level in ib_rep.c/ib_rep.h
> >> so ib_rep.h will provide the stubs needed in case CONFIG_MLX5_ESWITCH isn't defined.
> >> (Today include/linux/mlx5/eswitch.h) doesn't provide any stubs, mlx5_eswitch_get_encap_mode()
> >> should have probably done the same.
> >
> > This is exactly the problem, eswitch.h should provide stubs for all
> > exported functions, so other clients of eswitch won't need to deal with
> > various unrelated config options.
>
> The way it works today, code in drivers/infiniband/hw/mlx5/main.c doesn't call eswitch layer directly
> but the functions in ib_rep.{c,h} as most often there is additional logic we must do before calling
> the eswitch layer.
>
> If you look at drivers/infiniband/hw/mlx5/Makefile you will see ib_rep is complied only when
> CONFIG_MLX5_ESWITCH id defined.

This simple patch + cleanup of ib_rep.h will do the trick.

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 67b9e7ac569a..b917ba28659e 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -59,7 +59,9 @@
 #include <linux/in.h>
 #include <linux/etherdevice.h>
 #include "mlx5_ib.h"
+#if defined(CONFIG_MLX5_ESWITCH)
 #include "ib_rep.h"
+#endif
 #include "cmd.h"
 #include "srq.h"
 #include <linux/mlx5/fs_helpers.h>
@@ -6765,6 +6767,7 @@ static const struct mlx5_ib_profile  pf_profile = {
                        mlx5_ib_stage_delay_drop_cleanup),
	     };

+#if defined(CONFIG_MLX5_ESWITCH)
 const struct mlx5_ib_profile uplink_rep_profile = {
	STAGE_CREATE(MLX5_IB_STAGE_INIT,
		     mlx5_ib_stage_init_init,
@@ -6812,6 +6815,7 @@
 const struct mlx5_ib_profile uplink_rep_profile = {
		               mlx5_ib_stage_post_ib_reg_umr_init,
		               NULL),
		};

>
> so instead of having to deal with two places that contain stubs, we need to deal with only one (ib_rep.h).
> For me it makes it easier to follow, but I can adept if you don't like it.
>
> Mark
>
> >
> >>
> >> As my long term goal is to break drivers/infiniband/hw/mlx5/main.c (that file is already 7000 LOC)
> >> I want to group together stuff in separate files.
> >
> > Yes, it is right thing to do.
> >
> >>
> >> If you prefer direct calls that's okay as well.
> >
> > Yes, please.
> >
> >>
> >> Mark
> >>
> >>>
> >>>>
> >>>>>
> >>>>>>
> >>>>>>> 2. It should be bool and not u32.
> >>>>>>>
> >>>>>>> Thanks
> >>>>>>
> >>>>>> --
> >>>>
> >>>> --

^ permalink raw reply related


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