From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0088.outbound.protection.outlook.com [104.47.2.88]) by dpdk.org (Postfix) with ESMTP id 0C09E1B62D; Thu, 9 Nov 2017 17:05:02 +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=YiJRhQwNKrwWdei0JmEIU5GN/fna+jkRTViAoor0SLU=; b=cDoOCHeubyQ73dqd716Zal04vsiM1UH1HSzveiaylV0H93yAMEJmtR95hG3dlJNl7aqMRB2IWX+SBnN9COFGpZ0APCCo5N0DnIzVlxeoL+1ph2G6c0Hc69j0ysPxuSg1e/J8A3Z1NroWdBotrgV1iIC5DSEfqjfg8XGE3AQnpO4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; Received: from localhost.localdomain (82.166.227.17) by DB6PR05MB3208.eurprd05.prod.outlook.com (2603:10a6:6:1b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.218.12; Thu, 9 Nov 2017 16:04:58 +0000 From: Ori Kam To: adrien.mazarguil@6wind.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com Cc: dev@dpdk.org, orika@mellanox.com, stable@dpdk.org Date: Thu, 9 Nov 2017 18:04:32 +0200 Message-Id: <1510243472-24872-1-git-send-email-orika@mellanox.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1PR0102CA0008.eurprd01.prod.exchangelabs.com (2603:10a6:802::21) To DB6PR05MB3208.eurprd05.prod.outlook.com (2603:10a6:6:1b::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3174f7c5-1da7-411c-5b7b-08d5278ba195 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(2017052603199); SRVR:DB6PR05MB3208; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3208; 3:ardxRJmGaKcwjEnGWjRI8BmyhfusrPjvjOiAiBPHaMHKyUz77i3/CJXwAmgW25FA9NEhZldOXWDNFX4QZyYO0CytaS0n/cpxRs/22QpZIkNZ4NuWgK3S8xOzk6c8jvB0kN2pSrud0pHl7XSSM15wZrMptH7/9jkwt9MW3YZir1omOxyiKGfUpMWEk+6mNppy0L4Y6H9wIXCSeY+FMgfG/9T+qClU51ajMQ3ktKJdvF4U50StvA0EDJs33xagLykG; 25:mMBxrK1WeYAelP5Ph2NbFgVrwohuxSVZiIQU3ZvQI7sKh1+ZBOauyKK2W2y7XZP3I0xtzqZu2AzSWet+BlFPOFZA+Yr6K+tYk8e+9Z+aK83QLS7aXZ8EIr6B98z7PjSRaoYTafXQm9gIYmSrPXn+J8thSUfcViB2vlaIsAUmop2637EFVfFiRma9hfuODjLCOVaS9s/01oJAzYP6dJmnKwg8FLvBc7dOZn1VV7Of8EOZ7H0Boy7zMQbmX6wRjrPPOKc+hg1eEN7OH3+AYxEOOLDiD7P8VAVAa2jMYLadF/XNtg16sOryEpiphoTZFbT/ytp0z00+bca2uQV2clY6Lw==; 31:j6RbxsqxsvTCeB/CK8c1P2bR7PTT0ZGl8+y5kapNOQS4ddpPUsi407rN6AfQcsqDWyQnJwguD6EasAYwFk3YfYWbktytKR+9QlIQNLcF1esnWM8GNNCHY1tjUXrG6hXveJr0T5P/5WohdeIMn8oSmmXlc2iaLMIf2Q3PPszfSu2Zd7vTW+suqVzc709ddGhUWVt62KAY0alQ3d0gVkb4un7wtQUMF0XAcSVI5yJy7+Y= X-MS-TrafficTypeDiagnostic: DB6PR05MB3208: X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3208; 20:V9tgD1yQwh4JTkmQztOV+J2M2r2PzzDAT6679t6dimIFRI/XU1LEdEEm/uSTzFhlPlod3NIjvaswkCb0lZgCfXScu51b1LmtK4GHm0gZ6I3ERO3ZOJwIwft+vU6CWO8JZwcfAhtfGG6aj5UXFVqjB9uMc2ISzeDI0ft5fEUnvnUY/UWAC1WCEheR1YHE4C7bEWeePsu5wMh62G3LJs5h7NLmZPeMqiBscl8emwBw/o5kP4/E33t9ikIKsv2YpmCG1Z6TNjL9Mx3ZdSs1/kwkCoIk7bpqSe85HggKEMt24GWKZCpfBCM4RThI4jHnpfd5OY5MdhVWhUaqJCFkLm/SDyLcYm9iEKQdZtg2smxQX5WWYi17H1ZWE6Oh5G0c4f9hylke8Vc9fAvzRMhhiJCMl7nyeEc4Xqs0XD0I9lu5yNjwCVeU977SGhpofrox9pVTL77yH3B9uX3Qi8+7azt/8V13rPDGskj4DWjtFtEwqRyyx6XmgdAvNpXMFkNkikNI; 4:ijzgMBIU04eF3KwICl8Ed+KtbKmIyXvXhFgYKuQbc7A+VofbgPTcbSfn5LAw0fnAy5its4iw0ByjClnpEvqrNEdojimbfSOEXdoYIehXYWwTS5tEOPmpsbqdCvAVoHGN1nw9/Q48aqgOotR/GXmBemg35zeLaIZLvRqvwC8JYdtP6qBm+NbxJS3/OgHT4VbP5rFof1kt6jUWpvm08hp/qoXGRCprBZ9+GacLY0NEpAv8Dhe2Eb9xXelnzcliELTDPzZs0l7lwPIeruOakG2VxA== 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)(5005006)(8121501046)(100000703101)(100105400095)(3231021)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB6PR05MB3208; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB6PR05MB3208; X-Forefront-PRVS: 0486A0CB86 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(39860400002)(376002)(199003)(189002)(47776003)(86362001)(50226002)(8936002)(105586002)(68736007)(106356001)(189998001)(316002)(6636002)(48376002)(50466002)(33646002)(53936002)(305945005)(6666003)(4326008)(16526018)(7736002)(36756003)(6116002)(3846002)(6506006)(16586007)(2906002)(6512007)(8676002)(101416001)(50986999)(6486002)(81156014)(81166006)(66066001)(478600001)(5660300001)(97736004)(25786009)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3208; H:localhost.localdomain; 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: =?us-ascii?Q?1; DB6PR05MB3208; 23:SFiHzNJJSPCopU9lXF7vKuIhf7jphc/cPLI30cEGD?= =?us-ascii?Q?J8HobddU8eQSmktwcQpro+ROhYPcbC9cbWaCNmAd7XJ/fD2jRbCINhaH+zng?= =?us-ascii?Q?1bfDruUqjhXiQ3o4D674BsoFHkAyeJgFXECg/hTDJD0Wi0CQ6fuGrGBH7tg6?= =?us-ascii?Q?TuilRSwUlK3azPyC/7ltZqYNuSA4GWvO2DNuPtyuZF3eUMgwUt/9gzPrHphJ?= =?us-ascii?Q?WtsWUf64aeniLeSjIFDk3oBemugfiI1Hpibv3Ob+rQTYQ8dPiV397dU3/wa8?= =?us-ascii?Q?NFhs8fMjYam4qktNGSHzgeP4IJA+HtDc4UHuiSM4D2YBv2Prc+YdoZrwZaHd?= =?us-ascii?Q?fT0lTHqQJcdaf9MdgV/2gRTCHa/lJA6Q/Qi6xLYH8jdI7UVw3B5PdMt4xF9b?= =?us-ascii?Q?MwFqJND9s4oRc1izAe+cl5qabA3X/TWug38Pfb/dw++4ZXLDtgmcx+XW8EtI?= =?us-ascii?Q?djZef4C1pXC/ImSjIQP5RpZmZkT4QImyg5Mud4dvsuZ+yxk2MYV+NJqNlGde?= =?us-ascii?Q?epAr87EIRx4+tagPzYZ88h/+E30hwzYikrrrJf7W7o/SkHU7ArVqypNSX5Y4?= =?us-ascii?Q?NSB0Xa5uTUPeDoIV73m299toPBkXiyPVKohC9OahTGWoSEExRpF8ddBRTCvJ?= =?us-ascii?Q?ChYdmmdUSPVXFVcLJEZ7JEJpbNGDMuYWQq50Gal3eyeLFNoV6F91j4dCv8/3?= =?us-ascii?Q?GY1rRprRoWy1/ypzTm7o/hrK2MRAxWKl0nk9Npa5lujMUrHJoaJJEG0OamCI?= =?us-ascii?Q?satMiWycWyd0zVm5AhdUS+W5Ja1riDoS0a8me0iSXMWele6AK53RlFSRbTsi?= =?us-ascii?Q?Z7jUO3beCyr97QRT2SICU3JJUoENp5jfWB72JseciWVf5NhMtlN23U47hn0K?= =?us-ascii?Q?UVam8FOPq3lzKJeKLixOVfpse08lLw79RfCvgmbqdfG6s+6Zs7bxtLOq9bfF?= =?us-ascii?Q?d+tURWFEM6zrK98X734LBLemegHomNJMbmQTeCt5m7/AyAXf0huPDPDq1PLk?= =?us-ascii?Q?magW80WdplFpiLlSZbMAXXlO0NSJ47IzaVY6UqOVrIG4faibge0lIgx/6tJ9?= =?us-ascii?Q?AF0RqA=3D?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3208; 6:iO18jSU19zjOehJ3oAnROQ2DeBs82azD/rGFckHuwui44rpKqxBhnIxcXCVtZOjnrQXBBZvrTzC9hN8iU99lseRcFqqa6+ZsCa9VEe00SRv07kUn7pUAPxDGDeoqz3t9TxC7dif4zsQvK8jggbvXwolTnj/ydX5ReOliW0XUKyrAzYeuadYQ3mekJHQfxE/c/rVO06jAgDcx8uOvzLtMeumWAHopGaSHDHf1s/+PLsigubgOvF6o31aT7v5eeNiWuu109ySyNVXA7C+hvUA9dHTfva/5XVB8bO3NW+ICDui8HImM4jmmBnuywYY0PbGi0nHXsZhsvRw8rn4Fj1RHhYK9bPMUJqwBXLZqsUvNyoU=; 5:95Jlp7wG870tKsPkqU4TrMrGIOiQv5MDCaJcyQRHZq7mXjVWbYi+Sl0fnHUPmQcWF39yo1xlZ2/bfIuoebA2jXZ0gpfXIXbETbB8/DtISh5OdHxjYNE8estT/FySvmhTScb21ZGwu+2wJkcZReNiJ/r6/d5nCh+BDyXmvQIdseo=; 24:8RdTDKpAcqqiBTKM1TgyFRQZls3bHGECmm2b9PwJGSJzqDdQs3ih3LQuWrJFZw5+Sf3jmMrM0ccigrIMIglORqUV45JwQjEy+5vhIatG298=; 7:tY0KFPMn+wFt2Fz3n5I5+puFMUG1WT1ZWpYDJHJiteSGPKGz50y+t14IpGBMYTUqY4hS4WC9RonKN60tDljiZyqMm7Qzrz9TPRX2ERnSWZInHFcm3PRIqnsfQPvqpK6LPVS7B5+yufGZOkJipDYBde2mkKZrPOdJ/useqHmhg5unwmNjywlvSzmdwbVfjMNkV+ojVxtCMwrNOqkAfMfiDlt0rfNwjSOz+WAKbD+GEsri9Zz1V2LdbnYC3m+XX+Mx SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2017 16:04:58.8587 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3174f7c5-1da7-411c-5b7b-08d5278ba195 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3208 Subject: [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: Thu, 09 Nov 2017 16:05:03 -0000 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 --- drivers/net/mlx5/mlx5_rxq.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 6b29aae..701925b 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -887,6 +887,8 @@ struct mlx5_rxq_ctrl* const uint16_t desc_n = desc + priv->rx_vec_en * MLX5_VPMD_DESCS_PER_LOOP; unsigned int mb_len = rte_pktmbuf_data_room_size(mp); + uint8_t crc_size = + !!(dev->data->dev_conf.rxmode.hw_strip_crc == 0) << 2; tmpl = rte_calloc_socket("RXQ", 1, sizeof(*tmpl) + @@ -900,12 +902,13 @@ struct mlx5_rxq_ctrl* /* Enable scattered packets support for this queue if necessary. */ assert(mb_len >= RTE_PKTMBUF_HEADROOM); if (dev->data->dev_conf.rxmode.max_rx_pkt_len <= - (mb_len - RTE_PKTMBUF_HEADROOM)) { + (mb_len - RTE_PKTMBUF_HEADROOM - crc_size)) { tmpl->rxq.sges_n = 0; } else if (dev->data->dev_conf.rxmode.enable_scatter) { unsigned int size = RTE_PKTMBUF_HEADROOM + - dev->data->dev_conf.rxmode.max_rx_pkt_len; + dev->data->dev_conf.rxmode.max_rx_pkt_len + + crc_size; unsigned int sges_n; /* -- 1.7.1