Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
net/sched/act_ipt.c
static __net_init int xt_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, act_xt_ops.net_id); return tc_action_net_init(net, tn, &act_xt_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ipt.c
static int __init ipt_init_module(void) { int ret1, ret2; ret1 = tcf_register_action(&act_xt_ops, &xt_net_ops); if (ret1 < 0) pr_err("Failed to load xt action\n"); ret2 = tcf_register_action(&act_ipt_ops, &ipt_net_ops); if (ret2 < 0) pr_err("Failed to load ipt action\n"); if (ret1 < 0 && ret2 < ...
[ 1, 0 ]
Linux Kernel
net/sched/act_meta_skbtcindex.c
static int skbtcindex_check(struct sk_buff *skb, struct tcf_meta_info *e) { return ife_check_meta_u16(skb->tc_index, e); }
[ 0, 0 ]
Linux Kernel
net/sched/act_mirred.c
static bool tcf_mirred_is_act_redirect(int action) { return action == TCA_EGRESS_REDIR || action == TCA_INGRESS_REDIR; }
[ 0, 0 ]
Linux Kernel
net/sched/act_mirred.c
static struct net_device *tcf_mirred_dev_dereference(struct tcf_mirred *m) { return rcu_dereference_protected(m->tcfm_dev, lockdep_is_held(&m->tcf_lock)); }
[ 0, 0 ]
Linux Kernel
net/sched/act_mirred.c
static void tcf_mirred_release(struct tc_action *a) { struct tcf_mirred *m = to_mirred(a); struct net_device *dev; spin_lock(&mirred_list_lock); list_del(&m->tcfm_list); spin_unlock(&mirred_list_lock); dev = rcu_dereference_protected(m->tcfm_dev, 1); netdev_put(dev, &m->tcfm_dev_tracker); }
[ 0, 0 ]
Linux Kernel
net/sched/act_mirred.c
static int tcf_mirred_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb_tail_pointer(skb); struct tcf_mirred *m = to_mirred(a); struct tc_mirred opt = { .index = m->tcf_index, .refcnt = refcount_read(&m->tcf_refcnt) - ref, .bin...
[ 1, 0 ]
Linux Kernel
net/sched/act_mirred.c
static void tcf_mirred_dev_put(void *priv) { struct net_device *dev = priv; dev_put(dev); }
[ 0, 0 ]
Linux Kernel
net/sched/act_mirred.c
static struct net_device * tcf_mirred_get_dev(const struct tc_action *a, tc_action_priv_destructor *destructor) { struct tcf_mirred *m = to_mirred(a); struct net_device *dev; rcu_read_lock(); dev = rcu_dereference(m->tcfm_dev); if (dev) { dev_hold(dev); *destructor = tcf_mirred_de...
[ 0, 0 ]
Linux Kernel
net/sched/act_mirred.c
static void tcf_offload_mirred_get_dev(struct flow_action_entry *entry, const struct tc_action *act) { entry->dev = act->ops->get_dev(act, &entry->destructor); if (!entry->dev) return; entry->destructor_priv = entry->dev; }
[ 0, 0 ]
Linux Kernel
net/sched/act_mpls.c
static __be32 tcf_mpls_get_lse(struct mpls_shim_hdr *lse, struct tcf_mpls_params *p, bool set_bos) { u32 new_lse = 0; if (lse) new_lse = be32_to_cpu(lse->label_stack_entry); if (p->tcfm_label != ACT_MPLS_LABEL_NOT_SET) { new_lse &= ~MPLS_LS_LABEL_MASK; new_lse |= p->t...
[ 0, 0 ]
Linux Kernel
net/sched/act_mpls.c
static void tcf_mpls_cleanup(struct tc_action *a) { struct tcf_mpls *m = to_mpls(a); struct tcf_mpls_params *p; p = rcu_dereference_protected(m->mpls_p, 1); if (p) kfree_rcu(p, rcu); }
[ 0, 0 ]
Linux Kernel
net/sched/act_nat.c
static int tcf_nat_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb_tail_pointer(skb); struct tcf_nat *p = to_tcf_nat(a); struct tc_nat opt = { .index = p->tcf_index, .refcnt = refcount_read(&p->tcf_refcnt) - ref, .bindcnt = atom...
[ 1, 0 ]
Linux Kernel
net/sched/act_nat.c
static int __init nat_init_module(void) { return tcf_register_action(&act_nat_ops, &nat_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_nat.c
static void __exit nat_cleanup_module(void) { tcf_unregister_action(&act_nat_ops, &nat_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_pedit.c
static __net_init int pedit_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, act_pedit_ops.net_id); return tc_action_net_init(net, tn, &act_pedit_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_police.c
static void tcf_police_stats_update(struct tc_action *a, u64 bytes, u64 packets, u64 drops, u64 lastuse, bool hw) { struct tcf_police *police = to_police(a); struct tcf_t *tm = &police->tcf_tm; tcf_action_update_stats(a, bytes, packets, drops, hw); tm->lastuse = max_t(u64, ...
[ 0, 0 ]
Linux Kernel
net/sched/act_police.c
static int tcf_police_act_to_flow_act(int tc_act, u32 *extval, struct netlink_ext_ack *extack) { int act_id = -EOPNOTSUPP; if (!TC_ACT_EXT_OPCODE(tc_act)) { if (tc_act == TC_ACT_OK) act_id = FLOW_ACTION_ACCEPT; else if (tc_act == TC_ACT_SHOT) act_id = FLOW...
[ 0, 0 ]
Linux Kernel
net/sched/act_police.c
static void __net_exit police_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_police_ops.net_id); }
[ 0, 0 ]
Linux Kernel
net/sched/act_police.c
static int __init police_init_module(void) { return tcf_register_action(&act_police_ops, &police_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_sample.c
static bool tcf_sample_dev_ok_push(struct net_device *dev) { switch (dev->type) { case ARPHRD_TUNNEL: case ARPHRD_TUNNEL6: case ARPHRD_SIT: case ARPHRD_IPGRE: case ARPHRD_IP6GRE: case ARPHRD_VOID: case ARPHRD_NONE: return false; default: return true; } }
[ 0, 0 ]
Linux Kernel
net/sched/act_sample.c
TC_INDIRECT_SCOPE int tcf_sample_act(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res) { struct tcf_sample *s = to_sample(a); struct psample_group *psample_group; struct psample_metadata md = {}; int retval; tcf_l...
[ 0, 0 ]
Linux Kernel
net/sched/act_sample.c
static int tcf_sample_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb_tail_pointer(skb); struct tcf_sample *s = to_sample(a); struct tc_sample opt = { .index = s->tcf_index, .refcnt = refcount_read(&s->tcf_refcnt) - ref, .bin...
[ 1, 0 ]
Linux Kernel
net/sched/act_sample.c
static int tcf_sample_offload_act_setup(struct tc_action *act, void *entry_data, u32 *index_inc, bool bind, struct netlink_ext_ack *extack) { if (bind) { struct flow_action_entry *entry = entry_data; entry->id = FLOW_ACTION_SAMP...
[ 0, 0 ]
Linux Kernel
net/sched/act_sample.c
static int __init sample_init_module(void) { return tcf_register_action(&act_sample_ops, &sample_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_simple.c
static int reset_policy(struct tc_action *a, const struct nlattr *defdata, struct tc_defact *p, struct tcf_proto *tp, struct netlink_ext_ack *extack) { struct tcf_chain *goto_ch = NULL; struct tcf_defact *d; int err; err = tcf_action_check_ctrlact(p->action, tp,...
[ 1, 0 ]
Linux Kernel
net/sched/act_simple.c
static void __net_exit simp_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_simp_ops.net_id); }
[ 0, 0 ]
Linux Kernel
net/sched/act_simple.c
static void __exit simp_cleanup_module(void) { tcf_unregister_action(&act_simp_ops, &simp_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_skbedit.c
TC_INDIRECT_SCOPE int tcf_skbedit_act(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res) { struct tcf_skbedit *d = to_skbedit(a); struct tcf_skbedit_params *params; int action; tcf_lastuse_update(&d->tcf_tm); bs...
[ 1, 0 ]
Linux Kernel
net/sched/act_skbedit.c
static size_t tcf_skbedit_get_fill_size(const struct tc_action *act) { return nla_total_size(sizeof(struct tc_skbedit)) + nla_total_size(sizeof(u32)) + nla_total_size(sizeof(u16)) /* TCA_SKBEDIT_QUEUE_MAPPING */ + nla_total_size(sizeof(u16)) /* TCA_SKBEDIT_QUEUE_MAPPING_MAX */ + ...
[ 0, 0 ]
Linux Kernel
net/sched/act_skbedit.c
static void __net_exit skbedit_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_skbedit_ops.net_id); }
[ 0, 0 ]
Linux Kernel
net/sched/act_skbmod.c
static void __net_exit skbmod_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_skbmod_ops.net_id); }
[ 0, 0 ]
Linux Kernel
net/sched/act_tunnel_key.c
static int tunnel_key_copy_erspan_opt(const struct nlattr *nla, void *dst, int dst_len, struct netlink_ext_ack *extack) { struct nlattr *tb[TCA_TUNNEL_KEY_ENC_OPT_ERSPAN_MAX + 1]; int err; u8 ver; err = nla_parse_nested(tb, TCA_TUNNEL...
[ 1, 0 ]
Linux Kernel
net/sched/act_tunnel_key.c
static int tunnel_key_opts_set(struct nlattr *nla, struct ip_tunnel_info *info, int opts_len, struct netlink_ext_ack *extack) { info->options_len = opts_len; switch (nla_type(nla_data(nla))) { case TCA_TUNNEL_KEY_ENC_OPTS_GENEVE: #if IS_ENABLED(CONFIG_INET) info->key.tun_flags ...
[ 0, 0 ]
Linux Kernel
net/sched/act_tunnel_key.c
static void tunnel_key_release(struct tc_action *a) { struct tcf_tunnel_key *t = to_tunnel_key(a); struct tcf_tunnel_key_params *params; params = rcu_dereference_protected(t->params, 1); tunnel_key_release_params(params); }
[ 0, 0 ]
Linux Kernel
net/sched/act_tunnel_key.c
static int tunnel_key_geneve_opts_dump(struct sk_buff *skb, const struct ip_tunnel_info *info) { int len = info->options_len; u8 *src = (u8 *)(info + 1); struct nlattr *start; start = nla_nest_start_noflag(skb, TCA_TUNNEL_KEY_ENC_OPTS_GENEVE); if (!start) return -E...
[ 1, 0 ]
Linux Kernel
net/sched/act_tunnel_key.c
static int tunnel_key_dump_addresses(struct sk_buff *skb, const struct ip_tunnel_info *info) { unsigned short family = ip_tunnel_info_af(info); if (family == AF_INET) { __be32 saddr = info->key.u.ipv4.src; __be32 daddr = info->key.u.ipv4.dst; if (!nla_put_in_addr(...
[ 1, 0 ]
Linux Kernel
net/sched/act_tunnel_key.c
static int tcf_tunnel_key_offload_act_setup(struct tc_action *act, void *entry_data, u32 *index_inc, bool bind, struct netlink_ext_ack *extack) { int err; if (bind) { struct flow...
[ 0, 0 ]
Linux Kernel
net/sched/act_vlan.c
static void tcf_vlan_stats_update(struct tc_action *a, u64 bytes, u64 packets, u64 drops, u64 lastuse, bool hw) { struct tcf_vlan *v = to_vlan(a); struct tcf_t *tm = &v->tcf_tm; tcf_action_update_stats(a, bytes, packets, drops, hw); tm->lastuse = max_t(u64, tm->lastuse, lastu...
[ 0, 0 ]
Linux Kernel
net/sched/act_vlan.c
static void __exit vlan_cleanup_module(void) { tcf_unregister_action(&act_vlan_ops, &vlan_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static u32 destroy_obj_hashfn(const struct tcf_proto *tp) { return jhash_3words(tp->chain->index, tp->prio, (__force __u32)tp->protocol, 0); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tcf_proto_signal_destroyed(struct tcf_chain *chain, struct tcf_proto *tp) { struct tcf_block *block = chain->block; mutex_lock(&block->proto_destroy_lock); if (hash_hashed(&tp->destroy_ht_node)) hash_del_rcu(&tp->destroy_ht_node); mutex_unlock(&block->pro...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
bool tcf_queue_work(struct rcu_work *rwork, work_func_t func) { INIT_RCU_WORK(rwork, func); return queue_rcu_work(tc_filter_wq, rwork); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static bool tcf_proto_check_kind(struct nlattr *kind, char *name) { if (kind) return nla_strscpy(name, kind, IFNAMSIZ) < 0; memset(name, 0, IFNAMSIZ); return false; }
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
static bool tcf_proto_check_delete(struct tcf_proto *tp) { if (tp->ops->delete_empty) return tp->ops->delete_empty(tp); tp->deleting = true; return tp->deleting; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tcf_chain_destroy(struct tcf_chain *chain, bool free_block) { struct tcf_block *block = chain->block; mutex_destroy(&chain->filter_chain_lock); kfree_rcu(chain, rcu); if (free_block) tcf_block_destroy(block); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static bool tcf_chain_held_by_acts_only(struct tcf_chain *chain) { ASSERT_BLOCK_LOCKED(chain->block); return chain->refcnt == chain->action_refcnt; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static struct tcf_chain *tcf_chain_get(struct tcf_block *block, u32 chain_index, bool create) { return __tcf_chain_get(block, chain_index, create, false); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tcf_chain_put(struct tcf_chain *chain) { __tcf_chain_put(chain, false, false); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
void tcf_chain_put_by_act(struct tcf_chain *chain) { __tcf_chain_put(chain, true, false); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tcf_block_offload_init(struct flow_block_offload *bo, struct net_device *dev, struct Qdisc *sch, enum flow_block_command command, enum flow_block_binder_type binder_type, ...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tc_block_indr_cleanup(struct flow_block_cb *block_cb) { struct tcf_block *block = block_cb->indr.data; struct net_device *dev = block_cb->indr.dev; struct Qdisc *sch = block_cb->indr.sch; struct netlink_ext_ack extack = {}; struct flow_block_offload bo = {}; tcf_block_offload_init(&bo, dev, sc...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static int tcf_chain0_head_change_cb_add(struct tcf_block *block, struct tcf_block_ext_info *ei, struct netlink_ext_ack *extack) { struct tcf_filter_chain_list_item *item; struct tcf_chain *chain0; item = kmalloc(sizeof(*item), GF...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static struct tcf_block *tcf_block_lookup(struct net *net, u32 block_index) { struct tcf_net *tn = net_generic(net, tcf_net_id); return idr_find(&tn->idr, block_index); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static struct tcf_proto *__tcf_get_next_proto(struct tcf_chain *chain, struct tcf_proto *tp) { u32 prio = 0; ASSERT_RTNL(); mutex_lock(&chain->filter_chain_lock); if (!tp) { tp = tcf_chain_dereference(chain->filter_chain, chain); } else if (tcf_proto_is_dele...
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
static int __tcf_qdisc_cl_find(struct Qdisc *q, u32 parent, unsigned long *cl, int ifindex, struct netlink_ext_ack *extack) { if (ifindex == TCM_IFINDEX_MAGIC_BLOCK) return 0; if (TC_H_MIN(parent)) { const struct Qdisc_class_ops *cops = q->ops->cl_ops; *cl = cops->find(q...
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
static struct tcf_block *__tcf_block_find(struct net *net, struct Qdisc *q, unsigned long cl, int ifindex, u32 block_index, struct netlink_ext_ack *extack) { struct tcf_block *block; if (if...
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
int tcf_block_get(struct tcf_block **p_block, struct tcf_proto __rcu **p_filter_chain, struct Qdisc *q, struct netlink_ext_ack *extack) { struct tcf_block_ext_info ei = { .chain_head_change = tcf_chain_head_change_dflt, .chain_head_change_priv = p_filter_chain, }; ...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static int tcf_block_bind(struct tcf_block *block, struct flow_block_offload *bo) { struct flow_block_cb *block_cb, *next; int err, i = 0; lockdep_assert_held(&block->cb_lock); list_for_each_entry(block_cb, &bo->cb_list, list) { err = tcf_block_playback_offloads(block, block_cb-...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static inline int __tcf_classify(struct sk_buff *skb, const struct tcf_proto *tp, const struct tcf_proto *orig_tp, struct tcf_result *res, bool compat_mode, u32 *last_executed_chain) { #if...
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tcf_chain_tp_remove(struct tcf_chain *chain, struct tcf_chain_info *chain_info, struct tcf_proto *tp) { struct tcf_proto *next = tcf_chain_dereference(chain_info->next, chain); tcf_proto_mark_delete(tp); if (tp == chain->filter_chain) ...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static struct tcf_proto *tcf_chain_tp_insert_unique(struct tcf_chain *chain, struct tcf_proto *tp_new, u32 protocol, u32 prio, bool rtnl_held) { struct tcf_chain_...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static int tfilter_notify(struct net *net, struct sk_buff *oskb, struct nlmsghdr *n, struct tcf_proto *tp, struct tcf_block *block, struct Qdisc *q, u32 parent, void *fh, int event, bool unicast, bool rtnl_held) { struct sk_buff *skb; u3...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tfilter_put(struct tcf_proto *tp, void *fh) { if (tp->ops->put && fh) tp->ops->put(tp, fh); }
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
static int tc_chain_tmplt_add(struct tcf_chain *chain, struct net *net, struct nlattr **tca, struct netlink_ext_ack *extack) { const struct tcf_proto_ops *ops; char name[IFNAMSIZ]; void *tmplt_priv; if (!tca[TCA_KIND]) return 0; if (tcf_proto_c...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static void tc_chain_tmplt_del(const struct tcf_proto_ops *tmplt_ops, void *tmplt_priv) { if (!tmplt_ops) return; tmplt_ops->tmplt_destroy(tmplt_priv); module_put(tmplt_ops->owner); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
void tcf_exts_change(struct tcf_exts *dst, struct tcf_exts *src) { #ifdef CONFIG_NET_CLS_ACT struct tcf_exts old = *dst; *dst = *src; tcf_exts_destroy(&old); #endif }
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
static int __tc_setup_cb_call(struct tcf_block *block, enum tc_setup_type type, void *type_data, bool err_stop) { struct flow_block_cb *block_cb; int ok_count = 0; int err; list_for_each_entry(block_cb, &block->flow_block.cb_list, list) { err = block_cb->cb(type, type_data, b...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
int tc_setup_cb_add(struct tcf_block *block, struct tcf_proto *tp, enum tc_setup_type type, void *type_data, bool err_stop, u32 *flags, unsigned int *in_hw_count, bool rtnl_held) { bool take_rtnl = READ_ONCE(block->lockeddevcnt) && !rtnl_held; int ok_count; retry: if (take...
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
int tc_setup_cb_replace(struct tcf_block *block, struct tcf_proto *tp, enum tc_setup_type type, void *type_data, bool err_stop, u32 *old_flags, unsigned int *old_in_hw_count, u32 *new_flags, unsigned int *new_in_hw_count, bo...
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
static int tc_setup_offload_act(struct tc_action *act, struct flow_action_entry *entry, u32 *index_inc, struct netlink_ext_ack *extack) { #ifdef CONFIG_NET_CLS_ACT if (act->ops->offload_act_setup) { return act->ops->offload_act_setup(act, entry, ind...
[ 0, 0 ]
Linux Kernel
net/sched/cls_api.c
unsigned int tcf_exts_num_actions(struct tcf_exts *exts) { unsigned int num_acts = 0; struct tc_action *act; int i; tcf_exts_for_each_action(i, act, exts) { if (is_tcf_pedit(act)) num_acts += tcf_pedit_nkeys(act); else num_acts++; } return num_acts; }
[ 1, 0 ]
Linux Kernel
net/sched/cls_api.c
int tcf_qevent_validate_change(struct tcf_qevent *qe, struct nlattr *block_index_attr, struct netlink_ext_ack *extack) { u32 block_index; int err; if (!block_index_attr) return 0; err = tcf_qevent_parse_block_index(block_index_attr, &block_inde...
[ 0, 0 ]
Linux Kernel
net/sched/cls_basic.c
static void __basic_delete_filter(struct basic_filter *f) { tcf_exts_destroy(&f->exts); tcf_em_tree_destroy(&f->ematches); tcf_exts_put_net(&f->exts); free_percpu(f->pf); kfree(f); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_basic.c
static void basic_destroy(struct tcf_proto *tp, bool rtnl_held, struct netlink_ext_ack *extack) { struct basic_head *head = rtnl_dereference(tp->root); struct basic_filter *f, *n; list_for_each_entry_safe(f, n, &head->flist, link) { list_del_rcu(&f->link); tcf_unbind_filter(tp,...
[ 0, 0 ]
Linux Kernel
net/sched/cls_basic.c
static int __init init_basic(void) { return register_tcf_proto_ops(&cls_basic_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static void cls_bpf_offload_update_stats(struct tcf_proto *tp, struct cls_bpf_prog *prog) { struct tcf_block *block = tp->chain->block; struct tc_cls_bpf_offload cls_bpf = {}; tc_cls_common_offload_init(&cls_bpf.common, tp, prog->gen_flags, NULL); cls_bpf.command = TC_...
[ 1, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static void __cls_bpf_delete_prog(struct cls_bpf_prog *prog) { tcf_exts_destroy(&prog->exts); tcf_exts_put_net(&prog->exts); cls_bpf_free_parms(prog); kfree(prog); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static void *cls_bpf_get(struct tcf_proto *tp, u32 handle) { struct cls_bpf_head *head = rtnl_dereference(tp->root); struct cls_bpf_prog *prog; list_for_each_entry(prog, &head->plist, link) { if (prog->handle == handle) return prog; } return NULL; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static int cls_bpf_prog_from_ops(struct nlattr **tb, struct cls_bpf_prog *prog) { struct sock_filter *bpf_ops; struct sock_fprog_kern fprog_tmp; struct bpf_prog *fp; u16 bpf_size, bpf_num_ops; int ret; bpf_num_ops = nla_get_u16(tb[TCA_BPF_OPS_LEN]); if (bpf_num_ops > BPF...
[ 1, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static int cls_bpf_set_parms(struct net *net, struct tcf_proto *tp, struct cls_bpf_prog *prog, unsigned long base, struct nlattr **tb, struct nlattr *est, u32 flags, struct netlink_ext_ack *extack) { bool is_bpf, is_ebpf, have_ext...
[ 1, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static int cls_bpf_dump_bpf_info(const struct cls_bpf_prog *prog, struct sk_buff *skb) { struct nlattr *nla; if (nla_put_u16(skb, TCA_BPF_OPS_LEN, prog->bpf_num_ops)) return -EMSGSIZE; nla = nla_reserve(skb, TCA_BPF_OPS, prog->bpf_num_ops * sizeof(struct...
[ 1, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static int cls_bpf_dump_ebpf_info(const struct cls_bpf_prog *prog, struct sk_buff *skb) { struct nlattr *nla; if (prog->bpf_name && nla_put_string(skb, TCA_BPF_NAME, prog->bpf_name)) return -EMSGSIZE; if (nla_put_u32(skb, TCA_BPF_ID, prog->filter->aux->id)) return -EMS...
[ 1, 0 ]
Linux Kernel
net/sched/cls_bpf.c
static int __init cls_bpf_init_mod(void) { return register_tcf_proto_ops(&cls_bpf_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_cgroup.c
static void *cls_cgroup_get(struct tcf_proto *tp, u32 handle) { return NULL; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_cgroup.c
static int cls_cgroup_init(struct tcf_proto *tp) { return 0; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_cgroup.c
static void __cls_cgroup_destroy(struct cls_cgroup_head *head) { tcf_exts_destroy(&head->exts); tcf_em_tree_destroy(&head->ematches); tcf_exts_put_net(&head->exts); kfree(head); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_cgroup.c
static void cls_cgroup_destroy_work(struct work_struct *work) { struct cls_cgroup_head *head = container_of(to_rcu_work(work), struct cls_cgroup_head, rwork); rtnl_lock(); __cls_cgroup_destroy(head); rtnl_unlock(); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_cgroup.c
static void __exit exit_cgroup_cls(void) { unregister_tcf_proto_ops(&cls_cgroup_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flow.c
static inline u32 addr_fold(void *addr) { unsigned long a = (unsigned long)addr; return (a & 0xFFFFFFFF) ^ (BITS_PER_LONG > 32 ? a >> 32 : 0); }
[ 1, 0 ]
Linux Kernel
net/sched/cls_flow.c
static u32 flow_get_proto_src(const struct sk_buff *skb, const struct flow_keys *flow) { if (flow->ports.ports) return ntohs(flow->ports.src); return addr_fold(skb->sk); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flow.c
static u32 flow_get_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow) { if (flow->ports.ports) return ntohs(flow->ports.dst); return addr_fold(skb_dst(skb)) ^ (__force u16)skb_protocol(skb, true); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flow.c
static u32 flow_get_nfct_proto_dst(const struct sk_buff *skb, const struct flow_keys *flow) { return ntohs(CTTUPLE(skb, dst.u.all)); fallback: return flow_get_proto_dst(skb, flow); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flow.c
static u32 flow_get_skuid(const struct sk_buff *skb) { struct sock *sk = skb_to_full_sk(skb); if (sk && sk->sk_socket && sk->sk_socket->file) { kuid_t skuid = sk->sk_socket->file->f_cred->fsuid; return from_kuid(&init_user_ns, skuid); } return 0; }
[ 1, 0 ]
Linux Kernel
net/sched/cls_flow.c
static u32 flow_get_rxhash(struct sk_buff *skb) { return skb_get_hash(skb); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flow.c
static int flow_init(struct tcf_proto *tp) { struct flow_head *head; head = kzalloc(sizeof(*head), GFP_KERNEL); if (head == NULL) return -ENOBUFS; INIT_LIST_HEAD(&head->filters); rcu_assign_pointer(tp->root, head); return 0; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flower.c
static void *fl_key_get_start(struct fl_flow_key *key, const struct fl_flow_mask *mask) { return (u8 *)key + mask->range.start; }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flower.c
static bool fl_mask_put(struct cls_fl_head *head, struct fl_flow_mask *mask) { if (!refcount_dec_and_test(&mask->refcnt)) return false; rhashtable_remove_fast(&head->ht, &mask->ht_node, mask_ht_params); spin_lock(&head->masks_lock); list_del_rcu(&mask->list); spin_unlock(&head->masks_lock); tcf_queu...
[ 0, 0 ]
Linux Kernel
net/sched/cls_flower.c
static struct cls_fl_head *fl_head_dereference(struct tcf_proto *tp) { return rcu_dereference_raw(tp->root); }
[ 0, 0 ]
Linux Kernel
net/sched/cls_flower.c
static struct cls_fl_filter *__fl_get(struct cls_fl_head *head, u32 handle) { struct cls_fl_filter *f; rcu_read_lock(); f = idr_find(&head->handle_idr, handle); if (f && !refcount_inc_not_zero(&f->refcnt)) f = NULL; rcu_read_unlock(); return f; }
[ 0, 0 ]