[v6,13/14] net/nfp: support getting bond firmware creation
Checks
Commit Message
From: Long Wu <long.wu@corigine.com>
Support getting the status that whether the bonding port
is created by the nfp firmware.
Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
---
drivers/net/nfp/flower/nfp_flower_bond.c | 27 +++++++++++++++++++
drivers/net/nfp/flower/nfp_flower_bond.h | 2 ++
.../net/nfp/flower/nfp_flower_representor.c | 1 +
3 files changed, 30 insertions(+)
@@ -640,3 +640,30 @@ nfp_fl_bond_get_unprocessed(struct nfp_flower_bond *nfp_bond)
return mbuf;
}
+
+int
+nfp_flower_bond_fw_create_get(struct rte_eth_dev *bond_dev,
+ struct rte_eth_dev *nfp_dev)
+{
+ int ret = -EINVAL;
+ struct nfp_bond_group *group;
+ struct nfp_flower_bond *nfp_bond;
+ struct nfp_flower_representor *repr;
+
+ if (!nfp_flower_bond_is_member_port(bond_dev, nfp_dev))
+ return ret;
+
+ repr = nfp_dev->data->dev_private;
+ nfp_bond = repr->app_fw_flower->nfp_bond;
+
+ pthread_mutex_lock(&nfp_bond->mutex);
+ LIST_FOREACH(group, &nfp_bond->group_list, next) {
+ if (group->main_dev == bond_dev && group->offloaded == true) {
+ ret = 0;
+ break;
+ }
+ }
+ pthread_mutex_unlock(&nfp_bond->mutex);
+
+ return ret;
+}
@@ -153,5 +153,7 @@ 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);
+int nfp_flower_bond_fw_create_get(struct rte_eth_dev *bond_dev,
+ struct rte_eth_dev *nfp_dev);
#endif /* __NFP_FLOWER_BOND_H__ */
@@ -458,6 +458,7 @@ static const struct eth_dev_ops nfp_flower_repr_dev_ops = {
.mtr_ops_get = nfp_net_mtr_ops_get,
.bond_notify_member = nfp_flower_repr_bond_notify_member,
+ .bond_fw_create_get = nfp_flower_bond_fw_create_get,
};
static uint32_t