From nobody Wed Sep 16 14:13:20 2026 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 4hlLTD48L1z6rXDv for ; Wed, 16 Sep 2026 14:13:20 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hlLTD2HP9z3N9X for ; Wed, 16 Sep 2026 14:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789568000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IBcjALAhhryax4ca+AcolukFKEgjE3hhRMIIF/U4A7s=; b=loMchM/LLCJemrhELHOgxFyFmC5OYlJBKp8XxPPA3IKQD64ICM05/y68ZbCEDy9y79J6Ho md7pWnNQRPXLVJ/JXjaHnsZtWgZJyM6BlBAY4otYWv7+OX/RA2fYLlvJpMVjordOByR4wf y8BLgbD3H6LUtji6Z/0HFFsR1X+fx2Aa6AnAq2NiPfF9A1K0epnI+Ida+G1DcfpbFkVg4T 9j7TxTJJ/32AIsGQWc9TJTQ1ZxwJf9bvYsnuapFXAP5zC98McgHiE3iG4tDunX1jXOt+bH Mv7Ma89jSj3pqDfAGYJVso2PdHYqDyzMrGuxyo3uX4WapQpNoXySYzs8vC02sQ== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1789568000; b=XYK/5xsHhgP/hxOJdIM1fNwrMOFYNZDJYsYOSdQAPfBQI3VUqGiHtdBld7sstoiDzrDnw9 cDmGt1jgJXyVZ9tKlCU3CBWPrHZdTWjFvCRC5m4r0K6iGsQoM8kdIQvpSckvHoHjWjRLJG hzKHzAaRoaQxT2LH0Q6inOY8OtMop0PkbiYUURwFnq/dgi155rEOsqPsv45DhYOHIm00Dw uEUbvYu5OeZ9dRazfJdgXJNAWmfoUPXUNhXDPm+isoZPJjuJU1fSqPTqYcgnHGRfkVyNFU fpvdT5fsEnt/IU+CGFb/WhrKj/p1XhhE6ISBFsp94E6nm/CusfGqIQbFs64nXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1789568000; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=IBcjALAhhryax4ca+AcolukFKEgjE3hhRMIIF/U4A7s=; b=ofWTmbl09Mt3/bF6Ak4kJ/PowUYmfipXhYBXyTUuda9C4iLsAoxzByxIyzCFFdJdJyPguS UygJ03uyI6AOPuccEViNusLzfAnYu8L5Mhw2ZMyeddxDm0UnqFJBt4+KaWK5cXobQdwIe/ SLklLCTLw9fVrqxLEBvTNRQ4Nen0G04fwSNtdSdKm150rZnW76jMm6FkewjjNtmZ5eNGAL UT+XM6VTzbuR3Ko2DJs56TTS7YpO6hEYzSvBZniFRK5HkrOaN9/UV3HZgLMIH8BIMYdEUE 97IxuL4FXvc++QvsZo/9ttER4xqcuAaMb1qeb0PKjWZD0tyJhx3ErguBdTVs1w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hlLTD0Y8yzqWw for ; Wed, 16 Sep 2026 14:13:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 364cd by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 16 Sep 2026 14:13:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Vag Singh From: Konstantin Belousov Subject: git: 5189261cd0ec - main - libmlx5: Report SW parsing capabilities through mlx5 direct verbs 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5189261cd0ec0ddfc1fc684b4d8d27e7a6048115 Auto-Submitted: auto-generated Date: Wed, 16 Sep 2026 14:13:20 +0000 Message-Id: <6aaaa400.364cd.5a7d3d91@gitrepo.freebsd.org> The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=5189261cd0ec0ddfc1fc684b4d8d27e7a6048115 commit 5189261cd0ec0ddfc1fc684b4d8d27e7a6048115 Author: Vag Singh AuthorDate: 2025-08-14 06:51:22 +0000 Commit: Konstantin Belousov CommitDate: 2026-09-16 14:12:09 +0000 libmlx5: Report SW parsing capabilities through mlx5 direct verbs [PATCH 24/31] FreeBSD OFED support for DPDK MLX5 PMD Software parsing (SWP) is a feature that can be used to instruct the device to stop using its internal parser and to parse packets on the transmit path according to offsets set for each packet. Through this feature, the device allows the handling of checksum and LSO by the hardware according to the location of IP and TCP/UDP headers. Report various SW parsing capabilities and supported QP types through mlx5 direct verbs interface. Differential revision: https://reviews.freebsd.org/D32199 MFC after: 1 month --- contrib/ofed/libmlx5/mlx5-abi.h | 1 + contrib/ofed/libmlx5/mlx5.c | 5 +++++ contrib/ofed/libmlx5/mlx5.h | 1 + contrib/ofed/libmlx5/mlx5dv.h | 15 ++++++++++++++- contrib/ofed/libmlx5/verbs.c | 1 + 5 files changed, 22 insertions(+), 1 deletion(-) diff --git a/contrib/ofed/libmlx5/mlx5-abi.h b/contrib/ofed/libmlx5/mlx5-abi.h index bce9e559326b..d1e8b9d88ae7 100644 --- a/contrib/ofed/libmlx5/mlx5-abi.h +++ b/contrib/ofed/libmlx5/mlx5-abi.h @@ -289,6 +289,7 @@ struct mlx5_query_device_ex_resp { struct mlx5_packet_pacing_caps packet_pacing_caps; __u32 support_multi_pkt_send_wqe; __u32 reserved; + struct mlx5dv_sw_parsing_caps sw_parsing_caps; }; #endif /* MLX5_ABI_H */ diff --git a/contrib/ofed/libmlx5/mlx5.c b/contrib/ofed/libmlx5/mlx5.c index 807725580dac..56560c9d59c0 100644 --- a/contrib/ofed/libmlx5/mlx5.c +++ b/contrib/ofed/libmlx5/mlx5.c @@ -661,6 +661,11 @@ int mlx5dv_query_device(struct ibv_context *ctx_in, if (mctx->vendor_cap_flags & MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW) attrs_out->flags |= MLX5DV_CONTEXT_FLAGS_ENHANCED_MPW; + if (attrs_out->comp_mask & MLX5DV_CONTEXT_MASK_SWP) { + attrs_out->sw_parsing_caps = mctx->sw_parsing_caps; + comp_mask_out |= MLX5DV_CONTEXT_MASK_SWP; + } + attrs_out->comp_mask = comp_mask_out; return 0; diff --git a/contrib/ofed/libmlx5/mlx5.h b/contrib/ofed/libmlx5/mlx5.h index e2e4a882ed54..d8d5b48fc618 100644 --- a/contrib/ofed/libmlx5/mlx5.h +++ b/contrib/ofed/libmlx5/mlx5.h @@ -272,6 +272,7 @@ struct mlx5_context { uint64_t vendor_cap_flags; /* Use enum mlx5_vendor_cap_flags */ struct mlx5dv_cqe_comp_caps cqe_comp_caps; struct mlx5dv_ctx_allocators extern_alloc; + struct mlx5dv_sw_parsing_caps sw_parsing_caps; }; struct mlx5_bitmap { diff --git a/contrib/ofed/libmlx5/mlx5dv.h b/contrib/ofed/libmlx5/mlx5dv.h index 102efdf9065b..53cf5416c071 100644 --- a/contrib/ofed/libmlx5/mlx5dv.h +++ b/contrib/ofed/libmlx5/mlx5dv.h @@ -58,7 +58,8 @@ enum { enum mlx5dv_context_comp_mask { MLX5DV_CONTEXT_MASK_CQE_COMPRESION = 1 << 0, - MLX5DV_CONTEXT_MASK_RESERVED = 1 << 1, + MLX5DV_CONTEXT_MASK_SWP = 1 << 1, + MLX5DV_CONTEXT_MASK_RESERVED = 1 << 2, }; struct mlx5dv_cqe_comp_caps { @@ -66,6 +67,11 @@ struct mlx5dv_cqe_comp_caps { uint32_t supported_format; /* enum mlx5dv_cqe_comp_res_format */ }; +struct mlx5dv_sw_parsing_caps { + uint32_t sw_parsing_offloads; /* Use enum mlx5dv_sw_parsing_offloads */ + uint32_t supported_qpts; +}; + /* * Direct verbs device-specific attributes */ @@ -74,6 +80,7 @@ struct mlx5dv_context { uint64_t flags; uint64_t comp_mask; struct mlx5dv_cqe_comp_caps cqe_comp_caps; + struct mlx5dv_sw_parsing_caps sw_parsing_caps; }; enum mlx5dv_context_flags { @@ -316,6 +323,12 @@ enum mlx5dv_cqe_comp_res_format { MLX5DV_CQE_RES_FORMAT_RESERVED = 1 << 2, }; +enum mlx5dv_sw_parsing_offloads { + MLX5DV_SW_PARSING = 1 << 0, + MLX5DV_SW_PARSING_CSUM = 1 << 1, + MLX5DV_SW_PARSING_LSO = 1 << 2, +}; + static MLX5DV_ALWAYS_INLINE uint8_t mlx5dv_get_cqe_owner(struct mlx5_cqe64 *cqe) { diff --git a/contrib/ofed/libmlx5/verbs.c b/contrib/ofed/libmlx5/verbs.c index 2fdf985b0092..f591b177b599 100644 --- a/contrib/ofed/libmlx5/verbs.c +++ b/contrib/ofed/libmlx5/verbs.c @@ -2121,6 +2121,7 @@ int mlx5_query_device_ex(struct ibv_context *context, mctx->vendor_cap_flags |= MLX5_VENDOR_CAP_FLAGS_ENHANCED_MPW; mctx->cqe_comp_caps = resp.cqe_comp_caps; + mctx->sw_parsing_caps = resp.sw_parsing_caps; major = (raw_fw_ver >> 32) & 0xffff; minor = (raw_fw_ver >> 16) & 0xffff;