Projectname large_stringclasses 15
values | Filepath large_stringlengths 4 106 ⌀ | Function large_stringlengths 11 3.45k | Label list |
|---|---|---|---|
Linux Kernel | net/sched/sch_cake.c |
static void cake_tcph_get_tstamp(const struct tcphdr *tcph, u32 *tsval,
u32 *tsecr) {
const u8 *ptr;
int opsize;
ptr = cake_get_tcpopt(tcph, TCPOPT_TIMESTAMP, &opsize);
if (ptr && opsize == TCPOLEN_TIMESTAMP) {
*tsval = get_unaligned_be32(ptr);
*tsecr = get_unaligned_... | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static u64 cake_ewma(u64 avg, u64 sample, u32 shift) {
avg -= avg >> shift;
avg += sample >> shift;
return avg;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static u32 cake_heap_get_backlog(const struct cake_sched_data *q, u16 i) {
struct cake_heap_entry ii = q->overflow_heap[i];
return q->tins[ii.t].backlogs[ii.b];
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c | static u8 cake_handle_diffserv(struct sk_buff *skb, bool wash) {
const int offset = skb_network_offset(skb);
u16 *buf, buf_;
u8 dscp;
switch (skb_protocol(skb, true)) {
case htons(ETH_P_IP):
buf = skb_header_pointer(skb, offset, sizeof(buf_), &buf_);
if (unlikely(!buf))
return 0;
dscp = ip... | [
1,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static struct sk_buff *cake_dequeue_one(struct Qdisc *sch) {
struct cake_sched_data *q = qdisc_priv(sch);
struct cake_tin_data *b = &q->tins[q->cur_tin];
struct cake_flow *flow = &b->flows[q->cur_flow];
struct sk_buff *skb = NULL;
u32 len;
if (flow->head) {
skb = dequeue_head(flow);
len = qdisc_pk... | [
1,
0
] |
Linux Kernel | net/sched/sch_cake.c | static void cake_set_rate(struct cake_tin_data *b, u64 rate, u32 mtu,
u64 target_ns, u64 rtt_est_ns) {
static const u64 MIN_RATE = 64;
u32 byte_target = mtu;
u64 byte_target_ns;
u8 rate_shft = 0;
u64 rate_ns = 0;
b->flow_quantum = 1514;
if (rate) {
b->flow_quantum = max(min... | [
1,
0
] |
Linux Kernel | net/sched/sch_cake.c | static int cake_config_diffserv8(struct Qdisc *sch) {
struct cake_sched_data *q = qdisc_priv(sch);
u32 mtu = psched_mtu(qdisc_dev(sch));
u64 rate = q->rate_bps;
u32 quantum = 256;
u32 i;
q->tin_cnt = 8;
/* codepoint to class mapping */
q->tin_index = diffserv8;
q->tin_order = normal_order;
/* cl... | [
1,
0
] |
Linux Kernel | net/sched/sch_cake.c | static int cake_config_diffserv4(struct Qdisc *sch) {
struct cake_sched_data *q = qdisc_priv(sch);
u32 mtu = psched_mtu(qdisc_dev(sch));
u64 rate = q->rate_bps;
u32 quantum = 1024;
q->tin_cnt = 4;
/* codepoint to class mapping */
q->tin_index = diffserv4;
q->tin_order = bulk_order;
/* class charac... | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static unsigned long cake_find(struct Qdisc *sch, u32 classid) { return 0; } | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static unsigned long cake_bind(struct Qdisc *sch, unsigned long parent,
u32 classid) {
return 0;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cake.c |
static int cake_dump_class(struct Qdisc *sch, unsigned long cl,
struct sk_buff *skb, struct tcmsg *tcm) {
tcm->tcm_handle |= TC_H_MIN(cl);
return 0;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cbq.c | static void cbq_overlimit(struct cbq_class *cl) {
struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
psched_tdiff_t delay = cl->undertime - q->now;
if (!cl->delayed) {
delay += cl->offtime;
/*
* Class goes to sleep, so that it will have no
* chance to work avgidle. Let's forgive it 8)
*
... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c | static inline struct cbq_class *cbq_under_limit(struct cbq_class *cl) {
struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
struct cbq_class *this_cl = cl;
if (cl->tparent == NULL)
return cl;
if (cl->undertime == PSCHED_PASTPERFECT || q->now >= cl->undertime) {
cl->delayed = 0;
return cl;
}
do ... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static inline struct sk_buff *cbq_dequeue_1(struct Qdisc *sch) {
struct cbq_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
unsigned int activemask;
activemask = q->activemask & 0xFF;
while (activemask) {
int prio = ffz(~activemask);
activemask &= ~(1 << prio);
skb = cbq_dequeue_prio(sch, ... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c | static struct sk_buff *cbq_dequeue(struct Qdisc *sch) {
struct sk_buff *skb;
struct cbq_sched_data *q = qdisc_priv(sch);
psched_time_t now;
now = psched_get_time();
if (q->tx_class)
cbq_update(q);
q->now = now;
for (;;) {
q->wd_expires = 0;
skb = cbq_dequeue_1(sch);
if (skb) {
q... | [
0,
0
] |
Linux Kernel | net/sched/sch_cbq.c | static void cbq_normalize_quanta(struct cbq_sched_data *q, int prio) {
struct cbq_class *cl;
unsigned int h;
if (q->quanta[prio] == 0)
return;
for (h = 0; h < q->clhash.hashsize; h++) {
hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) {
if (cl->priority == prio) {
cl->quantum ... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static void cbq_change_defmap(struct cbq_class *cl, u32 splitid, u32 def,
u32 mask) {
struct cbq_class *split = NULL;
if (splitid == 0) {
split = cl->split;
if (!split)
return;
splitid = split->common.classid;
}
if (split == NULL || split->common.classid != spl... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static void cbq_set_lss(struct cbq_class *cl, struct tc_cbq_lssopt *lss) {
if (lss->change & TCF_CBQ_LSS_FLAGS) {
cl->share = (lss->flags & TCF_CBQ_LSS_ISOLATED) ? NULL : cl->tparent;
cl->borrow = (lss->flags & TCF_CBQ_LSS_BOUNDED) ? NULL : cl->tparent;
}
if (lss->change & TCF_CBQ_LSS_EWMA)
cl->ewma... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static void cbq_addprio(struct cbq_sched_data *q, struct cbq_class *cl) {
q->nclasses[cl->priority]++;
q->quanta[cl->priority] += cl->weight;
cbq_normalize_quanta(q, cl->priority);
} | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static int cbq_set_wrr(struct cbq_class *cl, struct tc_cbq_wrropt *wrr) {
struct cbq_sched_data *q = qdisc_priv(cl->qdisc);
if (wrr->allot)
cl->allot = wrr->allot;
if (wrr->weight)
cl->weight = wrr->weight;
if (wrr->priority) {
cl->priority = wrr->priority - 1;
cl->cpriority = cl->priority;
... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl) {
unsigned char *b = skb_tail_pointer(skb);
struct tc_cbq_wrropt opt;
memset(&opt, 0, sizeof(opt));
opt.flags = 0;
opt.allot = cl->allot;
opt.priority = cl->priority + 1;
opt.cpriority = cl->cpriority + 1;
opt.weight = cl->weight;
if... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static int cbq_dump_attr(struct sk_buff *skb, struct cbq_class *cl) {
if (cbq_dump_lss(skb, cl) < 0 || cbq_dump_rate(skb, cl) < 0 ||
cbq_dump_wrr(skb, cl) < 0 || cbq_dump_fopt(skb, cl) < 0)
return -1;
return 0;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static struct Qdisc *cbq_leaf(struct Qdisc *sch, unsigned long arg) {
struct cbq_class *cl = (struct cbq_class *)arg;
return cl->q;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cbq.c | static void cbq_destroy(struct Qdisc *sch) {
struct cbq_sched_data *q = qdisc_priv(sch);
struct hlist_node *next;
struct cbq_class *cl;
unsigned int h;
#ifdef CONFIG_NET_CLS_ACT
q->rx_class = NULL;
#endif
for (h = 0; h < q->clhash.hashsize; h++) {
hlist_for_each_entry(cl, &q->clhash.hash[h], common.hn... | [
0,
0
] |
Linux Kernel | net/sched/sch_cbq.c |
static void cbq_walk(struct Qdisc *sch, struct qdisc_walker *arg) {
struct cbq_sched_data *q = qdisc_priv(sch);
struct cbq_class *cl;
unsigned int h;
if (arg->stop)
return;
for (h = 0; h < q->clhash.hashsize; h++) {
hlist_for_each_entry(cl, &q->clhash.hash[h], common.hnode) {
if (!tc_qdisc_st... | [
0,
0
] |
Linux Kernel | net/sched/sch_cbq.c | static void __exit cbq_module_exit(void) { unregister_qdisc(&cbq_qdisc_ops); } | [
0,
0
] |
Linux Kernel | net/sched/sch_cbs.c | static int cbs_enqueue_soft(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff **to_free) {
struct cbs_sched_data *q = qdisc_priv(sch);
struct Qdisc *qdisc = q->qdisc;
if (sch->q.qlen == 0 && q->credits > 0) {
q->credits = 0;
q->last = ktime_get_ns();
}
return cbs_ch... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbs.c |
static int cbs_enqueue(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff **to_free) {
struct cbs_sched_data *q = qdisc_priv(sch);
return q->enqueue(skb, sch, to_free);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cbs.c | static s64 timediff_to_credits(s64 timediff, s64 slope) {
return div64_s64(timediff * slope, NSEC_PER_SEC);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cbs.c |
static s64 credits_from_len(unsigned int len, s64 slope, s64 port_rate) {
if (unlikely(port_rate == 0))
return S64_MAX;
return div64_s64(len * slope, port_rate);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_cbs.c | static struct sk_buff *cbs_dequeue_soft(struct Qdisc *sch) {
struct cbs_sched_data *q = qdisc_priv(sch);
struct Qdisc *qdisc = q->qdisc;
s64 now = ktime_get_ns();
struct sk_buff *skb;
s64 credits;
int len;
if (now < q->last) {
qdisc_watchdog_schedule_ns(&q->watchdog, q->last);
return NULL;
}
... | [
1,
0
] |
Linux Kernel | net/sched/sch_cbs.c |
static int cbs_enable_offload(struct net_device *dev, struct cbs_sched_data *q,
const struct tc_cbs_qopt *opt,
struct netlink_ext_ack *extack) {
const struct net_device_ops *ops = dev->netdev_ops;
struct tc_cbs_qopt_offload cbs = {};
int err;
if (!op... | [
0,
0
] |
Linux Kernel | net/sched/sch_cbs.c |
static int cbs_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
struct Qdisc **old, struct netlink_ext_ack *extack) {
struct cbs_sched_data *q = qdisc_priv(sch);
if (!new) {
new =
qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops, sch->handle, NULL);
if (!new)
... | [
0,
0
] |
Linux Kernel | net/sched/sch_cbs.c |
static unsigned long cbs_find(struct Qdisc *sch, u32 classid) { return 1; } | [
0,
0
] |
Linux Kernel | net/sched/sch_choke.c | static unsigned int choke_len(const struct choke_sched_data *q) {
return (q->tail - q->head) & q->tab_mask;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_choke.c | static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx,
struct sk_buff **to_free) {
struct choke_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb = q->tab[idx];
q->tab[idx] = NULL;
if (idx == q->head)
choke_zap_head_holes(q);
if (idx == q->tail)
choke_zap... | [
1,
0
] |
Linux Kernel | net/sched/sch_choke.c | static struct sk_buff *choke_peek_random(const struct choke_sched_data *q,
unsigned int *pidx) {
struct sk_buff *skb;
int retrys = 3;
do {
*pidx = (q->head + get_random_u32_below(choke_len(q))) & q->tab_mask;
skb = q->tab[*pidx];
if (skb)
return skb;
}... | [
0,
1
] |
Linux Kernel | net/sched/sch_choke.c |
static struct sk_buff *choke_dequeue(struct Qdisc *sch) {
struct choke_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
if (q->head == q->tail) {
if (!red_is_idling(&q->vars))
red_start_of_idle_period(&q->vars);
return NULL;
}
skb = q->tab[q->head];
q->tab[q->head] = NULL;
choke_zap_... | [
1,
0
] |
Linux Kernel | net/sched/sch_choke.c |
static void choke_reset(struct Qdisc *sch) {
struct choke_sched_data *q = qdisc_priv(sch);
while (q->head != q->tail) {
struct sk_buff *skb = q->tab[q->head];
q->head = (q->head + 1) & q->tab_mask;
if (!skb)
continue;
rtnl_qdisc_drop(skb, sch);
}
if (q->tab)
memset(q->tab, 0, (q->t... | [
1,
0
] |
Linux Kernel | net/sched/sch_choke.c |
static int choke_dump(struct Qdisc *sch, struct sk_buff *skb) {
struct choke_sched_data *q = qdisc_priv(sch);
struct nlattr *opts = NULL;
struct tc_red_qopt opt = {
.limit = q->limit,
.flags = q->flags,
.qth_min = q->parms.qth_min >> q->parms.Wlog,
.qth_max = q->parms.qth_max >> q->parms.... | [
1,
0
] |
Linux Kernel | net/sched/sch_choke.c |
static int choke_dump_stats(struct Qdisc *sch, struct gnet_dump *d) {
struct choke_sched_data *q = qdisc_priv(sch);
struct tc_choke_xstats st = {
.early = q->stats.prob_drop + q->stats.forced_drop,
.marked = q->stats.prob_mark + q->stats.forced_mark,
.pdrop = q->stats.pdrop,
.matched = q->s... | [
1,
0
] |
Linux Kernel | net/sched/sch_codel.c |
static void __exit codel_module_exit(void) {
unregister_qdisc(&codel_qdisc_ops);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_drr.c |
static struct drr_class *drr_find_class(struct Qdisc *sch, u32 classid) {
struct drr_sched *q = qdisc_priv(sch);
struct Qdisc_class_common *clc;
clc = qdisc_class_find(&q->clhash, classid);
if (clc == NULL)
return NULL;
return container_of(clc, struct drr_class, common);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_drr.c |
static int drr_delete_class(struct Qdisc *sch, unsigned long arg,
struct netlink_ext_ack *extack) {
struct drr_sched *q = qdisc_priv(sch);
struct drr_class *cl = (struct drr_class *)arg;
if (cl->filter_cnt > 0)
return -EBUSY;
sch_tree_lock(sch);
qdisc_purge_queue(cl->qdisc)... | [
0,
0
] |
Linux Kernel | net/sched/sch_drr.c |
static int drr_dump_class_stats(struct Qdisc *sch, unsigned long arg,
struct gnet_dump *d) {
struct drr_class *cl = (struct drr_class *)arg;
__u32 qlen = qdisc_qlen_sum(cl->qdisc);
struct Qdisc *cl_q = cl->qdisc;
struct tc_drr_stats xstats;
memset(&xstats, 0, sizeof(xstats));... | [
1,
0
] |
Linux Kernel | net/sched/sch_drr.c |
static int __init drr_init(void) { return register_qdisc(&drr_qdisc_ops); } | [
0,
0
] |
Linux Kernel | net/sched/sch_dsmark.c |
static unsigned long dsmark_bind_filter(struct Qdisc *sch, unsigned long parent,
u32 classid) {
pr_debug("%s(sch %p,[qdisc %p],classid %x)\n", __func__, sch, qdisc_priv(sch),
classid);
return dsmark_find(sch, classid);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_dsmark.c |
static void dsmark_unbind_filter(struct Qdisc *sch, unsigned long cl) {} | [
0,
0
] |
Linux Kernel | net/sched/sch_dsmark.c | static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) {
struct dsmark_qdisc_data *p = qdisc_priv(sch);
struct sk_buff *skb;
u32 index;
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
skb = qdisc_dequeue_peeked(p->q);
if (skb == NULL)
return NULL;
qdisc_bstats_update(sch, skb);
qdisc_qst... | [
1,
0
] |
Linux Kernel | net/sched/sch_dsmark.c |
static struct sk_buff *dsmark_peek(struct Qdisc *sch) {
struct dsmark_qdisc_data *p = qdisc_priv(sch);
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
return p->q->ops->peek(p->q);
} | [
1,
0
] |
Linux Kernel | net/sched/sch_dsmark.c |
static void dsmark_destroy(struct Qdisc *sch) {
struct dsmark_qdisc_data *p = qdisc_priv(sch);
pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
tcf_block_put(p->block);
qdisc_put(p->q);
if (p->mv != p->embedded)
kfree(p->mv);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_dsmark.c |
static void __exit dsmark_module_exit(void) {
unregister_qdisc(&dsmark_qdisc_ops);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_etf.c | static void report_sock_error(struct sk_buff *skb, u32 err, u8 code) {
struct sock_exterr_skb *serr;
struct sk_buff *clone;
ktime_t txtime = skb->tstamp;
struct sock *sk = skb->sk;
if (!sk || !sk_fullsock(sk) || !(sk->sk_txtime_report_errors))
return;
clone = skb_clone(skb, GFP_ATOMIC);
if (!clone)
... | [
0,
0
] |
Linux Kernel | net/sched/sch_etf.c | static struct sk_buff *etf_dequeue_timesortedlist(struct Qdisc *sch) {
struct etf_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
ktime_t now, next;
skb = etf_peek_timesortedlist(sch);
if (!skb)
return NULL;
now = q->get_time();
if (ktime_before(skb->tstamp, now)) {
timesortedlist_drop(sc... | [
0,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static void ets_offload_destroy(struct Qdisc *sch) {
struct net_device *dev = qdisc_dev(sch);
struct tc_ets_qopt_offload qopt;
if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
return;
qopt.command = TC_ETS_DESTROY;
qopt.handle = sch->handle;
qopt.parent = sch->parent;
dev->netdev_ops->nd... | [
1,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static void ets_offload_graft(struct Qdisc *sch, struct Qdisc *new,
struct Qdisc *old, unsigned long arg,
struct netlink_ext_ack *extack) {
struct net_device *dev = qdisc_dev(sch);
struct tc_ets_qopt_offload qopt;
qopt.command = TC_ETS_GRAFT;
qopt.ha... | [
0,
0
] |
Linux Kernel | net/sched/sch_ets.c | static int ets_class_change(struct Qdisc *sch, u32 classid, u32 parentid,
struct nlattr **tca, unsigned long *arg,
struct netlink_ext_ack *extack) {
struct ets_class *cl = ets_class_from_arg(sch, *arg);
struct ets_sched *q = qdisc_priv(sch);
struct nlattr *o... | [
0,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static unsigned long ets_class_find(struct Qdisc *sch, u32 classid) {
unsigned long band = TC_H_MIN(classid);
struct ets_sched *q = qdisc_priv(sch);
if (band - 1 >= q->nbands)
return 0;
return band;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static struct tcf_block *ets_qdisc_tcf_block(struct Qdisc *sch,
unsigned long cl,
struct netlink_ext_ack *extack) {
struct ets_sched *q = qdisc_priv(sch);
if (cl) {
NL_SET_ERR_MSG(extack, "ETS classid must be zero");
... | [
0,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
struct sk_buff **to_free) {
unsigned int len = qdisc_pkt_len(skb);
struct ets_sched *q = qdisc_priv(sch);
struct ets_class *cl;
int err = 0;
bool first;
cl = ets_classify(skb, sch, &err);
if (!cl) {
if ... | [
1,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch) {
struct ets_sched *q = qdisc_priv(sch);
struct ets_class *cl;
struct sk_buff *skb;
unsigned int band;
unsigned int len;
while (1) {
for (band = 0; band < q->nstrict; band++) {
cl = &q->classes[band];
skb = qdisc_dequeue_peeked(cl... | [
1,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static void ets_qdisc_reset(struct Qdisc *sch) {
struct ets_sched *q = qdisc_priv(sch);
int band;
for (band = q->nstrict; band < q->nbands; band++) {
if (q->classes[band].qdisc->q.qlen)
list_del(&q->classes[band].alist);
}
for (band = 0; band < q->nbands; band++)
qdisc_reset(q->classes[band].q... | [
0,
0
] |
Linux Kernel | net/sched/sch_ets.c |
static void ets_qdisc_destroy(struct Qdisc *sch) {
struct ets_sched *q = qdisc_priv(sch);
int band;
ets_offload_destroy(sch);
tcf_block_put(q->block);
for (band = 0; band < q->nbands; band++)
qdisc_put(q->classes[band].qdisc);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_fifo.c |
static void fifo_destroy(struct Qdisc *sch) { fifo_offload_destroy(sch); } | [
0,
0
] |
Linux Kernel | net/sched/sch_fifo.c |
static int __fifo_dump(struct Qdisc *sch, struct sk_buff *skb) {
struct tc_fifo_qopt opt = {.limit = sch->limit};
if (nla_put(skb, TCA_OPTIONS, sizeof(opt), &opt))
goto nla_put_failure;
return skb->len;
nla_put_failure:
return -1;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_fifo.c |
static int fifo_dump(struct Qdisc *sch, struct sk_buff *skb) {
int err;
err = fifo_offload_dump(sch);
if (err)
return err;
return __fifo_dump(sch, skb);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_fq.c |
static void fq_erase_head(struct Qdisc *sch, struct fq_flow *flow,
struct sk_buff *skb) {
if (skb == flow->head) {
flow->head = skb->next;
} else {
rb_erase(&skb->rbnode, &flow->t_root);
skb->dev = qdisc_dev(sch);
}
} | [
0,
0
] |
Linux Kernel | net/sched/sch_fq.c |
static void fq_destroy(struct Qdisc *sch) {
struct fq_sched_data *q = qdisc_priv(sch);
fq_reset(sch);
fq_free(q->fq_root);
qdisc_watchdog_cancel(&q->watchdog);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_fq.c |
static int __init fq_module_init(void) {
int ret;
fq_flow_cachep =
kmem_cache_create("fq_flow_cache", sizeof(struct fq_flow), 0, 0, NULL);
if (!fq_flow_cachep)
return -ENOMEM;
ret = register_qdisc(&fq_qdisc_ops);
if (ret)
kmem_cache_destroy(fq_flow_cachep);
return ret;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_fq_codel.c | static unsigned int fq_codel_drop(struct Qdisc *sch, unsigned int max_packets,
struct sk_buff **to_free) {
struct fq_codel_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
unsigned int maxbacklog = 0, idx = 0, i, len;
struct fq_codel_flow *flow;
unsigned int threshold;
... | [
1,
0
] |
Linux Kernel | net/sched/sch_fq_codel.c | static struct sk_buff *dequeue_func(struct codel_vars *vars, void *ctx) {
struct Qdisc *sch = ctx;
struct fq_codel_sched_data *q = qdisc_priv(sch);
struct fq_codel_flow *flow;
struct sk_buff *skb = NULL;
flow = container_of(vars, struct fq_codel_flow, cvars);
if (flow->head) {
skb = dequeue_head(flow);... | [
0,
0
] |
Linux Kernel | net/sched/sch_fq_codel.c | static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch) {
struct fq_codel_sched_data *q = qdisc_priv(sch);
struct sk_buff *skb;
struct fq_codel_flow *flow;
struct list_head *head;
begin:
head = &q->new_flows;
if (list_empty(head)) {
head = &q->old_flows;
if (list_empty(head))
return NULL;
... | [
1,
0
] |
Linux Kernel | net/sched/sch_fq_codel.c |
static int fq_codel_dump(struct Qdisc *sch, struct sk_buff *skb) {
struct fq_codel_sched_data *q = qdisc_priv(sch);
struct nlattr *opts;
opts = nla_nest_start_noflag(skb, TCA_OPTIONS);
if (opts == NULL)
goto nla_put_failure;
if (nla_put_u32(skb, TCA_FQ_CODEL_TARGET,
codel_time_to_us(q... | [
0,
0
] |
Linux Kernel | net/sched/sch_fq_codel.c |
static struct tcf_block *fq_codel_tcf_block(struct Qdisc *sch, unsigned long cl,
struct netlink_ext_ack *extack) {
struct fq_codel_sched_data *q = qdisc_priv(sch);
if (cl)
return NULL;
return q->block;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_fq_codel.c |
static int __init fq_codel_module_init(void) {
return register_qdisc(&fq_codel_qdisc_ops);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_fq_pie.c |
static int fq_pie_init(struct Qdisc *sch, struct nlattr *opt,
struct netlink_ext_ack *extack) {
struct fq_pie_sched_data *q = qdisc_priv(sch);
int err;
u32 idx;
pie_params_init(&q->p_params);
sch->limit = 10 * 1024;
q->p_params.limit = sch->limit;
q->quantum = psched_mtu(qdisc_dev... | [
1,
0
] |
Linux Kernel | net/sched/sch_fq_pie.c |
static int fq_pie_dump_stats(struct Qdisc *sch, struct gnet_dump *d) {
struct fq_pie_sched_data *q = qdisc_priv(sch);
struct tc_fq_pie_xstats st = {
.packets_in = q->stats.packets_in,
.overlimit = q->stats.overlimit,
.overmemory = q->overmemory,
.dropped = q->stats.dropped,
.ecn_mark ... | [
1,
0
] |
Linux Kernel | net/sched/sch_fq_pie.c | static void fq_pie_reset(struct Qdisc *sch) {
struct fq_pie_sched_data *q = qdisc_priv(sch);
u32 idx;
INIT_LIST_HEAD(&q->new_flows);
INIT_LIST_HEAD(&q->old_flows);
for (idx = 0; idx < q->flows_cnt; idx++) {
struct fq_pie_flow *flow = q->flows + idx;
rtnl_kfree_skbs(flow->head, flow->tail);
flow-... | [
0,
0
] |
Linux Kernel | net/sched/sch_frag.c | static int sch_frag_xmit(struct net *net, struct sock *sk,
struct sk_buff *skb) {
struct sch_frag_data *data = this_cpu_ptr(&sch_frag_data_storage);
if (skb_cow_head(skb, data->l2_len) < 0) {
kfree_skb(skb);
return -ENOMEM;
}
__skb_dst_copy(skb, data->dst);
*qdisc_skb_cb(skb... | [
1,
0
] |
Linux Kernel | net/sched/sch_frag.c |
static void sch_frag_prepare_frag(struct sk_buff *skb,
int (*xmit)(struct sk_buff *skb)) {
unsigned int hlen = skb_network_offset(skb);
struct sch_frag_data *data;
data = this_cpu_ptr(&sch_frag_data_storage);
data->dst = skb->_skb_refdst;
data->cb = *qdisc_skb_cb(skb);
da... | [
1,
0
] |
Linux Kernel | net/sched/sch_frag.c |
int sch_frag_xmit_hook(struct sk_buff *skb, int (*xmit)(struct sk_buff *skb)) {
u16 mru = tc_skb_cb(skb)->mru;
int err;
if (mru && skb->len > mru + skb->dev->hard_header_len)
err = sch_fragment(dev_net(skb->dev), skb, mru, xmit);
else
err = xmit(skb);
return err;
} | [
1,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static inline struct sk_buff *qdisc_dequeue_skb_bad_txq(struct Qdisc *q) {
struct sk_buff *skb = skb_peek(&q->skb_bad_txq);
if (unlikely(skb))
skb = __skb_dequeue_bad_txq(q);
return skb;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c | static void try_bulk_dequeue_skb(struct Qdisc *q, struct sk_buff *skb,
const struct netdev_queue *txq, int *packets) {
int bytelimit = qdisc_avail_bulklimit(txq) - skb->len;
while (bytelimit > 0) {
struct sk_buff *nskb = q->dequeue(q);
if (!nskb)
break;
bytelimi... | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c | static void netif_freeze_queues(struct net_device *dev) {
unsigned int i;
int cpu;
cpu = smp_processor_id();
for (i = 0; i < dev->num_tx_queues; i++) {
struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
__netif_tx_lock(txq, cpu);
set_bit(__QUEUE_STATE_FROZEN, &txq->state);
__netif_tx_unlo... | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
void netif_tx_lock(struct net_device *dev) {
spin_lock(&dev->tx_global_lock);
netif_freeze_queues(dev);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
void netif_tx_unlock(struct net_device *dev) {
netif_unfreeze_queues(dev);
spin_unlock(&dev->tx_global_lock);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c | static int noop_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
struct sk_buff **to_free) {
__qdisc_drop(skb, to_free);
return NET_XMIT_CN;
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static struct sk_buff *noop_dequeue(struct Qdisc *qdisc) { return NULL; } | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static int pfifo_fast_enqueue(struct sk_buff *skb, struct Qdisc *qdisc,
struct sk_buff **to_free) {
int band = prio2band[skb->priority & TC_PRIO_MAX];
struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
struct skb_array *q = band2list(priv, band);
unsigned int pkt_len = qdisc_pkt_le... | [
1,
0
] |
Linux Kernel | net/sched/sch_generic.c | static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) {
struct pfifo_fast_priv *priv = qdisc_priv(qdisc);
struct sk_buff *skb = NULL;
bool need_retry = true;
int band;
retry:
for (band = 0; band < PFIFO_FAST_BANDS && !skb; band++) {
struct skb_array *q = band2list(priv, band);
if (__skb_arr... | [
1,
0
] |
Linux Kernel | net/sched/sch_generic.c | struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
const struct Qdisc_ops *ops,
struct netlink_ext_ack *extack) {
struct Qdisc *sch;
unsigned int size = sizeof(*sch) + ops->priv_size;
int err = -ENOBUFS;
struct net_device *dev;
if (!dev_queue) {
... | [
1,
0
] |
Linux Kernel | net/sched/sch_generic.c |
void qdisc_free(struct Qdisc *qdisc) {
if (qdisc_is_percpu_stats(qdisc)) {
free_percpu(qdisc->cpu_bstats);
free_percpu(qdisc->cpu_qstats);
}
kfree(qdisc);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static void qdisc_destroy(struct Qdisc *qdisc) {
const struct Qdisc_ops *ops = qdisc->ops;
#ifdef CONFIG_NET_SCHED
qdisc_hash_del(qdisc);
qdisc_put_stab(rtnl_dereference(qdisc->stab));
#endif
gen_kill_estimator(&qdisc->rate_est);
qdisc_reset(qdisc);
if (ops->destroy)
ops->destroy(qdisc);
module_... | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
void qdisc_put(struct Qdisc *qdisc) {
if (!qdisc)
return;
if (qdisc->flags & TCQ_F_BUILTIN || !refcount_dec_and_test(&qdisc->refcnt))
return;
qdisc_destroy(qdisc);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static void transition_one_qdisc(struct net_device *dev,
struct netdev_queue *dev_queue,
void *_need_watchdog) {
struct Qdisc *new_qdisc = dev_queue->qdisc_sleeping;
int *need_watchdog_p = _need_watchdog;
if (!(new_qdisc->flags & TCQ_F_BUILTIN))
... | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static void qdisc_deactivate(struct Qdisc *qdisc) {
if (qdisc->flags & TCQ_F_BUILTIN)
return;
set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c | void dev_deactivate_many(struct list_head *head) {
struct net_device *dev;
list_for_each_entry(dev, head, close_list) {
netdev_for_each_tx_queue(dev, dev_deactivate_queue, &noop_qdisc);
if (dev_ingress_queue(dev))
dev_deactivate_queue(dev, dev_ingress_queue(dev), &noop_qdisc);
dev_watchdog_down(... | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
void dev_deactivate(struct net_device *dev) {
LIST_HEAD(single);
list_add(&dev->close_list, &single);
dev_deactivate_many(&single);
list_del(&single);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
void dev_qdisc_change_real_num_tx(struct net_device *dev,
unsigned int new_real_tx) {
struct Qdisc *qdisc = rtnl_dereference(dev->qdisc);
if (qdisc->ops->change_real_num_tx)
qdisc->ops->change_real_num_tx(qdisc, new_real_tx);
} | [
0,
0
] |
Linux Kernel | net/sched/sch_generic.c |
static void dev_init_scheduler_queue(struct net_device *dev,
struct netdev_queue *dev_queue,
void *_qdisc) {
struct Qdisc *qdisc = _qdisc;
rcu_assign_pointer(dev_queue->qdisc, qdisc);
dev_queue->qdisc_sleeping = qdisc;
} | [
0,
0
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.