Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/sched/cls_flower.c |
static void fl_destroy(struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct cls_fl_head *head = fl_head_dereference(tp);
struct fl_flow_mask *mask, *next_mask;
struct cls_fl_filter *f, *next;
bool last;
list_for_each_entry_safe(mask, next_mask, &head->masks, ... | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static void fl_put(struct tcf_proto *tp, void *arg) {
struct cls_fl_filter *f = arg;
__fl_put(f);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static void fl_set_key_val(struct nlattr **tb, void *val, int val_type,
void *mask, int mask_type, int len) {
if (!tb[val_type])
return;
nla_memcpy(val, tb[val_type], len);
if (mask_type == TCA_FLOWER_UNSPEC || !tb[mask_type])
memset(mask, 0xff, len);
else
nla_memcpy(mask... | [
1,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static int fl_set_key_port_range(struct nlattr **tb, struct fl_flow_key *key,
struct fl_flow_key *mask,
struct netlink_ext_ack *extack) {
fl_set_key_val(tb, &key->tp_range.tp_min.dst, TCA_FLOWER_KEY_PORT_DST_MIN,
&mask->tp_range.tp_mi... | [
1,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static int fl_delete(struct tcf_proto *tp, void *arg, bool *last,
bool rtnl_held, struct netlink_ext_ack *extack) {
struct cls_fl_head *head = fl_head_dereference(tp);
struct cls_fl_filter *f = arg;
bool last_on_mask;
int err = 0;
err = __fl_delete(tp, f, &last_on_mask, rtnl_held, extac... | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c | static void fl_walk(struct tcf_proto *tp, struct tcf_walker *arg,
bool rtnl_held) {
struct cls_fl_head *head = fl_head_dereference(tp);
unsigned long id = arg->cookie, tmp;
struct cls_fl_filter *f;
arg->count = arg->skip;
rcu_read_lock();
idr_for_each_entry_continue_ul(&head->handle_id... | [
1,
0
] |
Linux Kernel | net/sched/cls_flower.c | static int fl_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack) {
struct tcf_block *block = tp->chain->block;
struct flow_cls_offload cls_flower = {};
struct cls_fl_filter *f = NULL;
int err;
ASSERT_RTNL();
while ((f = fl_... | [
1,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static void fl_hw_del(struct tcf_proto *tp, void *type_data) {
struct flow_cls_offload *cls_flower = type_data;
struct cls_fl_filter *f = (struct cls_fl_filter *)cls_flower->cookie;
spin_lock(&tp->lock);
if (!list_empty(&f->hw_list))
list_del_init(&f->hw_list);
spin_unlock(&tp->lock);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c | static int fl_hw_create_tmplt(struct tcf_chain *chain,
struct fl_flow_tmplt *tmplt) {
struct flow_cls_offload cls_flower = {};
struct tcf_block *block = chain->block;
cls_flower.rule = flow_rule_alloc(0);
if (!cls_flower.rule)
return -ENOMEM;
cls_flower.common.chain_index =... | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static void fl_tmplt_destroy(void *tmplt_priv) {
struct fl_flow_tmplt *tmplt = tmplt_priv;
fl_hw_destroy_tmplt(tmplt->chain, tmplt);
kfree(tmplt);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static int fl_dump_key_flags(struct sk_buff *skb, u32 flags_key,
u32 flags_mask) {
u32 key, mask;
__be32 _key, _mask;
int err;
if (!memchr_inv(&flags_mask, 0, sizeof(flags_mask)))
return 0;
key = 0;
mask = 0;
fl_get_key_flag(flags_key, flags_mask, &key, &mask,
... | [
1,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static int fl_dump_key_gtp_opt(struct sk_buff *skb,
struct flow_dissector_key_enc_opts *enc_opts)
{
struct gtp_pdu_session_info *session_info;
struct nlattr *nest;
nest = nla_nest_start_noflag(skb, TCA_FLOWER_KEY_ENC_OPTS_GTP);
if (!nest)
goto nla_put_failure;
session_in... | [
0,
0
] |
Linux Kernel | net/sched/cls_flower.c |
static int __init cls_fl_init(void) {
return register_tcf_proto_ops(&cls_fl_ops);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_fw.c |
static void __fw_delete_filter(struct fw_filter *f) {
tcf_exts_destroy(&f->exts);
tcf_exts_put_net(&f->exts);
kfree(f);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_fw.c |
static void fw_delete_filter_work(struct work_struct *work) {
struct fw_filter *f =
container_of(to_rcu_work(work), struct fw_filter, rwork);
rtnl_lock();
__fw_delete_filter(f);
rtnl_unlock();
} | [
0,
0
] |
Linux Kernel | net/sched/cls_fw.c |
static void fw_destroy(struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct fw_head *head = rtnl_dereference(tp->root);
struct fw_filter *f;
int h;
if (head == NULL)
return;
for (h = 0; h < HTSIZE; h++) {
while ((f = rtnl_dereference(head->ht[h])) !=... | [
0,
0
] |
Linux Kernel | net/sched/cls_fw.c |
static void fw_bind_class(void *fh, u32 classid, unsigned long cl, void *q,
unsigned long base) {
struct fw_filter *f = fh;
tc_cls_bind_class(classid, cl, q, &f->res, base);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_matchall.c |
static int mall_init(struct tcf_proto *tp) { return 0; } | [
0,
0
] |
Linux Kernel | net/sched/cls_matchall.c |
static void mall_destroy_work(struct work_struct *work) {
struct cls_mall_head *head =
container_of(to_rcu_work(work), struct cls_mall_head, rwork);
rtnl_lock();
__mall_destroy(head);
rtnl_unlock();
} | [
0,
0
] |
Linux Kernel | net/sched/cls_matchall.c |
static void *mall_get(struct tcf_proto *tp, u32 handle) {
struct cls_mall_head *head = rtnl_dereference(tp->root);
if (head && head->handle == handle)
return head;
return NULL;
} | [
1,
0
] |
Linux Kernel | net/sched/cls_matchall.c |
static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg,
bool rtnl_held) {
struct cls_mall_head *head = rtnl_dereference(tp->root);
if (arg->count < arg->skip)
goto skip;
if (!head || head->deleting)
return;
if (arg->fn(tp, head, arg) < 0)
arg->stop = 1;
skip:
a... | [
1,
0
] |
Linux Kernel | net/sched/cls_matchall.c |
static void mall_stats_hw_filter(struct tcf_proto *tp,
struct cls_mall_head *head,
unsigned long cookie) {
struct tc_cls_matchall_offload cls_mall = {};
struct tcf_block *block = tp->chain->block;
tc_cls_common_offload_init(&cls_mall.common, tp, ... | [
1,
0
] |
Linux Kernel | net/sched/cls_matchall.c |
static int mall_dump(struct net *net, struct tcf_proto *tp, void *fh,
struct sk_buff *skb, struct tcmsg *t, bool rtnl_held) {
struct tc_matchall_pcnt gpf = {};
struct cls_mall_head *head = fh;
struct nlattr *nest;
int cpu;
if (!head)
return skb->len;
if (!tc_skip_hw(head->flags))... | [
1,
0
] |
Linux Kernel | net/sched/cls_route.c | static void route4_reset_fastmap(struct route4_head *head) {
spin_lock_bh(&fastmap_lock);
memset(head->fastmap, 0, sizeof(head->fastmap));
spin_unlock_bh(&fastmap_lock);
} | [
1,
0
] |
Linux Kernel | net/sched/cls_route.c |
static inline int route4_hash_to(u32 id) { return id & 0xFF; } | [
0,
0
] |
Linux Kernel | net/sched/cls_route.c |
static int route4_dump(struct net *net, struct tcf_proto *tp, void *fh,
struct sk_buff *skb, struct tcmsg *t, bool rtnl_held) {
struct route4_filter *f = fh;
struct nlattr *nest;
u32 id;
if (f == NULL)
return skb->len;
t->tcm_handle = f->handle;
nest = nla_nest_start_noflag(sk... | [
1,
0
] |
Linux Kernel | net/sched/cls_rsvp.h |
static void rsvp_delete_filter_work(struct work_struct *work) {
struct rsvp_filter *f =
container_of(to_rcu_work(work), struct rsvp_filter, rwork);
rtnl_lock();
__rsvp_delete_filter(f);
rtnl_unlock();
} | [
0,
0
] |
Linux Kernel | net/sched/cls_rsvp.h | static int rsvp_delete(struct tcf_proto *tp, void *arg, bool *last,
bool rtnl_held, struct netlink_ext_ack *extack) {
struct rsvp_head *head = rtnl_dereference(tp->root);
struct rsvp_filter *nfp, *f = arg;
struct rsvp_filter __rcu **fp;
unsigned int h = f->handle;
struct rsvp_session __... | [
1,
0
] |
Linux Kernel | net/sched/cls_rsvp.h |
static void tunnel_recycle(struct rsvp_head *data) {
struct rsvp_session __rcu **sht = data->ht;
u32 tmap[256 / 32];
int h1, h2;
memset(tmap, 0, sizeof(tmap));
for (h1 = 0; h1 < 256; h1++) {
struct rsvp_session *s;
for (s = rtnl_dereference(sht[h1]); s; s = rtnl_dereference(s->next)) {
for (h... | [
1,
0
] |
Linux Kernel | net/sched/cls_rsvp.h |
static u32 gen_tunnel(struct rsvp_head *data) {
int i, k;
for (k = 0; k < 2; k++) {
for (i = 255; i > 0; i--) {
if (++data->tgenerator == 0)
data->tgenerator = 1;
if (tunnel_bts(data))
return data->tgenerator;
}
tunnel_recycle(data);
}
return 0;
} | [
1,
0
] |
Linux Kernel | net/sched/cls_rsvp.h |
static void rsvp_walk(struct tcf_proto *tp, struct tcf_walker *arg,
bool rtnl_held) {
struct rsvp_head *head = rtnl_dereference(tp->root);
unsigned int h, h1;
if (arg->stop)
return;
for (h = 0; h < 256; h++) {
struct rsvp_session *s;
for (s = rtnl_dereference(head->ht[h]); ... | [
0,
0
] |
Linux Kernel | net/sched/cls_tcindex.c |
TC_INDIRECT_SCOPE int tcindex_classify(struct sk_buff *skb,
const struct tcf_proto *tp,
struct tcf_result *res) {
struct tcindex_data *p = rcu_dereference_bh(tp->root);
struct tcindex_filter_result *f;
int key = (skb->tc_index & p->mas... | [
1,
0
] |
Linux Kernel | net/sched/cls_tcindex.c |
static void tcindex_partial_destroy_work(struct work_struct *work) {
struct tcindex_data *p =
container_of(to_rcu_work(work), struct tcindex_data, rwork);
rtnl_lock();
if (p->perfect)
tcindex_free_perfect_hash(p);
kfree(p);
rtnl_unlock();
} | [
0,
0
] |
Linux Kernel | net/sched/cls_tcindex.c | static void tcindex_destroy(struct tcf_proto *tp, bool rtnl_held,
struct netlink_ext_ack *extack) {
struct tcindex_data *p = rtnl_dereference(tp->root);
int i;
pr_debug("tcindex_destroy(tp %p),p %p\n", tp, p);
if (p->perfect) {
for (i = 0; i < p->hash; i++) {
struct tcind... | [
1,
0
] |
Linux Kernel | net/sched/cls_tcindex.c |
static int __init init_tcindex(void) {
return register_tcf_proto_ops(&cls_tcindex_ops);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static inline unsigned int
u32_hash_fold(__be32 key, const struct tc_u32_sel *sel, u8 fshift) {
unsigned int h = ntohl(key & sel->hmask) >> fshift;
return h;
} | [
1,
0
] |
Linux Kernel | net/sched/cls_u32.c | static u32 gen_new_htid(struct tc_u_common *tp_c, struct tc_u_hnode *ptr) {
int id = idr_alloc_cyclic(&tp_c->handle_idr, ptr, 1, 0x7FF, GFP_KERNEL);
if (id < 0)
return 0;
return (id | 0x800U) << 20;
} | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static struct tc_u_common *tc_u_common_find(void *key) {
struct tc_u_common *tc;
hlist_for_each_entry(tc, tc_u_hash(key), hnode) {
if (tc->ptr == key)
return tc;
}
return NULL;
} | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static void u32_destroy_key(struct tc_u_knode *n, bool free_pf) {
tcf_exts_put_net(&n->exts);
#ifdef CONFIG_CLS_U32_PERF
if (free_pf)
free_percpu(n->pf);
#endif
#ifdef CONFIG_CLS_U32_MARK
if (free_pf)
free_percpu(n->pcpu_success);
#endif
__u32_destroy_key(n);
} | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c | static void u32_delete_key_work(struct work_struct *work) {
struct tc_u_knode *key =
container_of(to_rcu_work(work), struct tc_u_knode, rwork);
rtnl_lock();
u32_destroy_key(key, false);
rtnl_unlock();
} | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static void u32_clear_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
struct netlink_ext_ack *extack) {
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
tc_cls_common_offload_init(&cls_u32.common, tp, h->flags, extack);
cls_u32.command = T... | [
1,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static int u32_replace_hw_hnode(struct tcf_proto *tp, struct tc_u_hnode *h,
u32 flags, struct netlink_ext_ack *extack) {
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
bool skip_sw = tc_skip_sw(flags);
bool offloaded = false;
int err;
tc... | [
1,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static void u32_remove_hw_knode(struct tcf_proto *tp, struct tc_u_knode *n,
struct netlink_ext_ack *extack) {
struct tcf_block *block = tp->chain->block;
struct tc_cls_u32_offload cls_u32 = {};
tc_cls_common_offload_init(&cls_u32.common, tp, n->flags, extack);
cls_u32.command =... | [
1,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht,
struct netlink_ext_ack *extack) {
struct tc_u_common *tp_c = tp->data;
struct tc_u_knode *n;
unsigned int h;
for (h = 0; h <= ht->divisor; h++) {
while ((n = rtnl_dereference(ht->ht[h])) != NULL) {
R... | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c |
static u32 gen_new_kid(struct tc_u_hnode *ht, u32 htid) {
u32 index = htid | 0x800;
u32 max = htid | 0xFFF;
if (idr_alloc_u32(&ht->handle_idr, NULL, &index, max, GFP_KERNEL)) {
index = htid + 1;
if (idr_alloc_u32(&ht->handle_idr, NULL, &index, max, GFP_KERNEL))
index = max;
}
return index;
} | [
1,
0
] |
Linux Kernel | net/sched/cls_u32.c | static void u32_replace_knode(struct tcf_proto *tp, struct tc_u_common *tp_c,
struct tc_u_knode *n) {
struct tc_u_knode __rcu **ins;
struct tc_u_knode *pins;
struct tc_u_hnode *ht;
if (TC_U32_HTID(n->handle) == TC_U32_ROOT)
ht = rtnl_dereference(tp->root);
else
ht = u32_... | [
0,
0
] |
Linux Kernel | net/sched/cls_u32.c | static int u32_reoffload(struct tcf_proto *tp, bool add, flow_setup_cb_t *cb,
void *cb_priv, struct netlink_ext_ack *extack) {
struct tc_u_common *tp_c = tp->data;
struct tc_u_hnode *ht;
struct tc_u_knode *n;
unsigned int h;
int err;
for (ht = rtnl_dereference(tp_c->hlist); ht;
... | [
0,
0
] |
Linux Kernel | net/sched/ematch.c | int __tcf_em_tree_match(struct sk_buff *skb, struct tcf_ematch_tree *tree,
struct tcf_pkt_info *info) {
int stackp = 0, match_idx = 0, res = 0;
struct tcf_ematch *cur_match;
int stack[CONFIG_NET_EMATCH_STACK];
proceed:
while (match_idx < tree->hdr.nmatches) {
cur_match = tcf_em_get_... | [
0,
0
] |
Linux Kernel | net/sched/em_canid.c | static int em_canid_change(struct net *net, void *data, int len,
struct tcf_ematch *m) {
struct can_filter *conf = data;
struct canid_match *cm;
int i;
if (!len)
return -EINVAL;
if (len % sizeof(struct can_filter))
return -EINVAL;
if (len > sizeof(struct can_filter) * E... | [
1,
0
] |
Linux Kernel | net/sched/em_canid.c |
static void em_canid_destroy(struct tcf_ematch *m) {
struct canid_match *cm = em_canid_priv(m);
kfree(cm);
} | [
0,
0
] |
Linux Kernel | net/sched/em_canid.c |
static void __exit exit_em_canid(void) { tcf_em_unregister(&em_canid_ops); } | [
0,
0
] |
Linux Kernel | net/sched/em_ipset.c |
static void em_ipset_destroy(struct tcf_ematch *em) {
const struct xt_set_info *set = (const void *)em->data;
if (set) {
ip_set_nfnl_put(em->net, set->index);
kfree((void *)em->data);
}
} | [
0,
0
] |
Linux Kernel | net/sched/em_meta.c |
static int meta_var_change(struct meta_value *dst, struct nlattr *nla) {
int len = nla_len(nla);
dst->val = (unsigned long)kmemdup(nla_data(nla), len, GFP_KERNEL);
if (dst->val == 0UL)
return -ENOMEM;
dst->len = len;
return 0;
} | [
0,
0
] |
Linux Kernel | net/sched/em_meta.c |
static void meta_var_destroy(struct meta_value *v) { kfree((void *)v->val); } | [
0,
0
] |
Linux Kernel | net/sched/em_meta.c |
static int meta_var_dump(struct sk_buff *skb, struct meta_value *v, int tlv) {
if (v->val && v->len && nla_put(skb, tlv, v->len, (void *)v->val))
goto nla_put_failure;
return 0;
nla_put_failure:
return -1;
} | [
1,
0
] |
Linux Kernel | net/sched/em_meta.c |
static void meta_int_apply_extras(struct meta_value *v, struct meta_obj *dst) {
if (v->hdr.shift)
dst->value >>= v->hdr.shift;
if (v->val)
dst->value &= v->val;
} | [
1,
0
] |
Linux Kernel | net/sched/em_meta.c | static int meta_get(struct sk_buff *skb, struct tcf_pkt_info *info,
struct meta_value *v, struct meta_obj *dst) {
int err = 0;
if (meta_id(v) == TCF_META_ID_VALUE) {
dst->value = v->val;
dst->len = v->len;
return 0;
}
meta_ops(v)->get(skb, info, v, dst, &err);
if (err < 0)
... | [
0,
0
] |
Linux Kernel | net/sched/em_meta.c |
static int em_meta_match(struct sk_buff *skb, struct tcf_ematch *m,
struct tcf_pkt_info *info) {
int r;
struct meta_match *meta = (struct meta_match *)m->data;
struct meta_obj l_value, r_value;
if (meta_get(skb, info, &meta->lvalue, &l_value) < 0 ||
meta_get(skb, info, &meta->rv... | [
1,
0
] |
Linux Kernel | net/sched/em_meta.c |
static void meta_delete(struct meta_match *meta) {
if (meta) {
const struct meta_type_ops *ops = meta_type_ops(&meta->lvalue);
if (ops && ops->destroy) {
ops->destroy(&meta->lvalue);
ops->destroy(&meta->rvalue);
}
}
kfree(meta);
} | [
1,
0
] |
Linux Kernel | net/sched/em_meta.c |
static inline int meta_change_data(struct meta_value *dst, struct nlattr *nla) {
if (nla) {
if (nla_len(nla) == 0)
return -EINVAL;
return meta_type_ops(dst)->change(dst, nla);
}
return 0;
} | [
0,
0
] |
Linux Kernel | net/sched/em_meta.c |
static int em_meta_change(struct net *net, void *data, int len,
struct tcf_ematch *m) {
int err;
struct nlattr *tb[TCA_EM_META_MAX + 1];
struct tcf_meta_hdr *hdr;
struct meta_match *meta = NULL;
err = nla_parse_deprecated(tb, TCA_EM_META_MAX, data, len, meta_policy, NULL);
if (er... | [
1,
0
] |
Linux Kernel | net/sched/em_meta.c |
static void __exit exit_em_meta(void) { tcf_em_unregister(&em_meta_ops); } | [
0,
0
] |
Linux Kernel | net/sched/em_nbyte.c |
static int em_nbyte_change(struct net *net, void *data, int data_len,
struct tcf_ematch *em) {
struct tcf_em_nbyte *nbyte = data;
if (data_len < sizeof(*nbyte) || data_len < (sizeof(*nbyte) + nbyte->len))
return -EINVAL;
em->datalen = sizeof(*nbyte) + nbyte->len;
em->data = (un... | [
1,
0
] |
Linux Kernel | net/sched/em_u32.c |
static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em,
struct tcf_pkt_info *info) {
struct tc_u32_key *key = (struct tc_u32_key *)em->data;
const unsigned char *ptr = skb_network_header(skb);
if (info) {
if (info->ptr)
ptr = info->ptr;
ptr += (info->nexthdr & k... | [
1,
0
] |
Linux Kernel | net/sched/em_u32.c |
static int __init init_em_u32(void) { return tcf_em_register(&em_u32_ops); } | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static struct Qdisc_ops *qdisc_lookup_default(const char *name) {
struct Qdisc_ops *q = NULL;
for (q = qdisc_base; q; q = q->next) {
if (!strcmp(name, q->id)) {
if (!try_module_get(q->owner))
q = NULL;
break;
}
}
return q;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c | int qdisc_set_default(const char *name) {
const struct Qdisc_ops *ops;
if (!capable(CAP_NET_ADMIN))
return -EPERM;
write_lock(&qdisc_mod_lock);
ops = qdisc_lookup_default(name);
if (!ops) {
write_unlock(&qdisc_mod_lock);
request_module("sch_%s", name);
write_lock(&qdisc_mod_lock);
ops ... | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c | static struct Qdisc *qdisc_match_from_root(struct Qdisc *root, u32 handle) {
struct Qdisc *q;
if (!qdisc_dev(root))
return (root->handle == handle ? root : NULL);
if (!(root->flags & TCQ_F_BUILTIN) && root->handle == handle)
return root;
hash_for_each_possible_rcu(qdisc_dev(root)->qdisc_hash, q, hash... | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid) {
unsigned long cl;
const struct Qdisc_class_ops *cops = p->ops->cl_ops;
if (cops == NULL)
return NULL;
cl = cops->find(p, classid);
if (cl == 0)
return NULL;
return cops->leaf(p, cl);
} | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c | static struct Qdisc_ops *qdisc_lookup_ops(struct nlattr *kind) {
struct Qdisc_ops *q = NULL;
if (kind) {
read_lock(&qdisc_mod_lock);
for (q = qdisc_base; q; q = q->next) {
if (nla_strcmp(kind, q->id) == 0) {
if (!try_module_get(q->owner))
q = NULL;
break;
}
}
r... | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
struct nlattr *tab,
struct netlink_ext_ack *extack) {
struct qdisc_rate_table *rtab;
if (tab == NULL || r->rate == 0 || r->cell_log == 0 || r->cell_log >= 32 ||
nla_... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) {
struct nlattr *nest;
nest = nla_nest_start_noflag(skb, TCA_STAB);
if (nest == NULL)
goto nla_put_failure;
if (nla_put(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts))
goto nla_put_failure;
nla_nest_end(skb, nes... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
static struct hlist_head *qdisc_class_hash_alloc(unsigned int n) {
struct hlist_head *h;
unsigned int i;
h = kvmalloc_array(n, sizeof(struct hlist_head), GFP_KERNEL);
if (h != NULL) {
for (i = 0; i < n; i++)
INIT_HLIST_HEAD(&h[i]);
}
return h;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c | void qdisc_class_hash_grow(struct Qdisc *sch, struct Qdisc_class_hash *clhash) {
struct Qdisc_class_common *cl;
struct hlist_node *next;
struct hlist_head *nhash, *ohash;
unsigned int nsize, nmask, osize;
unsigned int i, h;
if (clhash->hashelems * 4 <= clhash->hashsize * 3)
return;
nsize = clhash->ha... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
int qdisc_class_hash_init(struct Qdisc_class_hash *clhash) {
unsigned int size = 4;
clhash->hash = qdisc_class_hash_alloc(size);
if (!clhash->hash)
return -ENOMEM;
clhash->hashsize = size;
clhash->hashmask = size - 1;
clhash->hashelems = 0;
return 0;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
void qdisc_class_hash_insert(struct Qdisc_class_hash *clhash,
struct Qdisc_class_common *cl) {
unsigned int h;
INIT_HLIST_NODE(&cl->hnode);
h = qdisc_class_hash(cl->classid, clhash->hashmask);
hlist_add_head(&cl->hnode, &clhash->hash[h]);
clhash->hashelems++;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
void qdisc_class_hash_remove(struct Qdisc_class_hash *clhash,
struct Qdisc_class_common *cl) {
hlist_del(&cl->hnode);
clhash->hashelems--;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c | void qdisc_offload_graft_helper(struct net_device *dev, struct Qdisc *sch,
struct Qdisc *new, struct Qdisc *old,
enum tc_setup_type type, void *type_data,
struct netlink_ext_ack *extack) {
bool any_qdisc_is_offloaded;
in... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
static void qdisc_offload_graft_root(struct net_device *dev, struct Qdisc *new,
struct Qdisc *old,
struct netlink_ext_ack *extack) {
struct tc_root_qopt_offload graft_offload = {
.command = TC_ROOT_GRAFT,
.handle = new ? new->handl... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
static void qdisc_clear_nolock(struct Qdisc *sch) {
sch->flags &= ~TCQ_F_NOLOCK;
if (!(sch->flags & TCQ_F_CPUSTATS))
return;
free_percpu(sch->cpu_bstats);
free_percpu(sch->cpu_qstats);
sch->cpu_bstats = NULL;
sch->cpu_qstats = NULL;
sch->flags &= ~TCQ_F_CPUSTATS;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static int qdisc_block_indexes_set(struct Qdisc *sch, struct nlattr **tca,
struct netlink_ext_ack *extack) {
u32 block_index;
if (tca[TCA_INGRESS_BLOCK]) {
block_index = nla_get_u32(tca[TCA_INGRESS_BLOCK]);
if (!block_index) {
NL_SET_ERR_MSG(extack, "Ingress block... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c | static int tc_dump_qdisc_root(struct Qdisc *root, struct sk_buff *skb,
struct netlink_callback *cb, int *q_idx_p,
int s_q_idx, bool recur, bool dump_invisible) {
int ret = 0, q_idx = *q_idx_p;
struct Qdisc *q;
int b;
if (!root)
return 0;
q = ro... | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static int tclass_del_notify(struct net *net,
const struct Qdisc_class_ops *cops,
struct sk_buff *oskb, struct nlmsghdr *n,
struct Qdisc *q, unsigned long cl,
struct netlink_ext_ack *extack) {
u32 port... | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static void tc_bind_tclass(struct Qdisc *q, u32 portid, u32 clid,
unsigned long new_cl) {}
#endif | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static int tc_dump_tclass_root(struct Qdisc *root, struct sk_buff *skb,
struct tcmsg *tcm, struct netlink_callback *cb,
int *t_p, int s_t, bool recur) {
struct Qdisc *q;
int b;
if (!root)
return 0;
if (tc_dump_tclass_qdisc(root, skb, tcm, cb, ... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c |
static int tc_dump_tclass(struct sk_buff *skb, struct netlink_callback *cb) {
struct tcmsg *tcm = nlmsg_data(cb->nlh);
struct net *net = sock_net(skb->sk);
struct netdev_queue *dev_queue;
struct net_device *dev;
int t, s_t;
if (nlmsg_len(cb->nlh) < sizeof(*tcm))
return 0;
dev = dev_get_by_index(net,... | [
1,
0
] |
Linux Kernel | net/sched/sch_api.c | static int psched_show(struct seq_file *seq, void *v) {
seq_printf(seq, "%08x %08x %08x %08x\n", (u32)NSEC_PER_USEC,
(u32)PSCHED_TICKS2NS(1), 1000000,
(u32)NSEC_PER_SEC / hrtimer_resolution);
return 0;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static void __net_exit psched_net_exit(struct net *net) {}
#endif | [
0,
0
] |
Linux Kernel | net/sched/sch_api.c |
static int __init pktsched_init(void) {
int err;
err = register_pernet_subsys(&psched_net_ops);
if (err) {
pr_err("pktsched_init: "
"cannot initialize per netns operations\n");
return err;
}
register_qdisc(&pfifo_fast_ops);
register_qdisc(&pfifo_qdisc_ops);
register_qdisc(&bfifo_qdis... | [
0,
0
] |
Linux Kernel | net/sched/sch_atm.c | static int atm_tc_delete(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack) {
struct atm_qdisc_data *p = qdisc_priv(sch);
struct atm_flow_data *flow = (struct atm_flow_data *)arg;
pr_debug("atm_tc_delete(sch %p,[qdisc %p],flow %p)\n", sch, p, flow);
if (list_empty(&f... | [
0,
0
] |
Linux Kernel | net/sched/sch_atm.c | static void sch_atm_dequeue(struct tasklet_struct *t) {
struct atm_qdisc_data *p = from_tasklet(p, t, task);
struct Qdisc *sch = qdisc_from_priv(p);
struct atm_flow_data *flow;
struct sk_buff *skb;
pr_debug("sch_atm_dequeue(sch %p,[qdisc %p])\n", sch, p);
list_for_each_entry(flow, &p->flows, list) {
if... | [
1,
0
] |
Linux Kernel | net/sched/sch_atm.c |
static void atm_tc_reset(struct Qdisc *sch) {
struct atm_qdisc_data *p = qdisc_priv(sch);
struct atm_flow_data *flow;
pr_debug("atm_tc_reset(sch %p,[qdisc %p])\n", sch, p);
list_for_each_entry(flow, &p->flows, list) qdisc_reset(flow->q);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_atm.c |
static int __init atm_init(void) { return register_qdisc(&atm_qdisc_ops); } | [
0,
0
] |
Linux Kernel | net/sched/sch_blackhole.c |
static int __init blackhole_init(void) {
return register_qdisc(&blackhole_qdisc_ops);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static void cobalt_set_enqueue_time(struct sk_buff *skb, ktime_t now) {
get_cobalt_cb(skb)->enqueue_time = now;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c | static void cobalt_newton_step(struct cobalt_vars *vars) {
u32 invsqrt, invsqrt2;
u64 val;
invsqrt = vars->rec_inv_sqrt;
invsqrt2 = ((u64)invsqrt * invsqrt) >> 32;
val = (3LL << 32) - ((u64)vars->count * invsqrt2);
val >>= 2;
val = (val * invsqrt) >> (32 - 2 + 1);
vars->rec_inv_sqrt = val;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_cake.c | static void cobalt_cache_init(void) {
struct cobalt_vars v;
memset(&v, 0, sizeof(v));
v.rec_inv_sqrt = ~0U;
cobalt_rec_inv_sqrt_cache[0] = v.rec_inv_sqrt;
for (v.count = 1; v.count < REC_INV_SQRT_CACHE; v.count++) {
cobalt_newton_step(&v);
cobalt_newton_step(&v);
cobalt_newton_step(&v);
coba... | [
1,
0
] |
Linux Kernel | net/sched/sch_cake.c | static struct sk_buff *dequeue_head(struct cake_flow *flow) {
struct sk_buff *skb = flow->head;
if (skb) {
flow->head = skb->next;
skb_mark_not_on_list(skb);
}
return skb;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c | static void flow_queue_add(struct cake_flow *flow, struct sk_buff *skb) {
if (!flow->head)
flow->head = skb;
else
flow->tail->next = skb;
flow->tail = skb;
skb->next = NULL;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c | static struct tcphdr *cake_get_tcphdr(const struct sk_buff *skb, void *buf,
unsigned int bufsize) {
unsigned int offset = skb_network_offset(skb);
const struct ipv6hdr *ipv6h;
const struct tcphdr *tcph;
const struct iphdr *iph;
struct ipv6hdr _ipv6h;
struct tcphdr _tcph... | [
1,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.