From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id ECC38A0565; Tue, 17 Mar 2020 16:47:12 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08AF01C0B8; Tue, 17 Mar 2020 16:45:38 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40053.outbound.protection.outlook.com [40.107.4.53]) by dpdk.org (Postfix) with ESMTP id 23E561C0B1 for ; Tue, 17 Mar 2020 16:45:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WARbmauIpy4IoXWSg5AW/JJpHrPRW+kYmmhcMJyjOMuM6t9nERUaKqK5Uix9GfeadTJ66G0e1dRGGDCqigNjEp/OpTBqvo6AUOt8FVPyN9+NRzEl4zSDQKkTZIJjr0dcVmwVpOYSwyVphjMi6uAyhM2AMsdcWVVRJHxRvBMBCdj9isPlZRSndXDsGg5O2e99RJIYKR9X2iIUZsyivtEbSK8eT54CW85wGMfD1TW8L9fJ2bXi0cyw2UJbSXjvTi2ju9GpRA3xaNN+uAj1H2PX8sB4abVbDaZH2NmKj8vSMsELVCGMfHu3D7qmDc+s6+BiattTpwmIYKkp7oGXxF0DFw== 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=v41XlMwv/2kHQYWHCfibHkoOsT+3TbqMwGOaAxhQcJk=; b=W7U+EGIvI6oU2Xo0vvSlnlFLzDZo2bUGUtswR5BwN9tcdfHjb+IIZdBHvscvS5Iyqm1jOeqHDaO1fJmNsbjrVq8QTCse8gvDNVQOpdYZHfvj8rKZNVjXK3jZ7lBzk622HVn4kY7QFG1xBwivRXFkeC12CcF8V3TFl9ePn454yYSwBRC0L9QqimM0OURxkSYZiewd8Akeu7LKMJvlsBATAqZUEA9eMy1hLUH7DTjJe+L5Vy79eBiswE0cvygwIQR6G9tCYITN+uc1+5I7hh/Xjd8um2EHk9Ff6Q07E9zk3ZJSbK5ySjGM9e/2aHSt7e+1tUhRuiNkCLByssejgDTYkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v41XlMwv/2kHQYWHCfibHkoOsT+3TbqMwGOaAxhQcJk=; b=IDLnlZEXMzC00WCaE6mBsxL8lFeUFu6oVX4llaNxDzvSMAKfX+skbsN81tkvvCoLURO8sIQJFcD338PYRvbMW6kNMUMt7MWqCJRIwr39PW6n2g4LejDRqFCmNnnxasLrBbUc78PE7qJL9b7nTHPL8I4VGnayQ8V6Jo3Qn3HPKfQ= Received: from VI1PR05MB4192.eurprd05.prod.outlook.com (10.171.183.18) by VI1PR05MB5599.eurprd05.prod.outlook.com (20.177.203.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.21; Tue, 17 Mar 2020 15:45:35 +0000 Received: from VI1PR05MB4192.eurprd05.prod.outlook.com ([fe80::e5c2:8505:424f:b28e]) by VI1PR05MB4192.eurprd05.prod.outlook.com ([fe80::e5c2:8505:424f:b28e%7]) with mapi id 15.20.2814.021; Tue, 17 Mar 2020 15:45:35 +0000 From: Bing Zhao To: Ori Kam , Matan Azrad CC: "dev@dpdk.org" , Raslan Darawsheh , Slava Ovsiienko Thread-Topic: [RFC] net/mlx5: new device parameter to configure hairpin queue data size Thread-Index: AdX8cw6zJDcnjQFFQvKZYK6YFXv6sA== Date: Tue, 17 Mar 2020 15:45:34 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=bingz@mellanox.com; x-originating-ip: [183.156.38.210] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 364c0244-843b-49d2-f5e7-08d7ca8a3bcb x-ms-traffictypediagnostic: VI1PR05MB5599:|VI1PR05MB5599: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 0345CFD558 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(136003)(396003)(39860400002)(346002)(376002)(366004)(199004)(107886003)(8936002)(6636002)(81166006)(8676002)(478600001)(76116006)(26005)(66446008)(64756008)(66556008)(66476007)(186003)(81156014)(66946007)(5660300002)(2906002)(52536014)(71200400001)(9686003)(54906003)(110136005)(86362001)(316002)(6506007)(33656002)(55016002)(4326008)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5599; H:VI1PR05MB4192.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 3YOBSJBSbe/rbVWm6YddA2qnyt3NxBDJIeVmab6u0mr1U11xO7oTr3ZrJW03Ab1AVfHOfqnV+We8dto+hcnvEfI/KEW7p/WjtfFpgbnz3MXfHtYjaRXt3GYjhx7AsngOmgeKEG2hEYYTuZrfkEYtVJdJSJTGy2sVtiezCUBnHoR3W2poQnt1xYpWu0eHUxrJFa69Q1YnBe8PSNA6qdsvzusvGdJ6EsUMZyuQf78toBeWVuNxB+IzVNCNugl1Zw+L9Z208Pb8XV2eVXuZ0SzT9THbnR5QgPM3i9h7Rh/m2uMMXiSuPm+0vbwHc3RpHbFgT5GajG9j2ld2VpYSOFfImCJvdHQc3lLCXYFkZ2/ksN+DoMhZnaAeAWeIgYenBDPyoBpH2E1Lgtvhj9f4Ujd0GvUDMyvORFp6rdZz+MfQGvejRqB9HZ04GnKSNBJqlTiK x-ms-exchange-antispam-messagedata: gvVeTrZHLlVMnMNRuiEF7kqMIl0RxZxgs4CpU97TQevkM7jLGLSKut09YmAsRNnAsm/hA796QcbgVhF+jhGHcUQaaFlWlWZPmI4ePZN4mMX93tj2jxgppOaOhZFZfmb6LJ5XYJExnNOViG2bVUFMdA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 364c0244-843b-49d2-f5e7-08d7ca8a3bcb X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2020 15:45:35.2575 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: IkkZQUcUJHuOyST98JYhlii8QiA04uP+2TipFvWiOer14gzduMvAfT5/OhamhynrR2Bx475nsW1Lc9WrlB8Idw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5599 Subject: [dpdk-dev] [RFC] net/mlx5: new device parameter to configure hairpin queue data size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" When configuring hairpin queues, there is an input parameter to set the number of descriptors both for TX and RX interfaces. But it is not used for mlx5 devices because of the firmware mechanism. Currently, the stride buffer is being used for every ingress packet in the firmware. PMD driver could only set the total data buffer size and the maximal number of packets. Their relationship is as below (for a single queue): total_data_size =3D stride_size * maximal_packet_number And small stride size is recommended (e.g. 64B) to save the memory for small packets and get better performance. To configure the hairpin queue, either the total data buffer size or the maximal packet number could be used. When using "maximal packet number", it is not quite straightforward: 1. It doesn't mean the packets number that could be held in the same time. Because for a larger packet, more than one stride will be consumed. 2. It is not quite clear that what is the maximal length supported for a single packet. A new device parameter will be introduced for mlx5 devices to set the data buffer length - "hp_buf_log_sz". 1. It is a logarithm value, so the actual buffer length will be 2 ^^ hp_buf_log_sz. 2. If not set when probing the device, a default value will be used. 3. If jumbo frames need to be supported for the hairpin, then a larger value could be set. Or else, some smaller value will help to save the memory and fewer cache misses. 4. There is no need to care about the hairpin queue depth since no SW is involved. And firmware will be in charge of the packet descriptors number and make sure it is full enough.