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 7819A42475 for ; Tue, 24 Jan 2023 08:16:56 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F5DA42B8B; Tue, 24 Jan 2023 08:16:56 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2102.outbound.protection.outlook.com [40.107.244.102]) by mails.dpdk.org (Postfix) with ESMTP id 9F382400EF; Tue, 24 Jan 2023 08:16:54 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=drNldLh65sxVDEhFj2yW1cMEOWaYTsfak8BMdje6EIp/sfYIr1OVibn8TS4qUHO2s7DABsZiuieqEv0YfXItRoi53HboO6Ccw7DixnnGhuBn1xWf+2m8XXJ/7PTeaqSwR7baPlLw6rlzp4hwupW3RJs1FCVwR26xfSCY5JEV2NKeGHveFcm3jy4dPnYKuChRrgS/PWgMfz1FldBsEDyhl41GMUKtqmXlnrgYi6R3jMLJyp0hM3gYbfRAm8iu+xlEYYUEyIRcBra4ieJmB5TsaiZdVrMuX9z4CNtR3g23rwXqEbxUNHbBDzPfUbK2zHRDliOUCWrBFLLqtXYIIJtVaA== 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=QThNQeejm3txnx9SyXv1gV3OB1tIbPJ+09+zo3MMy7I=; b=m1TpyEcPvQ2HliGUWwcs+IruGP4k91KI3dfniVo3WIu4p8zIUi3DUfYJiwEBEbYcBzj+ifykOwe7sWsXMyfJFX5rveyayE4LSwZEEMagC2zAyyd85j1H4wH7lzCCaaopSq+hQ1A0+l7L746bFWeUI6PqJbocEeAcIZxml9I6kQHFndUG9W++5ileEtUE2RwuKH+cIBZYgxaOeEFW2rGvxYTIv56LDMbXpFnw7mC0ZKH3ra5lOA/SUZ1nesXr2ug/VA4ik3i5f3DEBEacgOi8uCnirkkLYbK+KSpcmJ41pLiX+I6sOovfDsr+oCguvxwESApo+Ln/25H/b8KyakyxSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=QThNQeejm3txnx9SyXv1gV3OB1tIbPJ+09+zo3MMy7I=; b=lDgOdWSzyL+Yev/O3/JgWSNmd9OEcqIXOy+tLeHaFIggNwdLd2qQi/IxQBdr2Sm5jgs+8PQpeHMnxf0+xq6xPi+osT/4qLuv9RXIvkBe2SR8Ufxahrr8vMuWUFOjmB+48vfHjpijFpnBjr9TDXEK4pJ9abeljiCRG2YSbjlRYec= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by BY5PR13MB4485.namprd13.prod.outlook.com (2603:10b6:a03:1c5::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 07:16:52 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d%4]) with mapi id 15.20.6002.033; Tue, 24 Jan 2023 07:16:52 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He , stable@dpdk.org Subject: [PATCH] net/nfp: fix teardown of flows sharing a mask ID Date: Tue, 24 Jan 2023 15:16:31 +0800 Message-Id: <20230124071631.38272-1-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.29.3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SG2PR01CA0163.apcprd01.prod.exchangelabs.com (2603:1096:4:28::19) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BY5PR13MB4485:EE_ X-MS-Office365-Filtering-Correlation-Id: e0ed3245-db74-4ebf-b66b-08dafddaf762 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZQ5sbdgNZ6cVxZ9XTE6/wlt+Ct3zCEGb7N5pN0oMiwrHaNWvk17tvLOLaHUTYFCC9BETaZ6zyhevPQololvhEvLCSzNkBcD8k8BneNbsXblpLBz88f2WGSPP1NPD9B1w0DSulEmRSGGGFKZbrEg9036WECcx2InfnnyEvT0ylQZOclw9nODZKjbIfulzWwRbC+FKsiPk2Ii3fWFj0mAKdDL28JHREqIkgLXJ3SD5N/u4Giyg1w0oll3Waby0IzL4/BckLw2o1eWX+87kzgSFxa7E6EQLEhxVdtjKBYJeq7z1MFuBUViWuArIKDb8qvnE8PQwMV1UPobvmyKaxq+Y7rTUd/fcGFMh6Sycz4KQ2iLKnqHwrKpXs5TRiZMPyjnT/Yi02VD8LkEg0sDpg4NhsIJ4dEcAke0I7vEe+BlDvf7e2VahruA+TjTO4Nu/VCAyt18mfe3yVZN9NaYqQZyye0h1yvgZ8Z6QJ5xTlmmmnCO8eeb5H7DYpmbcTTPQLLA4dZS7YMWs/k+GaKiP/e+yC57/9CLyOggmIRSrRbi3Zxh1Ud9pejqmTwMUXgTBaoJrkWYUjnTcsMOfYapFJNtzlu/Do3x2DgHBFbxsyvpc7nh0LGc0xhi3OlEexhkyCOYRFbG9d6Qqsux7mVfbVHV0V9b3iCNSk2MYy+dXLl+JoyeXbQ3zVqnrwifYv/dSze1naGwglG8PBFiMIvevpYKHuA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(39830400003)(366004)(396003)(346002)(376002)(136003)(451199015)(38350700002)(38100700002)(83380400001)(41300700001)(86362001)(44832011)(2906002)(5660300002)(8936002)(4326008)(8676002)(6512007)(26005)(6916009)(6506007)(186003)(316002)(6666004)(66476007)(66556008)(66574015)(1076003)(2616005)(478600001)(52116002)(6486002)(450100002)(66946007)(66899015)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b2EweUVYQXBsTDJJdlBQUkgvTjgrRGE4UUNDSnl0dnNaRS95YWo5YWp2Ujgy?= =?utf-8?B?amJwajIxQWtHcVgwMDMyMktaSVBKdXZucTJaMkk4VS9POWg5dU9mZ3l4Z1VI?= =?utf-8?B?VnJhSHBKaG1HVHY1Y3VtdW51WHpWdmUyOGwzbHFLNUJJa2lYdXRnNWlGM3Js?= =?utf-8?B?U2lrT0NqSUlZZWgyOHlURERDOWx6a1NYWU1UVk85T3dnbENoalFXMW13ZUtX?= =?utf-8?B?NGJXN0RZOVlabWQ4Q0xESG93RTZqaXRNYk12amIyYU1lV1c1b0N4ZWs3aFJK?= =?utf-8?B?MEFwbWZNSHVNRU1yZlZyRWtpME1sVUo0S3FyUzRvTU9LbTBvVUVVRHhlNURG?= =?utf-8?B?ZDhXTkZrMGt2M0tValhYRzlHVEhGQzFzcEs5SDVzZ1R1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X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e0ed3245-db74-4ebf-b66b-08dafddaf762 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 07:16:52.4610 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: NSIBKwct/DgzzicqTJGqZSeZjSI1WCYXoPYboIZKNp1L51tbaJ9Z3CkKspcaj/3GupdAGjlD2QENn8J90XO7VoW0pXDe359EYKTJWtykJ/M= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR13MB4485 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org The same data in mask section of different flow add/delete control messages will share the same mask ID of mask table. The first flow add control message and the last flow delete control message for a specific mask ID should have the NFP_FL_META_FLAG_MANAGE_MASK flag set, this will indicate to the flower firmware to allocate/deallocate the mask table entry. The original logic wrongly process the flow delete control message, and caused the first flow delete control message to have the NFP_FL_META_FLAG_MANAGE_MASK flagset, thus the flower firmware deallocate the mask table entry on the first delete. This in turn prevented all the other flows sharing the same mask ID from offloading. Fixes: ac09376096d8 ("net/nfp: add structures and functions for flow offload") Cc: stable@dpdk.org Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_flow.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index d6c8c89921..ff2e21c817 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -285,7 +285,7 @@ nfp_check_mask_remove(struct nfp_flow_priv *priv, rte_free(mask_entry); if (meta_flags) - *meta_flags &= ~NFP_FL_META_FLAG_MANAGE_MASK; + *meta_flags |= NFP_FL_META_FLAG_MANAGE_MASK; } return true; @@ -3653,6 +3653,7 @@ nfp_flow_teardown(struct nfp_flow_priv *priv, nfp_flow_meta = nfp_flow->payload.meta; mask_data = nfp_flow->payload.mask_data; mask_len = nfp_flow_meta->mask_len << NFP_FL_LW_SIZ; + nfp_flow_meta->flags &= ~NFP_FL_META_FLAG_MANAGE_MASK; if (!nfp_check_mask_remove(priv, mask_data, mask_len, &nfp_flow_meta->flags)) { PMD_DRV_LOG(ERR, "nfp mask del check failed."); -- 2.29.3