aboutsummaryrefslogtreecommitdiffstats
path: root/net/dcb
diff options
context:
space:
mode:
authorHuy Nguyen <huyn@mellanox.com>2018-02-22 12:57:10 -0500
committerSaeed Mahameed <saeedm@mellanox.com>2018-05-24 17:22:59 -0400
commite549f6f9c098067a99e9de8ac84f5cc2c07ae5c6 (patch)
tree122652fd0b004e861763e210c701a635fda8945a /net/dcb
parent87e5808d52b65fc5b0bfda209ba8864cc2f933e5 (diff)
net/dcb: Add dcbnl buffer attribute
In this patch, we add dcbnl buffer attribute to allow user change the NIC's buffer configuration such as priority to buffer mapping and buffer size of individual buffer. This attribute combined with pfc attribute allows advanced user to fine tune the qos setting for specific priority queue. For example, user can give dedicated buffer for one or more priorities or user can give large buffer to certain priorities. The dcb buffer configuration will be controlled by lldptool. lldptool -T -i eth2 -V BUFFER prio 0,2,5,7,1,2,3,6 maps priorities 0,1,2,3,4,5,6,7 to receive buffer 0,2,5,7,1,2,3,6 lldptool -T -i eth2 -V BUFFER size 87296,87296,0,87296,0,0,0,0 sets receive buffer size for buffer 0,1,2,3,4,5,6,7 respectively After discussion on mailing list with Jakub, Jiri, Ido and John, we agreed to choose dcbnl over devlink interface since this feature is intended to set port attributes which are governed by the netdev instance of that port, where devlink API is more suitable for global ASIC configurations. We present an use case scenario where dcbnl buffer attribute configured by advance user helps reduce the latency of messages of different sizes. Scenarios description: On ConnectX-5, we run latency sensitive traffic with small/medium message sizes ranging from 64B to 256KB and bandwidth sensitive traffic with large messages sizes 512KB and 1MB. We group small, medium, and large message sizes to their own pfc enables priorities as follow. Priorities 1 & 2 (64B, 256B and 1KB) Priorities 3 & 4 (4KB, 8KB, 16KB, 64KB, 128KB and 256KB) Priorities 5 & 6 (512KB and 1MB) By default, ConnectX-5 maps all pfc enabled priorities to a single lossless fixed buffer size of 50% of total available buffer space. The other 50% is assigned to lossy buffer. Using dcbnl buffer attribute, we create three equal size lossless buffers. Each buffer has 25% of total available buffer space. Thus, the lossy buffer size reduces to 25%. Priority to lossless buffer mappings are set as follow. Priorities 1 & 2 on lossless buffer #1 Priorities 3 & 4 on lossless buffer #2 Priorities 5 & 6 on lossless buffer #3 We observe improvements in latency for small and medium message sizes as follows. Please note that the large message sizes bandwidth performance is reduced but the total bandwidth remains the same. 256B message size (42 % latency reduction) 4K message size (21% latency reduction) 64K message size (16% latency reduction) CC: Ido Schimmel <idosch@idosch.org> CC: Jakub Kicinski <jakub.kicinski@netronome.com> CC: Jiri Pirko <jiri@resnulli.us> CC: Or Gerlitz <gerlitz.or@gmail.com> CC: Parav Pandit <parav@mellanox.com> CC: Aron Silverton <aron.silverton@oracle.com> Signed-off-by: Huy Nguyen <huyn@mellanox.com> Reviewed-by: Parav Pandit <parav@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'net/dcb')
-rw-r--r--net/dcb/dcbnl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index bae7d78aa068..d2f4e0c1faaf 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -176,6 +176,7 @@ static const struct nla_policy dcbnl_ieee_policy[DCB_ATTR_IEEE_MAX + 1] = {
176 [DCB_ATTR_IEEE_MAXRATE] = {.len = sizeof(struct ieee_maxrate)}, 176 [DCB_ATTR_IEEE_MAXRATE] = {.len = sizeof(struct ieee_maxrate)},
177 [DCB_ATTR_IEEE_QCN] = {.len = sizeof(struct ieee_qcn)}, 177 [DCB_ATTR_IEEE_QCN] = {.len = sizeof(struct ieee_qcn)},
178 [DCB_ATTR_IEEE_QCN_STATS] = {.len = sizeof(struct ieee_qcn_stats)}, 178 [DCB_ATTR_IEEE_QCN_STATS] = {.len = sizeof(struct ieee_qcn_stats)},
179 [DCB_ATTR_DCB_BUFFER] = {.len = sizeof(struct dcbnl_buffer)},
179}; 180};
180 181
181/* DCB number of traffic classes nested attributes. */ 182/* DCB number of traffic classes nested attributes. */
@@ -1094,6 +1095,16 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
1094 return -EMSGSIZE; 1095 return -EMSGSIZE;
1095 } 1096 }
1096 1097
1098 if (ops->dcbnl_getbuffer) {
1099 struct dcbnl_buffer buffer;
1100
1101 memset(&buffer, 0, sizeof(buffer));
1102 err = ops->dcbnl_getbuffer(netdev, &buffer);
1103 if (!err &&
1104 nla_put(skb, DCB_ATTR_DCB_BUFFER, sizeof(buffer), &buffer))
1105 return -EMSGSIZE;
1106 }
1107
1097 app = nla_nest_start(skb, DCB_ATTR_IEEE_APP_TABLE); 1108 app = nla_nest_start(skb, DCB_ATTR_IEEE_APP_TABLE);
1098 if (!app) 1109 if (!app)
1099 return -EMSGSIZE; 1110 return -EMSGSIZE;
@@ -1453,6 +1464,15 @@ static int dcbnl_ieee_set(struct net_device *netdev, struct nlmsghdr *nlh,
1453 goto err; 1464 goto err;
1454 } 1465 }
1455 1466
1467 if (ieee[DCB_ATTR_DCB_BUFFER] && ops->dcbnl_setbuffer) {
1468 struct dcbnl_buffer *buffer =
1469 nla_data(ieee[DCB_ATTR_DCB_BUFFER]);
1470
1471 err = ops->dcbnl_setbuffer(netdev, buffer);
1472 if (err)
1473 goto err;
1474 }
1475
1456 if (ieee[DCB_ATTR_IEEE_APP_TABLE]) { 1476 if (ieee[DCB_ATTR_IEEE_APP_TABLE]) {
1457 struct nlattr *attr; 1477 struct nlattr *attr;
1458 int rem; 1478 int rem;