From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0081.outbound.protection.outlook.com [104.47.2.81]) by dpdk.org (Postfix) with ESMTP id 8C6D81B6E0; Fri, 10 Nov 2017 22:23:14 +0100 (CET) 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=bkUH7F6KLfrVQ8pW9wxWEG+M5lpL5chJVWhJdk0Jrdk=; b=h0PpLRLLRfBDccIpUbN4wtkLfmCPyqyTF1QtBC4sOmcl6hNY7HZF7Gh9BIgEepjIgO8CFdSL52mtsXCfWVRqWUlcEzG2DfERGoEJjry8uThQRU9WnJotDu1Nr0lfoPOOCeUMKrXaR9w6ay0y4FkpQvHHR0pd6kQdxs+S+Y+VoQU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=yskoh@mellanox.com; Received: from yongseok-MBP.local (209.116.155.178) by AM5PR0501MB2033.eurprd05.prod.outlook.com (2603:10a6:203:1a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.197.13; Fri, 10 Nov 2017 21:23:11 +0000 Date: Fri, 10 Nov 2017 13:22:58 -0800 From: Yongseok Koh To: Adrien Mazarguil Cc: Ori Kam , nelio.laranjeiro@6wind.com, dev@dpdk.org, stable@dpdk.org Message-ID: <20171110212257.GA4189@yongseok-MBP.local> References: <1510243472-24872-1-git-send-email-orika@mellanox.com> <20171110100625.GF24849@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171110100625.GF24849@6wind.com> User-Agent: Mutt/1.7.2 (2016-11-26) X-Originating-IP: [209.116.155.178] X-ClientProxiedBy: MWHPR1301CA0011.namprd13.prod.outlook.com (2603:10b6:301:29::24) To AM5PR0501MB2033.eurprd05.prod.outlook.com (2603:10a6:203:1a::19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 83de8697-193a-46fe-97cb-08d528813f87 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603258); SRVR:AM5PR0501MB2033; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2033; 3:+AMtWXnek3mrGlzg3hKr7L0qXRtqhn7TmEm6f7Y2ngCSpsiPQoHM/H6IGLHiPDPkJJnUiUm7Sh6SdsNXR+m2Jjg5rAqcX1HFF7EOS+GhuHvuyqwQPkR4wcqg+A15g04z6SUE7YV7HNGdJnmUbtE1/JASFOwzzbqCM0VlMiRFs+oOiD9Lmy+rKdqU/sYQQT1pc80lZMbe/IpPeik7B/2p25vG1zQbFlHbpKSdY+mvEs121uDBHyZtlIeItNRwnQC5; 25:TO00/8CaoFNJ0pay4MJYmodTXTMpp0dyFBicc4UPiPjJihmlV0rwf0RfUxEgsdS79XQuqUrVFK/tg86rqZc9fYEpaY+QrRJdayAwqM+kmHWM0njsWtQhBNMenHNmSeaeG4JY8TKq+hILt6Ll35wiJJCHev7RqBeNrC+zUDNlHUDrcXmj4D/x5cBVv41KpGwXHGdthtIvE8bR79u8TwVFeu+kpC/stvEdXjBu31stYcAIA0ZUcEDMSs35PGByPeNlTlPFsQrqtBgqUhafTQ+/w21mjRESxkl5EZjU1PzaovtEPFMFdKZ3CrvjW8os+VUjF872SOf+z/4krlsYnsIeZA==; 31:dvn1Et1Be6iIRSAE9YJaVj7Q0pgKtvacj37p7orkpYQdMLn9XBz6Pd6LVPruF4F52dAYzbi7D7pMjF57WfuhetzrrVqtkCE5uE1IQpeodJMQhc9Pjb74qka40qfBLjkTHKMoVSqlTc4459Pq2q3w2q2PfkkytVhrI+zLNa8ELzf3JdgDYwSrkk33hu0MNLgoeKQDUJBSOho3RFo3oCpLWzXtY4DxlY1wdzr5r8lCCWU= X-MS-TrafficTypeDiagnostic: AM5PR0501MB2033: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; AM5PR0501MB2033; 20:13NozoVHWSKU4x4Bo+fgggRe51MqtyQc5YjQIheoMA8nq4nhJOOb5XPKXgAihWnGgqL5KFzpIgEvYVYQTvzl16yttf9n6F9UgMn1lwqCcrrpEE0/YjeKOKwHGwMZSVoKNRLYc1wE2IU67g55OtD+o1Tal8TpQotQXpbZL4tnPIakO4NXXefM0w2ueMB3Lt0wXJ6wfUXH5x6MC0vjtbzG+EBLYsTbfoBp64tBIUPvpxMaI6ldEK2gpErxxYEZPDPp9Rff306oPBbYzj6KoJ/NYOUBh0AoWqvu/tnocsgx+tQcOx1Qltncr0+YpHUzdhpAWsnnx57v7qF+iOIE5b22FwY8cjOEksfjUMp5UnTmIjW8lVmNdToNlJc/vAD+GyLU1/Xz7uJjRmBovUv6VmVfcZGp6SlMty8IcsYFK09Y/tBaEt1fyjLBByB/zv5e1NYLoPTmgzy7Ltbz/RP5K/d8ZGHDykEypvR0jaeCtnT8mT1OecpFfZGnG17kfpG27UNz; 4:h1+Z/B6idxZ1cRB03LdgicJkieZQ2yFTBGaNaWR2rI2jiOzntT1XPP2/Tj6QvELcE0LR63kfMAV2VwKCrhY0oYFIXVBJSBJ8Qys35kt8uMe/CPlakhpf3GD6j8g5QYAqDeh7xTx31abO+e4lcohlveVFVozc08il8R0mvO4VO/nmd7PMeXTgKLsWose3nNkd1fz51fuupyQGo3e3x/h55+FOBbS9nOfYYORmdC4mimIrgjE05o9HdFqc6fHTmNVfJQJFA4vsncDw4qozHmJcGOSGjRh/BUk9Khu8WiATvyDU34pjyDfRLVvC0qi6hsV/lkQV/yGnUWWz9qAA2xhcvy7+eZDbRzVTKG4Iff3xBiA= X-Exchange-Antispam-Report-Test: UriScan:(278428928389397)(100405760836317); 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)(3231022)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:AM5PR0501MB2033; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:AM5PR0501MB2033; X-Forefront-PRVS: 0487C0DB7E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(24454002)(189002)(199003)(58126008)(97736004)(53936002)(16586007)(478600001)(4326008)(6246003)(66066001)(16526018)(7736002)(189998001)(98436002)(316002)(55016002)(86362001)(47776003)(9686003)(305945005)(68736007)(83506002)(25786009)(8936002)(50466002)(2906002)(8676002)(81156014)(6506006)(81166006)(6666003)(6916009)(50986999)(76176999)(54356999)(2950100002)(5660300001)(101416001)(33656002)(23726003)(6116002)(561944003)(229853002)(1076002)(105586002)(106356001)(3846002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2033; H:yongseok-MBP.local; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0501MB2033; 23:bSgMDodzZIMG76TpuhbO8bb2beLex1gwuc7tdNm?= =?us-ascii?Q?fO1oOP0ZH2WfoUC0V5NTyvGlcXxf70UjRA2+75dsKpRJrM3Iq/1qQDLy1LpR?= =?us-ascii?Q?IE0wwZd6jTq5cxIdhDOeaAkXu52t6J1yauT6T+cHouLC1+O83xi/cf4Gb36e?= =?us-ascii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0pyjorQj2A2LWLXKeaqcpPzAb6q2OOf2uV33/S9nvrwMza7dyttJS3J9F2FxmwiCI96PGPaKEH4KApROmW6SaIU7f6tfpO9FMwFugQNK50DIlaavjdKPVbq5oAmcFbj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2017 21:23:11.2192 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83de8697-193a-46fe-97cb-08d528813f87 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2033 Subject: Re: [dpdk-stable] [PATCH] net/mlx5: fix number of segment calculation 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: Fri, 10 Nov 2017 21:23:14 -0000 On Fri, Nov 10, 2017 at 11:06:25AM +0100, Adrien Mazarguil wrote: > Hi Ori, > > On Thu, Nov 09, 2017 at 06:04:32PM +0200, Ori Kam wrote: > > The CRC size should be taken into consideration when computing > > the number of mbuf segments for packet on the receive path. > > Large packets can be dropped due to extra CRC length. > > > > Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues") > > Cc: stable@dpdk.org > > Cc: nelio.laranjeiro@6wind.com > > > > Signed-off-by: Ori Kam > > I don't think there's an issue to fix, there's actually a reason it's done > that way, perhaps I'm wrong but let me elaborate. > > When applications request CRC to be written to mbuf (more precisely not to > be stripped), its extra 4 bytes are neither part of mbuf->pkt_len nor > mbuf->data_len. It just happens to be written past mbuf data if there's room > for it, where applications knowingly expect it based on how they configured > the PMD. That's the API. > > This implies applications also size mbufs accordingly; if they don't provide > room for the CRC, it can't be written. This extra room is assumed to be part > of max_rx_pkt_len. When CRC stripping is requested, they do not have to > provide such room (IBV_WQ_FLAGS_SCATTER_FCS is not set on mlx5 Rx queues). I looked around other driver/example codes as it is not documented (or too obvious to do?), it looks there's consensus that max_rx_pkt_len includes 4B FCS. Then, I agree that PMD doesn't need to care about this. > One problem with your proposal is assuming all segments are consumed > entirely during Rx and max_rx_pkt_len is reached, another segment with zero > data length gets appended just to hold the CRC. Applications may interpret > this as a bug. I don't think this patch causes the issue. It just unnecessarily reserves extra 4B room if CRC strip is disabled. And even apps should not interpret this as a bug because apps requested to have CRC. Currently mlx5_rx_busrt() doesn't allow this situation (putting only 4B CRC in the last segment) because it subtracts ETHER_CRC_LEN from pkt_len if CRC isn't stripped. And it is done before looking for the next segment. I think this is a problem to fix on the contrary - app wanted to see CRC but it's not there. Right? Thanks, Yongseok