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 3771241CAC; Thu, 16 Feb 2023 07:37:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B96E7410F1; Thu, 16 Feb 2023 07:37:07 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2137.outbound.protection.outlook.com [40.107.244.137]) by mails.dpdk.org (Postfix) with ESMTP id 3247F40695; Thu, 16 Feb 2023 07:37:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lvsxEKF2HtKJD+Q4SPAF+Nt+ONbf4dnvErOc3GHXos6dU190QJ33ScH8DYq0eOZmvCsqwHkRrs+OAjNAvNkzwv/uvt3joja1rtNCfY8Pr3c7xY/Dt6NlRFxeik6IMvqCScjJ2lbeFgjHhIhgCE2Oz+N5qSEuU43HmknLgHrEK0/m2Zpc5yXsO2SiuvgJ0OQ/Pd/yhJW3ZEvZNvs+RJ0R+aqmh2Pbxk13Gga3JVi/EX79gk3uNucmy25l5bb7DycmeMKUs4FOLqqar723A6cV+f4IFfMDiFdXnYIkoT3+8ztfgeB/c1NL0z9ejMbcUhai878l26WA+EAdURuck4tgGw== 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=cvAwqNCQhOlbpqCE7SQP8JyVLtWM/yApnn/bZLBHV2g=; b=oL+ufmDn99tUeLV/JZLDEbHqk9tUTxVH/CPaeNM7EUROFLRRLAgRz+AsdiWX8mzeSYLrIE5PeOUmDEZ6Pp+6q7Hv2oU2XvCFOLZuistKpS9P+XO/1VLNbwRZmSMu4JG3g5OBfrysoL7I2M8PrygDvj8Qv80zi6+Bc3jTkkbYytcxHmTMgqYtCNzUrm9HWGba4QncAVaPV65/Y4Cyj8CisGYxCMzGBofxZAfD7APJBD+i55bU4nFPzlzZ+feOjZgsWwh85BK7kZhlNwWKBfcvqalIxUkySZpqvTF/o+tbLZ7f+Zi4zTYjT1iZfKXS7/G/xl2h9DqN3T61oqN6NYkuJg== 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=cvAwqNCQhOlbpqCE7SQP8JyVLtWM/yApnn/bZLBHV2g=; b=BZ9WYXiRVc3rux9Xq3QRh36u4Ji6a09FxPF/EkBDAJN16B41KP+AbrNbcZjopEnVuIIOpwASuBfmQXF1VVDSG+BsbuYFdAmXZn3N0fgyztD1Jm2FVH8RIoZkyRekr6Quilwdso4OcPKcnoFaQWdsOLjfjNuXJlVz4GgHwiLlVXQ= 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 CH0PR13MB4764.namprd13.prod.outlook.com (2603:10b6:610:df::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.26; Thu, 16 Feb 2023 06:37:02 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7ea4:e421:5dd5:9f4d%5]) with mapi id 15.20.6086.026; Thu, 16 Feb 2023 06:37:02 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Jin Liu , stable@dpdk.org, Chaoyong He Subject: [PATCH] net/nfp: only flush specified port flow table Date: Thu, 16 Feb 2023 14:36:44 +0800 Message-Id: <20230216063644.13109-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: SG2PR02CA0132.apcprd02.prod.outlook.com (2603:1096:4:188::15) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH0PR13MB4764:EE_ X-MS-Office365-Filtering-Correlation-Id: 24e10f3e-8f79-4d46-0b0c-08db0fe83618 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GixKJp2Ll1CVMRxjzOGThmhj1j2+qfuDdioSyUnKGNPD1oW3D3Cci3PwNrLR/Mh+DccaN/OP6dyn3GvX5nY1UGlX2/Ifxhg38hsmkaFVJRB7bQPMDZewsEyWycJxFugsId+uOw78ssDudT0Jk9vdP9y/H8903ntN0pue1MJPTQtQABXrwAzNUS/NwGRQdg5RW/xJ2GCCftBm9iOxHHmipC7aO/UfxoWJupJTRDke96+hddXSJb4y3jO60DDsD1oEUjZgX8txiT0MWzQw+GsRLhGmxWdLADswYZGyYus1pmV4DysrvABkTUKvbU526NcHkJuokYjoAULq9me2Vymb97TvjROFqKzG1S+7SYExkcfF2ZiJ22LBaCD6bQJLDlYFfBCexZN+aqKPt0SAjHq8zYAAAcqb8Qdufu3+xRmS5rq58FZ8akgh5cWBqngllZdQ6ZLywhADheXWpjE5Qi3A7TxqS5cSOeeyn1cyBWUFufU8KXxyYPi/snslhUa4UIVZBSfWsrHEnLWXZg6REB7izdww8Vc5A8ivpn2vSu3keHav0W+p0U7SIws+R4he2w1FfC35kyT6Q6bOUy/yoFQ3O/wadw+vP8NDGVz2zMAvh7w3Wg0l5Vjlemu5mG+1g2d/aodQ1HYQDiMwYr6LNsnuB1swjgkT/HIdG+WOJqK9IEt5XQ6KYyfbU0tWY3wKIZoqSef6vNmy/LYUVk4DjI4FFQ== 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:(13230025)(4636009)(136003)(346002)(396003)(366004)(376002)(39840400004)(451199018)(38350700002)(66476007)(36756003)(86362001)(38100700002)(6512007)(4326008)(1076003)(83380400001)(6486002)(2616005)(107886003)(6666004)(6506007)(478600001)(52116002)(26005)(186003)(54906003)(450100002)(66946007)(8676002)(6916009)(5660300002)(316002)(44832011)(2906002)(66556008)(8936002)(41300700001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RWRocEhrOUdNci9mSjRqZTJldGN1TE90d3dVTFp0WVJVbkMzbHV3VHkwSWFJ?= =?utf-8?B?WXI0T2YvUG1UWEpPdDZHODJOV0Ixakxub3pkMWNaVXdVM0JWQzdsWURHK2Ux?= =?utf-8?B?UDNwZVBvcnk4MEIrMkwwN05aMVpMdmUxbG81NjROd1lMN2NlNS9RdDk2cDlW?= =?utf-8?B?MDRVVERiUTBsTllQbXZ6T1lSc05KOWhZaGpNL0kzOFBSK1pFNFZIZGRQTFhN?= =?utf-8?B?L0VSWUtBVXpqU0xnY2x3Q0pHcjBTd2pUd3BZTXl6WW9QN1JGSHJMZ1lHN0Ey?= =?utf-8?B?cjRtbmwwa2lDaUQyYmw2REowMnJ0cnlmM1N5dXZQdWJ3c1NHeUNzejIvS2NX?= =?utf-8?B?MFhYU1I2SjNLT24yQzZiRjBwU3NPeDJ5cWxDSzY2R2toa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B?bEE9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 24e10f3e-8f79-4d46-0b0c-08db0fe83618 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2023 06:37:02.0555 (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: LiVoRF2N0g3uBKV/l8y3bTY+yUH5J8DMutXocagQcByXRQDFbzPd/7Rndnr0W5qoR4447dRPv3H3nTmHm6OMHPQm5qj3dhbqp+q+VjM/cDY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR13MB4764 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 From: Jin Liu The flow flush function will destroy all the flow table on all the port of NFP nic rather than the provide port. Modify logic, only destroy the flow table on the corresponding port. Fixes: 30ecce522732 ("net/nfp: support flow API") Cc: stable@dpdk.org Signed-off-by: Jin Liu Reviewed-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_flow.c | 18 +++++++++++++----- drivers/net/nfp/nfp_flow.h | 1 + 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/net/nfp/nfp_flow.c b/drivers/net/nfp/nfp_flow.c index 4d4d21d997..bc28edee4c 100644 --- a/drivers/net/nfp/nfp_flow.c +++ b/drivers/net/nfp/nfp_flow.c @@ -339,7 +339,7 @@ nfp_flow_table_search(struct nfp_flow_priv *priv, } static struct rte_flow * -nfp_flow_alloc(struct nfp_fl_key_ls *key_layer) +nfp_flow_alloc(struct nfp_fl_key_ls *key_layer, uint32_t port_id) { char *tmp; size_t len; @@ -357,6 +357,7 @@ nfp_flow_alloc(struct nfp_fl_key_ls *key_layer) nfp_flow->length = len; nfp_flow->mtr_id = NFP_MAX_MTR_CNT; + nfp_flow->port_id = port_id; payload = &nfp_flow->payload; payload->meta = (struct nfp_fl_rule_metadata *)tmp; payload->unmasked_data = tmp + sizeof(struct nfp_fl_rule_metadata); @@ -3549,7 +3550,7 @@ nfp_flow_process(struct nfp_flower_representor *representor, return NULL; } - nfp_flow = nfp_flow_alloc(&key_layer); + nfp_flow = nfp_flow_alloc(&key_layer, representor->port_id); if (nfp_flow == NULL) { PMD_DRV_LOG(ERR, "Alloc nfp flow failed."); goto free_stats; @@ -3880,14 +3881,21 @@ nfp_flow_flush(struct rte_eth_dev *dev, void *next_data; uint32_t iter = 0; const void *next_key; + struct rte_flow *nfp_flow; struct nfp_flow_priv *priv; + struct nfp_flower_representor *representor; + + representor = dev->data->dev_private; priv = nfp_flow_dev_to_priv(dev); while (rte_hash_iterate(priv->flow_table, &next_key, &next_data, &iter) >= 0) { - ret = nfp_flow_destroy(dev, (struct rte_flow *)next_data, error); - if (ret != 0) - break; + nfp_flow = next_data; + if (nfp_flow->port_id == representor->port_id) { + ret = nfp_flow_destroy(dev, nfp_flow, error); + if (ret != 0) + break; + } } return ret; diff --git a/drivers/net/nfp/nfp_flow.h b/drivers/net/nfp/nfp_flow.h index b8da752a9d..d352671c2c 100644 --- a/drivers/net/nfp/nfp_flow.h +++ b/drivers/net/nfp/nfp_flow.h @@ -223,6 +223,7 @@ struct rte_flow { size_t length; uint32_t hash_key; uint32_t mtr_id; + uint32_t port_id; bool install_flag; enum nfp_flow_type type; }; -- 2.29.3