From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0064.outbound.protection.outlook.com [104.47.1.64]) by dpdk.org (Postfix) with ESMTP id 633E91C8E2; Fri, 11 May 2018 19:39:31 +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; bh=sNaXvdnIVAbaPD4X1UVev6U2v08QbscVgcell4dAKTw=; b=r+TZKsCciTlbmROUDqRMxq7aucHOKq9D5ODw+IqHMdgu2p4J82Ixez3IUScxwJCRD4SYGKJe38/v+w2xMFSCMsyYOOTVptPavf0uj2a8kYItvuNtTZNOLlJTtVpKToTa5qGPAQgVaG9R9dWZGuI6BxUwI50gUJMhW7/+FJ1/gHA= Received: from mellanox.com (209.116.155.178) by AM5PR0501MB2036.eurprd05.prod.outlook.com (2603:10a6:203:1a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.755.16; Fri, 11 May 2018 17:39:27 +0000 From: Yongseok Koh To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com Cc: dev@dpdk.org, shahafs@mellanox.com, Yongseok Koh , stable@dpdk.org, Xueming Li Date: Fri, 11 May 2018 10:39:13 -0700 Message-Id: <20180511173913.41414-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180511005032.30646-1-yskoh@mellanox.com> References: <20180511005032.30646-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: BYAPR03CA0015.namprd03.prod.outlook.com (2603:10b6:a02:a8::28) To AM5PR0501MB2036.eurprd05.prod.outlook.com (2603:10a6:203:1a::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:AM5PR0501MB2036; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 3:8UqLtjthc/Aaei5n+m7Qla78uO24jU+SzDDqj7iiHNDUm2wEt1IuX5/xmT1vGPtnJAm/coys2700OjYQZn+KXi6KXphC1gEFUjL/XjazzFhMGtS1zwvqXcSElHGY61YU4xk9f6n+Cw6sRB1mF31//gKFIQD7S6V8SVNHjE72RXGEYKJjTLZODhW1WjwRDtIOa9XaRayV8RDu/YI12udDa/fayvl62+BFL+7t7AagRsYULMEsVW5Z5TjxDr90MkDO; 25:CeMRwRi0D6fzZe5vb+/GSAbrXaVoyZ18ohV+J50L1RE9lziTXSZ5PyKC6qVryPrXIoTBi9ltuXMuvCsSvEBplNrnXR7wi556FlunVydzQHm/l1TGf1PiXc5LDgIRIqbmEirFkFfw4WIZMJ/fn8B46kkYLwrcmcepv06L5RIEjyYvvzZXEUCzLdm1il0ThJYdHnU9i9b0MLqXE/HuVdS7dcy7FU2TCgt9a/prC5VwqlC23DBCIrT8lYc3E/iJNgIkVLo5TqBlq3/xIQTv+a4PHTQvlnbghfNe15Q6J7LCbS7izooLPgV4nBJQjzyPQp4qgWYhoxtCc/eG65FoPBCxZQ==; 31:wlkMa+qDDSOkNMcbt+IHi/XaJzOdoQfvz7r81WmEJ6OEVnfWG6qab2F2eRBmlCsFbJSHvZyNyUZPKQbVxgqZVHPFQZ/TVHb4fea7nx5zCOn9hCTLDUUkBx3cpW1fMXw7KQtczOLAjAdI6xOJB0J92b/Gk6gLFQVYIfkUTON0hiM+RstKyX9tMXJ+gxrDpBxBy7ws9pnF0A7OhuAadARK6w9s2EbKtOVpB3z9Nf3VGSg= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2036: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 20:qboPS9F3/476vZx1nfYEhW+YRnJF3QZx+sOz7DyjVlzeOZiR+IK8mIdCWwyJQbJFyBwNO96ar6rZQbg8aec4j8nJV++8P+ZzylEYz0MfmyAy0bjzEjxpNOCBk5UtlFZzShT0COXCkEwyKIkvNdqS6J4WOXzDQd7SGCb1aB049YpT6vpouighqsix821dSutAl9PhbEiNUl/ztmp0Z+LUvrvbYEPDNVbCmZYv8retWtyDR6RDsfr+6SucB5I9SVVx2KXeByEIADjjy9gf5f0/kXpehWHYb5djo7HlAgrQZN7f+0Fq1+DF5G3r+IVoSmpSm0f4vNp5StL28oIAtx1tP05OZyBSGXiL/HkiCHPrEylKi0ugNSyEYooRYtBa+veVmRmWzgpKglH+/Hu+Zi/+K3mc4W9/Z5XsQtY/c3lT1bK6S3KiuQMeZIncmX6m3KfFbvBBDn3UOdVVqHDYhyylfxhFKtV5F0v/Jq8qNCcAI7rTAcH7B9o+Ig7aD/eGEFnY; 4:n9eA8xbmtREi9DWP3ZH02E9x5xzilygpB7ALyyGRVo28J5+XGCSAscIwGA/QCHe66XqwZdhfKEbXTfoSJwa+MtBokogn/wW716cazkDdr4cWWg0O4i0NK1CtEIKqQ6+tp0BF/VA36pm25ZKJHO2a+BB9wTrW9M1IPkBhRXS3oNrFxBbzw6j/2v/eNm/u8xp18C/GiUh012yOx2+jw+41o0OixBXjJBtntjdXRcNTBBitB3lB3jnaVcvSmhXUNRt3olhmiMftoMzJLcENuowJVbG2usUZJjOl5sOaqgcfV9OIjON0LgnwhNYcNkBzH1mG X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:AM5PR0501MB2036; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0501MB2036; X-Forefront-PRVS: 06691A4183 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39380400002)(39860400002)(366004)(396003)(189003)(199004)(50226002)(66066001)(1076002)(3846002)(52116002)(47776003)(305945005)(36756003)(51416003)(81166006)(8676002)(7696005)(81156014)(50466002)(105586002)(6116002)(55016002)(69596002)(16586007)(7736002)(48376002)(8936002)(68736007)(106356001)(54906003)(478600001)(86362001)(446003)(316002)(97736004)(2616005)(4326008)(107886003)(486006)(476003)(2906002)(6666003)(11346002)(186003)(16526019)(21086003)(25786009)(386003)(5660300001)(76176011)(956004)(26005)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2036; H:mellanox.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2036; 23:zXAtYh01vL7mUE+OlX2N/lEjQHyfQ4SPZuXaCtj?= =?us-ascii?Q?q+bQ6llJpZgnWBu+dMqxhfjdnDDPcg5xVUcmK5s6JnluXvwLWtzGlXiCsXXm?= =?us-ascii?Q?GGf/JqRK6ZWOr3sY29w+BZRLGagD47Rw9yCpeEJFZduUcgIc2vjq9Hh1XDCw?= =?us-ascii?Q?dKd8V9WZgdNO1k/MOTOFrSe+Mg7gvS5ERb3QpPONwzsCQQXG3e50dwgtM84D?= =?us-ascii?Q?qsQ5VuXSMrnlAluIml/yU315k+vpYNy7pkcvabcMLsaoAH34SR2zAuE1mBh+?= =?us-ascii?Q?XB045fBtYo8bd1EHbIZvx5Lbd/VXUHQJK3ymW/fMWr+ljKfIenDIJjoTBOsp?= =?us-ascii?Q?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Output: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2036; 7:EOMewsrsuwFUALcjK6xjaxHSLZCMu4RJWqJSPws+EDHj1KH2PAUJO3Z4PmlqPVnxNCqdhmJGPuwvf8Ym2uU/mJ8FSfl/fyhlfzVyJbRE62A3Ii4eWE33F5MsFWiOEO017sNkdVdt9WUlpazlRcPZoapDqzuIvozouc6S6kLL+Pq1RqIwiSGnTFSLzrz5afJZrNQ/h4uBK00RG6XZ+/eONOOw+McjGA3VXQtF/V7rOqhCmfR4Gpi+hzihjPDH0VOU X-MS-Office365-Filtering-Correlation-Id: 907883fa-4f66-4642-312e-08d5b76625e2 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2018 17:39:27.9170 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 907883fa-4f66-4642-312e-08d5b76625e2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2036 Subject: [dpdk-dev] [PATCH v2] net/mlx5: fix inlining segmented TSO packet 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: Fri, 11 May 2018 17:39:31 -0000 When a multi-segmented packet is inlined, data can be further inlined even after the first segment. In case of TSO packet, extra inline data after TSO header should be carried by an inline DSEG which has 4B inline header recording the length of the inline data. If more than one segment is inlined, the length doesn't count from the second segment. This will cause a fault in HW and CQE will have an error, which is ignored by PMD. Fixes: f895536be4fa ("net/mlx5: enable inlining data from multiple segments") Cc: stable@dpdk.org Signed-off-by: Xueming Li Signed-off-by: Yongseok Koh --- v2: * replace unnecessary check of 'inl' with assert(). * add "Signed-off-by: Xueming Li". drivers/net/mlx5/mlx5_rxtx.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c index d960a73d5..a2b373e21 100644 --- a/drivers/net/mlx5/mlx5_rxtx.c +++ b/drivers/net/mlx5/mlx5_rxtx.c @@ -645,7 +645,8 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) if (unlikely(max_wqe < n)) break; max_wqe -= n; - if (tso && !inl) { + if (tso) { + assert(inl == 0); inl = rte_cpu_to_be_32(copy_b | MLX5_INLINE_SEG); rte_memcpy((void *)raw, @@ -680,8 +681,17 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) } else if (!segs_n) { goto next_pkt; } else { - raw += copy_b; - inline_room -= copy_b; + /* + * Further inline the next segment only for + * non-TSO packets. + */ + if (!tso) { + raw += copy_b; + inline_room -= copy_b; + } else { + inline_room = 0; + } + /* Move to the next segment. */ --segs_n; buf = buf->next; assert(buf); -- 2.11.0