From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0054.outbound.protection.outlook.com [104.47.0.54]) by dpdk.org (Postfix) with ESMTP id 15E1069D4 for ; Thu, 31 May 2018 18:21:58 +0200 (CEST) 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=cQYFPxffTib+ffZonXusUBCUZFq4nzuvNHemjnOtnNY=; b=imMPaBGvbEU5NEXMmFyENo69e9/FEyfabfljGSelTY86ZVUAF+np6JUKvkJPxvm6KgclcTXvo9LcAWDQ7R6FmxYyWBleZMpJxW06VRfZOfbEjGMznmiiXEQiq2dW4kgbXsp/kyqwQupHYeTPJeQz0Z7vJU8ch5MP2BWoJmwpm9M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from localhost.localdomain (37.142.13.130) by AM0PR05MB4435.eurprd05.prod.outlook.com (2603:10a6:208:5a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.11; Thu, 31 May 2018 16:21:55 +0000 From: Moti Haimovsky To: adrien.mazarguil@6wind.com Cc: dev@dpdk.org, Moti Haimovsky Date: Thu, 31 May 2018 19:21:26 +0300 Message-Id: <1527783686-1727-1-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0701CA0050.eurprd07.prod.outlook.com (2603:10a6:800:5f::12) To AM0PR05MB4435.eurprd05.prod.outlook.com (2603:10a6:208:5a::20) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:AM0PR05MB4435; X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4435; 3:g9Va1s9NyumhxOFwS0azQGzdPHWisGlI0FT/4mq/RmHwh+a9VW5h1agd3uuMGl+hY5h6DfZ/2PGCuqqGrv1CogD6j6VBy1AewpVYTO/w1T4ctsHGY5vaCt2gyReuzdu9xf09mLjHhTqf0stNtBz745dYQFpWREajKh3SUZsy/PGF8BeTn7DJfr8kI69h3BEOe9YE1vwlMtLL1l5QRL6uWz6on/fWLXL208eXdepxkFBnASsHI9n07zso+er+d+q7; 25:Q8FsezXpiMiDI27dfnJ/X2ZsgtLBZO3NRu2+8KvJDPbf8c0HqoTdHPvxGOr1ScqBPeKThGF+NQy106j2XvwXBpm0nCv67ZN0U22Rov8vNLhheZudIIvF3GaLHb6MIfxIjxTXNSNi3wC6ozzAgN/KXupUHmLuLxMgm7IKiuVff6/22ivgrwEjKP7sQRgSqU0G6dRftle8ldmKBVUic97FsWAZmBZxM8aBGDEoGe8Do5sTkFfxVlJ5eVm8xbsF/MsrE2tuZ5p3TNKpF6e1oPpV9bNlf/Wuhzj9/GS+/oVUV0WA+i5d+fRmj8AmfYE5gyyFck5a13miibDA/BNPc7kzLw==; 31:Fr64QxSF/n9wR86GTveTnXIpcMz/1FYPTkjtm7ocN0hMMkSHpPyqloRC/yYFmZ1wwX8fOoFWWoY7z3/oGFRC/ATk1Masnmo0vxniKTpI333SZ/MwiAy/zf4eb/Q4UUPadigDCq4ni4rWTSm1lL+94gSCi0FinaO0WCHQ1KO+TH87G5ZUAJImncT0prnBm3kDs7lbf+crM72zcwqak9cJ/81I+xg9MHEteC+qXYLL488= X-MS-TrafficTypeDiagnostic: AM0PR05MB4435: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4435; 20:nnqso1fS4fe4+j+lTakuqQzerv8nB7/PXWvOkNgkqLOFoAnnqfvQ4STWXttw5ZPm+AgtfzxEjF+qQRFon5UpAxe5OE5oBEpSjNi6pAU7gwEGA/PHwmgyan5peZVxnR41VAUwBggGLJ5rIxWjSWKiFPDQlj4xo3KaucQpNiXjN1zX9jEkCJugP23FJOn1Cpuzm2sgy5tbPNcHOgC8PbpSl/WhrtA+lGZDVQJvOErNJLKBuW+DBkPAyOFJTLJ9td/kC5RVbo0UU3K2B4Q45as7V14KFezcsGMWbbu/Jlg9NevhYRVjOL1vu372ET/fEou97Y3pc2AcA8Gy3avKReSXBpzuvlxPaS84OUIZb7tBUZyLbF6Mf+Wapju7e/5qQYeMqchGjnlbi61qBO36gYgLacUfa+HoAdzQ51U4z0KVYAJ6p2Ngj0x2nu1e5lHC7zqx16xj9vrkhF0E1k0tfULPJLCXM+K8bDy3HNfMzNoP3KyTJp+7hBTkoSqob1x0MK5f; 4:KoLY9CC0v7y0aNCW+H2iNRyikl5UKZi8nQfvQkeTBvnWLPVwMsYgDFahmpIrOTuGO26VxP6XoobAoZgCWf9bsvfBhxoAhVTfmGKa1Mzn/6D1fRmnsXzBdbkF+gxpyvTz5DC6WvpL97u/QYmWULa588gy21qv3IBcIUg5qxlGrx9oCCwyvw2OktZ9Ki3wU76kcaqV9ARga6QSMGhBLoqtLnobrbt+/Vvv8DGyO0LujAXVOjFq5xHMmuUlAa/M1FEs1UMR7g2XrvDwy8B06KQiTppwPfkkDZRivdyJC5aa11boy9Xzq5nMUhJZvrQ7Aq5k X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:AM0PR05MB4435; BCL:0; PCL:0; RULEID:; SRVR:AM0PR05MB4435; X-Forefront-PRVS: 06891E23FB X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(366004)(39860400002)(39380400002)(376002)(396003)(346002)(199004)(189003)(6916009)(7736002)(59450400001)(386003)(478600001)(50466002)(6486002)(305945005)(6116002)(53936002)(48376002)(186003)(3846002)(47776003)(107886003)(68736007)(6666003)(105586002)(5660300001)(6512007)(36756003)(2906002)(4326008)(97736004)(2361001)(81156014)(81166006)(8676002)(106356001)(8936002)(50226002)(2351001)(25786009)(51416003)(2616005)(52116002)(956004)(86362001)(476003)(26005)(66066001)(6506007)(486006)(16526019)(316002)(16586007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB4435; H:localhost.localdomain; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR05MB4435; 23:DCjMRw2PRFhXxTIDGH1GhizglSChK/cbBdcKmHHHV?= =?us-ascii?Q?8GPB64MkeqSU/KtjXxzcKr0L5Dc19FZw/SL9H6XnTkItZ9UfcDZOMJ8TNryz?= =?us-ascii?Q?4JyN9zCxsSeFLyHZIY8TKdQ9H1K63TdX2IYPjjXEVc94CFrKqHeWr2ACESt6?= =?us-ascii?Q?/1kDAKm2xhJLqYyF5JWvt85p8x3YwgSG3eyWe6M8+LNd+gD6PWOKJr40dzi1?= =?us-ascii?Q?Zo879E8RnzcSYnc/bbFYKOc+NvcHPo7m9mJoqljDbAlDIQSX7lcjk4g8vEh4?= =?us-ascii?Q?V0wjemvMDaDx9C2euWlW3Hwuu6J8z7EKbbV5PhO768FkceC25z9iHAX21akf?= =?us-ascii?Q?mYj9tlBtNzZjEWDh/moEjjCTuPrpOb6i7TG8v7PRDW+iVysZu+pSKhcRnyf3?= =?us-ascii?Q?Xw+AULcIQocv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3nsq5+T84fnfH/OVyTS/hhZ25y2n6185swTTzAQhr2GOn/gNDEG7ge9xaes9aIZN61ILPT9MiWgOfr+Ro4zIaFgA+pDtyheljm+6c7duSjkmE1VmSeV0mLcB5NrsD20rHj7m6a2QBD5GoPQnRqmykDzEDsCB/5gTLy+1eajuq X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4435; 6:CZrWmeg0LnRos/19l0RrBF8tw2b8WgCmpuav02IEIBARuiGn3SF052mRjobIHW6dwXcnfeMnJ3cBA2qeWI0u+fLPpzzYnDvbwjy7mrqebepxEdyGECnd8ZgbEc1IZGG/U0ya9s0VfknCX3d34t9Nl6HjV5p9E+HJtAI3pVPAmjNOhm/VGcaSziSj95tZruAFEbQKti7rs+IcN72WHxTMzEDjqkaeWfMugYmql1hhtx5Bh0wgj2lBWWVyIwn22u22PPl5LzXrp//GxJ7ZJVgYRi9ZtMqNznCmDDGZRiTLLZ4Y0rmX0HMis4rNJE0g7YkXwJFw8OdHg8yNj5yiIfKujHphvaA2GAS6OYa88XAqReFWTU5XgbqJDMDlwavh0gBBUhjJSoOd/EEjF5v6pAlFVi7Z+WvDCeHVsJVcVw4BLPOSjbyf2DMoQ5w3Dso01evPJlqTT20jS25bm5ffvosSxQ==; 5:TMdQoLqI7zz5qK8R+iyPU5X+i0SQer3X3TYmemN6FRYLNHZRpgMBw3jBWMEnpjG4+w+YAM7WkAGGgbtBXWwqImbvGyvJkSvMh1yefSFvTXhvesr1dx91ocW8ci85jYTToMrwO1dtTgRUHpe2DBRXf6utvxFLKFgie9qilDL/FFY=; 24:avD46Vtw3FkuEFLEs1wa2iT1cJoLaEdoKdfS3b8B8+StmsNvu98tzLqeyfSA8aAMf3b4riJdjysjml88RQUWjwSbeCcTQLULv+WFzAdL0JU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR05MB4435; 7:bww02rCA9HY4MAs187Y9u323PBm4Tg148lYql+/0raVXAQlW2enyHfz5mx1xkjfume+H3tngGG52zw9YTjBm4F2GGyXGI/r91y8WdCz1Eb5z7P/c5Tm3eodehINzUM0qWC+fbjg8SMBwNB/YQVnYAkFzRWdreX5MZK+04qjKkU3bDjzPVl1raANlw7e3KT0W6ewc+x/RkYntqSU7pEZLoIIPEUjreyB/cqCTcd2aJUr1nJCYvALBAqHBc2Ex2AAy X-MS-Office365-Filtering-Correlation-Id: bf062be7-fe79-4c4e-1cc3-08d5c712a0ad X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 May 2018 16:21:55.5066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bf062be7-fe79-4c4e-1cc3-08d5c712a0ad X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB4435 Subject: [dpdk-dev] [RFC] net/mlx4: add TSO support 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: , X-List-Received-Date: Thu, 31 May 2018 16:21:58 -0000 TCP Segmentation Offload (TSO) is a feature which enables the TCP/IP network stack to delegate segmentation of a TCP segment to the NIC, thus saving compute resources. This RFC proposes to add support for TSO to the MLX4 PMD. Prerequisites: In order for the PMD to recognize the TSO capabilities of the device one has to use: * RDMA-core v18.0 or above. * Linux kernel 4.16 or above. Assumptions: * mlx4 PMD will follow the TSO support implemented in mlx5 PMD. * PMD is backwards compatible. ** The PMD will continue work with the kernels and RDMA-core supported by it today. ** The PMD will continue to work with devices not supporting TSO. Changes proposed in the PMD for implementing TSO: * At init, query the device for TSO support and MAX segment size being supported. This will also determine if the PMD will advertise support for TSO (dev_info->tx_offload_capa |= DEV_TX_OFFLOAD_TCP_TSO;) * Calling create-qp when creating a Tx queue will have to consider the MAX TSO header size when calculating the actual queue buffer size. This may be abstracted by calling ibv_create_qp_ex with IBV_QP_INIT_ATTR_MAX_TSO_HEADER as comp flag rather than ibv_create_qp. If this breaks backwards compatibility then this calculation will be done in the PMD code. * Modify tx_burst function to: ** Check for TSO flag indication in the packets of the packet burst (buf->ol_flags & PKT_TX_TCP_SEG). ** For TSO packet create the WQE appropriate for sending a TSO packet and fill it with packet info and L2/L3/L4 Headers. * Modify Tx completion function to handle releasing of TSO packet buffers that were transmitted. Concerns: * Impact of changing Tx send routine on performance. The performance of the tx_burst routine for non-TSO packets may be affected just by placing the code that handles TSO packets in it, so we may want to consider having a dedicated routine for TSO packets. * No MAX-TSO parameter. This is a cross-PMD issue that may need a separate mailing thread to handle. As for today there is no way for the PMD to advertise the MAX-TSO it or its HW support as done with other capabilities. (The indirection table size for example. see rte_eth_dev_info.reta_size in rte_ethdev.h). Also there is no DPDK parameter or constant value that the PMD can use in order to know the MAX-TSO the system requires. This prevents applications from determining the MAX-TSO that can be used leading to configuration mismatches that may lead to transmit failures or to less-than-optimize TSO configuration in the best case. I propose to add a max_tso field in rte_eth_dev_info that will allow the PMD to advertise the max tso is supports. This can be used by DPDK applications to determine what TSO size to use. If this is a major change that cannot fit the 18.08 schedule then I propose to add a MAX_TSO constant in rte_ethdev.h, The PMD will compare this value whit its own MAX-TSO and if it cannot meet the defined value it will not advertise that it is a TSO capable device. * Handling packets longer then MAX-TSO In case a PMD is requested to send a TSO packet which is longer than MAX-TSO the PMD send routine should return with an error. A different approach that can be used on the future is to apply GSO to those packets using the GSO lib in DPDK. I am interested in general design comments and concerns listed above. Signed-off-by: Moti Haimovsky -- 1.8.3.1