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 51A1E43795; Tue, 26 Dec 2023 08:28:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2317F402DA; Tue, 26 Dec 2023 08:28:49 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2099.outbound.protection.outlook.com [40.107.212.99]) by mails.dpdk.org (Postfix) with ESMTP id 72BE140298 for ; Tue, 26 Dec 2023 08:28:46 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GQXQqMD9MK2y/kgyS1wM0xi6gH8h+zXKeN7EG2hco41pbWQxLOkE8+2S2fY0jz9544PxrCgGTeNejnuofqUIkoE6rjpnRsKzbPAgl7hmaVkbI9oCvK0ArbIoOeA6ocaZk9bDm3vNBZcwNIkXvmeLtAPP8Zh5/W7OXj8WDTwBfBBYO46E18SFkaKnE0e6qxi/aoC/vMmgK1D4w31WF+4rFQlFReJlrLs4zaHdNzYT4jO4dpJziWcthwvTXyM8aYSB87KHgSRA/qUKhFlgsfp8s9u+44YR3u2sSgEvP3y6Tr9BENY9Qic+e+R/UTyeyT2p/wBiJr7yNNMI/NA26XO+ug== 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=Mki8yuQ1A6hfXtD4gf047/YcoqBl3GGixpXXPAf5ZWU=; b=lr6KXdUeg0NHDlGSzT7b6fyd7mRaMPauLaPp0eCRUr/Jg6eViVrtAetYeu8r1C3Y6HschAaeq7LCP4PkuW4DSzYQeYUHbX/NLmPf6gYu94ScMwBgytmvFLYNyradybSW/7QNs3QDqL2Gjxw55ohJTnMBQGE4KocPVmjv9IrZ6TnLbpFSjJlFfDNB7BcGUw3ZBg4fVafyc9VGW9ZR8oXCRris+l1qVagnr6qJT+BawhRgxcI8zsk/g0NdaHRX/oX29fPTrWAEi9BC4yfuGXx0ISvBro4KwN4LxU3pZF6vNG3dOXfNQoR0Ha1Bc3neCTrAjJGJaR0WG26DB46PopQ+2A== 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=Mki8yuQ1A6hfXtD4gf047/YcoqBl3GGixpXXPAf5ZWU=; b=tASH05CnI9lq1TXzTyjsPFu7lnwEP28ihuLgnc7/YDCjvNe+Fgmu8JkTf0axkqw6KX+wcL2NwatEZfIn/pk/Oyg/tWp13CmyuRkouGMedavdz13xnoCdqdJWL1u6UVS8Wk+fsFDlcQ/tMZKQyiiWWy+VHqI8nbC9lKKiP0nnawE= 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 CH3PR13MB6506.namprd13.prod.outlook.com (2603:10b6:610:1a3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.27; Tue, 26 Dec 2023 07:28:44 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::45b3:d83c:cff2:4a1b%6]) with mapi id 15.20.7113.027; Tue, 26 Dec 2023 07:28:44 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , James Hershaw , Chaoyong He , Peng Zhang Subject: [PATCH v6 01/14] ethdev: add member notification for bonding port Date: Tue, 26 Dec 2023 15:28:11 +0800 Message-Id: <20231226072824.3163121-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226072824.3163121-1-chaoyong.he@corigine.com> References: <20231226023745.3144143-1-chaoyong.he@corigine.com> <20231226072824.3163121-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SJ0PR03CA0239.namprd03.prod.outlook.com (2603:10b6:a03:39f::34) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|CH3PR13MB6506:EE_ X-MS-Office365-Filtering-Correlation-Id: e706ad6c-eb8a-476e-c4fd-08dc05e44ac6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JfVTyd3oxZgj1K6rmz2jCt3qzA4U2rkdqMF9td+OT0j+lHk7wl6IsL1K7YNc/LtIpnuiDT3NuSvbSXn1dsifmmq2y6HH3fqBfIydOjDpKNURr48O1d6n3/ej8Ke0peZYP54La+uC7SR2dN+GJKzQgzQfOqVT09O19j4bAGqenWg4srGlAE3PCOpWRF0Wc4Aq9IQOxzz+DJB9Q41t0zWpTnJI7IOwSjIQ+ITkfRIgDvk2VLfJsbS1dar5kJK1E6GCyse1cQIO9qgv8qRaEhdoVtf9OXczWOAu1tqWZoPujx/9wZujqDbKz/FdeHKNtT5bLROaMzawxDn6apFgksvnq1BeUcZ2v31rPXHB3GI4NPkoxJXdoX69ug0+v2qEwARYaW77QvPdGJJNYACmGBBN6//Kbe+1OoACXJXaoY93baEuxeYVKpPbYE9UKptTUN3haYOfqamR3xS/LyqTes1Qq4KChapo2T7HFFFBkHnapNUYsfszA5TXRHIY4qGcWY+3mTbLy6rHl2IyIHabXo5ctXXcuEeztIN+a0Ohgn4yGKnp0RpSLqOmiqJ48C+W2kZW5MxI/Hct/u8G2fLGGrxWOdQjpYnGNDPYHgtJ32SJSNIAqb4EqJBRFFZBiVtQTuLQ8RoRiN1TooZB+U+Ft2C98gZa6dechKqLAJiDm4VYui8= 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)(376002)(346002)(136003)(396003)(366004)(39840400004)(230922051799003)(451199024)(186009)(64100799003)(1800799012)(107886003)(26005)(1076003)(52116002)(6666004)(2616005)(6512007)(83380400001)(5660300002)(44832011)(15650500001)(4326008)(8676002)(41300700001)(2906002)(30864003)(8936002)(6486002)(478600001)(316002)(6916009)(54906003)(66476007)(66556008)(66946007)(6506007)(86362001)(36756003)(38100700002)(38350700005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?epjpbDQpvfDwC5yK4uvaKu5WY5bzsFxolUk9K+orSGZpsAaiNpy2yr7s722X?= =?us-ascii?Q?abvFXZu71u/ArZQvrwHjUXbTbvQU57zfK4yJVup4MsZkBnEAIMlZ/FEP8FZt?= =?us-ascii?Q?A2VcIH1h6UKeiTbofztOdbzvbuTafRTI+z85UJRFt5j6Zpf0ya1tJ6gpl8jI?= =?us-ascii?Q?D36cQ1gWNmqcpuRIxiLt6A53XPwP6MWxaziyWjTtzICi8nOv37XOuJgRzDm2?= =?us-ascii?Q?XC+UrbEQWeayZ7BZ1f6UjWF5q929FLtUUGVKN9irWFJdbyrsSda0MMlH7JY5?= =?us-ascii?Q?A92RaypqsQ2JKUIwrCT0XtFx1E4QKYQTgdFJ5YviudLdjwfkkwvEa490r9AC?= =?us-ascii?Q?FkH2trGqot2f4Sumcd+s4aXM/14HkT7JJRtzJBN1Rtrz2J/ZeH518jAFvQAI?= =?us-ascii?Q?5SrHDUDHWCbZOZzDe/VPM30ZJ9wtIDXYMUBWFDD/7tkPgu3sfi4ryfItfpOs?= =?us-ascii?Q?+HgTngCfYYqBNFxXhqqBwwy3nyh4gakMQGRJp652ufPf3p1GDvS6UQk8O1hG?= =?us-ascii?Q?YOZNUx5BTPBBYvvia8QJ74f0tJK1TDFrluPHzVCbxOt/xe8+HzaS6lnuAy8/?= =?us-ascii?Q?k3QbAdMay8GH2+cOdfzFeKU/pvx5smKUhab0HAXpXZrwetsxUyj+dq+TvxdT?= =?us-ascii?Q?ruahcWC0PmP+sVsudz1lpWMe8kGDapCFK8swgyGDdx+9PV1PfHn8m3v+v/mf?= =?us-ascii?Q?BRQuUUvdPrVJAdRjJ7kkY7QKq4XDa8/PyUDgWCn67a22mP+xBHG82pKOqMlX?= =?us-ascii?Q?IpJW5DWmz7oVnevQR5PfgBbrt29I4hPuXcqAgRFCixCgJP9d4XLmpSrE9HrY?= =?us-ascii?Q?QJ028LXdxZbdp3CUAIQ6MzqJk+BvXinTJFvYngigFpeDfTqD/lP+QmZs0mmG?= =?us-ascii?Q?Jys6ux2dZFUtObucVjO3EnavXeoRoEqniwQWQsvEpSKNLnII8zq8iSTOiC41?= =?us-ascii?Q?KpI8rfnpw4JgIo4HbnGYogjk7DKi2FXCytIEX4oPfe8EfZC0PfEZvAOiAszl?= =?us-ascii?Q?BR2qAJLLkSoX0hkVPvjy4ebLhUY6512h2pJIJYxwudBWYAG/LX6Bextl2Slr?= =?us-ascii?Q?sWt4p5NKpj4tKq09I4A5KlMJcSBBaIqwHTYqaCnvc+6bbglrqiRavotLcDhP?= =?us-ascii?Q?vM6h3vZrrjeMRn3p43IUZsVAGFObhMYmLNRlUF6zZxecwatd90N879aNLf3s?= =?us-ascii?Q?LcPdCWbVs8alqwCarxB3ivd+Kj1mgv90Z92QqCrmm3eXp4QowDs+4Dbc6MIg?= =?us-ascii?Q?PJwbjkiPyqSB0+Gy5bZGhoFYokoObcVC9iMu7wHGP5dR5d9gPxtKQtJ6QHfu?= =?us-ascii?Q?i/3ii28DcsOhLzf79NlFHlFZb7kW7NPjjleQf2sWs2ne94lH5dkBBAfvuoSH?= =?us-ascii?Q?oTVduo78cw+s/HoKDmu/J99ARqX4+/9NX7V3SNuKkg4SPR5rjkcZOhECnqzC?= =?us-ascii?Q?anwefkG4kn60aYWyCrDB0zYCacIsUFEWkpBhSqD+75woJa+giW8SUsYEBkhc?= =?us-ascii?Q?H9swgTH0ul7LGTdh5KCdnzSjdMrL81sCNum2QFoZjSM0EakPwDwdG0AJP6Y2?= =?us-ascii?Q?7Z1eCQ0ZIgb29YQpM1dd46WFJPVXCSp/2s38uhqPsu+EynDbQSJd7FnO+wAb?= =?us-ascii?Q?Qg=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: e706ad6c-eb8a-476e-c4fd-08dc05e44ac6 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 07:28:44.7718 (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: T1PtFJTmVv8Q8uwSyie7zQM3oS0eT5jp9Si1drj5RRmhxIdEIBn8qIGKtg/XWTPtxq4BS10v8gESJurKb/te+sm00COvxkQbHsrM8fQoW/U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR13MB6506 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 offload bond-flow that its destination port is a bonding port. Signed-off-by: Long Wu Reviewed-by: James Hershaw Reviewed-by: Chaoyong He Reviewed-by: Peng Zhang --- drivers/net/bonding/eth_bond_private.h | 1 + drivers/net/bonding/rte_eth_bond.h | 46 ++++++++++++++++ drivers/net/bonding/rte_eth_bond_api.c | 72 ++++++++++++++++++++++++++ drivers/net/bonding/rte_eth_bond_pmd.c | 32 ++++++++++-- drivers/net/bonding/version.map | 3 ++ lib/ethdev/ethdev_driver.h | 18 +++++++ 6 files changed, 169 insertions(+), 3 deletions(-) diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h index e688894210..f69e85c199 100644 --- a/drivers/net/bonding/eth_bond_private.h +++ b/drivers/net/bonding/eth_bond_private.h @@ -180,6 +180,7 @@ struct bond_dev_private { uint8_t member_update_idx; bool kvargs_processing_is_done; + bool notify_member; /**< Enable member notification of bonding port. */ uint32_t candidate_max_rx_pktlen; uint32_t max_rx_pktlen; diff --git a/drivers/net/bonding/rte_eth_bond.h b/drivers/net/bonding/rte_eth_bond.h index f10165f2c6..f6c773615c 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 + * 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); + +/** + * Get the flag of whether bonding port notifies member ports. + * + * @param bonding_port_id + * Port ID of bonding device. + * @param notify + * 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); + +/** + * 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..239f86ee92 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,60 @@ 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) +{ + 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; + + return 0; +} + +int +rte_eth_bond_notify_member_flag_get(uint16_t bonding_port_id, bool *notify) +{ + 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 = 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 rte_eth_dev *member_dev; + struct bond_dev_private *internals; + + 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 = &rte_eth_devices[member_port_id]; + /* Notify member port if it supports. */ + if (*member_dev->dev_ops->bond_notify_member != NULL) + member_dev->dev_ops->bond_notify_member(member_dev, + 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 c40d18d128..d2c890075a 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -2982,11 +2982,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; @@ -3058,8 +3060,12 @@ 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); + + if (internals->notify_member) + rte_eth_bond_notify_members(bonding_port_id); + } } else { if (active_pos == internals->active_member_count) goto link_update; @@ -3078,6 +3084,10 @@ 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; + + if (internals->notify_member) + 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); @@ -3376,6 +3386,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)); @@ -3445,6 +3456,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 @@ -3997,8 +4015,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; @@ -4236,6 +4258,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 b482cd12bb..39316a7a29 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -1216,6 +1216,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. */ @@ -1455,6 +1470,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