Whamcloud - gitweb
LU-16466 kfilnd: Allow custom traffic class per-NI 90/50490/4
authorChris Horn <chris.horn@hpe.com>
Thu, 3 Nov 2022 15:37:05 +0000 (09:37 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 May 2023 07:06:41 +0000 (07:06 +0000)
commit9aff811bde056335538685a9c96d0877b0980c87
tree7cb0098f9aecd701716047b0c289588c2df6fd15
parentfe2e85e5c312a6a10e3410524c7929a4ac6aa738
LU-16466 kfilnd: Allow custom traffic class per-NI

Allow a traffic class to be specified per-NI. Per-NI values can be
specified via yaml configuration or the lnetctl CLI. A new kfilnd
module parameter, traffic_class, defines the default traffic class
when a per-NI value is not otherwise specified.

Here are the valid values and their associated mapping to kfabric:
 - best_effort -> KFI_TC_BEST_EFFORT
 - low_latency -> KFI_TC_LOW_LATENCY
 - dedicated_access -> KFI_TC_DEDICATED_ACCESS
 - bulk_data -> KFI_TC_BULK_DATA
 - scavenger -> KFI_TC_SCAVENGER
 - network_ctrl -> KFI_TC_NETWORK_CTRL

The default value of the traffic_class kfilnd parameter is
"best_effort".

Here's an example yaml configuration:
net:
    - net type: kfi1
      local NI(s):
        - interfaces:
              0: cxi0
          tunables:
          lnd tunables:
              traffic_class: bulk_data
    - net type: kfi2
      local NI(s):
        - interfaces:
              0: cxi1
          tunables:
          lnd tunables:
              traffic_class: low_latency

Here's an example of setting per-NI values using the lnetctl CLI:

$ lnetctl net add --net kfi1 --if cxi0 --traffic-class bulk_data
$ lnetctl net add --net kfi2 --if cxi0 --traffic-class low_latency

Both the string and numeric representation of the traffic class is
shown in the output of lnetctl net show. e.g.

$ lnetctl net show -v | egrep -e kfi -e traffic
    - net type: kfi1
        - nid: 0@kfi1
              traffic_class: bulk_data
              traffic_class_num: 515
    - net type: kfi2
        - nid: 0@kfi2
              traffic_class: low_latency
              traffic_class_num: 513
$

This is simply a debug tool to ensure the feature is working
correctly. "traffic_class_num" is ignored if it is specified as
part of a yaml configuration, and it is ommitted from lnetctl export
output when the --backup option is specified.

HPE-bug-id: LUS-10197
Test-Parameters: trivial
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: I014a323e675d608ee5b506d8676fcc2cc78e8c4a
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50490
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Ian Ziemba <ian.ziemba@hpe.com>
Reviewed-by: Ron Gredvig <ron.gredvig@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lnet/include/uapi/linux/lnet/lnet-dlc.h
lnet/klnds/kfilnd/kfilnd.c
lnet/klnds/kfilnd/kfilnd.h
lnet/klnds/kfilnd/kfilnd_dom.c
lnet/klnds/kfilnd/kfilnd_modparams.c
lnet/utils/lnetconfig/liblnd.h
lnet/utils/lnetconfig/liblnetconfig.c
lnet/utils/lnetconfig/liblnetconfig_lnd.c
lnet/utils/lnetctl.c