From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 291AFA0524; Wed, 5 May 2021 14:23:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2E20941103; Wed, 5 May 2021 14:23:53 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2066.outbound.protection.outlook.com [40.107.244.66]) by mails.dpdk.org (Postfix) with ESMTP id 45F2C410FE for ; Wed, 5 May 2021 14:23:52 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Nlyk1269+VrGD13AexbCbk6L7AXHbiheidBNseD1tOwKtw4ZB6v+SmtPaCWXWk49CkskSzWRsLnb5VCPB0SArwDscM8uoPPw4mWb9kcE+bPrseeyTF14yleayj1XI91ai/u+hOboMnj9E4uu96VvsIkV/0rlh7noac/M5dPfjuCVPSdKzvSMMHye90AK6W2PQFAS0ZFrLy7QG5CJZbdauVEUTNCOHgw+L5rPDSf9cQSglEeBaaVNzRgcw9YHuubQzeoRi5VbdZS4WUe3qHelCTnU+Jn2VxOG7ho+mzz3KzatC2c6LpGtKXeYZYZ1eQJlAjEM4b2TrA+6zv0Cp9TlnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5m+ieE7zc1GLz0SUsFZX3mEDLIOA2bTIKdx1es7028s=; b=fVqWD0iqD1SyUBY46Nh0t0zYUXmSZqdwHIwGk73JZMhJegiFeYepCZPluLMpQ0tQ38934Ghj8zsDCNDAg1Ja5v3MH1AOnYQzVccTlhjjqoeZWwZ/8qs9vWviSNauMajn6tbm5e59WfNbBFJAV+qFDgr3ohufjr4ovw7xliJz0laHE49HXTns53zl8XT4mon7SRZ9vTbA44x7ZbdLYX8Q/0UdpgtNAjMst5GWm+rIftPpyObptmbrE8V4or0pI/0gNjMFv6pqKIb7YwUIDI4v4Z/qjydmRD1i+HQvJW4oJSOloOexGKCVD9n7Pne6g46E98uL8D9MhEgEramrEIJc9g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5m+ieE7zc1GLz0SUsFZX3mEDLIOA2bTIKdx1es7028s=; b=P2fl0I6MiKrsyyTJUfxs4458yOoAokRXClZjyRZeUsBPjZdySsTWlH4oK0UK7RstQX+ZDSESv3URXSepCNeg+19IdxP0AeWoxqjToTrB6Nk9Kwzk++3D2YEXwOQ9vhTlrRZcM4SUffLRN4Uc0pah0vlMeTP6qbrh2YlGipMi4LV178+dS1yNOCnf3YqWuiFq06Q9fbqJJdq1miANlLSI+gEgjSiUGJvqQXJWTWxn7JqMspoFBjeGkdXTT8gmeI/8+XUaBylh7INU23sfwXA12yDqTo9SoNpBsibyxY53B6ISxFAZrswRqBqSkrvA+nma/cj9Xo2oX+YGc6yLDscBXw== Received: from DM3PR08CA0010.namprd08.prod.outlook.com (2603:10b6:0:52::20) by BY5PR12MB4227.namprd12.prod.outlook.com (2603:10b6:a03:206::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25; Wed, 5 May 2021 12:23:51 +0000 Received: from DM6NAM11FT062.eop-nam11.prod.protection.outlook.com (2603:10b6:0:52:cafe::1e) by DM3PR08CA0010.outlook.office365.com (2603:10b6:0:52::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 5 May 2021 12:23:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by DM6NAM11FT062.mail.protection.outlook.com (10.13.173.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4108.25 via Frontend Transport; Wed, 5 May 2021 12:23:50 +0000 Received: from nvidia.com (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 5 May 2021 12:23:47 +0000 From: Bing Zhao To: , , CC: , , Date: Wed, 5 May 2021 15:23:12 +0300 Message-ID: <20210505122328.51129-2-bingz@nvidia.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210505122328.51129-1-bingz@nvidia.com> References: <20210427153811.11554-1-bingz@nvidia.com> <20210505122328.51129-1-bingz@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8ee25b8-d13e-4c3b-ae83-08d90fc0a3f0 X-MS-TrafficTypeDiagnostic: BY5PR12MB4227: X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QIcTRVCccMlBGzm8q62b1muYXte1rbNiT8fIJzB7YuUlwRWY4FAfa1vPVpDnie0Wp4kLWPfxajT4ZjgQ0hjlxGqY3SRjYJBqBkhIkFmm4jfAIaQdIAChC/0JmkTsZpJ+9fy1jxOVa/uds6CxicHUn29IY+h+SXMBubmYh4iOAxuZXGHVe6WNVcqxdSdBUINw+oTcZM0J0Y+qB83lEJo1XaQOJvyFbmYI2XMXh1h018xFfMq+FQP3UHkmoWfqEsuqcysuNDFf9jga4WVXgmAemoAj/z+zxdwYTWWjXnDo3Qva3q22oLrrSP1gr6bkwWsZpZpDOkn3eqkXU8MjH+/mgC0V10GYqkY2lx7+EtMoOFjp7wYwya1YY9sHOY4l0ZOJNKzIjogvCS4JHgCHLrKUVQQWAKeit8aX0uZmfr97B59QUm3BIXJvFu57nMyYhxLV/hzvEeI+29JtV1oPWamtnN22AtoRn+WapaQJd7ICVXYTTTvCdfVKM+yUVcmg4Sa81/gkZ7iu/deMkRejaTyV0ACYKSsZSzgYOkThbg9UFU7JkK80F9HzcLzxMMTB08BqunZ3APcQKZHOWr5RhJGUg5OO6+1WLF10DFbRTwRVCYN7hG5Ed2k5iJY6mDne3Umez27mTUEau/fae8850kHRX34svSlAp/GbSWBTF3FgYdQ= X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(136003)(39860400002)(376002)(346002)(396003)(46966006)(36840700001)(70206006)(110136005)(82740400003)(6286002)(316002)(54906003)(107886003)(7636003)(478600001)(336012)(356005)(82310400003)(83380400001)(186003)(16526019)(36756003)(5660300002)(36860700001)(47076005)(55016002)(6666004)(426003)(2906002)(2616005)(26005)(4326008)(36906005)(8936002)(70586007)(1076003)(8676002)(7696005)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2021 12:23:50.6783 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a8ee25b8-d13e-4c3b-ae83-08d90fc0a3f0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT062.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4227 Subject: [dpdk-dev] [PATCH v7 01/17] common/mlx5: add connection tracking object definition X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The structures of ASO connection tracking offload object are added based on the definitions in the PRM. One CT object context will be loaded into the cache completely in a reversed order of dwords. The valid bit should be the MSB of the last dword. This is used for the conntrack context creation and update, as well as for the query. The capabilities 2 (HCA_CAP_2) layout is also added. The connection tracking related capabilities could be queried via the HCA_CAP_2. Signed-off-by: Bing Zhao Acked-by: Viacheslav Ovsiienko --- drivers/common/mlx5/mlx5_prm.h | 85 ++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h index 330101233a..683ab40338 100644 --- a/drivers/common/mlx5/mlx5_prm.h +++ b/drivers/common/mlx5/mlx5_prm.h @@ -1124,6 +1124,7 @@ enum { MLX5_GET_HCA_CAP_OP_MOD_ROCE = 0x4 << 1, MLX5_GET_HCA_CAP_OP_MOD_NIC_FLOW_TABLE = 0x7 << 1, MLX5_GET_HCA_CAP_OP_MOD_VDPA_EMULATION = 0x13 << 1, + MLX5_GET_HCA_CAP_OP_MOD_GENERAL_DEVICE_2 = 0x20 << 1, }; #define MLX5_GENERAL_OBJ_TYPES_CAP_VIRTQ_NET_Q \ @@ -1692,6 +1693,29 @@ struct mlx5_ifc_flow_table_nic_cap_bits { ft_field_support_2_nic_receive; }; +struct mlx5_ifc_cmd_hca_cap_2_bits { + u8 reserved_at_0[0x80]; /* End of DW4. */ + u8 reserved_at_80[0xb]; + u8 log_max_num_reserved_qpn[0x5]; + u8 reserved_at_90[0x3]; + u8 log_reserved_qpn_granularity[0x5]; + u8 reserved_at_98[0x3]; + u8 log_reserved_qpn_max_alloc[0x5]; /* End of DW5. */ + u8 max_reformat_insert_size[0x8]; + u8 max_reformat_insert_offset[0x8]; + u8 max_reformat_remove_size[0x8]; + u8 max_reformat_remove_offset[0x8]; /* End of DW6. */ + u8 aso_conntrack_reg_id[0x8]; + u8 reserved_at_c8[0x3]; + u8 log_conn_track_granularity[0x5]; + u8 reserved_at_d0[0x3]; + u8 log_conn_track_max_alloc[0x5]; + u8 reserved_at_d8[0x3]; + u8 log_max_conn_track_offload[0x5]; + u8 reserved_at_e0[0x20]; /* End of DW7. */ + u8 reserved_at_100[0x700]; +}; + union mlx5_ifc_hca_cap_union_bits { struct mlx5_ifc_cmd_hca_cap_bits cmd_hca_cap; struct mlx5_ifc_per_protocol_networking_offload_caps_bits @@ -2630,6 +2654,67 @@ struct mlx5_ifc_create_flow_meter_aso_in_bits { struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; struct mlx5_ifc_flow_meter_aso_bits flow_meter_aso; }; + +struct mlx5_ifc_tcp_window_params_bits { + u8 max_ack[0x20]; + u8 max_win[0x20]; + u8 reply_end[0x20]; + u8 sent_end[0x20]; +}; + +struct mlx5_ifc_conn_track_aso_bits { + struct mlx5_ifc_tcp_window_params_bits reply_dir; /* End of DW3. */ + struct mlx5_ifc_tcp_window_params_bits original_dir; /* End of DW7. */ + u8 last_end[0x20]; /* End of DW8. */ + u8 last_ack[0x20]; /* End of DW9. */ + u8 last_seq[0x20]; /* End of DW10. */ + u8 last_win[0x10]; + u8 reserved_at_170[0xa]; + u8 last_dir[0x1]; + u8 last_index[0x5]; /* End of DW11. */ + u8 reserved_at_180[0x40]; /* End of DW13. */ + u8 reply_direction_tcp_scale[0x4]; + u8 reply_direction_tcp_close_initiated[0x1]; + u8 reply_direction_tcp_liberal_enabled[0x1]; + u8 reply_direction_tcp_data_unacked[0x1]; + u8 reply_direction_tcp_max_ack[0x1]; + u8 reserved_at_1c8[0x8]; + u8 original_direction_tcp_scale[0x4]; + u8 original_direction_tcp_close_initiated[0x1]; + u8 original_direction_tcp_liberal_enabled[0x1]; + u8 original_direction_tcp_data_unacked[0x1]; + u8 original_direction_tcp_max_ack[0x1]; + u8 reserved_at_1d8[0x8]; /* End of DW14. */ + u8 valid[0x1]; + u8 state[0x3]; + u8 freeze_track[0x1]; + u8 reserved_at_1e5[0xb]; + u8 reserved_at_1f0[0x1]; + u8 connection_assured[0x1]; + u8 sack_permitted[0x1]; + u8 challenged_acked[0x1]; + u8 heartbeat[0x1]; + u8 max_ack_window[0x3]; + u8 reserved_at_1f8[0x1]; + u8 retransmission_counter[0x3]; + u8 retranmission_limit_exceeded[0x1]; + u8 retranmission_limit[0x3]; /* End of DW15. */ +}; + +struct mlx5_ifc_conn_track_offload_bits { + u8 modify_field_select[0x40]; + u8 reserved_at_40[0x40]; + u8 reserved_at_80[0x8]; + u8 conn_track_aso_access_pd[0x18]; + u8 reserved_at_a0[0x160]; + struct mlx5_ifc_conn_track_aso_bits conn_track_aso; +}; + +struct mlx5_ifc_create_conn_track_aso_in_bits { + struct mlx5_ifc_general_obj_in_cmd_hdr_bits hdr; + struct mlx5_ifc_conn_track_offload_bits conn_track_offload; +}; + enum mlx5_access_aso_opc_mod { ASO_OPC_MOD_IPSEC = 0x0, ASO_OPC_MOD_CONNECTION_TRACKING = 0x1, -- 2.26.2