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 AA88C43795; Tue, 26 Dec 2023 08:30:23 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 720C940DFB; Tue, 26 Dec 2023 08:29:10 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam02on2122.outbound.protection.outlook.com [40.107.212.122]) by mails.dpdk.org (Postfix) with ESMTP id AD9FE40DD8 for ; Tue, 26 Dec 2023 08:29:08 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cfhr/Z3+lXu0qrUnXo34UQMbVwZY/PjsadfCsq/6XoP3oP+EHFBIyfK8+QegAc5zS/yy/VfqclB/y7L0RtfAxsC9akZT8yaexk7armMHccievpRjIdHI/eBrPDYKxc4wttl4UxAcSnNAqU2TYTslKVQtiHGL//BM1/h1NklB5YbBRC8NC5ZFirheQZKd865cFru1fXdsvuLHEpgjeYuHqq1AVTTOT415yjYu10u3vq99PblnB8gQhaN3t6Ml835tY3LWHIrTNownuKrOfXCBw0Zo3o+5RotKOoOwyCyunUTOiOOP0/lIu9cjEmj1yunnV7u2rFptxkfS2BHEhKqUeQ== 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=ui2j8LC54ZPyKBEjT5YgaFHqCtDDsiPOA51tu6vBWfE=; b=GZ9T6Gu8GsnKbMiXHe8iFR7mLZcGeN82NiWsxp8SiaVfMQi3mDPdy+hFnbEhWCiDH3MvDQKw1umKZIZkYpt8GFS036dB9h5cNLVsSBJwfzqYHjPOV9KD+9ZumoEOmEwtu+s5fBhBagzDwadOs483LRekIdECbYeBWqmyhRYhuuUh3mJauWTMAyIVQ98iRAjlGglG/NaqbJgthJyV8c7i6JVENAg0rLrq+9fqERZSjO0wwmmywa9L3MbMS+SM0GhCbYLPfErYs4wkwsvcNTIfViZRqm+Hcz+Rnr04qv58IqtNm+52Oe9oKc22vDPLYCATVn97qYEQ4gZuTcNz3y3g3Q== 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=ui2j8LC54ZPyKBEjT5YgaFHqCtDDsiPOA51tu6vBWfE=; b=kCdp0bA4NhIg7kvJG51R/L6HSpqSuNnOAe9UGoxwgiGJZBlPyxHrFRKUwu2EL8OuNjSlklwfL3RjaFRu+GRUj9QGE/gQJMoyC5sR8ZesVm5ZAEtkxHGbzFIQgSnXiU61rJpkIJV60od+qGC9mDoB4Z9zCjgvr63IRl03CgOF3io= 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:29:07 +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:29:07 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, Long Wu , Peng Zhang , Chaoyong He Subject: [PATCH v6 12/14] net/nfp: handle bond packets from firmware Date: Tue, 26 Dec 2023 15:28:22 +0800 Message-Id: <20231226072824.3163121-13-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: eda4726b-2f86-4ae5-b4f7-08dc05e45821 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lq1yr3SRQJt+DcdPFBF1o71aJ4YJfqP8tZOHSoJQ1NQSv/ngHIXa/bb9WHNuSc94UdYGQz40t0vzbr0Qxj097cggaareV5rfpK/99HLgA34i3Cl81UZv3bec3bJAHO+CalgMZLn1GkQISYBbXRNqsDHW5sE6kls3fDzSTgeSA+ff580/I/SvOBpi1TzvyjAo5edvzShk4+2QgKad0/47J++moNbNPu0NMHwqF+7uJR4gjbGeed+gmhttDQF8CJ5G4wUX31RAHGJwVlAc+Ekg5fTtzAzyLFmlqATN5+V/jjZKnfFpOh6h/Zj3WlcRNgnOuMY6476Xu6pfuvNS1+11s0heRFKZqKg+4KuyR5K/Hlm6AOyXqC7pZlhwA7a6IUwIja0QKBvark2IM4j/iev5hNExshq/ILd1C/4QKYeN9Z5axmkZWIsv7MQ7R0qj5PgaI4/0gV5Ce/S6/Cv0IDclT09g19B6tfn7ypveN04ZWTttjoNaLfHDt0dMkXLZNaKZfAXblrJJ79l+xG13LqR/NUkrbWE/F9pdyMjg5kxYQBxMpJhjf/Pj3m/REhKfCJymibWZbKbQV4k7ep676y7haVmuoKkEcV4sYOVAaUNZiB/pM/ZGUx5Eic6HY1HzGkTdpflONgbUsXVEQl4HKNOqoMSvl5m/t42kwwg32EVdgfk= 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)(4326008)(8676002)(41300700001)(2906002)(8936002)(6486002)(478600001)(316002)(6916009)(54906003)(66476007)(66556008)(66946007)(6506007)(86362001)(36756003)(38100700002)(38350700005)(66899024); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?lanw2T1gIzh4ZYjWc+nhgZQ5R2xDOmejrGkWYdihJ/9fgJEY390vTFplzEKG?= =?us-ascii?Q?gXKB+HO2mASOuKlODHlSW35avROz6Ttm0VPx6ykX8EiroSNBx8Stt1b0uWCO?= =?us-ascii?Q?wX4ixTpgjrbT8dPVDgNdPd0A6yph+XcSvsIowUWCERMkBq3Xv8zSm4RMsG/2?= =?us-ascii?Q?WIjAfBjlBQNVYm0l+FP/V2ggxhj5Z32r+I+DtDI1w+L7v0L6RJeTcR16RZjJ?= =?us-ascii?Q?HTvEzQGgou0VAFRSOwqn3Q5HKug/F0oXOYC98AnFEs5GMHQ/AXoEmsGMW2Tv?= =?us-ascii?Q?UAoRtMEJ9Xl2aJmlwRSS+pirE/ZyfUua3V3ygskiXrBgZDsXS6+OQg7nkXks?= =?us-ascii?Q?r2FjeN/VuUGAsEQG8aqaZLRt+JXu1r/yQVr05Rqh7pwkx4/2RX1B5xGPmP+5?= =?us-ascii?Q?bHYwOQYbiQC+sQosQTjiuiU0HNEUBHf1udEgQ7jVnyNi+IYje4J3l1EC7wGo?= =?us-ascii?Q?OH6b7TWUIpbjJz5lXRsoQ6h6+d8Ud5WuUlme3U3ZvCeUuDBEtuV6CBTTr025?= =?us-ascii?Q?+i1raKZagMRmaamhe4IMsP+GSti7emFH0oY/yvd4GRML9OKtXwyePU1p3j4C?= =?us-ascii?Q?YfEvaKdFGnTSDMXs9StWVtalXbJk72Y6pzpD4IrH3amy/h/gNUUR4OWxC7a0?= =?us-ascii?Q?h1TZS/9DQOlmRde8WlfkgOcSxnkncWpAWrjWxdHwxtRaIVLDmX+iZ5TwfmQO?= =?us-ascii?Q?EqwLNTyutD/hi+XqDDDV2lNZrxVaCJ4DHcljY4p0K1i+nLd6Ko7uK6FfC5qP?= =?us-ascii?Q?VU0koS4f9n68YsQmjDZAd0TueXL9Muq59G4hZsIxAK5440VU1jmFQq1UGuIo?= =?us-ascii?Q?rHLkZMY23DI5m34urt4Iu5xhyunYGRAVNgtLkPCIdb59malyc01Wpn4mxeEC?= =?us-ascii?Q?WmIpxfZHzd4eVLgI6oJicDI5VWIpB5LG961aQhm/gXc6he4Wyu5KLfJTYZmm?= =?us-ascii?Q?T2tVS5W/F+pOKnr0t9JnFr4LT4MOrjn8KJ80YFcf2135+7YgIGFgeNwAAb+9?= =?us-ascii?Q?1hkd5WRC6mfFyQAPSJCRH1+VOxKXXzElOGFiDoxelz9j0TnhMFTJ5yGivrp2?= =?us-ascii?Q?lkooz+ZDZV+IaKJP7LEYIzwUbTPJchK4fUPswQmaqX+0SjXF331Gn76AK1NL?= =?us-ascii?Q?SJ4I2ipH8YE9oqBbPZ/m65Zp/B8Xjchzn/mJzvzK/ZA5J6FgdTWEJzg/s97V?= =?us-ascii?Q?RzsJgYR+wXcYstXdvM4SG4srDDBuz2HKE0eyEfi7b3WexWr3PokwtynWRR3B?= =?us-ascii?Q?xE/TUubL/en242imHbT/7Il4fg2TrmqL0Fg+Zq0s0YBttMWLRsDuQF2bnPS6?= =?us-ascii?Q?Jc9FBuYZCJ1kFZjkRUaAcBhQV95Ce9bv698B8SAzmmufTwuLw+18yZFGlFxc?= =?us-ascii?Q?lEbgw+gummuC1nN+q/Oz4hpGBnwkQju64OrHgtelddDBqcuG2MDzLVvjBj7y?= =?us-ascii?Q?RU970rnfXcJKPBW473Zu+Mss3LhCNrg+RrhWnTCvjxkkA6T+3rwbJLZr/eqJ?= =?us-ascii?Q?rdMilzJcG6D086Oy0ByBLr/DuSqpf9EJSQIw9Gv2ownBCEOiSPPzXQR3HqJI?= =?us-ascii?Q?hRcMYcyrsoONvWReHpMBLs8PFBllr0eH4oqvQktdorjR+/oAUYi5OKes2yzc?= =?us-ascii?Q?/w=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: eda4726b-2f86-4ae5-b4f7-08dc05e45821 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:29:07.1923 (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: tEaE1UE8szB4H2gVRt34u7Zd/jfg87BNvMLiu48T3kRqXsFsM4H8csdKNvhoG5NYSKqBeIwJ5sd3Kjm4RjKCnLZZMTVYt2RUcBLu2Drb3kE= 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 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 12e61ff1ce..e88d72899f 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