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 9EC92426BB; Thu, 5 Oct 2023 04:40:42 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D603402E0; Thu, 5 Oct 2023 04:40:39 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2117.outbound.protection.outlook.com [40.107.93.117]) by mails.dpdk.org (Postfix) with ESMTP id 564CA402D8 for ; Thu, 5 Oct 2023 04:40:38 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Jf8nvXRi7MJ3VXLTtBSpjlPC2mXduURD0KkCGwnlYgf4Pls3UhPWUFkMnyX+cjAf4uXrbGvOqLntJ2HjpkX2dEktpNH5RYXYTy7+W3v7cJSbPrUe+E8HMBgx1vhxnRuXGQ+cXD6cad6i5tX/O/V9CeX4+fWaq0ZPQ8ABEGVg5aNJmPp8Ika0J3Wi7rRDdt+E4oX61t0a3jitOgsESC/Dmm73igBA7YS9psNn6wHg0dMw3ceZs3IAFBoeNl+pcHJnsSb9J1kV39NaachdWufg7LjX13065AVr0gdi/Mm62gVH1cC3t1XUXFkJ5gfGBLQEt0QsLYUC/Isf1tbT1UuWRw== 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=arCrKiX9xZ1wWCIGFUz1LLdfF0MkWh4r3KUqX+B5jHc=; b=ET3VOy0DyQd0RzXvKlW97T7hrGihEPHZNELkWjVP6PL+cI4T7aZ+MrlN+V18NuXO9PLXTUGEcqaPu+LwtBy1ievSA3sWEUfYp7b78KUA2YtvW/jt13QEOdzCmDYTqHs1W9p4F5dPLY+EhA88tLyMBz/LiPqZqZ+rJdr13sCkAYmhSGsbVY6Tuwpwh5BWbeTvjL/OpD/no6Ccj3zWAq+VQTCYf7/11FhNPDqMA8Q73mHOfNq9WQBpXq/A4pfs/GEiHiVm6pqhhtOcvJ2l2VLx8jRIYpZNtHLzmQx4r5F0/ri5Xbm/pWG9aqcEZ0QxSW1FAt+YeQbfjIV16yX6sF2pew== 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=arCrKiX9xZ1wWCIGFUz1LLdfF0MkWh4r3KUqX+B5jHc=; b=udtIQECR8j6XE5mhc8YZuK3vzyQqN6xM2dTnxBwDgfymxN8DExOGOsYiBt3tdR8EcB27+qWL7GUHU5TruA20DLHNorFnWf/x5pPNIg0pxU5ijkbzwCVmykwXIOxHqk/gjkcWUx0dboUDfIGGhElDZuKlakBGTK1etwx2K2QxVJA= 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 BN0PR13MB4679.namprd13.prod.outlook.com (2603:10b6:408:125::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.34; Thu, 5 Oct 2023 02:40:36 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::28c0:63e2:ecd1:9314%4]) with mapi id 15.20.6813.027; Thu, 5 Oct 2023 02:40:36 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He Subject: [PATCH 1/8] ethdev: add member notification for bonding port Date: Thu, 5 Oct 2023 10:40:05 +0800 Message-Id: <20231005024012.1279810-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231005024012.1279810-1-chaoyong.he@corigine.com> References: <20231005024012.1279810-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH0PR07CA0064.namprd07.prod.outlook.com (2603:10b6:510:f::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|BN0PR13MB4679:EE_ X-MS-Office365-Filtering-Correlation-Id: db55fde1-4523-46fb-c036-08dbc54c7415 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ci5QB6fVjePbjkoWes8h3y4KzChLeQjW3bc9ULslJfwIaU1OK2YKYRMzirXcKXFBo3pcjFnqwPSWYvrYnOcUnudr+a2KXExiiQi+n0Fn8aaGjjNlSAv8hXPYyrNEndJgRWaIEzmtMzO41i/8BGx4R0TOy19G7AcQwHkwC+PHX1ldqMBsUxbxkFhhCA2VYbX4Me42B32brqxt+KYcmrr9emGEL5t0bfkIKOthrVsO/ro4wnyT2rcB0MDHfBQkbs071f4hc6CCUsPujIOTpclyll28YQ6eePZPU2kLVljy2i8WdnZRHg/DNRYYmPsncCAfFqmktfUkZEPVxdzEEfOABQlOOAjvMY6hgc789saJ82cegD8TtXkp0Zb7lPADxdxxntkFw6RkHaCXWcqTus6iWKVadCfeJ+RBNq2CpXnEZAih0XUrk+U9jv2H5SAb2XEE/gQAdojlX1Ct18iVYKzsjla/Y9O0azxp0TtkzUGumrj+D2Fozclt9BkG+SqmFr5gxvvXTOhgpF9g2Ssxl3jKgDXYgMlZcmkyXFtMpZUzoflnu5D/UXAY02qTx0exmsMlQbkQVH+OSwcPELSqN8k+OiI+vfI9qUBIaShveWnlNP8d5gJZhe9sB3AwQxEOAWnKoEDmuDOviwXz//zXCoxYPpsOi2ptJZsa+grUcyffQ0I= 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:(13230031)(346002)(39830400003)(136003)(396003)(376002)(366004)(230922051799003)(64100799003)(1800799009)(451199024)(186009)(52116002)(6506007)(2616005)(6512007)(107886003)(6486002)(36756003)(86362001)(38350700002)(38100700002)(30864003)(2906002)(6916009)(26005)(15650500001)(478600001)(83380400001)(6666004)(1076003)(54906003)(8676002)(316002)(8936002)(41300700001)(66556008)(66946007)(4326008)(5660300002)(44832011)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?t28kTnAD/7tOYNaC2tJuQd+/onwMbgR+U4F3meLDi6xK2DhNn2mk7cMtvlXe?= =?us-ascii?Q?N3PWYmL9PpqYx1epKF+vN6qyhFw6vHEWonmDdCWBNHtsxK1jwfayNl/Y0Wbw?= =?us-ascii?Q?THnHIikfv8ppdB0tJlMsWV2P4o44Rc5HJRoP/UN0MTB/dzFw4aaBCONFrKl8?= =?us-ascii?Q?83JPqkZDKD3HYqQecz2MMB+TYNO+O+ERUqdNES5SCcAoYn/jcWHw/CzjUYWQ?= =?us-ascii?Q?v2n5HUz+pm1E4c/I4u6zcV3hoqQVAxizX4RdWgQQG3a+1DBrndq4vI/ACdw3?= =?us-ascii?Q?/3kFX8fnBFj8qfOBcf6QOV1KXuY8s6BFpOImB/QKFOZb0YRR9Ur7czZNFaOi?= =?us-ascii?Q?3I6mQCZ5aXaWf3tf/I6t8T7AY9+f23T3B28ZyQFWKs8VfsYNEX02Bnf86+O5?= =?us-ascii?Q?O55WZKGamxMaxQHJ9aCVeayYJW6T3NnauThBm1fzZymKjiUQXYaxy8+d/n+W?= =?us-ascii?Q?6hZ/oOBRMi0Jw6b2Y3IiXa7tCynHlEQe3m1q9XqRPdGzY2xViiuiBnHhiSsw?= =?us-ascii?Q?9Ym03zFTmt7zPdwfpm7jPP2sUByPJrK+sf82MSuuwaBqnjS6G8wMw5Qd6x59?= =?us-ascii?Q?/VNpDycl2sbVhX2//qYHd9rJkYPzi1Tj8S9dhi6ddnq5a2kDN6+cV1wwUXJo?= =?us-ascii?Q?m7sP6QWeR6IIP4KQ7yBychoE4jqpRhzUiza1sKImMsWaNKHfG1DqGqoHU/u/?= =?us-ascii?Q?AFN6NAD+xHInS4BysDsiBJ+RX5L7eChhVN/OBvT3jM/WRwkJ//fbmTWON5ZK?= =?us-ascii?Q?OfbjXWCqjdprrq5JqAj3d3/ADXnl4DHtQlOIkweQMijGD/tjPEBGSB+UmDXf?= =?us-ascii?Q?7q49ba4EcI1KGuw/X96LPJw3Uia2ib/dLF+BFsk158kZPZLAWF961SFK6Oy0?= =?us-ascii?Q?NmVMaM5XCheVmXIAhQm3kr1/D2sdLiYmEftlA7qw83rrn309o6YAXIMDT41V?= =?us-ascii?Q?2Ji38/CtSgFHpvfL14VQGGzwi3I5bH8pM/tJ+bivr8i1k85tJV1+W0qZ4liX?= =?us-ascii?Q?8A1/mPCDIt1bhaCI1lbU8dQH8jmmmr/bS3Nyb5NsHc/lH+zrHIRl6/bkslg2?= =?us-ascii?Q?a8dEkFTCm6CfapR42pA5tr5of3hD+UqzD99JB96TYDY3x+KysO/4nPupsLeQ?= =?us-ascii?Q?ZgxjsZwKNnWYvym1DM2O9Y03VuAmsaJjtfG25wH2rHKPxoqh1ixHBTo6mvI1?= =?us-ascii?Q?W2p8V4o1SWueXxcZ7tnCYUP54qiAKY3oMf3+yMm0RkP9BMMarUlpXfCAb8KJ?= =?us-ascii?Q?Hl5+GWKDGSFDmSkof/13hqodEhzpFWM2XJXjP8cxRgcIrOk+SuOngDKiU9SO?= =?us-ascii?Q?nW70cFCNWnqsilcHevzJoQAZ7esslGSzCgnwknrEshXcLxphdmHf344y3dfy?= =?us-ascii?Q?J6VXkOHA/yssGP24TWsflr9OkFwhKdsfWhnAsdAFIEo71xRRkUm38rQJYdQh?= =?us-ascii?Q?wCGr5WCU94hjRWcKJ05GQq5JcFfMTt2BewNnaFK55bxswGkEkSxgkwq+iFxw?= =?us-ascii?Q?CyuYt9Yxf7mUWv4tOtlMcUu5I4mSsL17IqTnAP+SJk9L4bKzuRrXsxspteIj?= =?us-ascii?Q?5CWS8mYOICwyrHu/j5ck5yIMcq3xVCu72FXWumh7vzXRh0JaRINYaaxYiVoD?= =?us-ascii?Q?FA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: db55fde1-4523-46fb-c036-08dbc54c7415 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2023 02:40:36.1862 (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: LS0BBml06hXEEOzn+P4T3HK3SB2vsIMqY5C0FGoK5yQf/RlM4pz9Tw9s8JVHmlRV7gEvsD0wFRGZ2qPDCMd2jaPLXwcw/TKl8qpGCLuVecg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR13MB4679 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: Long Wu Bonding PMD does not let member ports know the bonding port's information, like how many member ports the bonding port has, what mode the bonding port is in and so on. Add the notification interface for bonding port to let member port know it is added to a bonding port and what the bonding port's configuration is. If so the member ports have chance to achieve its bond-flow-offlod or other private bonding functions. Signed-off-by: Long Wu Reviewed-by: James Hershaw Reviewed-by: Chaoyong He --- drivers/net/bonding/eth_bond_private.h | 2 + drivers/net/bonding/rte_eth_bond.h | 46 ++++++++++++++++ drivers/net/bonding/rte_eth_bond_api.c | 73 ++++++++++++++++++++++++++ drivers/net/bonding/rte_eth_bond_pmd.c | 27 ++++++++-- drivers/net/bonding/version.map | 3 ++ lib/ethdev/ethdev_driver.h | 18 +++++++ 6 files changed, 166 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index e688894210..1344f8c002 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -186,6 +186,8 @@ struct bond_dev_private { void *vlan_filter_bmpmem; /* enabled vlan filter bitmap */ struct rte_bitmap *vlan_filter_bmp; + + bool notify_member; /**< Enable member notification of bonding port. */ }; extern const struct eth_dev_ops default_dev_ops; diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index f10165f2c6..737beca446 100644 --- a/drivers/net/bonding/rte_eth_bond.h +++ b/drivers/net/bonding/rte_eth_bond.h @@ -351,6 +351,52 @@ rte_eth_bond_link_up_prop_delay_set(uint16_t bonding_port_id, int rte_eth_bond_link_up_prop_delay_get(uint16_t bonding_port_id); +/** + * Set the flag of whether bonding port notifies member ports. + * + * @param bonding_port_id + * Port ID of bonding device. + * @param notify_member + * Flag of whether bonding port notifies member ports. + * + * @return + * 0 on success, negative value otherwise. + */ +__rte_experimental +int +rte_eth_bond_notify_member_flag_set(uint16_t bonding_port_id, bool notify_member); + +/** + * Get the flag of whether bonding port notifies member ports. + * + * @param bonding_port_id + * Port ID of bonding device. + * @param notify_member + * Flag of whether bonding port notifies member ports. + * + * @return + * 0 on success, negative value otherwise. + */ +__rte_experimental +int +rte_eth_bond_notify_member_flag_get(uint16_t bonding_port_id, bool *notify_member); + +/** + * Notify the member ports of bonding port's information. + * + * This interface is called in the following functions: + * - bond_ethdev_lsc_event_callback() + * - bond_ethdev_configure() + * + * @param bonding_port_id + * Port ID of bonding device. + * + * @return + * 0 on success, negative value otherwise. + */ +__rte_experimental +int +rte_eth_bond_notify_members(uint16_t bonding_port_id); #ifdef __cplusplus } diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 99e496556a..48c1d050fd 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -627,6 +627,17 @@ __eth_bond_member_add_lock_free(uint16_t bonding_port_id, uint16_t member_port_i member_vlan_filter_set(bonding_port_id, member_port_id); + if (internals->notify_member && + *member_eth_dev->dev_ops->bond_notify_member != NULL) { + ret = member_eth_dev->dev_ops->bond_notify_member(member_eth_dev, + bonding_eth_dev); + if (ret < 0) { + RTE_BOND_LOG(ERR, "Add member (port %u) notify failed!", + member_port_id); + return -1; + } + } + return 0; } @@ -733,6 +744,10 @@ __eth_bond_member_remove_lock_free(uint16_t bonding_port_id, member_eth_dev = &rte_eth_devices[member_port_id]; member_remove(internals, member_eth_dev); member_eth_dev->data->dev_flags &= (~RTE_ETH_DEV_BONDING_MEMBER); + if (internals->notify_member && + *member_eth_dev->dev_ops->bond_notify_member != NULL) + member_eth_dev->dev_ops->bond_notify_member(member_eth_dev, + bonding_eth_dev); /* first member in the active list will be the primary by default, * otherwise use first device in list */ @@ -1098,3 +1113,61 @@ rte_eth_bond_link_up_prop_delay_get(uint16_t bonding_port_id) return internals->link_up_delay_ms; } + +int +rte_eth_bond_notify_member_flag_set(uint16_t bonding_port_id, bool notify_member) +{ + struct bond_dev_private *internals; + + if (valid_bonding_port_id(bonding_port_id) != 0) + return -EINVAL; + + internals = rte_eth_devices[bonding_port_id].data->dev_private; + + internals->notify_member = notify_member; + + return 0; +} + +int +rte_eth_bond_notify_member_flag_get(uint16_t bonding_port_id, bool *notify_member) +{ + struct bond_dev_private *internals; + + if (valid_bonding_port_id(bonding_port_id) != 0) + return -EINVAL; + + internals = rte_eth_devices[bonding_port_id].data->dev_private; + + *notify_member = internals->notify_member; + + return 0; +} + +int +rte_eth_bond_notify_members(uint16_t bonding_port_id) +{ + uint32_t i; + uint16_t member_port_id; + struct rte_eth_dev *bond_dev; + struct bond_dev_private *internals; + struct rte_eth_dev *member_dev[RTE_MAX_ETHPORTS]; + + if (valid_bonding_port_id(bonding_port_id) != 0) + return -EINVAL; + + bond_dev = &rte_eth_devices[bonding_port_id]; + internals = bond_dev->data->dev_private; + + for (i = 0; i < internals->member_count; i++) { + member_port_id = internals->members[i].port_id; + member_dev[i] = &rte_eth_devices[member_port_id]; + if (*member_dev[i]->dev_ops->bond_notify_member == NULL) + return -ENOTSUP; + } + + for (i = 0; i < internals->member_count; i++) + member_dev[i]->dev_ops->bond_notify_member(member_dev[i], bond_dev); + + return 0; +} diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 122b1187fd..b99b8b8938 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2968,11 +2968,13 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, int valid_member = 0; uint16_t active_pos, member_idx; uint16_t i; + uint16_t bonding_port_id; if (type != RTE_ETH_EVENT_INTR_LSC || param == NULL) return rc; - bonding_eth_dev = &rte_eth_devices[*(uint16_t *)param]; + bonding_port_id = *(uint16_t *)param; + bonding_eth_dev = &rte_eth_devices[bonding_port_id]; if (check_for_bonding_ethdev(bonding_eth_dev)) return rc; @@ -3044,8 +3046,10 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, * using it. */ if (internals->user_defined_primary_port && - internals->primary_port == port_id) + internals->primary_port == port_id) { bond_ethdev_primary_set(internals, port_id); + rte_eth_bond_notify_members(bonding_port_id); + } } else { if (active_pos == internals->active_member_count) goto link_update; @@ -3064,6 +3068,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type, internals->active_members[0]); else internals->current_primary_port = internals->primary_port; + rte_eth_bond_notify_members(bonding_port_id); mac_address_members_update(bonding_eth_dev); bond_ethdev_promiscuous_update(bonding_eth_dev); bond_ethdev_allmulticast_update(bonding_eth_dev); @@ -3362,6 +3367,7 @@ dump_basic(const struct rte_eth_dev *dev, FILE *f) struct bond_dev_private instant_priv; const struct bond_dev_private *internals = &instant_priv; int mode, i; + bool notify_member; /* Obtain a instance of dev_private to prevent data from being modified. */ memcpy(&instant_priv, dev->data->dev_private, sizeof(struct bond_dev_private)); @@ -3431,6 +3437,13 @@ dump_basic(const struct rte_eth_dev *dev, FILE *f) fprintf(f, "\tUser Defined Primary: [%u]\n", internals->primary_port); if (internals->member_count > 0) fprintf(f, "\tCurrent Primary: [%u]\n", internals->current_primary_port); + + if (rte_eth_bond_notify_member_flag_get(internals->port_id, ¬ify_member) == 0) + fprintf(f, "\tNotify Member Ports Flag: %s\n", + notify_member ? "enable" : "disable"); + else + fprintf(f, "\tFailed to get notify member ports flag for bonding port %d\n", + internals->port_id); } static void @@ -3983,8 +3996,12 @@ bond_ethdev_configure(struct rte_eth_dev *dev) * if no kvlist, it means that this bonding device has been created * through the bonding api. */ - if (!kvlist || internals->kvargs_processing_is_done) + if (!kvlist || internals->kvargs_processing_is_done) { + if (internals->notify_member && rte_eth_bond_notify_members(port_id) != 0) + RTE_BOND_LOG(ERR, "Notify member ports failed"); + return 0; + } internals->kvargs_processing_is_done = true; @@ -4222,6 +4239,10 @@ bond_ethdev_configure(struct rte_eth_dev *dev) return -1; } } + + if (internals->notify_member && rte_eth_bond_notify_members(port_id) != 0) + RTE_BOND_LOG(ERR, "Notify member ports failed"); + return 0; } diff --git a/drivers/net/bonding/version.map b/drivers/net/bonding/version.map index 09ee21c55f..3bd5e8ad11 100644 --- a/drivers/net/bonding/version.map +++ b/drivers/net/bonding/version.map @@ -35,4 +35,7 @@ EXPERIMENTAL { rte_eth_bond_member_add; rte_eth_bond_member_remove; rte_eth_bond_members_get; + rte_eth_bond_notify_member_flag_get; + rte_eth_bond_notify_member_flag_set; + rte_eth_bond_notify_members; }; diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index 980f837ab6..5e73579f22 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -1206,6 +1206,21 @@ typedef int (*eth_count_aggr_ports_t)(struct rte_eth_dev *dev); typedef int (*eth_map_aggr_tx_affinity_t)(struct rte_eth_dev *dev, uint16_t tx_queue_id, uint8_t affinity); +/** + * @internal + * Bonding port notifies the member ports. + * + * @param dev + * Member port (ethdev) handle. + * @param bonding_dev + * Bonding port (ethdev) handle. + * + * @return + * Negative on error, 0 on success. + */ +typedef int (*eth_bond_notify_member)(struct rte_eth_dev *dev, + struct rte_eth_dev *bonding_dev); + /** * @internal A structure containing the functions exported by an Ethernet driver. */ @@ -1443,6 +1458,9 @@ struct eth_dev_ops { eth_count_aggr_ports_t count_aggr_ports; /** Map a Tx queue with an aggregated port of the DPDK port */ eth_map_aggr_tx_affinity_t map_aggr_tx_affinity; + + /** Notify the member port of bonding port information */ + eth_bond_notify_member bond_notify_member; }; /** -- 2.39.1