From nobody Tue Feb 08 15:14:07 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 92ED519C3B9E; Tue, 8 Feb 2022 15:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4JtRPF2f6Hz4dhr; Tue, 8 Feb 2022 15:14:09 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644333249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eev5ZkwzSgcT/FbHV/WS5ob0lctO5WxKTzzDZYPFD9M=; b=V3a4Ixv3yzoSNDJHEw20d7UTtI7DmT72CLLb64gl2O4qSnjW45Qq8Uxtav9iMXW/LrrkL5 TGUa9Vn1OjZlyF7IphJVPSMPX9aTuVLi4yWG+1B6DHFLS6D3d5CZ2Qg1dKADEaH0gsUF0u tX0v503gFgzGQiCI46Ujs06YdRfhQ2RlEB13n/XdvuoBF5vThLMNHW9LLy4dbRSrhrr0dY X27w8Jo7noPukyS6dPOxnkkm/L2ZBtDt9ECn7XxzGa/AaoT64CeHVWRFB0YtUA/VsPr8TS TCtN3TkVIt86dtxOCxzt4Mwlh0b3+6qZZH9snf2Me9Gvi5y0NzgZCbv/Tcr6kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C3281BADA; Tue, 8 Feb 2022 15:14:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 218FE7Br020866; Tue, 8 Feb 2022 15:14:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 218FE7jH020865; Tue, 8 Feb 2022 15:14:07 GMT (envelope-from git) Date: Tue, 8 Feb 2022 15:14:07 GMT Message-Id: <202202081514.218FE7jH020865@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 513a6d84e913 - stable/13 - mlx5: Implement offloads flowtable namespace. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 513a6d84e913d99925a989e86ce1a0e0a30f4bdd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1644333249; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eev5ZkwzSgcT/FbHV/WS5ob0lctO5WxKTzzDZYPFD9M=; b=O4UsHu3wZsPRSAdsxbNl1K16/UbOd+EskpkglZnZtjSIT6NfhjhPogtyWbwh/vENM6D5Ol DPt32h8eu2R0Vp3oZ6xOAZnBEpYS/1gMnwFkoTNqi7yDN6Eu7R94/MktUeL+iX2+3OXJJb zMN8OiWZS3QczxcDhk/ajV3hxKLl0C2saG1Hy+JjkIeNDWPEjyd33jIYSMY5UOsO37N9la oxbSiY3xMuLFmRdDMNA6qqe/3bduklpwj2DfDLeXUlbjmgb5Rw/5k+dp7QjeebSKqWipbM PEhXhKoLIf66Z0K3bKG6d1ROTOyLfww6+OKZrOHvnfGt1uiNcyo7P5jdVI2sbg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1644333249; a=rsa-sha256; cv=none; b=qpkBkrzRFbAlJrYkeQo4a2Hdde8eyn5UjKQEXotgzdONmRpQ1QxYNOviafzCD3vTl/jJ+m mvdSgs/+nDdEQEytD1paK/rzNgWbL/og4K+2pTQMTJ/pUWA6maiCtYkzfXNZg2/98uF+/x jRQpzWoMncnOcJQofzbDITbF4vFAjjmwyiZEuZ8mPT78K3rqPW8M1vLPgSAVaVlixcmxBG f7BSYzjx40/05RLj7BqGwIkAgz3jpdsatDXYNp/gIjyCd+y6/CVGuolRtS9eYaQY5GftNT 04UjaqfK9SM+FYGRbKcckSzQBbsOisuAW3vhj4dLhi+Mgip7RS/kfZkm7GYpAw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=513a6d84e913d99925a989e86ce1a0e0a30f4bdd commit 513a6d84e913d99925a989e86ce1a0e0a30f4bdd Author: Hans Petter Selasky AuthorDate: 2022-02-08 15:08:53 +0000 Commit: Hans Petter Selasky CommitDate: 2022-02-08 15:08:53 +0000 mlx5: Implement offloads flowtable namespace. This namespace will be used for TCP offloads, like hardware decryption of TLS TCP data. Sponsored by: NVIDIA Networking (cherry picked from commit 0ee1b09eaa99ed96885fd024a32baf182411a35a) --- sys/dev/mlx5/fs.h | 1 + sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c | 35 ++++++++++++++++++++++++----------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/sys/dev/mlx5/fs.h b/sys/dev/mlx5/fs.h index fc7a6f429fd0..e5ec897fd9f1 100644 --- a/sys/dev/mlx5/fs.h +++ b/sys/dev/mlx5/fs.h @@ -54,6 +54,7 @@ enum { enum mlx5_flow_namespace_type { MLX5_FLOW_NAMESPACE_BYPASS, + MLX5_FLOW_NAMESPACE_OFFLOADS, MLX5_FLOW_NAMESPACE_KERNEL, MLX5_FLOW_NAMESPACE_LEFTOVERS, MLX5_FLOW_NAMESPACE_SNIFFER_RX, diff --git a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c index 860c2331f03a..5305991689ca 100644 --- a/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c +++ b/sys/dev/mlx5/mlx5_core/mlx5_fs_tree.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2017, Mellanox Technologies, Ltd. All rights reserved. + * Copyright (c) 2013-2021, Mellanox Technologies, Ltd. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -67,13 +67,19 @@ #define FS_REQUIRED_CAPS(...) {.arr_sz = INIT_CAPS_ARRAY_SIZE(__VA_ARGS__), \ .caps = (long[]) {__VA_ARGS__}} -#define BYPASS_MAX_FT 5 -#define BYPASS_PRIO_MAX_FT 1 -#define KERNEL_MAX_FT 5 -#define LEFTOVER_MAX_FT 1 -#define KERNEL_MIN_LEVEL 3 -#define LEFTOVER_MIN_LEVEL KERNEL_MIN_LEVEL + 1 -#define BYPASS_MIN_LEVEL MLX5_NUM_BYPASS_FTS + LEFTOVER_MIN_LEVEL +/* Flowtable sizes: */ +#define BYPASS_MAX_FT 5 +#define BYPASS_PRIO_MAX_FT 1 +#define OFFLOADS_MAX_FT 2 +#define KERNEL_MAX_FT 5 +#define LEFTOVER_MAX_FT 1 + +/* Flowtable levels: */ +#define OFFLOADS_MIN_LEVEL 3 +#define KERNEL_MIN_LEVEL (OFFLOADS_MIN_LEVEL + 1) +#define LEFTOVER_MIN_LEVEL (KERNEL_MIN_LEVEL + 1) +#define BYPASS_MIN_LEVEL (MLX5_NUM_BYPASS_FTS + LEFTOVER_MIN_LEVEL) + struct node_caps { size_t arr_sz; long *caps; @@ -92,7 +98,7 @@ struct init_tree_node { } root_fs = { .type = FS_TYPE_NAMESPACE, .name = "root", - .ar_size = 3, + .ar_size = 4, .children = (struct init_tree_node[]) { ADD_PRIO("by_pass_prio", 0, BYPASS_MIN_LEVEL, 0, FS_REQUIRED_CAPS(FS_CAP(flow_table_properties_nic_receive.flow_modify_en), @@ -116,6 +122,10 @@ struct init_tree_node { BYPASS_PRIO_MAX_FT), ADD_FT_PRIO("prio-mcast", 0, BYPASS_PRIO_MAX_FT))), + ADD_PRIO("offloads_prio", 0, OFFLOADS_MIN_LEVEL, 0, {}, + ADD_NS("offloads_ns", + ADD_FT_PRIO("prio_offloads-0", 0, + OFFLOADS_MAX_FT))), ADD_PRIO("kernel_prio", 0, KERNEL_MIN_LEVEL, 0, {}, ADD_NS("kernel_ns", ADD_FT_PRIO("prio_kernel-0", 0, @@ -2375,12 +2385,15 @@ struct mlx5_flow_namespace *mlx5_get_flow_namespace(struct mlx5_core_dev *dev, case MLX5_FLOW_NAMESPACE_BYPASS: prio = 0; break; - case MLX5_FLOW_NAMESPACE_KERNEL: + case MLX5_FLOW_NAMESPACE_OFFLOADS: prio = 1; break; - case MLX5_FLOW_NAMESPACE_LEFTOVERS: + case MLX5_FLOW_NAMESPACE_KERNEL: prio = 2; break; + case MLX5_FLOW_NAMESPACE_LEFTOVERS: + prio = 3; + break; case MLX5_FLOW_NAMESPACE_FDB: if (dev->fdb_root_ns) return &dev->fdb_root_ns->ns;