Skip to contentSkip to conversation

Add packet pacing support for IB verbs

PATCH In review Leon Romanovsky 6 participants 17 messages Oct 31, 2016 – Nov 17, 2016 12 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Add packet pacing support for IB verbs

When sending from a 10G host to a 1G host, it is easy to overrun the receiver, leading to packet loss and traffic backing off. Similar problems occur when a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending to a 10G host. Packet pacing could control packet injection rate and reduces network congestion to maximize throughput & minimize network latency.

Packet pacing is a rate limiting and shaping for a QP (SQ for RAW QP), set and change the rate is done by modifying QP. This series of patch made the following high level changes:
1. Report rate limit capabilities through user data. Reported capabilities
include: The maximum and minimum rate limit in kbps supported by packet pacing; Bitmap showing which QP types are supported by packet pacing operation.
2. Extend modify QP interface for growing attributes. Add rate limit support to the extended interface.
3. Enable mlx5-based hardware to be able to update the rate limit for RAW QP packet.

Available in the "topic/packet_pacing" topic branch of this git repo:
git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git

Or for browsing:
https://git.kernel.org/cgit/linux/kernel/git/leon/linux-rdma.git/log/?h=topic/packet_pacing

Thanks,
Bodong & Leon

Bodong Wang (4):
IB/mlx5: Report mlx5 packet pacing capabilities when querying device IB/core: Support rate limit for packet pacing
IB/uverbs: Extend modify_qp and support packet pacing IB/mlx5: Update the rate limit according to user setting for RAW QP

 drivers/infiniband/core/uverbs.h      |   1 +
 drivers/infiniband/core/uverbs_cmd.c  | 178 +++++++++++++++++++++-------------
 drivers/infiniband/core/uverbs_main.c |   1 +
 drivers/infiniband/core/verbs.c       |   2 +
 drivers/infiniband/hw/mlx5/main.c     |  16 ++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h  |   1 +
 drivers/infiniband/hw/mlx5/qp.c       |  71 ++++++++++++--
 include/rdma/ib_verbs.h               |   2 +
 include/uapi/rdma/ib_user_verbs.h     |  12 +++
 include/uapi/rdma/mlx5-abi.h          |  13 +++
 10 files changed, 219 insertions(+), 78 deletions(-)

--
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1477909297-14491-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#2 lore raw

PATCH 1/4 IB/mlx5: Report mlx5 packet pacing capabilities when querying device

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

Enable mlx5 based hardware to report packet pacing capabilities from kernel to user space. Packet pacing allows to limit the rate to any number between the maximum and minimum, based on user settings.

The capabilities are exposed to user space through query_device by uhw. The following capabilities are reported:

1. The maximum and minimum rate limit in kbps supported by packet pacing.
2. Bitmap showing which QP types are supported by packet pacing operation.

---
 drivers/infiniband/hw/mlx5/main.c | 13 +++++++++++++
 include/uapi/rdma/mlx5-abi.h      | 13 +++++++++++++
 2 files changed, 26 insertions(+)
drivers/infiniband/hw/mlx5/main.c +13 -0
index 2217477..ed9d327 100644
@@ -669,6 +669,19 @@ static int mlx5_ib_query_device(struct ib_device *ibdev,
 			1 << MLX5_CAP_GEN(dev->mdev, log_max_rq);
 	}
 
