From nobody Tue Feb 1 15:24:30 2022 X-Original-To: dev-commits-src-main@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 31345191664C; Tue, 1 Feb 2022 15:24:31 +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 4Jp7yQ5gydz3G1S; Tue, 1 Feb 2022 15:24:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643729071; 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=nDJ/EDOhiqZRXxGS+V/CwgGT3jTYFDEBespns+clUNw=; b=J/2nkEbN90PNMa5nMEFzSrs3B8eDlFRuyStHpTTZdqfO2QiuT2WxkVcT55I98AMd+9SNly /6nbilNar8N2FK+Rr4lXDjHuOS4Ol5bWCwSE4u+3FxCIIiE9KxVEMkKAvnvEk6ZO3+BnXV jGoGozjkf0JiH75z6632c6ifq2S/LwnJ22ImZU+GEFtelvu9+m14KP3WxI4HwwaeWHtC/J d9mK86AKBRUQIuVztFmm3Liv4RGfKkshMm88qHU/VIHTy9WvR3ndHndKRUo37TNbJuLQgE lvENnAVHyxvhwsCHOIefjD+aG1Zav42KsT/LU4qziI44mwHwJ/QfHXruM6WtBw== 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 589FD13607; Tue, 1 Feb 2022 15:24:30 +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 211FOUCp051220; Tue, 1 Feb 2022 15:24:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 211FOUN8051219; Tue, 1 Feb 2022 15:24:30 GMT (envelope-from git) Date: Tue, 1 Feb 2022 15:24:30 GMT Message-Id: <202202011524.211FOUN8051219@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: 0ee1b09eaa99 - main - mlx5: Implement offloads flowtable namespace. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0ee1b09eaa99ed96885fd024a32baf182411a35a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643729071; 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=nDJ/EDOhiqZRXxGS+V/CwgGT3jTYFDEBespns+clUNw=; b=V86E/BXE0n4mh/fSmMBVgFljx8zvc7Nz9EYtXgcKpTcFkA56s4eYIQvcBlfmqz0T7OySHz 6iWyGCxMRd0Wk+So4N4XAeDswjLMRMmHtJNRu6mKzv466cCmRAGajJSZO8xgg3s2obmRJ8 0ZWZkru456xgQrUV36B33sVzomHOxoZy70uCdS9gHSqbAxw0bqIK1JlFzO2W4y5hEHWnpm CpZ+u36XPvDPI81IEKD+P+CFUfBYOU2zObQ2v63A9uuWwKtvq3pF6DpQ5KFfEFZDghy8RF MLm4hEglBR5n8nq3EJsGsBYtjf+YRT5nu5kl3ruCpwClZbbFOJIY6b33sfXcUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643729071; a=rsa-sha256; cv=none; b=hOyF7qDEAS9XUedp6PiawdHxbWRB9DTEFZ36GgHIJWZIARejVmG49tELFFkU94+clrURDo ZTLhwV50CEFN/eArrc+7izyI9Q8YdxAsx6UlH7RfSfI9Dz13GJAcKw8v2ny5z0sNIwT1wf lOrYBAKuukF3tBvpgj5RK1qWvZWHADosKN1RvFLwE/tntlxBAfAbEEnfSAD+Eyfd8698LG LOsbcIN74kdlqStasmcTeOTCD1qDfvai7eAipjqN9HmN0YsxJF1SswuGM/iZWetE1uzkJN FWj3EGuj0Dp6OB/kxjmjGvrPF5alMj1CaGPPM+/WvbcPQ2FNdeIGaROLd2/QTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=0ee1b09eaa99ed96885fd024a32baf182411a35a commit 0ee1b09eaa99ed96885fd024a32baf182411a35a Author: Hans Petter Selasky AuthorDate: 2022-02-01 15:20:13 +0000 Commit: Hans Petter Selasky CommitDate: 2022-02-01 15:21:16 +0000 mlx5: Implement offloads flowtable namespace. This namespace will be used for TCP offloads, like hardware decryption of TLS TCP data. MFC after: 1 week Sponsored by: NVIDIA Networking --- 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;