Projectname
large_stringclasses
15 values
Filepath
large_stringlengths
4
106
⌀
Function
large_stringlengths
11
3.45k
Label
list
Linux Kernel
net/rxrpc/peer_event.c
void rxrpc_peer_keepalive_worker(struct work_struct *work) { struct rxrpc_net *rxnet = container_of(work, struct rxrpc_net, peer_keepalive_work); const u8 mask = ARRAY_SIZE(rxnet->peer_keepalive) - 1; time64_t base, now, delay; u8 cursor, stop; LIST_HEAD(collector); now = ktime_get_seconds(); base ...
[ 1, 0 ]
Linux Kernel
net/rxrpc/peer_object.c
static void rxrpc_assess_MTU_size(struct rxrpc_sock *rx, struct rxrpc_peer *peer) { struct net *net = sock_net(&rx->sk); struct dst_entry *dst; struct rtable *rt; struct flowi fl; struct flowi4 *fl4 = &fl.u.ip4; #ifdef CONFIG_AF_RXRPC_IPV6 struct flowi6 *fl6 = &fl.u.ip6; #e...
[ 1, 0 ]
Linux Kernel
net/rxrpc/peer_object.c
static void __rxrpc_put_peer(struct rxrpc_peer *peer) { struct rxrpc_net *rxnet = peer->local->rxnet; ASSERT(hlist_empty(&peer->error_targets)); spin_lock(&rxnet->peer_hash_lock); hash_del_rcu(&peer->hash_link); list_del_init(&peer->keepalive_link); spin_unlock(&rxnet->peer_hash_lock); rxrpc_free_peer(...
[ 1, 0 ]
Linux Kernel
net/rxrpc/peer_object.c
void rxrpc_destroy_all_peers(struct rxrpc_net *rxnet) { struct rxrpc_peer *peer; int i; for (i = 0; i < HASH_SIZE(rxnet->peer_hash); i++) { if (hlist_empty(&rxnet->peer_hash[i])) continue; hlist_for_each_entry(peer, &rxnet->peer_hash[i], hash_link) { pr_err("Leaked peer %u {%u} %pISp\n", pee...
[ 0, 0 ]
Linux Kernel
net/rxrpc/peer_object.c
bool rxrpc_kernel_get_srtt(struct socket *sock, struct rxrpc_call *call, u32 *_srtt) { struct rxrpc_peer *peer = call->peer; if (peer->rtt_count == 0) { *_srtt = 1000000; return false; } *_srtt = call->peer->srtt_us >> 3; return true; }
[ 1, 0 ]
Linux Kernel
net/rxrpc/proc.c
static void rxrpc_call_seq_stop(struct seq_file *seq, void *v) __releases(rcu) { rcu_read_unlock(); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/proc.c
static void *rxrpc_connection_seq_next(struct seq_file *seq, void *v, loff_t *pos) { struct rxrpc_net *rxnet = rxrpc_net(seq_file_net(seq)); return seq_list_next(v, &rxnet->conn_proc_list, pos); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/proc.c
static void *rxrpc_peer_seq_start(struct seq_file *seq, loff_t *_pos) __acquires(rcu) { struct rxrpc_net *rxnet = rxrpc_net(seq_file_net(seq)); unsigned int bucket, n; unsigned int shift = 32 - HASH_BITS(rxnet->peer_hash); void *p; rcu_read_lock(); if (*_pos >= UINT_MAX) return NULL; n = *_pos...
[ 1, 0 ]
Linux Kernel
net/rxrpc/proc.c
int rxrpc_stats_clear(struct file *file, char *buf, size_t size) { struct seq_file *m = file->private_data; struct rxrpc_net *rxnet = rxrpc_net(seq_file_single_net(m)); if (size > 1 || (size == 1 && buf[0] != '\n')) return -EINVAL; atomic_set(&rxnet->stat_tx_data, 0); atomic_set(&rxnet->stat_tx_data_ret...
[ 1, 0 ]
Linux Kernel
net/rxrpc/recvmsg.c
bool rxrpc_abort_call(const char *why, struct rxrpc_call *call, rxrpc_seq_t seq, u32 abort_code, int error) { bool ret; write_lock(&call->state_lock); ret = __rxrpc_abort_call(why, call, seq, abort_code, error); write_unlock(&call->state_lock); return ret; }
[ 0, 0 ]
Linux Kernel
net/rxrpc/recvmsg.c
static int rxrpc_recvmsg_term(struct rxrpc_call *call, struct msghdr *msg) { u32 tmp = 0; int ret; switch (call->completion) { case RXRPC_CALL_SUCCEEDED: ret = 0; if (rxrpc_is_service_call(call)) ret = put_cmsg(msg, SOL_RXRPC, RXRPC_ACK, 0, &tmp); break; case RXRPC_CALL_REMOTELY_ABORTED: ...
[ 0, 0 ]
Linux Kernel
net/rxrpc/recvmsg.c
static void rxrpc_end_rx_phase(struct rxrpc_call *call, rxrpc_serial_t serial) { rxrpc_seq_t whigh = READ_ONCE(call->rx_highest_seq); _enter("%d,%s", call->debug_id, rxrpc_call_states[call->state]); trace_rxrpc_receive(call, rxrpc_receive_end, 0, whigh); if (call->state == RXRPC_CALL_CLIENT_RECV_REPLY) r...
[ 1, 0 ]
Linux Kernel
net/rxrpc/recvmsg.c
static void rxrpc_rotate_rx_window(struct rxrpc_call *call) { struct rxrpc_skb_priv *sp; struct sk_buff *skb; rxrpc_serial_t serial; rxrpc_seq_t old_consumed = call->rx_consumed, tseq; bool last; int acked; _enter("%d", call->debug_id); skb = skb_dequeue(&call->recvmsg_queue); rxrpc_see_skb(skb, rxr...
[ 0, 0 ]
Linux Kernel
net/rxrpc/rtt.c
static u32 rxrpc_rto_min_us(struct rxrpc_peer *peer) { return 200; }
[ 0, 0 ]
Linux Kernel
net/rxrpc/rtt.c
static u32 __rxrpc_set_rto(const struct rxrpc_peer *peer) { return usecs_to_jiffies((peer->srtt_us >> 3) + peer->rttvar_us); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/rtt.c
static void rxrpc_set_rto(struct rxrpc_peer *peer) { u32 rto; rto = __rxrpc_set_rto(peer); /* 2. Fixups made earlier cannot be right. * If we do not estimate RTO correctly without them, * all the algo is pure shit and should be replaced * with correct one. It is exactly, which we pretend to do...
[ 0, 0 ]
Linux Kernel
net/rxrpc/rtt.c
static void rxrpc_ack_update_rtt(struct rxrpc_peer *peer, long rtt_us) { if (rtt_us < 0) return; rxrpc_rtt_estimator(peer, rtt_us); rxrpc_set_rto(peer); /* RFC6298: only reset backoff on valid RTT measurement. */ peer->backoff = 0; }
[ 0, 0 ]
Linux Kernel
net/rxrpc/rtt.c
void rxrpc_peer_add_rtt(struct rxrpc_call *call, enum rxrpc_rtt_rx_trace why, int rtt_slot, rxrpc_serial_t send_serial, rxrpc_serial_t resp_serial, ktime_t send_time, ktime_t resp_time) { struct rxrpc_peer *peer = call->peer; s64 rtt_us; rtt...
[ 1, 0 ]
Linux Kernel
net/rxrpc/rxkad.c
static int rxkad_how_much_data(struct rxrpc_call *call, size_t remain, size_t *_buf_size, size_t *_data_size, size_t *_offset) { size_t shdr, buf_size, chunk; switch (call->conn->security_level) { default: buf_size = chunk = min_t(size_t, remain, ...
[ 1, 0 ]
Linux Kernel
net/rxrpc/rxkad.c
static void rxkad_free_call_crypto(struct rxrpc_call *call) {}
[ 0, 0 ]
Linux Kernel
net/rxrpc/rxkad.c
static int rxkad_secure_packet_auth(const struct rxrpc_call *call, struct rxrpc_txbuf *txb, struct skcipher_request *req) { struct rxkad_level1_hdr *hdr = (void *)txb->data; struct rxrpc_crypt iv; struct scatterlist sg; size_t pad; u16 ch...
[ 1, 0 ]
Linux Kernel
net/rxrpc/rxkad.c
static int rxkad_secure_packet_encrypt(const struct rxrpc_call *call, struct rxrpc_txbuf *txb, struct skcipher_request *req) { const struct rxrpc_key_token *token; struct rxkad_level2_hdr *rxkhdr = (void *)txb->data; struct rxrpc_crypt ...
[ 1, 0 ]
Linux Kernel
net/rxrpc/rxperf.c
static void rxperf_rx_attach(struct rxrpc_call *rxcall, unsigned long user_call_ID) { struct rxperf_call *call = (struct rxperf_call *)user_call_ID; call->rxcall = rxcall; }
[ 0, 0 ]
Linux Kernel
net/rxrpc/rxperf.c
static void rxperf_notify_end_reply_tx(struct sock *sock, struct rxrpc_call *rxcall, unsigned long call_user_ID) { rxperf_set_call_state((struct rxperf_call *)call_user_ID, RXPERF_CALL_SV_AWAIT_ACK); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/rxperf.c
static void rxperf_close_socket(void) { kernel_listen(rxperf_socket, 0); kernel_sock_shutdown(rxperf_socket, SHUT_RDWR); flush_workqueue(rxperf_workqueue); sock_release(rxperf_socket); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/rxperf.c
static void rxperf_log_error(struct rxperf_call *call, s32 remote_abort) { static int max = 0; const char *msg; int m; switch (remote_abort) { case RX_EOF: msg = "unexpected EOF"; break; case RXGEN_CC_MARSHAL: msg = "client marshalling"; break; case RXGEN_CC_UNMARSHAL: msg = "client u...
[ 0, 0 ]
Linux Kernel
net/rxrpc/rxperf.c
static int rxperf_deliver_request(struct rxperf_call *call) { int ret; switch (call->unmarshal) { case 0: call->kvec[0].iov_len = call->iov_len; call->kvec[0].iov_base = call->tmp; iov_iter_kvec(&call->iter, READ, call->kvec, 1, call->iov_len); call->unmarshal++; fallthrough; case 1: re...
[ 0, 0 ]
Linux Kernel
net/rxrpc/security.c
const struct rxrpc_security *rxrpc_security_lookup(u8 security_index) { if (security_index >= ARRAY_SIZE(rxrpc_security_types)) return NULL; return rxrpc_security_types[security_index]; }
[ 0, 0 ]
Linux Kernel
net/rxrpc/sendmsg.c
static int rxrpc_wait_for_tx_window_intr(struct rxrpc_sock *rx, struct rxrpc_call *call, long *timeo) { for (;;) { set_current_state(TASK_INTERRUPTIBLE); if (rxrpc_check_tx_space(call, NULL)) return 0; if (call->state >= RXRPC_CALL_COMPLETE) return cal...
[ 0, 0 ]
Linux Kernel
net/rxrpc/sendmsg.c
static int rxrpc_wait_for_tx_window_nonintr(struct rxrpc_sock *rx, struct rxrpc_call *call, long *timeo) { for (;;) { set_current_state(TASK_UNINTERRUPTIBLE); if (rxrpc_check_tx_space(call, NULL)) return 0; if (...
[ 0, 0 ]
Linux Kernel
net/rxrpc/server_key.c
static int rxrpc_vet_description_s(const char *desc) { unsigned long service, sec_class; char *p; service = simple_strtoul(desc, &p, 10); if (*p != ':' || service > 65535) return -EINVAL; sec_class = simple_strtoul(p + 1, &p, 10); if ((*p && *p != ':') || sec_class < 1 || sec_class > 255) return -E...
[ 0, 0 ]
Linux Kernel
net/rxrpc/server_key.c
static int rxrpc_preparse_s(struct key_preparsed_payload *prep) { const struct rxrpc_security *sec; unsigned int service, sec_class; int n; _enter("%zu", prep->datalen); if (!prep->orig_description) return -EINVAL; if (sscanf(prep->orig_description, "%u:%u%n", &service, &sec_class, &n) != 2) retu...
[ 0, 0 ]
Linux Kernel
net/rxrpc/server_key.c
static void rxrpc_destroy_s(struct key *key) { const struct rxrpc_security *sec = key->payload.data[1]; if (sec && sec->destroy_server_key) sec->destroy_server_key(key); }
[ 1, 0 ]
Linux Kernel
net/rxrpc/skbuff.c
void rxrpc_new_skb(struct sk_buff *skb, enum rxrpc_skb_trace why) { int n = atomic_inc_return(select_skb_count(skb)); trace_rxrpc_skb(skb, refcount_read(&skb->users), n, why); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/sysctl.c
void rxrpc_sysctl_exit(void) { if (rxrpc_sysctl_reg_table) unregister_net_sysctl_table(rxrpc_sysctl_reg_table); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/txbuf.c
static void rxrpc_free_txbuf(struct rcu_head *rcu) { struct rxrpc_txbuf *txb = container_of(rcu, struct rxrpc_txbuf, rcu); trace_rxrpc_txbuf(txb->debug_id, txb->call_debug_id, txb->seq, 0, rxrpc_txbuf_free); kfree(txb); atomic_dec(&rxrpc_nr_txbuf); }
[ 0, 0 ]
Linux Kernel
net/rxrpc/txbuf.c
void rxrpc_shrink_call_tx_buffer(struct rxrpc_call *call) { struct rxrpc_txbuf *txb; rxrpc_seq_t hard_ack = smp_load_acquire(&call->acks_hard_ack); bool wake = false; _enter("%x/%x/%x", call->tx_bottom, call->acks_hard_ack, call->tx_top); for (;;) { spin_lock(&call->tx_lock); txb = list_first_entry_...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static void tcf_action_goto_chain_exec(const struct tc_action *a, struct tcf_result *res) { const struct tcf_chain *chain = rcu_dereference_bh(a->goto_chain); res->goto_tp = rcu_dereference_bh(chain->filter_chain); }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static bool tc_act_skip_hw(u32 flags) { return (flags & TCA_ACT_FLAGS_SKIP_HW) ? true : false; }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_action_offload_add(struct tc_action *action, struct netlink_ext_ack *extack) { return tcf_action_offload_add_ex(action, extack, NULL, NULL); }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static void tcf_action_cleanup(struct tc_action *p) { tcf_action_offload_del(p); if (p->ops->cleanup) p->ops->cleanup(p); gen_kill_estimator(&p->tcfa_rate_est); free_tcf(p); }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static int __tcf_idr_release(struct tc_action *p, bool bind, bool strict) { int ret = 0; if (p) { if (!bind && strict && atomic_read(&p->tcfa_bindcnt) > 0) return -EPERM; if (__tcf_action_put(p, bind)) ret = ACT_P_DELETED; } return ret; }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static size_t tcf_action_shared_attrs_size(const struct tc_action *act) { struct tc_cookie *act_cookie; u32 cookie_len = 0; rcu_read_lock(); act_cookie = rcu_dereference(act->act_cookie); if (act_cookie) cookie_len = nla_total_size(act_cookie->len); rcu_read_unlock(); return nla_total_size(0) + nla...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_action_dump_terse(struct sk_buff *skb, struct tc_action *a, bool from_act) { unsigned char *b = skb_tail_pointer(skb); struct tc_cookie *cookie; if (nla_put_string(skb, TCA_KIND, a->ops->kind)) goto nla_put_failure; if (tcf_action_copy_stats(skb, a, 0)) ...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_idr_release_unsafe(struct tc_action *p) { if (atomic_read(&p->tcfa_bindcnt) > 0) return -EPERM; if (refcount_dec_and_test(&p->tcfa_refcnt)) { idr_remove(&p->idrinfo->action_idr, p->tcfa_index); tcf_action_cleanup(p); return ACT_P_DELETED; } return 0; }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_del_walker(struct tcf_idrinfo *idrinfo, struct sk_buff *skb, const struct tc_action_ops *ops, struct netlink_ext_ack *extack) { struct nlattr *nest; int n_i = 0; int ret = -EINVAL; struct idr *idr = &idrinfo->action_idr; struct tc_action *p; ...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_idr_delete_index(struct tcf_idrinfo *idrinfo, u32 index) { struct tc_action *p; int ret = 0; mutex_lock(&idrinfo->lock); p = idr_find(&idrinfo->action_idr, index); if (!p) { mutex_unlock(&idrinfo->lock); return -ENOENT; } if (!atomic_read(&p->tcfa_bindcnt)) { if (refcount_dec...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
int tcf_idr_create(struct tc_action_net *tn, u32 index, struct nlattr *est, struct tc_action **a, const struct tc_action_ops *ops, int bind, bool cpustats, u32 flags) { struct tc_action *p = kzalloc(ops->size, GFP_KERNEL); struct tcf_idrinfo *idrinfo = tn->idrinfo; int err =...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
int tcf_idr_check_alloc(struct tc_action_net *tn, u32 *index, struct tc_action **a, int bind) { struct tcf_idrinfo *idrinfo = tn->idrinfo; struct tc_action *p; int ret; again: mutex_lock(&idrinfo->lock); if (*index) { p = idr_find(&idrinfo->action_idr, *index); if (IS_ERR(p)) ...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static void tcf_pernet_del_id_list(unsigned int id) { struct tc_act_pernet_id *id_ptr; mutex_lock(&act_id_mutex); list_for_each_entry(id_ptr, &act_pernet_id_list, list) { if (id_ptr->id == id) { list_del(&id_ptr->list); kfree(id_ptr); break; } } mutex_unlock(&act_id_mutex); }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static struct tc_action_ops *tc_lookup_action_n(char *kind) { struct tc_action_ops *a, *res = NULL; if (kind) { read_lock(&act_mod_lock); list_for_each_entry(a, &act_base, head) { if (strcmp(kind, a->kind) == 0) { if (try_module_get(a->owner)) res = a; break; } } ...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
int tcf_action_dump_old(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { return a->ops->dump(skb, a, bind, ref); }
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
void tcf_idr_insert_many(struct tc_action *actions[]) { int i; for (i = 0; i < TCA_ACT_MAX_PRIO; i++) { struct tc_action *a = actions[i]; struct tcf_idrinfo *idrinfo; if (!a) continue; idrinfo = a->idrinfo; mutex_lock(&idrinfo->lock); idr_replace(&idrinfo->action_idr, a, a->tcfa_ind...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
void tcf_action_update_stats(struct tc_action *a, u64 bytes, u64 packets, u64 drops, bool hw) { if (a->cpu_bstats) { _bstats_update(this_cpu_ptr(a->cpu_bstats), bytes, packets); this_cpu_ptr(a->cpu_qstats)->drops += drops; if (hw) _bstats_update(this_cpu_ptr(a->cpu_bs...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static int tca_get_fill(struct sk_buff *skb, struct tc_action *actions[], u32 portid, u32 seq, u16 flags, int event, int bind, int ref) { struct tcamsg *t; struct nlmsghdr *nlh; unsigned char *b = skb_tail_pointer(skb); struct nlattr *nest; nlh = nlmsg_put(skb...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_get_notify(struct net *net, u32 portid, struct nlmsghdr *n, struct tc_action *actions[], int event, struct netlink_ext_ack *extack) { struct sk_buff *skb; skb = alloc_skb(NLMSG_GOODSIZE, GFP_KERNEL); if (!skb) return -ENOBUFS; if (tca_get_...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static int tca_action_gd(struct net *net, struct nlattr *nla, struct nlmsghdr *n, u32 portid, int event, struct netlink_ext_ack *extack) { int i, ret; struct nlattr *tb[TCA_ACT_MAX_PRIO + 1]; struct tc_action *act; size_t attr_size = 0; struct tc_action *actio...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_add_notify(struct net *net, struct nlmsghdr *n, struct tc_action *actions[], u32 portid, size_t attr_size, struct netlink_ext_ack *extack) { struct sk_buff *skb; skb = alloc_skb(attr_size <= NLMSG_GOODSIZE ? NLMSG_GOODSIZE : attr_size, ...
[ 0, 0 ]
Linux Kernel
net/sched/act_api.c
static int tcf_action_add(struct net *net, struct nlattr *nla, struct nlmsghdr *n, u32 portid, u32 flags, struct netlink_ext_ack *extack) { size_t attr_size = 0; int loop, ret, i; struct tc_action *actions[TCA_ACT_MAX_PRIO] = {}; int init_res[TCA_ACT_MAX_PRIO]...
[ 1, 0 ]
Linux Kernel
net/sched/act_api.c
static int __init tc_action_init(void) { rtnl_register(PF_UNSPEC, RTM_NEWACTION, tc_ctl_action, NULL, 0); rtnl_register(PF_UNSPEC, RTM_DELACTION, tc_ctl_action, NULL, 0); rtnl_register(PF_UNSPEC, RTM_GETACTION, tc_ctl_action, tc_dump_action, 0); return 0; }
[ 0, 0 ]
Linux Kernel
net/sched/act_bpf.c
static int tcf_bpf_init_from_efd(struct nlattr **tb, struct tcf_bpf_cfg *cfg) { struct bpf_prog *fp; char *name = NULL; u32 bpf_fd; bpf_fd = nla_get_u32(tb[TCA_ACT_BPF_FD]); fp = bpf_prog_get_type(bpf_fd, BPF_PROG_TYPE_SCHED_ACT); if (IS_ERR(fp)) return PTR_ERR(fp); if (tb[TCA_ACT_BPF_NAME]) { ...
[ 0, 0 ]
Linux Kernel
net/sched/act_bpf.c
static void tcf_bpf_cfg_cleanup(const struct tcf_bpf_cfg *cfg) { struct bpf_prog *filter = cfg->filter; if (filter) { if (cfg->is_ebpf) bpf_prog_put(filter); else bpf_prog_destroy(filter); } kfree(cfg->bpf_ops); kfree(cfg->bpf_name); }
[ 0, 0 ]
Linux Kernel
net/sched/act_csum.c
static int tcf_csum_ipv4_icmp(struct sk_buff *skb, unsigned int ihl, unsigned int ipl) { struct icmphdr *icmph; icmph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*icmph)); if (icmph == NULL) return 0; icmph->checksum = 0; skb->csum = csum_partial(icmph, ipl - ihl, 0); ...
[ 1, 0 ]
Linux Kernel
net/sched/act_csum.c
static int tcf_csum_ipv4_igmp(struct sk_buff *skb, unsigned int ihl, unsigned int ipl) { struct igmphdr *igmph; igmph = tcf_csum_skb_nextlayer(skb, ihl, ipl, sizeof(*igmph)); if (igmph == NULL) return 0; igmph->csum = 0; skb->csum = csum_partial(igmph, ipl - ihl, 0); igm...
[ 1, 0 ]
Linux Kernel
net/sched/act_csum.c
static int tcf_csum_ipv6_hopopts(struct ipv6_opt_hdr *ip6xh, unsigned int ixhl, unsigned int *pl) { int off, len, optlen; unsigned char *xh = (void *)ip6xh; off = sizeof(*ip6xh); len = ixhl - off; while (len > 1) { switch (xh[off]) { case IPV6_TLV_PAD1: optlen ...
[ 1, 0 ]
Linux Kernel
net/sched/act_csum.c
static size_t tcf_csum_get_fill_size(const struct tc_action *act) { return nla_total_size(sizeof(struct tc_csum)); }
[ 0, 0 ]
Linux Kernel
net/sched/act_csum.c
static __net_init int csum_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, act_csum_ops.net_id); return tc_action_net_init(net, tn, &act_csum_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_csum.c
static void __net_exit csum_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_csum_ops.net_id); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static struct flow_action_entry * tcf_ct_flow_table_flow_action_get_next(struct flow_action *flow_action) { int i = flow_action->num_entries++; return &flow_action->entries[i]; }
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static void tcf_ct_flow_table_add_action_nat_ipv6(const struct nf_conntrack_tuple *tuple, struct nf_conntrack_tuple target, struct flow_action *action) { if (memcmp(&target.src.u3, &tuple->src.u3, sizeof(target.src.u3))) tcf_ct_add_ipv6_...
[ 1, 0 ]
Linux Kernel
net/sched/act_ct.c
static int tcf_ct_flow_table_add_action_nat(struct net *net, struct nf_conn *ct, enum ip_conntrack_dir dir, struct flow_action *action) { const struct nf_conntrack_tuple *tuple = &ct->tuplehash[dir].tuple; struct nf_conntrack_t...
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static void tcf_ct_flow_table_put(struct tcf_ct_flow_table *ct_ft) { if (refcount_dec_and_test(&ct_ft->ref)) { rhashtable_remove_fast(&zones_ht, &ct_ft->node, zones_params); INIT_RCU_WORK(&ct_ft->rwork, tcf_ct_flow_table_cleanup_work); queue_rcu_work(act_ct_wq, &ct_ft->rwork); } }
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static void tcf_ct_flow_tc_ifidx(struct flow_offload *entry, struct nf_conn_act_ct_ext *act_ct_ext, u8 dir) { entry->tuplehash[dir].tuple.xmit_type = FLOW_OFFLOAD_XMIT_TC; entry->tuplehash[dir].tuple.tc.iifidx = act_ct_ext->ifindex[dir]; }
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static void tcf_ct_flow_table_add(struct tcf_ct_flow_table *ct_ft, struct nf_conn *ct, bool tcp) { struct nf_conn_act_ct_ext *act_ct_ext; struct flow_offload *entry; int err; if (test_and_set_bit(IPS_OFFLOAD_BIT, &ct->status)) return; entry = flow_offload_alloc(ct); ...
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static bool tcf_ct_flow_table_lookup(struct tcf_ct_params *p, struct sk_buff *skb, u8 family) { struct nf_flowtable *nf_ft = &p->ct_ft->nf_ft; struct flow_offload_tuple_rhash *tuplehash; struct flow_offload_tuple tuple = {}; enum ip_conntrack_info ctinfo; struct tcphdr *t...
[ 1, 0 ]
Linux Kernel
net/sched/act_ct.c
static void tcf_ct_params_free(struct tcf_ct_params *params) { if (params->helper) { #if IS_ENABLED(CONFIG_NF_NAT) if (params->ct_action & TCA_CT_ACT_NAT) nf_nat_helper_put(params->helper); #endif nf_conntrack_helper_put(params->helper); } if (params->ct_ft) tcf_ct_flow_table_put(params->ct_ft)...
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static void tcf_stats_update(struct tc_action *a, u64 bytes, u64 packets, u64 drops, u64 lastuse, bool hw) { struct tcf_ct *c = to_ct(a); tcf_action_update_stats(a, bytes, packets, drops, hw); c->tcf_tm.lastuse = max_t(u64, c->tcf_tm.lastuse, lastuse); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static int tcf_ct_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_CT; entry->c...
[ 0, 0 ]
Linux Kernel
net/sched/act_ct.c
static void __net_exit ct_exit_net(struct list_head *net_list) { struct net *net; rtnl_lock(); list_for_each_entry(net, net_list, exit_list) { struct tc_ct_action_net *tn = net_generic(net, act_ct_ops.net_id); if (tn->labels) nf_connlabels_put(net); } rtnl_unlock(); tc_action_net_exit(net_...
[ 0, 0 ]
Linux Kernel
net/sched/act_ctinfo.c
static int __init ctinfo_init_module(void) { return tcf_register_action(&act_ctinfo_ops, &ctinfo_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_gact.c
static int tcf_gact_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb_tail_pointer(skb); struct tcf_gact *gact = to_gact(a); struct tc_gact opt = { .index = gact->tcf_index, .refcnt = refcount_read(&gact->tcf_refcnt) - ref, .bind...
[ 1, 0 ]
Linux Kernel
net/sched/act_gact.c
static size_t tcf_gact_get_fill_size(const struct tc_action *act) { size_t sz = nla_total_size(sizeof(struct tc_gact)); #ifdef CONFIG_GACT_PROB if (to_gact(act)->tcfg_ptype) /* TCA_GACT_PROB */ sz += nla_total_size(sizeof(struct tc_gact_p)); #endif return sz; }
[ 0, 0 ]
Linux Kernel
net/sched/act_gact.c
static void __net_exit gact_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_gact_ops.net_id); }
[ 0, 0 ]
Linux Kernel
net/sched/act_gate.c
static void release_entry_list(struct list_head *entries) { struct tcfg_gate_entry *entry, *e; list_for_each_entry_safe(entry, e, entries, list) { list_del(&entry->list); kfree(entry); } }
[ 0, 0 ]
Linux Kernel
net/sched/act_gate.c
static void gate_setup_timer(struct tcf_gate *gact, u64 basetime, enum tk_offsets tko, s32 clockid, bool do_init) { if (!do_init) { if (basetime == gact->param.tcfg_basetime && tko == gact->tk_offset && clockid == gact->param.tcfg_clockid) return; spin_unlock_bh(&g...
[ 0, 0 ]
Linux Kernel
net/sched/act_ife.c
int ife_check_meta_u32(u32 metaval, struct tcf_meta_info *mi) { if (metaval || mi->metaval) return 8; return 0; }
[ 1, 0 ]
Linux Kernel
net/sched/act_ife.c
int ife_check_meta_u16(u16 metaval, struct tcf_meta_info *mi) { if (metaval || mi->metaval) return 8; return 0; }
[ 1, 0 ]
Linux Kernel
net/sched/act_ife.c
int ife_encode_meta_u32(u32 metaval, void *skbdata, struct tcf_meta_info *mi) { u32 edata = metaval; if (mi->metaval) edata = *(u32 *)mi->metaval; else if (metaval) edata = metaval; if (!edata) return 0; edata = htonl(edata); return ife_tlv_meta_encode(skbdata, mi->metaid, 4, &edata); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ife.c
int ife_validate_meta_u32(void *val, int len) { if (len == sizeof(u32)) return 0; return -EINVAL; }
[ 1, 0 ]
Linux Kernel
net/sched/act_ife.c
static int __add_metainfo(const struct tcf_meta_ops *ops, struct tcf_ife_info *ife, u32 metaid, void *metaval, int len, bool atomic, bool exists) { struct tcf_meta_info *mi = NULL; int ret = 0; mi = kzalloc(sizeof(*mi), atomic ? GFP_ATOMIC : GFP_KERNEL); if (...
[ 0, 0 ]
Linux Kernel
net/sched/act_ife.c
static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind, int ref) { unsigned char *b = skb_tail_pointer(skb); struct tcf_ife_info *ife = to_ife(a); struct tcf_ife_params *p; struct tc_ife opt = { .index = ife->tcf_index, .refcnt = refcount_read(&ife->tcf_re...
[ 1, 0 ]
Linux Kernel
net/sched/act_ife.c
static int find_decode_metaid(struct sk_buff *skb, struct tcf_ife_info *ife, u16 metaid, u16 mlen, void *mdata) { struct tcf_meta_info *e; /* XXX: use hash to speed up */ list_for_each_entry(e, &ife->metalist, metalist) { if (metaid == e->metaid) { if (e->ops) { /*...
[ 0, 1 ]
Linux Kernel
net/sched/act_ife.c
static int tcf_ife_decode(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res) { struct tcf_ife_info *ife = to_ife(a); int action = ife->tcf_action; u8 *ifehdr_end; u8 *tlv_data; u16 metalen; bstats_update(this_cpu_ptr(ife->common.cpu_bstats), skb); tcf_lastus...
[ 0, 0 ]
Linux Kernel
net/sched/act_ife.c
static int ife_get_sz(struct sk_buff *skb, struct tcf_ife_info *ife) { struct tcf_meta_info *e, *n; int tot_run_sz = 0, run_sz = 0; list_for_each_entry_safe(e, n, &ife->metalist, metalist) { if (e->ops->check_presence) { run_sz = e->ops->check_presence(skb, e); tot_run_sz += run_sz; } } ...
[ 0, 1 ]
Linux Kernel
net/sched/act_ife.c
static __net_init int ife_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, act_ife_ops.net_id); return tc_action_net_init(net, tn, &act_ife_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ife.c
static int __init ife_init_module(void) { return tcf_register_action(&act_ife_ops, &ife_net_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ipt.c
static void tcf_ipt_release(struct tc_action *a) { struct tcf_ipt *ipt = to_ipt(a); if (ipt->tcfi_t) { ipt_destroy_target(ipt->tcfi_t, a->idrinfo->net); kfree(ipt->tcfi_t); } kfree(ipt->tcfi_tname); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ipt.c
TC_INDIRECT_SCOPE int tcf_ipt_act(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res) { int ret = 0, result = 0; struct tcf_ipt *ipt = to_ipt(a); struct xt_action_param par; struct nf_hook_state state = { .net = dev_ne...
[ 0, 0 ]
Linux Kernel
net/sched/act_ipt.c
static __net_init int ipt_init_net(struct net *net) { struct tc_action_net *tn = net_generic(net, act_ipt_ops.net_id); return tc_action_net_init(net, tn, &act_ipt_ops); }
[ 0, 0 ]
Linux Kernel
net/sched/act_ipt.c
static void __net_exit ipt_exit_net(struct list_head *net_list) { tc_action_net_exit(net_list, act_ipt_ops.net_id); }
[ 0, 0 ]