From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50084.outbound.protection.outlook.com [40.107.5.84]) by dpdk.org (Postfix) with ESMTP id 345583B5 for ; Mon, 1 May 2017 23:06:02 +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=XLkGQNbpbCPOht7ukXnGoaB95RHlw7mvlNqMISXdAcQ=; b=Inp3xNvOHjriVDHvDgHdba6Rr1QnE+RaLWN97MYgMBTQme+PQTm16VcBKtto0BMpIh7JesgCcOhzx5lNXZNqoCiOrub1edjmY7dSFnWQqiK+IOY5/1Ye4jMiIWlLaMthBKgU26GTp44KVbaxbHLl6jQzcPB3ML0sckJUr0gpioE= Authentication-Results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=mellanox.com; Received: from mellanox.com (12.250.235.110) by HE1PR0501MB2044.eurprd05.prod.outlook.com (10.167.245.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1061.12; Mon, 1 May 2017 21:05:57 +0000 From: Yongseok Koh To: CC: , , , Yongseok Koh Date: Mon, 1 May 2017 14:05:42 -0700 Message-ID: <20170501210542.5032-1-yskoh@mellanox.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [12.250.235.110] X-ClientProxiedBy: MWHPR1201CA0002.namprd12.prod.outlook.com (10.174.253.12) To HE1PR0501MB2044.eurprd05.prod.outlook.com (10.167.245.150) X-MS-Office365-Filtering-Correlation-Id: 16c539c0-889b-40d3-2d91-08d490d5ddd5 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(201703131423075)(201703031133081); SRVR:HE1PR0501MB2044; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2044; 3:tdewSCTCM+03rZeshTmGOsriMlo07M+xfwANHfMuHRNjOAazmahcT+wDqcDTAj9K0/IKw0SLLDbmOI3rCQ4XdeCXWmpi3BOB3EcLSu1aDkmleaf1sCwGFoJ5zrfY7V62EP9XnhnFSN0CFF5mOv+xPFY/gZEZ8r5hy5uJtH96mSQh70Aexkka8j72aX3z05p+6Ev1B894JmRsJLYuw6m5an6VmaoWYDh3vtsytccjxRgpFGcFBc+fitKiKEuN6b+ta6jEzHWWlLBKVWuNihTCr27Q1A6X1PhFj//+s55wG56ILAEy0DeegRf2aDJqfEANb8jAylbqzRPovHS73a5sgzsnSLmJ1p5eSfGk0hOENIE=; 25:sBNej3mWjqGYJZs/vryRsl5gO9WnDBfA/Q+9ReNws6XldjcCh2ToNqyGc346dPooIYD1uyNoEKTZShpmO798yuqJKTulXkusqjpTflnX2WVJG+sYmZSiBgdskpgTbZnxEecgM74xd5N0Ts+b+lx8ZTj/hsvtdb9pVXYBu3z6gCNDrHNMMDSIMejT/z5og8Gp9Iy+WB0zoQmB3RoFFfrwn7J1AGActn0jAoewqEadST1eG0KKShtuVoF+llee3fUcOcaik797meRu72+j3Y8MnQ470jsKNbJARK9+ySrb6hlXx7RLWclxLhHCI8/os8ja0Bia55aLivmqLImF/Bxy/fH2qNfVRcjKjcvszZRR2AEPPK7FuB4JT0yGOyspda/kpaFhxbRSLh05+6Hgqi4VfieWZyQ1/4nrenzxFdoYljuiPYYUY+MsG9bNYQFsxxdzyN6AYBB+PuYjPijeRDyUZg== X-LD-Processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2044; 31:xtVyegp96cUH+AbjkvY4PKbOdhTEc67rbb0kBzubykoSGh3+8ty4fsZQjnpE1QH8ig76tX3+o/R2xAAhq1CIKpilDD+RUx2EdS2ZXWhsAE05KtCHNONUvgUSW2U/N2kVMzMyG5Yi+uJzW203vVox+zHDr8ASih78vwSkJZ4S0O5LtyAk9NqRJbzJqptHWlu/n358FV9M+uNKuMctBk9MIo0VEkatWZut0XxjW4NT/+LnQ+byUHTjPHvxInOgjzr9; 20:Y9GKmafFgqBd6E5F4+BpudHWI9Nz8tKuTOttO+Q147uybwMJO/LsDWLJlezlBe3M4E1RhL53A/8/cuM8xTnGt/UkCCtOQp2bkHZa21JrR4slBq44iOSFVvnLBgoFaJsuX/F3IKYCfnmUvlv4nF7Jq5mOZJc7jRnQ9x1F1/HjyDh/kpVUoAm9T61lWrSkel7iYbDxgXR0jg9xyIYfrBVtNvuVbI37OusqY8gL1+8VHVwAdopo4oiw2ym8OVTgaFPF4MD8NjAc7JZj/rzooIm5raqJDwNzDuT+DwrcBQ5mjOl+h6JdX+Sw5J6jZ6H5xp0N1lWcant+vrFxYyAntS0HpjpKnyyCgSIvybPaw5tYbG29/PWJqVGIAR8l2Ty+HFVUg1WVDjGuN0OJIICRs0yfs5f5f9MbgP4oaytRyxnVStX6eO15WdH/VYR2+OPP2LQmqIpzWWcidbJlsEPE3IX5h9bwA2E8jPtIxEKt7ppD4KxO74T7/a8AKzf+l3fv+bAc X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148); SRVR:HE1PR0501MB2044; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2044; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2044; 4:J6P+OwXhnDBNpPeHjfLGCsG7TTdaYXaJAJU/jsd67qMhKQkHmPFIYv9230rvz3dBWx9FTIgoaDH5WJECRWH1GKKn4TfAUpaNR1QQ3/Ilfm/DKrH+qnoM7bYWxWgVAoGFgRwYiJc1MOn4POvCVXdyB6fkbgi1ViTzntkTK8BI3qjkKZKocUTfpDh2v43NJbrtu+FPsxbZ5RPLNAl3mLu/pahEY/byNmYLm5NQU2ZjG/F0BU3ZhFhV/s79utP1r81a/VSaC1b/cQ5inDzMUAxtSoVWbmUb4xhKL4PgZ7X2LWyvwxjMYvfNShY/gdaggAM7+VeT4xGIj+Tgt7V7Y48aX6iNhgR6AvZrWdFWqSt+keOUtJzf3Fqyku4UTpla2X5UOdrd4xariIBAmQUnOeqfYZFVLyRWjM15d/WKFs5p6/r6yKoo5X+z3stxEJdSWjWZUEEYrboF4h+VJ2tyEcJVoyC2ym1IuJtcfbbVf70rgLiQHItfSxHEKHkpeFyBboIFTrVxfuUanhemwnK5j2EsJOUQ3o1ttXcLMsF7XTurTf7gQB2sTI1n0gvv0gXnEUCoeKtCzEey1vuVAdjTrU6fYp4gU4wSvFH4uIZOr4ixMHIuKJXl+kEoLyB8MVf9OgNxjiJOInLvyDCsBtnEG8DjxVXPtSSCa9t11AxisfnAoJtJd3mFMvRtJQbrNcTnPK2pJUM2jC9cmfPXtGM6BshqfocZDj7hmEBlMXUm9ThoB6qRodTTMbSx1fLGNK9oFj0SMWJS+uscrIJgdB6lEf8pvqZ4zpzEXMeOHOPJaQSk0bzo/G8EU/IrLrnAxO4B4Xu8 X-Forefront-PRVS: 02945962BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39410400002)(39400400002)(39850400002)(39840400002)(39450400003)(39860400002)(53936002)(2351001)(54906002)(42186005)(55016002)(7736002)(110136004)(107886003)(305945005)(5660300001)(38730400002)(4326008)(25786009)(48376002)(33026002)(50986999)(33646002)(478600001)(50466002)(189998001)(81166006)(50226002)(8676002)(6666003)(2906002)(86362001)(3846002)(36756003)(6116002)(1076002)(6916009)(66066001)(47776003)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2044; H:mellanox.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-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A=; 24:dIR8kvENGp0VY04Fcr5H63TqQwbZaDOUv6V1JdeFYIwJ2vTmAs5wG6HoyruPVxmDqTxF5g24kNhTMA+oDr3ZWZFtsx82CxGw7evlWQzrqiE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2044; 7:vI7vmqULg5Lh2SJntCXCgZMeQVGDZ0rjXSfxS3Cqv8nKQSyoVSbTKZXZd8BGonFk/7a2GJmX0MHMvxE1gmKjpIK8+/y2w8B2AV8AXrCWoIaZDVdOoHnRDUwaY84sKgTWMsjcndiJX5OdKQFUmBmeIpCv/gmdLWkRZ3jJE9lQwodql97RdzeZtMCwlQVxXwvS0eudikyJ34HDBCRtpStHHVA2o5vKH8M7+kb3Ax2/7weppleEODGjnyFO426cVDcFBtx77fBBhHdZSascfIoeMVW2LgMRiLgIPVf+BUY/t5HsYI2W/4OUQHbGj5678ZPbcS02gdAXmsfrDK/rRssq0Q== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 May 2017 21:05:57.5876 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2044 Subject: [dpdk-dev] [PATCH] net/mlx5: fix crash on deleting flow drop queue 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: Mon, 01 May 2017 21:06:02 -0000 If mlx5_dev_start() fails, it tries to rollback data structures related to rte_flow including drop queue. The destruction code doesn't assume the structures are created but priv_flow_delete_drop_queue() never does sanity check. This can cause a crash. Fixes: 028761059aeb ("net/mlx5: use an RSS drop queue") Signed-off-by: Yongseok Koh --- drivers/net/mlx5/mlx5_flow.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index cd3e5daf3..adcbe3f52 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1465,13 +1465,18 @@ priv_flow_delete_drop_queue(struct priv *priv) struct rte_flow_drop *fdq = priv->flow_drop_queue; unsigned int i; - claim_zero(ibv_destroy_qp(fdq->qp)); - claim_zero(ibv_exp_destroy_rwq_ind_table(fdq->ind_table)); + if (!fdq) + return; + if (fdq->qp) + claim_zero(ibv_destroy_qp(fdq->qp)); + if (fdq->ind_table) + claim_zero(ibv_exp_destroy_rwq_ind_table(fdq->ind_table)); for (i = 0; i != MLX5_DROP_WQ_N; ++i) { - assert(fdq->wqs[i]); - claim_zero(ibv_exp_destroy_wq(fdq->wqs[i])); + if (fdq->wqs[i]) + claim_zero(ibv_exp_destroy_wq(fdq->wqs[i])); } - claim_zero(ibv_destroy_cq(fdq->cq)); + if (fdq->cq) + claim_zero(ibv_destroy_cq(fdq->cq)); rte_free(fdq); priv->flow_drop_queue = NULL; } -- 2.11.0