int i, err, count = 0;
reprs = rcu_dereference_protected(app->reprs[type],
- lockdep_is_held(&app->pf->lock));
+ nfp_app_is_locked(app));
if (!reprs)
return 0;
if (!tot_repl)
return 0;
- lockdep_assert_held(&app->pf->lock);
+ assert_nfp_app_locked(app);
if (!wait_event_timeout(priv->reify_wait_queue,
atomic_read(replies) >= tot_repl,
NFP_FL_REPLY_TIMEOUT)) {
nfp_reprs_get_locked(struct nfp_app *app, enum nfp_repr_type type)
{
return rcu_dereference_protected(app->reprs[type],
- lockdep_is_held(&app->pf->lock));
+ nfp_app_is_locked(app));
}
struct nfp_reprs *
#ifndef _NFP_APP_H
#define _NFP_APP_H 1
+#include <linux/lockdep.h>
#include <net/devlink.h>
#include <trace/events/devlink.h>
+#include "nfp_main.h"
#include "nfp_net_repr.h"
#define NFP_APP_CTRL_MTU_MAX U32_MAX
void *priv;
};
+static inline void assert_nfp_app_locked(struct nfp_app *app)
+{
+ lockdep_assert_held(&app->pf->lock);
+}
+
+#define nfp_app_is_locked(app) lockdep_is_held(&(app)->pf->lock)
+
void nfp_check_rhashtable_empty(void *ptr, void *arg);
bool __nfp_ctrl_tx(struct nfp_net *nn, struct sk_buff *skb);
bool nfp_ctrl_tx(struct nfp_net *nn, struct sk_buff *skb);
nfp_repr_get_locked(struct nfp_app *app, struct nfp_reprs *set, unsigned int id)
{
return rcu_dereference_protected(set->reprs[id],
- lockdep_is_held(&app->pf->lock));
+ nfp_app_is_locked(app));
}
static void
int i;
reprs = rcu_dereference_protected(app->reprs[type],
- lockdep_is_held(&app->pf->lock));
+ nfp_app_is_locked(app));
if (!reprs)
return;