From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DADA0A0542; Wed, 26 Oct 2022 08:34:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7734D40E28; Wed, 26 Oct 2022 08:34:03 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2072.outbound.protection.outlook.com [40.107.223.72]) by mails.dpdk.org (Postfix) with ESMTP id 5839040A7F for ; Wed, 26 Oct 2022 08:34:01 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=myom7DM1R6rEDqi71W6DIUfxM2X9DXgcGdSSBv7kvJ2U0FEQQCXZHH+Pw7DPUik8er5hS60GpgyLd94Xm9Yin4FJLhvm41H3UdjIQMajG9M0MxiPgU87WEBeehRNTPdiDmKTll7hIluf/004QO7X8fC/XDu1McRFJqhdS5+v4umVC/HrmsGnlU4eW5ncmB3pQI2W0ncjNLhaHkT2geyBc8C3PI/cUBaI/yp6SjG9q26IppSBG5f9GarbPfd4lFTrjff8b1tT1rCFsQ6JRSUP0gTVedvCKGtuMyr3WEvPFbnlrMjyfkKRUpzP4IJ8lV1RcBGo1Jfr7b+Jpq0nwNKQYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ffx/vR8k9PopDoqAHNR/B8tsNBEFZVfNH1nCtfJIVTM=; b=OypFQbF5gZsafL75pnux8NNc8OcA5QmWBbb/cpriWXk6FG5pXt9BGFlwGvLu5R8Lckcbq9gjZ60bGcIRGhlfZ+5SZ3IAnMajbtXIJ8MOFXfJS07fiUzPDHrg5TUMCr/e9vBXWPYeJV5VHFhOQE9k8dx+JGvknzPTse1t7E67yj/nsZrb3Bh8JL7G/L9urS9v61eSdn1dUHC8g2CgbF03sX6oIBRGhaeQT8ELPE/lrKFPTwESPCwkbBy8zWD1JBI0/nz6awdN4ymKziUqXpwSvHU3ZZeSEf0ykzfnbX39jyCvfAbYSbC8K5uGAw6JDON9SW6WokfGGSvxQ05yoLx1fQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ffx/vR8k9PopDoqAHNR/B8tsNBEFZVfNH1nCtfJIVTM=; b=nwXvyms1RSyd9Bj1ZKqZhjW2TvVPz0dmyfZDXOeEEwYjeFIXrQJseQksHgyNSSEO/2C8T1LKLFy3DCRx2zSiaT6taedMQk8Kc8FKU1lAgHzWgO0NFhKQVUifCgEHoKLIhJAWOPiElXPOD5HBmC6BFV5J9w0AEQFTwIxUYz8G8rMKTV7ZRD5tOxbgPyRg33vW4l2t2jSo0ZB6guguAwAejLPLE64/Y6n4dwM/dtlNtPDjGkvTe5KghMqJW9m4c94fsDyo2qM3c3KR0N7spoI3I12lBY+IbXriN81W+M+c8YSPHrxSyrRRsLyh1ottm1WZcH6m2UagZ7gyCfoqbjsYyA== Received: from BN9P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:408:13e::16) by PH0PR12MB7959.namprd12.prod.outlook.com (2603:10b6:510:282::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Wed, 26 Oct 2022 06:33:59 +0000 Received: from BN8NAM11FT109.eop-nam11.prod.protection.outlook.com (2603:10b6:408:13e:cafe::fd) by BN9P220CA0011.outlook.office365.com (2603:10b6:408:13e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.28 via Frontend Transport; Wed, 26 Oct 2022 06:33:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by BN8NAM11FT109.mail.protection.outlook.com (10.13.176.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.16 via Frontend Transport; Wed, 26 Oct 2022 06:33:59 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.26; Tue, 25 Oct 2022 23:33:48 -0700 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 25 Oct 2022 23:33:47 -0700 From: Suanming Mou To: Matan Azrad , Viacheslav Ovsiienko CC: , Subject: [PATCH] net/mlx5: remove unneeded SQ null checking Date: Wed, 26 Oct 2022 09:33:26 +0300 Message-ID: <20221026063326.2850-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT109:EE_|PH0PR12MB7959:EE_ X-MS-Office365-Filtering-Correlation-Id: c705cfc7-e51c-4e49-a21e-08dab71c10d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hcT1G9ALCim695e4E9dKm5SjswpPOYSoupXOJ6hIi49zRV8+NWFTR+glIgdpKZSH+rSzJb/lU0vFNU9bGZmdJY6d65JC4R2Pl1e9gyvXN2fwJ2KgDOvP44csLkUWThtkD55kBDozWmXX3OWRplZEX4yQywdmP/xHHJ/5BcMeMlpn40SUJgc+0+xgxUwkci+EQbr/1olSNnbrDUJxcxvnoScPPZfrkJlHFuhVuz4+dE7jNiUbvIjP0N9z3unKmYefZlYLfPeYo/dJzczCicjT2LHgt6YXdGSxuCSJCpRSuy5becp1TC9EYkJ2ApI0q1DbmBMTT+SJ+Gk2/fhAdUxUC17PKYrf51CDSv+9yVnFQ5pLPcsJpxRzX1iQqYbjrnDLGsl81FPe1aMdFSoEMBBfO3r0XdrjeOPB9qFJHo1/Lnbl1gJeWXTrbhsQxUdoerJu4zGdmniy27eDAG7A4eNCATvDF3xXhiv/9XAqHrnhDbMqWRfWhSBoUiEie7rOQ2dhaEcZ44FlqSbWCgoJ+WAxsSQppv91z/RVtcy/VsnMsRgsBtRKi+odfEfWupuIHRMtz9lL3vu67DbX1Ea13NQDebPwCkjjduYcmBPLM7UKCZ1OF9M+IudiV+qOgXOpfmP6cOre71YrzGFyZyRIcSwNuZE3LNmGfU8eC8R7/2PIrMJgTWmFirnMvfcDsOBnAKJ8SxDH6UVnTWHE0UFlR/Eo3aQZDvW9OaZ2MHyZjEDzDRhdb/fKEzBoCBeH7Oju46EK77YEN4nEwaJFQVfYUjOZMQ== X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199015)(36840700001)(46966006)(40470700004)(70206006)(4326008)(70586007)(8676002)(7696005)(36756003)(2906002)(83380400001)(426003)(36860700001)(47076005)(86362001)(8936002)(5660300002)(82740400003)(186003)(2616005)(1076003)(6286002)(41300700001)(336012)(40460700003)(16526019)(7636003)(40480700001)(26005)(107886003)(54906003)(6636002)(478600001)(110136005)(316002)(6666004)(356005)(82310400005)(55016003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Oct 2022 06:33:59.3693 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c705cfc7-e51c-4e49-a21e-08dab71c10d7 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT109.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7959 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org The ASO SQ is a dynamic array in the ASO pool struct. That means the checking of the SQ pointer is incorrect and not needed. And the mlx5_aso_destroy_sq() function internally also checks if inside the SQ any resources need to be released or not. There is no need to have that extra checking. This commit removes the redundant checking code. Fixes: aa90929cd5db ("net/mlx5: add HW steering connection tracking support") Signed-off-by: Suanming Mou Acked-by: Matan Azrad --- drivers/net/mlx5/mlx5_flow_aso.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_aso.c b/drivers/net/mlx5/mlx5_flow_aso.c index 1ddf71e44e..29bd7ce9e8 100644 --- a/drivers/net/mlx5/mlx5_flow_aso.c +++ b/drivers/net/mlx5/mlx5_flow_aso.c @@ -328,8 +328,7 @@ mlx5_aso_mtr_queue_init(struct mlx5_dev_ctx_shared *sh, return 0; error: do { - if (&hws_pool->sq[i]) - mlx5_aso_destroy_sq(hws_pool->sq + i); + mlx5_aso_destroy_sq(hws_pool->sq + i); } while (i--); return -1; } @@ -1149,8 +1148,7 @@ mlx5_aso_ct_queue_init(struct mlx5_dev_ctx_shared *sh, do { if (ct_mng->aso_sqs[i].mr.addr) mlx5_aso_dereg_mr(sh->cdev, &ct_mng->aso_sqs[i].mr); - if (&ct_mng->aso_sqs[i]) - mlx5_aso_destroy_sq(&ct_mng->aso_sqs[i]); + mlx5_aso_destroy_sq(&ct_mng->aso_sqs[i]); } while (i--); ct_mng->nb_sq = 0; return -1; -- 2.25.1