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 DF242A0032; Fri, 21 Oct 2022 10:02:34 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A724442BC2; Fri, 21 Oct 2022 10:02:29 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2115.outbound.protection.outlook.com [40.107.94.115]) by mails.dpdk.org (Postfix) with ESMTP id D523C42BB8 for ; Fri, 21 Oct 2022 10:02:26 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VQRwx4dPLaEshMJgRdp2gZW9ffBLAVNLr630RsI7dfPFRsCtutTrSfLZ52wlmWnCJHsSzobAk/WYYCx05kfqvLfOs1dnTg2T/NfDMnAdKRPC10w6plC46gIm5fLCrJf3WcNufaqbYiCdCgb7XZBWCflfH2qlE/i+yQOs8BDjY/tty62kYcNN3Y6d0tyG+iojet0Bi4f/G43oCkVyifRkLcu/CfxKVJNcIIlKExD/9by69dBlt4VBI6e7Q6bZ5QkTlQlbxZR7xXqWRIVnkxZHbaVi6XMAZ2tbkxpZw6P4CUKKhoDR5J7GA1Lz73KfwFTs8krXbrR3NwCn5099bEVVeA== 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=qlXHBeI7qElrEqpIus/X7DHKiUsZ5jUAOpA2K6A34kg=; b=Y1ug3UAowTji2rFAH9B8fj61PTwGuNQhxLifIk/nS6tRSnRPZDQitrRcx0flbj4Ejpz/ToCoo48RRG1p81RjqvrVscr8U6gYfiS5kUuv3nI/nhmKhnnn0Dwd7YjjGKnHY6ypWOXb9EQjj+j+pAaOYSbeuC8VAZjch7InEuOfJf9dyXH9GtJaHJOZ/tQtUkjegasJqazteLz4xwMXh4uCnp3qUUqsSm9YFKxjfpTbFKJlQDLYYYXOMeSRbKh58ozRwoZM1ShwLyP4t2jGhs6Mq+sB0ySMG2DP42sBp3kcxjqFvBjLqJkG5tWuG3NakFB0alPc/n63uo3bCJxA75ly9g== 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=qlXHBeI7qElrEqpIus/X7DHKiUsZ5jUAOpA2K6A34kg=; b=LI0XoHlOFFLqza5hWaueRa0ro+FyVdTx9GadYlEi8ahSiwShUkC4K4Dnwm3U3rfmwfP36EA4uBmGvYldkcvdRTRnPDJRnZw1UBMierzo/cHhELagf2QS1fw1Nfe8PuvgJaMkJK3+1JDEiNIplauZq1AW70zeNxY6sP/pPDPwu7o= 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 DM6PR13MB4493.namprd13.prod.outlook.com (2603:10b6:5:1b9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.22; Fri, 21 Oct 2022 08:02:25 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::7c26:1a0b:2825:6f4b%4]) with mapi id 15.20.5723.014; Fri, 21 Oct 2022 08:02:25 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v6 02/27] net/nfp: fix the promiscuous mode control functions Date: Fri, 21 Oct 2022 16:01:38 +0800 Message-Id: <1666339323-24016-3-git-send-email-chaoyong.he@corigine.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1666339323-24016-1-git-send-email-chaoyong.he@corigine.com> References: <1666232391-29152-1-git-send-email-chaoyong.he@corigine.com> <1666339323-24016-1-git-send-email-chaoyong.he@corigine.com> Content-Type: text/plain X-ClientProxiedBy: SI2PR01CA0051.apcprd01.prod.exchangelabs.com (2603:1096:4:193::6) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM6PR13MB4493:EE_ X-MS-Office365-Filtering-Correlation-Id: 9d32f115-33e3-46ba-dc6a-08dab33a9732 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RvxAJNL0wmfS84yaT6XnFhQ4TlU1DOnRojtL+TqUtNSO8jECW29GIlh1zNR/4jCvmYilDqgZIWs27rbWYZ61/ez9IHSrv0ZDlbQTxgbinhYHcgn7p6y3mkOf1+MEaeICUiA+ygepMYRM/jhUXAHbEm1UOrwV3jbm1KC7o2YZKwulHiAPJeuHzgRQZ6JTG4p41BZcLXpRr0xkt6AftDTEuVTQTEI8ck27nJs/XPE+nDbTATCW+uHahb+oh+dVxhzGwIMSpqP+i8o5qKWNi6ii6GGuPjxSamREQuEe6A6VIRsJ+HSvvLJ6x+SU1a+BIV70rwXxuMQMhj3rHQ/39IdX+Yv3xzYEyCWB90K5jlfsRWkvjTrPUjzu0xhBbcGfarFyOkvCTpeGFqERzWg5Z4itX1uYYm0i1Ko742PLkutqqWm5/1ypltG0S38ua4ZnNDm97L8sus+sFythMBvyV0mi7k8HqST4DsOplagGOU5AnKpvsaHr7b3APCcCv4z2VRSnOkeUJbrPMnwLmoOC7zfXDuMMSrAewQPM+s6IER0lCGSzcqeq0UjKidD3t30xP99VCRkhKjjf/BKcqVuJ1hTX2ntIY1VZ68fhF7uMChtVt6mNJXuMa9np1v7vdNeqGfkAG0WbLTjBePFBnc64EdXC7Ww+E1kPE6zCZl76sqo0HKtdQQj33opTBFTzHevF6JDFlP6B94NSP0kNdjKkCUMNm4WLopJKfNgfb2kmZUz9CKxv/gwSHqVhcJUld1Yjrc27hmkZfy0XYukp+mv7hTpV0A== 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)(346002)(366004)(136003)(396003)(376002)(39830400003)(451199015)(36756003)(8936002)(66556008)(86362001)(41300700001)(478600001)(83380400001)(2906002)(5660300002)(186003)(6916009)(38350700002)(2616005)(4326008)(6512007)(66476007)(52116002)(66946007)(316002)(8676002)(6666004)(6506007)(26005)(107886003)(38100700002)(6486002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+S+r6HBOzq/rAc5xwrrKQp4aCAGYQ1ZI8RkL7+U1fBeYOMk5ajOE+tXoYw8G?= =?us-ascii?Q?t7tEFzL67/WMWhUJNMkdyo3ypm4/e6nQ0I6q4FVz1wKWylgv7kablzG6G5ke?= =?us-ascii?Q?7PHmIJY2Vm9vGZQHdHxpxJRDIKAaLGY0JmwaNpTH779HHXHCo0j4Js20I8U8?= =?us-ascii?Q?c/4aPEt80M7i7SYViDtjvhGgyTzs/5/6MEgGE48shvh4E7qkUvtiiV+ambJd?= =?us-ascii?Q?qz1VST+iFFUEhDtMre9UMZBQ/1u0F7QMkv4Q+C982TyABLyiTAzapmDpTXnr?= =?us-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Taa2/AoaOq5rieE?= =?us-ascii?Q?MwBRws7ggSggpNqINp749QsOouoXoJoriKOtLBMREY0KYyazdTm6RS25+zfT?= =?us-ascii?Q?T69lCRCgMyFLk6NxI6c0wLWOhEoK+lhXJ1ns2kwBZgONkgMU78PqWYSj6x7Z?= =?us-ascii?Q?iSzPe6zmlKd2z84QJSadQ1ieyZgh9i3ITIYOHx26Pz2ghixDyeBQ+Lnw6fUO?= =?us-ascii?Q?HsctuUBgxnXQ6F62v9B6nUM536I3s2ZGLIoUvMesLhUQIHhRMqBPXWNxI7hm?= =?us-ascii?Q?yRk7lo5M9BmxLyU1iGpjXcQMJZbNBtYKYi1/SsdW5pqGbKWTishIMQnsjTiT?= =?us-ascii?Q?glEc0Jc/oZfDoiLLCdRavWqFLn+i8aeGIVBfOWk/0waWrr10aEGsCUzm21H8?= =?us-ascii?Q?mYasoIHbtqPdrbRE4fb4E875f58Vygi0eINGeVLdIexvwB3I/lENpLBzv5ET?= =?us-ascii?Q?eg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9d32f115-33e3-46ba-dc6a-08dab33a9732 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2022 08:02:25.5482 (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: icYxj0FBtDCYwtc0zL537W/fbO4wvZuVvx85Wb5gZjNd866dSTrY0aaiHppuuYvlKC2utd9xG6GVzS90DG1idatE/W0OlQpPuXMfKV5VM/Y= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB4493 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 original functions of promiscuous mode can't process the representor port rightly, revise the logic to do that. Fixes: e1124c4f8a45 ("net/nfp: add flower representor framework") Signed-off-by: Chaoyong He --- drivers/net/nfp/flower/nfp_flower_representor.c | 26 +++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c index 0e60f50..cecdf46 100644 --- a/drivers/net/nfp/flower/nfp_flower_representor.c +++ b/drivers/net/nfp/flower/nfp_flower_representor.c @@ -415,6 +415,9 @@ static int nfp_flower_repr_promiscuous_enable(struct rte_eth_dev *dev) { + int ret; + uint32_t update; + uint32_t new_ctrl; struct nfp_net_hw *pf_hw; struct nfp_flower_representor *repr; @@ -431,12 +434,23 @@ return 0; } - return nfp_net_promisc_enable(pf_hw->eth_dev); + new_ctrl = pf_hw->ctrl | NFP_NET_CFG_CTRL_PROMISC; + update = NFP_NET_CFG_UPDATE_GEN; + ret = nfp_net_reconfig(pf_hw, new_ctrl, update); + if (ret < 0) + return ret; + + pf_hw->ctrl = new_ctrl; + + return 0; } static int nfp_flower_repr_promiscuous_disable(struct rte_eth_dev *dev) { + int ret; + uint32_t update; + uint32_t new_ctrl; struct nfp_net_hw *pf_hw; struct nfp_flower_representor *repr; @@ -448,7 +462,15 @@ return 0; } - return nfp_net_promisc_disable(pf_hw->eth_dev); + new_ctrl = pf_hw->ctrl & ~NFP_NET_CFG_CTRL_PROMISC; + update = NFP_NET_CFG_UPDATE_GEN; + ret = nfp_net_reconfig(pf_hw, new_ctrl, update); + if (ret < 0) + return ret; + + pf_hw->ctrl = new_ctrl; + + return 0; } static int -- 1.8.3.1