+	if (field_avail(typeof(resp), packet_pacing_caps, uhw->outlen)) {
+		if (MLX5_CAP_QOS(mdev, packet_pacing) &&
+		    MLX5_CAP_GEN(mdev, qos)) {
+			resp.packet_pacing_caps.qp_rate_limit_max =
+				MLX5_CAP_QOS(mdev, packet_pacing_max_rate);
+			resp.packet_pacing_caps.qp_rate_limit_min =
+				MLX5_CAP_QOS(mdev, packet_pacing_min_rate);
+			resp.packet_pacing_caps.supported_qpts |=
+				1 << IB_QPT_RAW_PACKET;
+		}
+		resp.response_length += sizeof(resp.packet_pacing_caps);
+	}
+
 	if (uhw->outlen) {
 		err = ib_copy_to_udata(uhw, &resp, resp.response_length);
 
include/uapi/rdma/mlx5-abi.h +13 -0
index f5d0f4e..4e9338d 100644
@@ -124,11 +124,24 @@ struct mlx5_ib_rss_caps {
 	__u8 reserved[7];
 };
 
+struct mlx5_packet_pacing_caps {
+	__u32 qp_rate_limit_min;
+	__u32 qp_rate_limit_max; /* In kpbs */
+
+	/* Corresponding bit will be set if qp type from
+	 * 'enum ib_qp_type' is supported, e.g.
+	 * supported_qpts |= 1 << IB_QPT_RAW_PACKET
+	 */
+	__u32 supported_qpts;
+	__u32 reserved;
+};
+
 struct mlx5_ib_query_device_resp {
 	__u32	comp_mask;
 	__u32	response_length;
 	struct	mlx5_ib_tso_caps tso_caps;
 	struct	mlx5_ib_rss_caps rss_caps;
+	struct	mlx5_packet_pacing_caps packet_pacing_caps;
 };
 
 struct mlx5_ib_create_cq {
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw

PATCH 2/4 IB/core: Support rate limit for packet pacing

In reply to a message not in the archive

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add new member rate_limit to ib_qp_attr, it shows the packet pacing rate in Kbps, 0 means unlimited.

IB_QP_RATE_LIMIT is added to ib_attr_mask, and it could be used by RAW QPs when changing QP state from RTR to RTS, RTS to RTS.

---
 drivers/infiniband/core/verbs.c | 2 ++
 include/rdma/ib_verbs.h         | 2 ++
 2 files changed, 4 insertions(+)
drivers/infiniband/core/verbs.c +2 -0
index 8368764..3e688b3 100644
@@ -1014,6 +1014,7 @@ static const struct {
 						 IB_QP_QKEY),
 				 [IB_QPT_GSI] = (IB_QP_CUR_STATE		|
 						 IB_QP_QKEY),
+				 [IB_QPT_RAW_PACKET] = IB_QP_RATE_LIMIT,
 			 }
 		}
 	},
@@ -1047,6 +1048,7 @@ static const struct {
 						IB_QP_QKEY),
 				[IB_QPT_GSI] = (IB_QP_CUR_STATE			|
 						IB_QP_QKEY),
+				[IB_QPT_RAW_PACKET] = IB_QP_RATE_LIMIT,
 			}
 		},
 		[IB_QPS_SQD]   = {
include/rdma/ib_verbs.h +2 -0
index 5ad43a4..a065361 100644
@@ -1102,6 +1102,7 @@ enum ib_qp_attr_mask {
 	IB_QP_RESERVED2			= (1<<22),
 	IB_QP_RESERVED3			= (1<<23),
 	IB_QP_RESERVED4			= (1<<24),
+	IB_QP_RATE_LIMIT		= (1<<25),
 };
 
 enum ib_qp_state {
@@ -1151,6 +1152,7 @@ struct ib_qp_attr {
 	u8			rnr_retry;
 	u8			alt_port_num;
 	u8			alt_timeout;
+	u32			rate_limit;
 };
 
 enum ib_wr_opcode {
Signature · 6 lines
2.7.4

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

A message that is not in the archive (sent off-list or not yet received): 1477909297-14491-3-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

#5 lore raw

Re: [PATCH rdma-next 2/4] IB/core: Support rate limit for packet pacing

Two (extremely) minor suggestions inline.

Yuval

Quoted 3 lines · Leon Romanovsky

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add new member rate_limit to ib_qp_attr, it shows the packet pacing rate

Suggesting to replace with:
Add new member rate_limit to ib_qp_attr which holds the packet pacing rate

Quoted 3 lines

in Kbps, 0 means unlimited.

IB_QP_RATE_LIMIT is added to ib_attr_mask, and it could be used by RAW

Suggesting to replace with:
IB_QP_RATE_LIMIT is added to ib_attr_mask and could be used by RAW

Quoted 57 lines

QPs when changing QP state from RTR to RTS, RTS to RTS.

---
 drivers/infiniband/core/verbs.c | 2 ++
 include/rdma/ib_verbs.h         | 2 ++
 2 files changed, 4 insertions(+)
drivers/infiniband/core/verbs.c +2 -0
index 8368764..3e688b3 100644
@@ -1014,6 +1014,7 @@ static const struct {
 						 IB_QP_QKEY),
 				 [IB_QPT_GSI] = (IB_QP_CUR_STATE		|
 						 IB_QP_QKEY),
+				 [IB_QPT_RAW_PACKET] = IB_QP_RATE_LIMIT,
 			 }
 		}
 	},
