From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0052.outbound.protection.outlook.com [104.47.2.52]) by dpdk.org (Postfix) with ESMTP id 3687EF1F; Tue, 12 Sep 2017 00:18:01 +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=MVSphUpru2ChQ4+uO/t6465Wnq/d0PqsFSaxAxCZ7RY=; b=LbUqSA8qqTKm18NS6spJscX2yTbkilC0x7WibyxYqnbuYloHlkZg6OkB3NeZl6JAZgvK5aHPraggVf195zXLXb5HJ/eZYtos7qMHRMPxEqoCiB3Of+8Jd4y+9hZNZpDfkai/svxacc2Ym4gV0TZXm5ITRIJpVQwaxxPDV87D0Tg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Mon, 11 Sep 2017 22:17:57 +0000 Date: Mon, 11 Sep 2017 15:17:44 -0700 From: Yongseok Koh To: =?iso-8859-1?Q?N=E9lio?= Laranjeiro Cc: adrien.mazarguil@6wind.com, dev@dpdk.org, stable@dpdk.org, Shahaf Shuler Message-ID: <20170911221743.GB1922@yongseok-MBP.local> References: <20170831162706.30899-1-yskoh@mellanox.com> <20170904140107.nkr565m266sw5cyf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170904140107.nkr565m266sw5cyf@localhost> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR10CA0063.namprd10.prod.outlook.com (2603:10b6:300:2c::25) To VI1PR0501MB2045.eurprd05.prod.outlook.com (2603:10a6:800:36::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2e5e6a3e-dc90-4554-c234-08d4f962f548 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:VI1PR0501MB2045; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 3:5SaLcQU4pp/ItNhJ602VJYjNtkEepKuHXWF8QN11+fjF9RY3YQ+VKRAoNnAQq6y4THCgZ9QVIkUiuthPLaqZDh/u6uNWKtgyCKtSGfxP6Cxh9Es5xL5KQw643jKSV5ie5YlNKlH7o+Vq3emP6d9QmkCY4oJIDUvOIMypc/QQls7V5036E9+DnpBfl8mdHZO5woBEuLg1laO6mCWYsdFNeF8RXR4920oHQwB2SzJ6Xjzx1Gd//ZRyZ1x9tqbBREd7; 25:I2diRSzFk6uRH9WwB3EFoZxtv1CvHeZhMB1CEuCvZ14VbChVohV8tWufRWZvdbDDl27WZwsEht/tMJYXeXcPeqjBcXH7AcKHZtKjGzxQTGZnioCtdRo6c4e//5dIIGuqU4iBJjlZXb2I+clwuYgWwr/MGakwvvbDJ6dkZMMUVwF8CUSp5QKusVEqAHzbDTkxxk/1J4IY6UxHQKPFHQQxLmKK9e9sIJ7wTpL1HgC577IRnS9p9rAwoOJE4c4Zs/gQHnR3WzH40crrmTLbU7rB/rWPJUYTxYdFrXEOvdN2NKduUxkPLtBymmkXIXYjccotfiU/VOmL279yWY3OVtdEyw==; 31:WLhC//kJWK8CJQnH46MAGk8uJ8GlKkQUYsJYzgjoS3uPPG0o3rXGUUNkZGRfnWW5akgJMDVqhaItGvTeC/5lRmPqTBq6XK9jgVsIRVSkxah9GxFojefcXyO7ITmfnXrHfHCgk/PI6Eu8xZWVoZgjmYqy/i+h9yAqAU9dHnPzmxqjzt2hWuZKV7etWIzcXCIJL5ZSdH4GyaFhf1Qt4Zvk4RiWr0GSwx3MQnXkKcU9Smk= X-MS-TrafficTypeDiagnostic: VI1PR0501MB2045: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; VI1PR0501MB2045; 20:2Khuux/2Y/rn5C5pnpbLiGM6Gj6GAeDgI0iBjrsjlcDg62huhm1HW8q81eo2TXs6ctT72lhVtrk+F44MN+eHj+BBHigyj7XAmg6CpaxapxSaXcs+TuedYV3ZxFA/yjRVKRYXepT7NZqGf7VlJQsO4xvRbzVLgBFya2Zo7rfYeNPlOH5BLWeoYbSAKX6goZ43Eltq+LgZZsBLmW5kyB2663PbupsKAdUhpqJrmKZ2VaaI/2u+f9QGJKemf+GZcPJb2TEnL38RKOLKzUPqzZ/xQP1kj4BiRPNPtIlIoal23lUqg/ukOeHOpWEZBF/8wT9SNhH8a8ezjnm6i8/SM6rLZDYofCv1gHp7Mw1On1ftIzcv4zs+0mrgtFqbPNGke76dIv4woGXZdUaCuSHboAj9/5f70Q+ePIDK6ftlxnqdY3Jrqr+JSSjD5rZmMc6Lhxnhf+O03tUIvG+VHylwKVfp2IP0G3V0/T3AiTACbZpde7E5PAGiumsBkr7SYl2LvGP3; 4:vJ216YitHZu0vEKECmPxEQEkdRqrtGqkh7/OunUWtrh5JHY0Kc33ILiuBCh9rQdWxcDI9YZlgjMxTOY98JSabZAoiF63QHc4dMQg3wggIrzV74XQ5U9+hTkQ0dcebqQNFfmoZ3/3RkRF3x7w6tcqs71sTbvgOVn9TMIlUzB1z7f/iQwAGukv1DAg/jDUAaOprCro9kpFS6C5bo63hiH+n50atarfrvdaroRUAMOHzzkdl2R7ilGGGWdNz/MKratG X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123558100)(20161123562025)(20161123560025)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR0501MB2045; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR0501MB2045; X-Forefront-PRVS: 04270EF89C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(199003)(189002)(24454002)(3846002)(50986999)(76176999)(54356999)(6116002)(6246003)(66066001)(106356001)(105586002)(478600001)(7736002)(4001350100001)(47776003)(6506006)(107886003)(2906002)(23756003)(1076002)(110136004)(101416001)(86362001)(316002)(97736004)(42186005)(4326008)(8676002)(50466002)(53936002)(5660300001)(2950100002)(189998001)(2870700001)(81156014)(9686003)(81166006)(55016002)(7350300001)(6666003)(6916009)(229853002)(33656002)(98436002)(305945005)(83506001)(25786009)(68736007)(18370500001)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0501MB2045; H:yongseok-MBP.local; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1; VI1PR0501MB2045; 23:gyePacCoXA6MYheXTM/amwf+Vgt9XkUBYK8R9?= =?iso-8859-1?Q?H6iiAHVMkNh4yECc9Exvqnb9IsKLxa9ASc80Tu16xf9+RoMovCDD3dqee+?= =?iso-8859-1?Q?QMFXemZ7sWlKi1tK18+eup1USiUkSU1sd8uffjMQdfE2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AR6fvJLaZ3aPYMpi19mO3g5sva0A/AMwYV7VS3LuUET/nLJM=; 7:O7Gi1qHu9eRWTTJ342ZXbqD2hm2P4D9DedZ+ZIJAhes/v4qGHkXks+kloWYiQjA53w1ubyzTE/bksKgjGCh1Vmr4UVMv+E8m6+RAzshBxto4Vz5E+ELRlYM/hthMtlPZf8Dx2Fvp0vFXlEwvg9YTCBnY7UvpsnRodEsRlPj1Q7tEs9dwOn4f3QrGfOAZtjzLWZygXHkyqKn/WXdJCaiFJtTZsAQQbTHRTLPYnxGOFXw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2017 22:17:57.0567 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0501MB2045 Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix calculating TSO inline size X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Sep 2017 22:18:01 -0000 On Mon, Sep 04, 2017 at 04:01:08PM +0200, Nélio Laranjeiro wrote: > Hi Yongseok, > > Please see some comments below, > > On Thu, Aug 31, 2017 at 09:27:06AM -0700, Yongseok Koh wrote: > > Tx descriptor for TSO embeds packet header to be replicated. If Tx inline > > is enabled, there could be additional packet data inlined with 4B inline > > header ahead. And between the header and additional inlined packet data, > > there may be padding to make the inline part aligned to > > MLX5_WQE_DWORD_SIZE. In calculating the total size of inlined data, the > > size of inline header and padding is missing. > > > > Fixes: 3f13f8c23a7c ("net/mlx5: support hardware TSO") > > Cc: stable@dpdk.org > > > > Signed-off-by: Shahaf Shuler > > Signed-off-by: Yongseok Koh > > --- > > drivers/net/mlx5/mlx5_rxtx.c | 25 +++++++++---------------- > > 1 file changed, 9 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_rxtx.c b/drivers/net/mlx5/mlx5_rxtx.c > > index fe9e7eac0..f89fa40b5 100644 > > --- a/drivers/net/mlx5/mlx5_rxtx.c > > +++ b/drivers/net/mlx5/mlx5_rxtx.c > > @@ -524,19 +521,20 @@ mlx5_tx_burst(void *dpdk_txq, struct rte_mbuf **pkts, uint16_t pkts_n) > > } > > /* Inline if enough room. */ > > if (inline_en || tso) { > > + uint32_t inl; > > uintptr_t end = (uintptr_t) > > (((uintptr_t)txq->wqes) + > > (1 << txq->wqe_n) * MLX5_WQE_SIZE); > > unsigned int inline_room = max_inline * > > RTE_CACHE_LINE_SIZE - > > - (pkt_inline_sz - 2); > > + (pkt_inline_sz - 2) - > > + !!tso * sizeof(inl); > > Is not it dangerous to assume inl will always be 4 bytes long? Why not > writing the real value instead? That was for readability of the code and uint32_t will be always 4bytes. But for better readability, it should be 'inline_header' instead of 'inl' though. I'm also okay with using "4" as well. Which way do you prefer? Thanks, Yongseok