|
@@ -76,6 +76,8 @@ extern const struct nfp_app_type app_flower;
|
|
|
* @vnic_free: free up app's vNIC state
|
|
|
* @vnic_init: vNIC netdev was registered
|
|
|
* @vnic_clean: vNIC netdev about to be unregistered
|
|
|
+ * @repr_init: representor about to be registered
|
|
|
+ * @repr_clean: representor about to be unregistered
|
|
|
* @repr_open: representor netdev open callback
|
|
|
* @repr_stop: representor netdev stop callback
|
|
|
* @start: start application logic
|
|
@@ -109,6 +111,9 @@ struct nfp_app_type {
|
|
|
int (*vnic_init)(struct nfp_app *app, struct nfp_net *nn);
|
|
|
void (*vnic_clean)(struct nfp_app *app, struct nfp_net *nn);
|
|
|
|
|
|
+ int (*repr_init)(struct nfp_app *app, struct net_device *netdev);
|
|
|
+ void (*repr_clean)(struct nfp_app *app, struct net_device *netdev);
|
|
|
+
|
|
|
int (*repr_open)(struct nfp_app *app, struct nfp_repr *repr);
|
|
|
int (*repr_stop)(struct nfp_app *app, struct nfp_repr *repr);
|
|
|
|
|
@@ -212,6 +217,21 @@ static inline int nfp_app_repr_stop(struct nfp_app *app, struct nfp_repr *repr)
|
|
|
return app->type->repr_stop(app, repr);
|
|
|
}
|
|
|
|
|
|
+static inline int
|
|
|
+nfp_app_repr_init(struct nfp_app *app, struct net_device *netdev)
|
|
|
+{
|
|
|
+ if (!app->type->repr_init)
|
|
|
+ return 0;
|
|
|
+ return app->type->repr_init(app, netdev);
|
|
|
+}
|
|
|
+
|
|
|
+static inline void
|
|
|
+nfp_app_repr_clean(struct nfp_app *app, struct net_device *netdev)
|
|
|
+{
|
|
|
+ if (app->type->repr_clean)
|
|
|
+ app->type->repr_clean(app, netdev);
|
|
|
+}
|
|
|
+
|
|
|
static inline int nfp_app_start(struct nfp_app *app, struct nfp_net *ctrl)
|
|
|
{
|
|
|
app->ctrl = ctrl;
|