diff mbox series

[rdma-next,2/5] RDMA/iwcm: add tos_set bool to iw_cm struct

Message ID 1b0457368d73a1feb5d28d5d77ee76e3cdd55265.1549054042.git.swise@opengridcomputing.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series RDMA cm_id type of service fixes | expand

Commit Message

Steve Wise Feb. 1, 2019, 8:44 p.m. UTC
This allows drivers to know the tos was actively
set by the application.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
---
 drivers/infiniband/core/cma.c | 2 ++
 include/rdma/iw_cm.h          | 1 +
 2 files changed, 3 insertions(+)

Comments

Jason Gunthorpe Feb. 8, 2019, 11:20 p.m. UTC | #1
On Fri, Feb 01, 2019 at 12:44:32PM -0800, Steve Wise wrote:
> This allows drivers to know the tos was actively
> set by the application.
> 
> Signed-off-by: Steve Wise <swise@opengridcomputing.com>
>  drivers/infiniband/core/cma.c | 2 ++
>  include/rdma/iw_cm.h          | 1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
> index 8d2fd41c94a2..96c1c118beb6 100644
> +++ b/drivers/infiniband/core/cma.c
> @@ -2407,6 +2407,7 @@ static int cma_iw_listen(struct rdma_id_private *id_priv, int backlog)
>  		return PTR_ERR(id);
>  
>  	id->tos = id_priv->tos;
> +	id->tos_set = id_priv->tos_set;
>  	id_priv->cm_id.iw = id;
>  
>  	memcpy(&id_priv->cm_id.iw->local_addr, cma_src_addr(id_priv),
> @@ -3808,6 +3809,7 @@ static int cma_connect_iw(struct rdma_id_private *id_priv,
>  		return PTR_ERR(cm_id);
>  
>  	cm_id->tos = id_priv->tos;
> +	cm_id->tos_set = id_priv->tos_set;
>  	id_priv->cm_id.iw = cm_id;
>  
>  	memcpy(&cm_id->local_addr, cma_src_addr(id_priv),
> diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
> index 5cd7701db148..0447dda1a85b 100644
> +++ b/include/rdma/iw_cm.h
> @@ -94,6 +94,7 @@ struct iw_cm_id {
>  	void (*add_ref)(struct iw_cm_id *);
>  	void (*rem_ref)(struct iw_cm_id *);
>  	u8  tos;
> +	bool tos_set;
>  	bool mapped;

I switched this to

-       bool mapped;
+       bool tos_set:1;
+       bool mapped:1;

To follow the coding style

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index 8d2fd41c94a2..96c1c118beb6 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -2407,6 +2407,7 @@  static int cma_iw_listen(struct rdma_id_private *id_priv, int backlog)
 		return PTR_ERR(id);
 
 	id->tos = id_priv->tos;
+	id->tos_set = id_priv->tos_set;
 	id_priv->cm_id.iw = id;
 
 	memcpy(&id_priv->cm_id.iw->local_addr, cma_src_addr(id_priv),
@@ -3808,6 +3809,7 @@  static int cma_connect_iw(struct rdma_id_private *id_priv,
 		return PTR_ERR(cm_id);
 
 	cm_id->tos = id_priv->tos;
+	cm_id->tos_set = id_priv->tos_set;
 	id_priv->cm_id.iw = cm_id;
 
 	memcpy(&cm_id->local_addr, cma_src_addr(id_priv),
diff --git a/include/rdma/iw_cm.h b/include/rdma/iw_cm.h
index 5cd7701db148..0447dda1a85b 100644
--- a/include/rdma/iw_cm.h
+++ b/include/rdma/iw_cm.h
@@ -94,6 +94,7 @@  struct iw_cm_id {
 	void (*add_ref)(struct iw_cm_id *);
 	void (*rem_ref)(struct iw_cm_id *);
 	u8  tos;
+	bool tos_set;
 	bool mapped;
 };