nn->app_priv = priv;
spin_lock_init(&priv->rx_filter_lock);
- setup_timer(&priv->rx_filter_stats_timer,
- nfp_net_filter_stats_timer, (unsigned long)nn);
+ priv->nn = nn;
+ timer_setup(&priv->rx_filter_stats_timer,
+ nfp_net_filter_stats_timer, 0);
ret = nfp_app_nic_vnic_alloc(app, nn, id);
if (ret)
struct nfp_stat_pair rx_filter, rx_filter_prev;
unsigned long rx_filter_change;
struct timer_list rx_filter_stats_timer;
+ struct nfp_net *nn;
spinlock_t rx_filter_lock;
};
int nfp_net_bpf_offload(struct nfp_net *nn, struct tc_cls_bpf_offload *cls_bpf);
-void nfp_net_filter_stats_timer(unsigned long data);
+void nfp_net_filter_stats_timer(struct timer_list *t);
#endif
#include "../nfp_net_ctrl.h"
#include "../nfp_net.h"
-void nfp_net_filter_stats_timer(unsigned long data)
+void nfp_net_filter_stats_timer(struct timer_list *t)
{
- struct nfp_net *nn = (void *)data;
- struct nfp_net_bpf_priv *priv;
+ struct nfp_net_bpf_priv *priv = from_timer(priv, t,
+ rx_filter_stats_timer);
+ struct nfp_net *nn = priv->nn;
struct nfp_stat_pair latest;
- priv = nn->app_priv;
-
spin_lock_bh(&priv->rx_filter_lock);
if (nn->dp.ctrl & NFP_NET_CFG_CTRL_BPF)
return timed_out ? -EIO : 0;
}
-static void nfp_net_reconfig_timer(unsigned long data)
+static void nfp_net_reconfig_timer(struct timer_list *t)
{
- struct nfp_net *nn = (void *)data;
+ struct nfp_net *nn = from_timer(nn, t, reconfig_timer);
spin_lock_bh(&nn->reconfig_lock);
spin_lock_init(&nn->reconfig_lock);
spin_lock_init(&nn->link_status_lock);
- setup_timer(&nn->reconfig_timer,
- nfp_net_reconfig_timer, (unsigned long)nn);
+ timer_setup(&nn->reconfig_timer, nfp_net_reconfig_timer, 0);
return nn;
}