@@ -1047,6 +1048,7 @@ static const struct {
 						IB_QP_QKEY),
 				[IB_QPT_GSI] = (IB_QP_CUR_STATE			|
 						IB_QP_QKEY),
+				[IB_QPT_RAW_PACKET] = IB_QP_RATE_LIMIT,
 			}
 		},
 		[IB_QPS_SQD]   = {
include/rdma/ib_verbs.h +2 -0
index 5ad43a4..a065361 100644
@@ -1102,6 +1102,7 @@ enum ib_qp_attr_mask {
 	IB_QP_RESERVED2			= (1<<22),
 	IB_QP_RESERVED3			= (1<<23),
 	IB_QP_RESERVED4			= (1<<24),
+	IB_QP_RATE_LIMIT		= (1<<25),
 };
 
 enum ib_qp_state {
@@ -1151,6 +1152,7 @@ struct ib_qp_attr {
 	u8			rnr_retry;
 	u8			alt_port_num;
 	u8			alt_timeout;
+	u32			rate_limit;
 };
 
 enum ib_wr_opcode {
Signature · 6 lines
2.7.4

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

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

A message that is not in the archive (sent off-list or not yet received): 20161101100607.GB3727-Hxa29pjIrETlQW142y8m19+IiqhCXseY@public.gmane.org

#7 lore raw

Re: [PATCH rdma-next 2/4] IB/core: Support rate limit for packet pacing

Quoted 12 lines · Yuval Shaia

Two (extremely) minor suggestions inline.

Yuval

Quoted 3 lines · Leon Romanovsky

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

Add new member rate_limit to ib_qp_attr, it shows the packet pacing rate

Suggesting to replace with:
Add new member rate_limit to ib_qp_attr which holds the packet pacing rate

Quoted 12 lines
Quoted 3 lines

in Kbps, 0 means unlimited.

IB_QP_RATE_LIMIT is added to ib_attr_mask, and it could be used by RAW

Suggesting to replace with:
IB_QP_RATE_LIMIT is added to ib_attr_mask and could be used by RAW

Quoted 5 lines

QPs when changing QP state from RTR to RTS, RTS to RTS.

Thanks Yuval,

Doug,
What do you expect from us? respin of this patch?

Thanks

#8 lore raw

RE: [PATCH rdma-next 2/4] IB/core: Support rate limit for packet pacing

In reply to a message not in the archive

include/rdma/ib_verbs.h struct ib_qp_attr { · line 1156

Quoted 7 lines

enum ib_qp_state {

include/rdma/ib_verbs.h +1 -0
@@ -1151,6 +1152,7 @@ struct ib_qp_attr {
 	u8			rnr_retry;
 	u8			alt_port_num;
 	u8			alt_timeout;
+	u32			rate_limit;
 };

We already have ib_qp_attr::ib_ah_attr::static_rate, and that accounts for both the primary and alternate paths. We should not add a conflicting rate_limit field. Either use static_rate as defined by the spec, or replace/update it, with corresponding changes to how it is used in conjunction with SM data. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1828884A29C6694DAF28B7E6B8A82373AB0A7F70-P5GAC/[email protected]

#10 lore raw

Re: [PATCH rdma-next 2/4] IB/core: Support rate limit for packet pacing

Quoted 8 lines · Sean

include/rdma/ib_verbs.h struct ib_qp_attr { · line 1156

Quoted 7 lines
  enum ib_qp_state {
include/rdma/ib_verbs.h +1 -0
@@ -1151,6 +1152,7 @@ struct ib_qp_attr {
  	u8			rnr_retry;
  	u8			alt_port_num;
  	u8			alt_timeout;
+	u32			rate_limit;
  };

We already have ib_qp_attr::ib_ah_attr::static_rate, and that accounts for both the primary and alternate paths. We should not add a conflicting rate_limit field. Either use static_rate as defined by the spec, or replace/update it, with corresponding changes to how it is used in conjunction with SM data.

They are different features. Static rate has a limitation on how many different speeds we could get, while packet pacing(rate limit) allows customer to set any number between the min and max range.

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

#11 lore raw

PATCH 3/4 IB/uverbs: Extend modify_qp and support packet pacing

In reply to a message not in the archive

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

- Modify_qp is extended to support more attributes. Existing applications are not affected when calling modify_qp. New applications could call modify_qp_ex to use the extended fields.
- New member rate_limit is added to the modify_qp extended structure, users can modify it through modify_qp to control packet packing.

---
 drivers/infiniband/core/uverbs.h      |   1 +
 drivers/infiniband/core/uverbs_cmd.c  | 178 +++++++++++++++++++++-------------
 drivers/infiniband/core/uverbs_main.c |   1 +
 include/uapi/rdma/ib_user_verbs.h     |  12 +++
 4 files changed, 123 insertions(+), 69 deletions(-)
drivers/infiniband/core/uverbs.h +1 -0
index df26a74..455034a 100644
@@ -289,5 +289,6 @@ IB_UVERBS_DECLARE_EX_CMD(modify_wq);
 IB_UVERBS_DECLARE_EX_CMD(destroy_wq);
 IB_UVERBS_DECLARE_EX_CMD(create_rwq_ind_table);
 IB_UVERBS_DECLARE_EX_CMD(destroy_rwq_ind_table);
+IB_UVERBS_DECLARE_EX_CMD(modify_qp);
 
 #endif /* UVERBS_H */
drivers/infiniband/core/uverbs_cmd.c +109 -69

209 lines not on this page · raw message

drivers/infiniband/core/uverbs_main.c +1 -0
index 0012fa5..80839c3 100644
@@ -137,6 +137,7 @@ static int (*uverbs_ex_cmd_table[])(struct ib_uverbs_file *file,
 	[IB_USER_VERBS_EX_CMD_DESTROY_WQ]       = ib_uverbs_ex_destroy_wq,
 	[IB_USER_VERBS_EX_CMD_CREATE_RWQ_IND_TBL] = ib_uverbs_ex_create_rwq_ind_table,
 	[IB_USER_VERBS_EX_CMD_DESTROY_RWQ_IND_TBL] = ib_uverbs_ex_destroy_rwq_ind_table,
+	[IB_USER_VERBS_EX_CMD_MODIFY_QP]        = ib_uverbs_ex_modify_qp,
 };
 
 static void ib_uverbs_add_one(struct ib_device *device);
include/uapi/rdma/ib_user_verbs.h +12 -0
index 25225eb..351f260 100644
@@ -93,6 +93,7 @@ enum {
 	IB_USER_VERBS_EX_CMD_QUERY_DEVICE = IB_USER_VERBS_CMD_QUERY_DEVICE,
 	IB_USER_VERBS_EX_CMD_CREATE_CQ = IB_USER_VERBS_CMD_CREATE_CQ,
 	IB_USER_VERBS_EX_CMD_CREATE_QP = IB_USER_VERBS_CMD_CREATE_QP,
+	IB_USER_VERBS_EX_CMD_MODIFY_QP = IB_USER_VERBS_CMD_MODIFY_QP,
 	IB_USER_VERBS_EX_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD,
 	IB_USER_VERBS_EX_CMD_DESTROY_FLOW,
 	IB_USER_VERBS_EX_CMD_CREATE_WQ,
@@ -684,9 +685,20 @@ struct ib_uverbs_modify_qp {
 	__u64 driver_data[0];
 };
 
+struct ib_uverbs_ex_modify_qp {
+	struct ib_uverbs_modify_qp base;
+	__u32	rate_limit;
+	__u32	reserved;
+};
+
 struct ib_uverbs_modify_qp_resp {
 };
 
+struct ib_uverbs_ex_modify_qp_resp {
+	__u32  comp_mask;
+	__u32  response_length;
+};
+
 struct ib_uverbs_destroy_qp {
 	__u64 response;
 	__u32 qp_handle;
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#12 lore raw

PATCH 4/4 IB/mlx5: Update the rate limit according to user setting for RAW QP

In reply to a message not in the archive

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

- Add MODIFY_QP_EX CMD to extend modify_qp.
- Rate limit will be updated in the following state transactions: RTR2RTS, RTS2RTS. The limit will be removed when SQ is in RST and ERR state.

---
 drivers/infiniband/hw/mlx5/main.c    |  3 +-
 drivers/infiniband/hw/mlx5/mlx5_ib.h |  1 +
 drivers/infiniband/hw/mlx5/qp.c      | 71 ++++++++++++++++++++++++++++++++----
 3 files changed, 66 insertions(+), 9 deletions(-)
drivers/infiniband/hw/mlx5/main.c +2 -1
index ed9d327..fd13786 100644
@@ -3025,7 +3025,8 @@ static void *mlx5_ib_add(struct mlx5_core_dev *mdev)
 	dev->ib_dev.uverbs_ex_cmd_mask =
 		(1ull << IB_USER_VERBS_EX_CMD_QUERY_DEVICE)	|
 		(1ull << IB_USER_VERBS_EX_CMD_CREATE_CQ)	|
-		(1ull << IB_USER_VERBS_EX_CMD_CREATE_QP);
+		(1ull << IB_USER_VERBS_EX_CMD_CREATE_QP)	|
+		(1ull << IB_USER_VERBS_EX_CMD_MODIFY_QP);
 
 	dev->ib_dev.query_device	= mlx5_ib_query_device;
 	dev->ib_dev.query_port		= mlx5_ib_query_port;
drivers/infiniband/hw/mlx5/mlx5_ib.h +1 -0
index dcdcd19..0e43254 100644
@@ -387,6 +387,7 @@ struct mlx5_ib_qp {
 	struct list_head	qps_list;
 	struct list_head	cq_recv_list;
 	struct list_head	cq_send_list;
+	u32			rate_limit;
 };
 
 struct mlx5_ib_cq_buf {
drivers/infiniband/hw/mlx5/qp.c +63 -8

135 lines not on this page · raw message

Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#13 lore raw
In reply to a message not in the archive
Quoted 9 lines

When sending from a 10G host to a 1G host, it is easy to overrun the receiver,
leading to packet loss and traffic backing off. Similar problems occur when
a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending
to a 10G host. Packet pacing could control packet injection rate and reduces
network congestion to maximize throughput & minimize network latency.

Why isn't the path record data and existing mechanisms sufficient to handle this?

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

A message that is not in the archive (sent off-list or not yet received): 1828884A29C6694DAF28B7E6B8A82373AB0A7B31-P5GAC/[email protected]

#15 lore raw
Quoted 10 lines · Sean
Quoted 9 lines

When sending from a 10G host to a 1G host, it is easy to overrun the receiver,
leading to packet loss and traffic backing off. Similar problems occur when
a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending
to a 10G host. Packet pacing could control packet injection rate and reduces
network congestion to maximize throughput & minimize network latency.

Quoted 2 lines

Why isn't the path record data and existing mechanisms sufficient to handle this?

Packet pacing allows different combinations of traffic shaping: per-CPU, per-flow and their combinations with better and steady QoS requirements without involving subnet management.

Thanks

A message that is not in the archive (sent off-list or not yet received): 20161109064009.GE27883-2ukJVAZIZ/[email protected]

#17 lore raw
Quoted 15 lines · Sean
Quoted 1 line
Quoted 1 line

When sending from a 10G host to a 1G host, it is easy to overrun

the

Quoted 2 lines
Quoted 2 lines

receiver,
leading to packet loss and traffic backing off. Similar problems

occur

Quoted 4 lines
Quoted 4 lines

when
a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending
to a 10G host. Packet pacing could control packet injection rate

and

Quoted 2 lines
Quoted 2 lines

reduces
network congestion to maximize throughput & minimize network

latency.

Quoted 1 line
Quoted 8 lines
Quoted 1 line

Why isn't the path record data and existing mechanisms sufficient to

handle this?

Quoted 1 line

Packet pacing allows different combinations of traffic shaping: per- CPU,
per-flow and their combinations with better and steady QoS requirements without involving subnet management.

The patch adds this as a QP attribute, and we already have a rate for that. I still don't see why the standard mechanisms are insufficient or couldn't be adapted. --
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 1828884A29C6694DAF28B7E6B8A82373AB0A7F0A-P5GAC/[email protected]

#19 lore raw
Quoted 19 lines · Sean
Quoted 19 lines · Sean
Quoted 1 line
Quoted 1 line

When sending from a 10G host to a 1G host, it is easy to overrun

the

Quoted 2 lines
Quoted 2 lines

receiver,
leading to packet loss and traffic backing off. Similar problems

occur

Quoted 4 lines
Quoted 4 lines

when
a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending
to a 10G host. Packet pacing could control packet injection rate

and

Quoted 2 lines
Quoted 2 lines

reduces
network congestion to maximize throughput & minimize network

latency.

Quoted 2 lines

Why isn't the path record data and existing mechanisms sufficient to

handle this?

Quoted 1 line
Quoted 6 lines
Quoted 4 lines

Packet pacing allows different combinations of traffic shaping: per- CPU,
per-flow and their combinations with better and steady QoS requirements without involving subnet management.

The patch adds this as a QP attribute, and we already have a rate for that. I still don't see why the standard mechanisms are insufficient or couldn't be adapted.

I'll let to Bodong to elaborate on it more, but as far as I see, the AH attribute is relevant to UD QP only, while the packet pacing is intended for all types of QPs.

Thanks

A message that is not in the archive (sent off-list or not yet received): 20161110072242.GC28957-2ukJVAZIZ/[email protected]

#21 lore raw
Quoted 21 lines · Leon Romanovsky
Quoted 20 lines · Sean
Quoted 20 lines · Sean
Quoted 1 line
Quoted 1 line

When sending from a 10G host to a 1G host, it is easy to overrun

the

Quoted 2 lines
Quoted 2 lines

receiver,
leading to packet loss and traffic backing off. Similar problems

occur

Quoted 4 lines
Quoted 4 lines

when
a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending
to a 10G host. Packet pacing could control packet injection rate

and

Quoted 2 lines
Quoted 2 lines

reduces
network congestion to maximize throughput & minimize network

latency.

Quoted 1 line

Why isn't the path record data and existing mechanisms sufficient to

handle this?
Packet pacing allows different combinations of traffic shaping: per- CPU,
per-flow and their combinations with better and steady QoS requirements without involving subnet management.

Quoted 6 lines
Quoted 1 line

The patch adds this as a QP attribute, and we already have a rate for that. I still don't see why the standard mechanisms are insufficient or couldn't be adapted.

I'll let to Bodong to elaborate on it more, but as far as I see, the AH attribute is relevant to UD QP only, while the packet pacing is intended for all types of QPs.

Thanks

While the path record data can prevent the overrun but cannot control the rate speed easily within the hardware limitation range. One main use case for packet pacing is for streaming vendors to control the speed for different customers based on service coverage. For example, user's NIC supports 10G speed but only pays for 1G speed service, packet pacing can achieve this purpose only by modify_qp.

Another advantage, packet pacing doesn't need to involve with subnet admin which path record data has to. Moreover, like indicated in the other thread, the main flaw of the static rate is its limitations on the speed options.

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

#22 lore raw
In reply to a message not in the archive
Quoted 3 lines · Leon Romanovsky

I'll let to Bodong to elaborate on it more, but as far as I see, the AH attribute is relevant to UD QP only, while the packet pacing is intended for all types of QPs.

In IB static rate is supposed to work for all QP types.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): CAFo2czDeGUrA8yYAJ0r5-8q5T=Y=gZojjfHrLqxribZaexmbOA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): HE1PR0501MB27291D7FD8782D6650C57E5ACABF0@HE1PR0501MB2729.eurprd05.prod.outlook.com

A message that is not in the archive (sent off-list or not yet received): DB5PR0501MB19281A8064B283BE35EDE821B0BF0@DB5PR0501MB1928.eurprd05.prod.outlook.com

A message that is not in the archive (sent off-list or not yet received): DB5PR0501MB19281A8064B283BE35EDE821B0BF0-1FH/Iesddo5/SeJcUcAJq8DSnupUy6xnnBOFsp37pqbUKgpGm//BTAC/[email protected]

#27 lore raw

cover Add packet pacing support for IB verbs

DQpPbiBUaHUsIE5vdiAxMCwgMjAxNiBhdCA2OjQ3IFBNICswMjAwLCBKYXNvbiBHdW50aG9ycGUg d3JvdGU6DQo+T24gVGh1LCBOb3YgMTAsIDIwMTYgYXQgMDk6MjI6NDJBTSArMDIwMCwgTGVvbiBS b21hbm92c2t5IHdyb3RlOg0KPj4gSSdsbCBsZXQgdG8gQm9kb25nIHRvIGVsYWJvcmF0ZSBvbiBp dCBtb3JlLCBidXQgYXMgZmFyIGFzIEkgc2VlLCB0aGUgDQo+PiBBSCBhdHRyaWJ1dGUgaXMgcmVs ZXZhbnQgdG8gVUQgUVAgb25seSwgd2hpbGUgdGhlIHBhY2tldCBwYWNpbmcgaXMgDQo+PiBpbnRl bmRlZCBmb3IgYWxsIHR5cGVzIG9mIFFQcy4NCg0KPkluIElCIHN0YXRpYyByYXRlIGlzIHN1cHBv c2VkIHRvIHdvcmsgZm9yIGFsbCBRUCB0eXBlcy4NCkluZGVlZCB3ZSBhbHJlYWR5IGhhdmUgYSBz dGF0aWNfcmF0ZSBmaWVsZCwgd2hpY2ggYXBwbGllcyB0byBhbGwgSUIgdHJhZmZpYyAoaW5jbHVk aW5nIFVEKS4NClRoZSBwcm9ibGVtIGlzOg0KLSBUaGlzIGZpZWxkIGlzIG9ubHkgdTgsIGFuZCB1 c2VzIElCIHN0YW5kYXJkIHJhdGUgZW51bWVyYXRpb25zLiBGb3IgcGFjaW5nLCB3ZSBuZWVkIGFy Yml0cmFyeSByYXRlcy4NCi0gVGhlIGZpZWxkIGRvZXNuJ3QgYXBwbHkgdG8gUmF3IEV0aGVybmV0 IFFQcywgQUggb3IgQVYgd2hpY2ggaXNuJ3QgYXBwbGljYWJsZSB0byBSYXcgRXRoZXJuZXQuIEl0 IGlzIGluY29ycmVjdCB0byBzdXBwb3J0IEFWL0FIIGZvciBSYXcgRXRoZXJuZXQgUVBzLg0KIA0K VGhlIHJhdGVfbGltaXQgY29uZmlndXJhdGlvbiBjYW1lIGZvcm0gdGhlIGFwcGxpY2F0aW9uIGxp a2UgcmVxdWlyZWQgQlcgZm9yIHRoZSBzdHJlYW1pbmcgYW5kIG5vdCBmcm9tIHRoZSBmYWJyaWMg KFNNKS4NClRoZSByYXRlX2xpbWl0IHJlc29sdXRpb24gaXMgbXVjaCBoaWdoZXIgYW5kIGl0IGlz IDFLYi9zLg0KDQpCb3RoIG9mIHRoZSBmaWVsZHMgYXJlIGxpbWl0IHRoZSByYXRlIGJ1dCBjb21p bmcgZnJvbSBhIGRpZmZlcmVudCBlbnRpdGllcyBhbmQgcmVxdWlyZWQgc2VwYXJhdGUgZmllbGRz Lg0KVGhlIGFjdHVhbCBsaW1pdCBzaG91bGQgYmUgdGhlIG1pbmltdW0gb2YgYm90aCBvZiB0aGVt Lg0KDQpSb255DQoNCj5KYXNvbg0K
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#28 lore raw
In reply to a message not in the archive
Quoted 18 lines · Leon Romanovsky

When sending from a 10G host to a 1G host, it is easy to overrun the receiver, leading to packet loss and traffic backing off. Similar problems occur when a 10G host sends data to a sub-10G virtual circuit, or a 40G host sending to a 10G host. Packet pacing could control packet injection rate and reduces network congestion to maximize throughput & minimize network latency.

Packet pacing is a rate limiting and shaping for a QP (SQ for RAW QP), set and change the rate is done by modifying QP. This series of patch made the following high level changes:
1. Report rate limit capabilities through user data. Reported capabilities
include: The maximum and minimum rate limit in kbps supported by packet pacing; Bitmap showing which QP types are supported by packet pacing operation.
2. Extend modify QP interface for growing attributes. Add rate limit support to the extended interface.
3. Enable mlx5-based hardware to be able to update the rate limit for RAW QP packet.

Quoted 5 lines

Available in the "topic/packet_pacing" topic branch of this git repo:
git://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git

Or for browsing:
https://git.kernel.org/cgit/linux/kernel/git/leon/linux-rdma.git/log/?h=topic/packet_pacing

Hi Doug,

Please drop this patch series, we discovered an issue with proposed modify_qp implementation and will respin it.

Sorry for the inconvenience.

Thanks

Quoted 29 lines

Thanks,
Bodong & Leon

Bodong Wang (4):
IB/mlx5: Report mlx5 packet pacing capabilities when querying device IB/core: Support rate limit for packet pacing
IB/uverbs: Extend modify_qp and support packet pacing IB/mlx5: Update the rate limit according to user setting for RAW QP

 drivers/infiniband/core/uverbs.h      |   1 +
 drivers/infiniband/core/uverbs_cmd.c  | 178 +++++++++++++++++++++-------------
 drivers/infiniband/core/uverbs_main.c |   1 +
 drivers/infiniband/core/verbs.c       |   2 +
 drivers/infiniband/hw/mlx5/main.c     |  16 ++-
 drivers/infiniband/hw/mlx5/mlx5_ib.h  |   1 +
 drivers/infiniband/hw/mlx5/qp.c       |  71 ++++++++++++--
 include/rdma/ib_verbs.h               |   2 +
 include/uapi/rdma/ib_user_verbs.h     |  12 +++
 include/uapi/rdma/mlx5-abi.h          |  13 +++
 10 files changed, 219 insertions(+), 78 deletions(-)

--
2.7.4

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