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 B1DDC45EF5; Fri, 20 Dec 2024 08:08:15 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3BD8840267; Fri, 20 Dec 2024 08:08:15 +0100 (CET) Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2093.outbound.protection.outlook.com [40.107.255.93]) by mails.dpdk.org (Postfix) with ESMTP id BB51040144 for ; Fri, 20 Dec 2024 08:08:13 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mV086qjHQRpffTnMgsEyrc2r0EWG72sc0ochNTjhwML0hyxnaVVoPeFbx1vq/bASKMIIob6J+aOvx9SrgxypnD0iekRGxO766DN2TQhV+XcanEce7CJRrEgrBYrkIMvZ0e/vPAddw6LPpV4JpyCoCn+iwwF8t0H9yT0FHAGOZLQo2Lfu8/paJ+FSeL+SBhFJSZEJokJYHhbE9ny/IeW5IwD+Pvpbcs+BbHWFarWUigQ7byyeIfvweUQEUXM7oG9t4qgYh4OLGaZpEW9T6McYjlaCWBTVwHCZ+dp6TxqhkVK2gPjNf3r22tzO3OcIdrVafAeSMYvlX5Dda0v+r9WzcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=MeISj+ZooZ7I2M3Lm9nqB6ljXkkezcTlg1pnjgKYPd0=; b=T0IL5y4bKd17FJUrawzJwoQT/Kz/kbvKUuEXZ4RnKQrfb1YcuxP/QOd0421fv9bg+lMvEXEsawOXkvdfSrbgFjJNbPlY8bMCKA6wzI7vWD+YAMrpcOEOENKEeU3VFcP8buGSpH0I6vFqqP46uVkVU2W6uvmY6QIeHtzF1nc4ep3kHRkPmdSElyPHV/1bjl89NsTtCUKBzFu2AGzI15IWYB8WffjztgW+z9dVtA5T9j9sRMmSFsS5v/RtWn/ab8v98MUUA4Y17N+qDwcf6wQR4c/hhbMV6GX7ippiV34nVBKVuoLVH93x5CeWPJ0fFusyNWNTXe0/XKAwOMifeBI8LQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jaguarmicro.com; dmarc=pass action=none header.from=jaguarmicro.com; dkim=pass header.d=jaguarmicro.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jaguarmicro.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MeISj+ZooZ7I2M3Lm9nqB6ljXkkezcTlg1pnjgKYPd0=; b=YxNA1yovTWaV/YUt7dsnjPnvalCfzhYJjf5yzQZW/5jKUWpWPimJeGBb9syC/EqzmEKJ+c+Z/uM1y2LyWdluZGYMvuNmzekKiotsiz1HEYQmHULSiNRNFg2y41dUQ11RgBYYCXGUJClSMiLtK850LzDU8jgf1RqFTXUGa9CX8qMFd7LiLcrHcpQYRUX5WdzYl/Y73rqUheQo5bhAWCxrKdDaKjS/+fS298YBSJp/DJqZc5iuHBTXFq0ikKmYclp2XGQDaDqz1gbecGNz1F5Kquiy/zmFftSyPvmMwE2otysi+YeDIHWvLZNQ6Z18wsz6Daszv3/kuyL7LmP5f9vnYA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=jaguarmicro.com; Received: from KL1PR0601MB5567.apcprd06.prod.outlook.com (2603:1096:820:c5::14) by SEYPR06MB6634.apcprd06.prod.outlook.com (2603:1096:101:168::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Fri, 20 Dec 2024 07:08:08 +0000 Received: from KL1PR0601MB5567.apcprd06.prod.outlook.com ([fe80::3ad3:b4d9:7e69:85cb]) by KL1PR0601MB5567.apcprd06.prod.outlook.com ([fe80::3ad3:b4d9:7e69:85cb%7]) with mapi id 15.20.8272.005; Fri, 20 Dec 2024 07:08:07 +0000 From: Sunyang Wu To: dev@dpdk.org Cc: chas3@att.com Subject: [PATCH] net/bonding: check return value when enable/disable promisc mode Date: Fri, 20 Dec 2024 15:08:11 +0800 Message-Id: <20241220070811.40124-1-sunyang.wu@jaguarmicro.com> X-Mailer: git-send-email 2.19.0.rc0.windows.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYWP286CA0032.JPNP286.PROD.OUTLOOK.COM (2603:1096:400:262::16) To KL1PR0601MB5567.apcprd06.prod.outlook.com (2603:1096:820:c5::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB5567:EE_|SEYPR06MB6634:EE_ X-MS-Office365-Filtering-Correlation-Id: da3f5f6a-e6ea-4bbd-563d-08dd20c50e1d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|1800799024|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?8xn8NyETLU39WtgehvtIm0QhEM7yXfFEHeHhKgPPouNL50jAEv2kshKcq93l?= =?us-ascii?Q?B8fD/5wXpMzeuxDVcSRCspqB+xQk2nEIw4Zuw7EBeelKpllWdbkW7zDWsPIi?= =?us-ascii?Q?XhCy2IfFSamIdzwz6brqCR23luJexEzYSJ0YBPkSPBgg/eaEOyogDtrhP7IF?= =?us-ascii?Q?Q0ICv+f+BBbCYN2D4WySfAdZH+w/rUwExSVzWMn0TsgH7o9yGg2OyUoBjHNo?= =?us-ascii?Q?4TyNiI9qBDr5prldsINxDdK7abjy54+cLV9/GMWip1zockYCCuzNt42Z2Ef5?= =?us-ascii?Q?iSYmw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Up?= =?us-ascii?Q?LANDEwE+03o2gWA7D4wvndKXweSMTwRTJJadO5FRfOOGwd1bNreSjM3WyURV?= =?us-ascii?Q?+VKWW2ujfvyfmKe5C69brhi26Vdd9uuOrSxlhhgGcdozlt9wB0A0BMTBnTxP?= =?us-ascii?Q?prudrzv7Hcs+8f11V386FVrtzMnj0J3jbHVATDJNu2HyKoTIHPrZ5GZqqax5?= =?us-ascii?Q?o+BWW/tn+6yFSDEIHG1VNwUy0V8+p9lMgVT34w3Df1sSUkpf094QYN9HEad1?= =?us-ascii?Q?o9++KniIwN+EBELPxa6pk6r1iJv984dg?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB5567.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(52116014)(366016)(38350700014); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+3bPzSA29nAmnzprMqhLztv/fiwmNDv1r0znHLDX+IPHPdwuoP7Gwse77JV7?= =?us-ascii?Q?/S/QoqiXSR7R+6OFSVsevfrMh3jGBDBKOeLTEHWXqCUt9THME4GolejM1Faf?= =?us-ascii?Q?WLNDDaPBbJClXh9dIdDD7evM4O4PbJYIS+HQz/ND4kproMoT/SYPyXq2CuOC?= =?us-ascii?Q?LWiiUyfAhyecxgIEh287zEiqgWwkq5Hary+AQjDsLvoYGLksb4Wmmf5hWT/s?= =?us-ascii?Q?AaYxXF36dzH12V6uYlGiGfiteE5tocXPX4uDhqgPjcML4gcz6209dtZl+JHu?= =?us-ascii?Q?Thsgw6qTNeyNsX3RMElU7Brg7InB8GB2GTH5j1b4sEcG3wtAqZFYpkTobzh8?= =?us-ascii?Q?aR6y4iVKypKgFov5/Si6e/YHEx6/ItW8YErmgH0z0mLLpOpv+HP7H+pzUe+P?= =?us-ascii?Q?tH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jvn0Qu6syOb8yuei56KM1NOvcXPj9kNtF?= =?us-ascii?Q?057DMo+lmHkg4q8u9dOGJwG1U2zlotRUPvYuN+Ni/czp8cpeJW38uB3SoTcq?= =?us-ascii?Q?j9tq/QVo5beVBT2cYBZuMDTVHsr0Uav9ayGb4gsHJNY3ck7lqum8nGNl5osZ?= =?us-ascii?Q?Pl3joWRlrJ77sTbG9MFcnAJXb1CFtmVgl3VYa4OSvpfgrD5oaf2+0T8TQ0PW?= =?us-ascii?Q?GCb9PeJtMBRWQht7+RsLoeA4l8wcU/VBr5I5MUzMdw9ruX4//lykNA5lAyp9?= =?us-ascii?Q?ei7VVcdm4SDw05clYVlb1gTxoiRcfEK/TCA4mgmhogq+gA/WQyZJuoZR7mIe?= =?us-ascii?Q?xQ=3D=3D?= X-OriginatorOrg: jaguarmicro.com X-MS-Exchange-CrossTenant-Network-Message-Id: da3f5f6a-e6ea-4bbd-563d-08dd20c50e1d X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB5567.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2024 07:08:07.7265 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 1e45a5c2-d3e1-46b3-a0e6-c5ebf6d8ba7b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 78kWI94ulK2u3xIs7NHLDv9hT2mB+51lOy4LFyvtXMBleuuDPUd8RN+gwcNJ4sFRIUQzj3Y/cPIXgdKmtkbDS0GCKYZmJpZe08cjuEgxz1I= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6634 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 Add validation for the return value of rte_eth_promiscuous_enable and rte_eth_promiscuous_disable. Signed-off-by: Sunyang Wu --- drivers/net/bonding/rte_eth_bond_pmd.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 91bf2c2345..f69496feec 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2783,6 +2783,7 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *dev) { struct bond_dev_private *internals = dev->data->dev_private; uint16_t port_id = internals->current_primary_port; + int ret; switch (internals->mode) { case BONDING_MODE_ROUND_ROBIN: @@ -2802,10 +2803,19 @@ bond_ethdev_promiscuous_update(struct rte_eth_dev *dev) * mode should be set to new primary member according to bonding * device. */ - if (rte_eth_promiscuous_get(internals->port_id) == 1) - rte_eth_promiscuous_enable(port_id); - else - rte_eth_promiscuous_disable(port_id); + if (rte_eth_promiscuous_get(internals->port_id) == 1) { + ret = rte_eth_promiscuous_enable(port_id); + if (ret != 0) + RTE_BOND_LOG(ERR, + "Failed to enable promiscuous mode for port %u: %s", + port_id, rte_strerror(-ret)); + } else { + ret = rte_eth_promiscuous_disable(port_id); + if (ret != 0) + RTE_BOND_LOG(ERR, + "Failed to disable promiscuous mode for port %u: %s", + port_id, rte_strerror(-ret)); + } } return 0; -- 2.19.0.rc0.windows.1