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 8742E4378F; Tue, 26 Dec 2023 03:39:47 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0CADA40A6F; Tue, 26 Dec 2023 03:38:38 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2100.outbound.protection.outlook.com [40.107.236.100]) by mails.dpdk.org (Postfix) with ESMTP id D319840A7F for ; Tue, 26 Dec 2023 03:38:35 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cXmcydAMY6S9I0QkCEBpVhfrTMLlE4xtj8H0wIHqpQEGRZG5cMipukjfUwGas6ILE4ZNIO5hwKtDyeEg19qRCRecNBouBaOuZ7uD3frxWTLhHxR1F+CZ0lNRh1FIS6BBSWQY4yPcIK3DQNyQ47It7umC4zbcivu3w35wMZ/dxuCVyKYP6FpmVEja8KWg6d4+HlL/41EneFeJaFw7BRCs0jVrJYptZlPcTs6q+Z33NlD52QunnHoGVNM0G1QBrYD1VhuNF0AyL1v5ZoaInKhPfg83yucUHNiboOAn5sc7noiZbxBZ01V2IilF71S0zKlZXY2uBP0cSKHOdNOAxjC+Wg== 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=0OwJHY3FYM0ExXAv8nWpYDzuMfFZ5Z5BJXA8xUHZHBY=; b=HXiRuMrWPuEqCSwmveACks6zXrrkdg0NmfVjhyvYsN+SMlevVPDW4DEC1Vnb+U8U55EH92/iKtmRuxEI4egCZhFYbEgOsNAOHfM7BPEY6OG5BTvfm/R9wFYJFksTc6TOKVsiE/snQp5hpxvtoIqvRoVSN40u8SssSM/fffaAE77cMbB5CGjjag7DUddjEOY4Rvv19eGcvQJJDLn2dP+Pvw9CPR6V1Y1a/RApFY2h0obxT2srxkrukovvCbdRg8NF6rwhZK8sDj+YN1lBKUdGIjdbm4YVOXKlKbyx7/CR+MqgReJLpFZrHzjrEiOoL4DwOHGWJRBeCxQyUgCL+aqExg== 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=0OwJHY3FYM0ExXAv8nWpYDzuMfFZ5Z5BJXA8xUHZHBY=; b=o61X4IgOWaXkEcIdSNs9JcFL9fspP4CSerNHHT7lK/Fq0oYJkndPX/XmPClcy3jNf+2LSc+qv7OvfiaQOp/u+4ggvVfPdBX2Q5+HYBKCOpFPG1zi8juV7OpbPQ7jDLgll99qzpaqkpsKuokPvt4mMhQhlAB4X//AAwo6RqsIgjY= 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 MW4PR13MB5864.namprd13.prod.outlook.com (2603:10b6:303:1b7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.26; Tue, 26 Dec 2023 02:38:33 +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.026; Tue, 26 Dec 2023 02:38:33 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH v5 12/14] net/nfp: handle bond packets from firmware Date: Tue, 26 Dec 2023 10:37:43 +0800 Message-Id: <20231226023745.3144143-13-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20231226023745.3144143-1-chaoyong.he@corigine.com> References: <20231018074821.1908906-1-chaoyong.he@corigine.com> <20231226023745.3144143-1-chaoyong.he@corigine.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0156.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::36) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|MW4PR13MB5864:EE_ X-MS-Office365-Filtering-Correlation-Id: a9b741f4-c61c-4f8b-34c7-08dc05bbc0fc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: p4rZZ6spTkig+Ls5vbYuGyzz3V2raiDulMEeQ76zBWUPPz0YTV9MLKpmoUadhMwPEMYLzuQ/KxJt+N4BT3az1FlxbLPbBvtxQ+THz8F9MMw20fEApDqI7ADqORnxjAWSUOSR5irVaQlbuAGJPJzgY8k3jq+fP0prhVybELSlW+l63Q3n5FGqN5Q4+hp9yAqUVIwICKaHd9RmHIVNSdPZt4VyrHMtNQbbiqVlLUORN5AuJLmmXHCDBvfrOgWV2CkbweVPM9p2SD+9IEauBwn3WUN2W/7ybzaCVFN6b8mXYOOVdtQClW3FlAwUnsqDxwDFe1v0bz+eDztazr4A+i+ciXdlik/k4ti1/b0KtMpPMZkeJ1nmhZ0Qqg06D37Z6tpovBEzdz3EZKhRmiUbmu8g2vC8lPCHf0RTm6YT4KtvK5MJhw54WpJNmapTPFoeRL9zq1ut9QoLppG7aRGWiJNref/A7T6xd3yIiQVWWqwHRi80VubdThv8NmJpHtRqid19xWOekF9fL+b0VsKpwvxEctohAMLtZHmLShBkd01K7tT2n+cGFzGA13Xuy0hB4ckwLamT/Pw8WRMewl7KxBEsRB6YhI/ApYFmu59ocrOPse62nHBQ5edV0D0XMRkK9YOVWCJB/FhEK6PI5atv0c8B/GyBvPtxUI5z0EB/oANA3rM= 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)(39840400004)(376002)(396003)(366004)(136003)(346002)(230922051799003)(451199024)(1800799012)(64100799003)(186009)(66899024)(83380400001)(41300700001)(2616005)(38100700002)(26005)(107886003)(1076003)(316002)(4326008)(54906003)(8676002)(2906002)(5660300002)(44832011)(8936002)(478600001)(6512007)(6666004)(6506007)(52116002)(66476007)(66556008)(66946007)(6486002)(6916009)(38350700005)(86362001)(36756003); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hEACxwek2e3Uliuj31JhvBB/j4hH2DyppDD8sczexPFUGZiZ3U98rLUHJo3E?= =?us-ascii?Q?5IdekHbdyUjJtriDsZORAYHVzAlmHkWG30ohXHrkQ6lWr1neIXwzDjA6vfVT?= =?us-ascii?Q?6WW9QZZ3eGMndmdmiKeeSWZW0xv+XZffhnXUjiUSHqn0wXHpjN1rC2YGKi5H?= =?us-ascii?Q?Rude5h2orWErynQbPNg9SiTofcKoWnGGCR/QMJ7+YmbFcHQubSbYP9T3Byi6?= =?us-ascii?Q?ZqRIn2r1mo50q6OQ0t48Ycakqu8zHfFvwP5I7h1iR1hY2L3Pm7i91JM3/7NV?= =?us-ascii?Q?bcvcVAfAGTuKsNNUqqbZT1awpbjUrmDOxRmstiiIpkLKiYLGjCQ7i8VgXPRs?= =?us-ascii?Q?Vac8zlHDQNhqxz5VeMStVhO/V1PVu60vPpoK1gTc1aRpn2CEkfqlF/uqJGfW?= =?us-ascii?Q?inyivL7FI+l9NvA/+rZ3xl2k9Hc9c+7OAPcP41TfDCbdFeZjo2lLGbuxZA2H?= =?us-ascii?Q?2x5a3nSto1pTQi8i8FS1uAQ0dwqn709lAnmMjAPoXvb0SxFM45uezzGfz18i?= =?us-ascii?Q?i3bkygOtt/8HytD8+UJCc9raqBmdwFKNPNSW5lD9+y/1FZEVG50XcMmdtQJD?= =?us-ascii?Q?yv4UTmz6/666VBo0j5HZQA//jT7WAL+HJ2/HN9QG2ucQezKuvF8SOrY1l0+A?= =?us-ascii?Q?NLwbHLm2H1tYu+w0oLEwXSekaK45+3mHAfEiSERG7PNoXrAes22W2C+FUfAS?= =?us-ascii?Q?K7B11TAXzVVCKEddK8UF+krh7+6h/IYOkYKD3hznZMv/t6u8cQzQNdiLu5ox?= =?us-ascii?Q?mLmGxwkJPvrcVBBqmv/RG8A85tpQmUt0BohdETDSTAbAwCGMjxl8xF+pIznN?= =?us-ascii?Q?RGfyM0tDlcq8k4UMM1O6Eo0e/R4uoFyQ9KtPEv9fWU9et+mvqnPuIk2xlRs8?= =?us-ascii?Q?gTWWNdYTUVDkhNDzL5xWFDoiTsakmiWrL2hZFNwNhMK0krOurkknQxiCWLhQ?= =?us-ascii?Q?na3d/EblkJEBRhWu/FZKysDS368glh+4SWNSo1B8yEMby0hfAUrfJBMXo/aR?= =?us-ascii?Q?p1j1OcXSH5H0tCQHv7TLYhvmtAi+N92CSRWa7LHLjvYaZEjvSAkv6AZDrIp2?= =?us-ascii?Q?Lt95FC+ox2aethLK4KeCd2P0n4SmPMqSuRDLUkCN+9tWXSya8hgPBxI96Qjg?= =?us-ascii?Q?BwhBJeIYGB9nLT+U7JZ4XWpE6UByeeZ885IRfawwNow0Ni35o8x9QH1VLG9L?= =?us-ascii?Q?VSQtf9Xlgry+XTiDnvMcg91KPoafW+6iAiooP32u17Ofe1q23S442A0l3ZXz?= =?us-ascii?Q?WScDQMlG3cu1yBB0tI0f8JD0TmuInHbwbUyiFEwtBg87R3Qfjf6Eg2jz6pAU?= =?us-ascii?Q?5+cvdWtYUONtnnYulltgZDk9jRjK7UDCCEzqVJ/M8TwikP6Hp1gaLj7Ln0/C?= =?us-ascii?Q?8bpnquVczG7419hSfeBO1yLBlBhXkrfGidoAe0dWi0nzqdp/gs4I5j5GVOfp?= =?us-ascii?Q?Kkyww3yvacFJknzPNDIEkOzgZ9ZLghqfvVW/gdx9akol7AeAVx+2c/VcjWvA?= =?us-ascii?Q?bXAGxL+nf39/lUPooytHLK+rfJQOscDfF88lmA0auwMo5tdVbCvGnpE3uBbZ?= =?us-ascii?Q?J60yUdjUZMNBsw8IsF2N0yg8s2cZXNN9R8fWAPTY+QZ8+hBOajtN0meYsp+Y?= =?us-ascii?Q?+g=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9b741f4-c61c-4f8b-34c7-08dc05bbc0fc X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2023 02:38:33.6272 (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: M50KVsCm+kPetmrfe/Sh7hcPrdN5LIBJdXYaUXvZ3KhQZEyjsOGJxg96LFjOTztfLgAZUwOQfOIOUZ8LFLsG7S8YUKeAeMAJzVNaFkzOK08= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR13MB5864 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 Firmware sends bond firmware creation packets to driver, driver needs to handle it in ctrl VNIC service. Signed-off-by: Long Wu Reviewed-by: Peng Zhang Reviewed-by: Chaoyong He --- drivers/net/nfp/flower/nfp_flower_bond.c | 53 ++++++++++++ drivers/net/nfp/flower/nfp_flower_bond.h | 14 +++ drivers/net/nfp/flower/nfp_flower_ctrl.c | 106 +++++++++++++++++++++-- 3 files changed, 168 insertions(+), 5 deletions(-) diff --git a/drivers/net/nfp/flower/nfp_flower_bond.c b/drivers/net/nfp/flower/nfp_flower_bond.c index 523e0025ad..73b616360a 100644 --- a/drivers/net/nfp/flower/nfp_flower_bond.c +++ b/drivers/net/nfp/flower/nfp_flower_bond.c @@ -161,6 +161,8 @@ nfp_flower_bond_init(struct nfp_app_fw_flower *app_fw_flower) LIST_INIT(&nfp_bond->group_list); nfp_flower_bond_increment_version(nfp_bond); nfp_bond->app_fw_flower = app_fw_flower; + nfp_bond->retrans.head = 0; + nfp_bond->retrans.rear = 0; return 0; } @@ -168,6 +170,7 @@ nfp_flower_bond_init(struct nfp_app_fw_flower *app_fw_flower) void nfp_flower_bond_cleanup(struct nfp_app_fw_flower *app_fw_flower) { + struct rte_mbuf *mbuf_tmp; struct nfp_bond_group *entry; struct nfp_flower_bond *nfp_bond = app_fw_flower->nfp_bond; @@ -177,6 +180,12 @@ nfp_flower_bond_cleanup(struct nfp_app_fw_flower *app_fw_flower) LIST_REMOVE(entry, next); rte_free(entry); } + + mbuf_tmp = nfp_fl_bond_get_unprocessed(nfp_bond); + for (; mbuf_tmp != NULL; + mbuf_tmp = nfp_fl_bond_get_unprocessed(nfp_bond)) + rte_pktmbuf_free(mbuf_tmp); + pthread_mutex_unlock(&nfp_bond->mutex); pthread_mutex_destroy(&nfp_bond->mutex); @@ -587,3 +596,47 @@ nfp_flower_bond_all_member_are_phyrepr(struct rte_eth_dev *bond_dev) return true; } + +int +nfp_fl_bond_put_unprocessed(struct nfp_flower_bond *nfp_bond, + struct rte_mbuf *mbuf) +{ + uint16_t rear_real; + struct nfp_flower_bond_retrans *retrans; + struct nfp_flower_cmsg_bond_config *cmsg_payload; + + cmsg_payload = rte_pktmbuf_mtod_offset(mbuf, + struct nfp_flower_cmsg_bond_config *, + NFP_FLOWER_CMSG_HLEN); + + if (rte_be_to_cpu_32(cmsg_payload->group_id) >= NFP_FL_BOND_GROUP_MAX) + return -EINVAL; + + retrans = &nfp_bond->retrans; + rear_real = (retrans->rear + 1) % NFP_FL_BOND_RETRANS_LIMIT; + if (rear_real == retrans->head) + return -ENOSPC; + + retrans->mbufs[retrans->rear] = mbuf; + + retrans->rear = rear_real; + + return 0; +} + +struct rte_mbuf * +nfp_fl_bond_get_unprocessed(struct nfp_flower_bond *nfp_bond) +{ + struct rte_mbuf *mbuf; + struct nfp_flower_bond_retrans *retrans; + + retrans = &nfp_bond->retrans; + if (retrans->rear == retrans->head) + return NULL; + + mbuf = retrans->mbufs[retrans->head]; + + retrans->head = (retrans->head + 1) % NFP_FL_BOND_RETRANS_LIMIT; + + return mbuf; +} diff --git a/drivers/net/nfp/flower/nfp_flower_bond.h b/drivers/net/nfp/flower/nfp_flower_bond.h index f73589265f..59d1c211f2 100644 --- a/drivers/net/nfp/flower/nfp_flower_bond.h +++ b/drivers/net/nfp/flower/nfp_flower_bond.h @@ -41,6 +41,9 @@ #define NFP_FL_BOND_PORT_TX_ENABLED RTE_BIT32(1) #define NFP_FL_BOND_PORT_CHANGED RTE_BIT32(2) +/** We store 100(101-1) mbufs but queue needs 101 */ +#define NFP_FL_BOND_RETRANS_LIMIT 101 + enum nfp_flower_bond_batch { NFP_FLOWER_BOND_BATCH_FIRST, NFP_FLOWER_BOND_BATCH_MEMBER, @@ -53,6 +56,12 @@ enum nfp_flower_bond_event { NFP_FLOWER_UNREGISTER }; +struct nfp_flower_bond_retrans { + struct rte_mbuf *mbufs[NFP_FL_BOND_RETRANS_LIMIT]; + uint16_t head; + uint16_t rear; +}; + /* Control message payload for bond config */ struct nfp_flower_cmsg_bond_config { /** Configuration flags */ @@ -113,6 +122,8 @@ struct nfp_flower_bond { bool group_id_map[NFP_FL_BOND_GROUP_MAX]; /** Pointer to the flower app */ struct nfp_app_fw_flower *app_fw_flower; + /** Store bond offload packets from firmware */ + struct nfp_flower_bond_retrans retrans; }; struct nfp_flower_bond_cmsg_args { @@ -139,5 +150,8 @@ int nfp_flower_bond_event_handle(struct nfp_flower_bond *nfp_bond, enum nfp_flower_bond_event event); void nfp_flower_bond_do_work(struct nfp_flower_bond *nfp_bond); bool nfp_flower_bond_all_member_are_phyrepr(struct rte_eth_dev *bond_dev); +struct rte_mbuf *nfp_fl_bond_get_unprocessed(struct nfp_flower_bond *nfp_bond); +int nfp_fl_bond_put_unprocessed(struct nfp_flower_bond *nfp_bond, + struct rte_mbuf *mbuf); #endif /* __NFP_FLOWER_BOND_H__ */ diff --git a/drivers/net/nfp/flower/nfp_flower_ctrl.c b/drivers/net/nfp/flower/nfp_flower_ctrl.c index c25487c277..75c8c0b20a 100644 --- a/drivers/net/nfp/flower/nfp_flower_ctrl.c +++ b/drivers/net/nfp/flower/nfp_flower_ctrl.c @@ -15,6 +15,36 @@ #define MAX_PKT_BURST 32 +static void +nfp_flower_bond_recover_status(struct nfp_flower_bond *nfp_bond) +{ + int err; + struct rte_mbuf *mbuf_tmp; + struct nfp_bond_group *entry; + + pthread_mutex_lock(&nfp_bond->mutex); + + /* Clear all unprocessed messages */ + mbuf_tmp = nfp_fl_bond_get_unprocessed(nfp_bond); + for (; mbuf_tmp != NULL; + mbuf_tmp = nfp_fl_bond_get_unprocessed(nfp_bond)) + rte_pktmbuf_free(mbuf_tmp); + + /* Mark all groups dirty */ + LIST_FOREACH(entry, &nfp_bond->group_list, next) + entry->dirty = true; + + /* Reset NFP group config */ + err = nfp_flower_bond_reset(nfp_bond); + if (err != 0) + PMD_DRV_LOG(ERR, "Mem err in group reset msg"); + + pthread_mutex_unlock(&nfp_bond->mutex); + + /* Schedule a LAG/BOND config update */ + nfp_flower_bond_do_work(nfp_bond); +} + static uint16_t nfp_flower_ctrl_vnic_recv(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -450,6 +480,55 @@ nfp_flower_cmsg_port_mod_rx(struct nfp_app_fw_flower *app_fw_flower, return 0; } +static bool +nfp_flower_bond_unprocessed_msg(void *app_flower, + struct rte_mbuf *mbuf) +{ + uint16_t cnt; + uint8_t flags; + bool store_tag = false; + struct rte_mbuf *mbuf_tmp; + struct nfp_flower_bond *nfp_bond; + struct nfp_flower_cmsg_bond_config *cmsg_payload; + struct nfp_app_fw_flower *app_fw_flower = app_flower; + + cmsg_payload = rte_pktmbuf_mtod_offset(mbuf, + struct nfp_flower_cmsg_bond_config *, + NFP_FLOWER_CMSG_HLEN); + + flags = cmsg_payload->ctrl_flags; + + /* + * Note the intentional fall through below. If DATA and XON are both + * set, the message will stored and sent again with the rest of the + * unprocessed messages list. + */ + nfp_bond = app_fw_flower->nfp_bond; + + /* Store */ + if ((flags & NFP_FL_BOND_DATA) != 0) { + if (nfp_fl_bond_put_unprocessed(nfp_bond, mbuf) == 0) + store_tag = true; + } + + /* Send stored */ + if ((flags & NFP_FL_BOND_XON) != 0) { + mbuf_tmp = nfp_fl_bond_get_unprocessed(nfp_bond); + for (; mbuf_tmp != NULL; + mbuf_tmp = nfp_fl_bond_get_unprocessed(nfp_bond)) { + cnt = nfp_flower_ctrl_vnic_xmit(app_fw_flower, mbuf_tmp); + if (cnt == 0) + rte_pktmbuf_free(mbuf_tmp); + } + } + + /* Resend all */ + if ((flags & NFP_FL_BOND_SYNC) != 0) + nfp_flower_bond_recover_status(nfp_bond); + + return store_tag; +} + static void nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, struct rte_mbuf **pkts_burst, @@ -457,6 +536,7 @@ nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, { uint16_t i; char *meta; + bool mbuf_stored; uint32_t meta_type; uint32_t meta_info; struct nfp_mtr_priv *mtr_priv; @@ -486,18 +566,34 @@ nfp_flower_cmsg_rx(struct nfp_app_fw_flower *app_fw_flower, continue; } - if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_FLOW_STATS) { + mbuf_stored = false; + + switch (cmsg_hdr->type) { + case NFP_FLOWER_CMSG_TYPE_FLOW_STATS: /* We need to deal with stats updates from HW asap */ nfp_flower_cmsg_rx_stats(flow_priv, pkts_burst[i]); - } else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_QOS_STATS) { + break; + case NFP_FLOWER_CMSG_TYPE_QOS_STATS: /* Handle meter stats */ nfp_flower_cmsg_rx_qos_stats(mtr_priv, pkts_burst[i]); - } else if (cmsg_hdr->type == NFP_FLOWER_CMSG_TYPE_PORT_MOD) { - /* Handle changes to port configuration/status */ + break; + case NFP_FLOWER_CMSG_TYPE_PORT_MOD: + /* Handle meter stats */ nfp_flower_cmsg_port_mod_rx(app_fw_flower, pkts_burst[i]); + break; + case NFP_FLOWER_CMSG_TYPE_LAG_CONFIG: + /* Handle LAG/BOND related packets */ + if (nfp_flower_support_bond_offload(app_fw_flower)) + mbuf_stored = nfp_flower_bond_unprocessed_msg(app_fw_flower, + pkts_burst[i]); + break; + default: + PMD_DRV_LOG(INFO, "Unmatched repr message type: %u", + cmsg_hdr->type); } - rte_pktmbuf_free(pkts_burst[i]); + if (!mbuf_stored) + rte_pktmbuf_free(pkts_burst[i]); } } -- 2.39.1