/net/netfilter/ |
D | nft_bitwise.c | 29 const struct nft_bitwise *priv) in nft_bitwise_eval_bool() argument 33 for (i = 0; i < DIV_ROUND_UP(priv->len, sizeof(u32)); i++) in nft_bitwise_eval_bool() 34 dst[i] = (src[i] & priv->mask.data[i]) ^ priv->xor.data[i]; in nft_bitwise_eval_bool() 38 const struct nft_bitwise *priv) in nft_bitwise_eval_lshift() argument 40 u32 shift = priv->data.data[0]; in nft_bitwise_eval_lshift() 44 for (i = DIV_ROUND_UP(priv->len, sizeof(u32)); i > 0; i--) { in nft_bitwise_eval_lshift() 51 const struct nft_bitwise *priv) in nft_bitwise_eval_rshift() argument 53 u32 shift = priv->data.data[0]; in nft_bitwise_eval_rshift() 57 for (i = 0; i < DIV_ROUND_UP(priv->len, sizeof(u32)); i++) { in nft_bitwise_eval_rshift() 66 const struct nft_bitwise *priv = nft_expr_priv(expr); in nft_bitwise_eval() local [all …]
|
D | nft_limit.c | 32 static inline bool nft_limit_eval(struct nft_limit_priv *priv, u64 cost) in nft_limit_eval() argument 37 spin_lock_bh(&priv->limit->lock); in nft_limit_eval() 39 tokens = priv->limit->tokens + now - priv->limit->last; in nft_limit_eval() 40 if (tokens > priv->tokens_max) in nft_limit_eval() 41 tokens = priv->tokens_max; in nft_limit_eval() 43 priv->limit->last = now; in nft_limit_eval() 46 priv->limit->tokens = delta; in nft_limit_eval() 47 spin_unlock_bh(&priv->limit->lock); in nft_limit_eval() 48 return priv->invert; in nft_limit_eval() 50 priv->limit->tokens = tokens; in nft_limit_eval() [all …]
|
D | nft_hash.c | 30 struct nft_jhash *priv = nft_expr_priv(expr); in nft_jhash_eval() local 31 const void *data = ®s->data[priv->sreg]; in nft_jhash_eval() 34 h = reciprocal_scale(jhash(data, priv->len, priv->seed), in nft_jhash_eval() 35 priv->modulus); in nft_jhash_eval() 37 regs->data[priv->dreg] = h + priv->offset; in nft_jhash_eval() 50 struct nft_symhash *priv = nft_expr_priv(expr); in nft_symhash_eval() local 54 h = reciprocal_scale(__skb_get_hash_symmetric(skb), priv->modulus); in nft_symhash_eval() 56 regs->data[priv->dreg] = h + priv->offset; in nft_symhash_eval() 73 struct nft_jhash *priv = nft_expr_priv(expr); in nft_jhash_init() local 84 priv->offset = ntohl(nla_get_be32(tb[NFTA_HASH_OFFSET])); in nft_jhash_init() [all …]
|
D | nft_numgen.c | 24 static u32 nft_ng_inc_gen(struct nft_ng_inc *priv) in nft_ng_inc_gen() argument 29 oval = atomic_read(priv->counter); in nft_ng_inc_gen() 30 nval = (oval + 1 < priv->modulus) ? oval + 1 : 0; in nft_ng_inc_gen() 31 } while (atomic_cmpxchg(priv->counter, oval, nval) != oval); in nft_ng_inc_gen() 33 return nval + priv->offset; in nft_ng_inc_gen() 40 struct nft_ng_inc *priv = nft_expr_priv(expr); in nft_ng_inc_eval() local 42 regs->data[priv->dreg] = nft_ng_inc_gen(priv); in nft_ng_inc_eval() 56 struct nft_ng_inc *priv = nft_expr_priv(expr); in nft_ng_inc_init() local 60 priv->offset = ntohl(nla_get_be32(tb[NFTA_NG_OFFSET])); in nft_ng_inc_init() 62 priv->modulus = ntohl(nla_get_be32(tb[NFTA_NG_MODULUS])); in nft_ng_inc_init() [all …]
|
D | nft_dynset.c | 29 static int nft_dynset_expr_setup(const struct nft_dynset *priv, in nft_dynset_expr_setup() argument 36 for (i = 0; i < priv->num_exprs; i++) { in nft_dynset_expr_setup() 38 if (nft_expr_clone(expr, priv->expr_array[i]) < 0) in nft_dynset_expr_setup() 41 elem_expr->size += priv->expr_array[i]->ops->size; in nft_dynset_expr_setup() 50 const struct nft_dynset *priv = nft_expr_priv(expr); in nft_dynset_new() local 58 timeout = priv->timeout ? : set->timeout; in nft_dynset_new() 59 elem = nft_set_elem_init(set, &priv->tmpl, in nft_dynset_new() 60 ®s->data[priv->sreg_key], NULL, in nft_dynset_new() 61 ®s->data[priv->sreg_data], in nft_dynset_new() 67 if (priv->num_exprs && nft_dynset_expr_setup(priv, ext) < 0) in nft_dynset_new() [all …]
|
D | nft_payload.c | 163 const struct nft_payload *priv = nft_expr_priv(expr); in nft_payload_eval() local 165 u32 *dest = ®s->data[priv->dreg]; in nft_payload_eval() 168 if (priv->len % NFT_REG32_SIZE) in nft_payload_eval() 169 dest[priv->len / NFT_REG32_SIZE] = 0; in nft_payload_eval() 171 switch (priv->base) { in nft_payload_eval() 177 nft_payload_need_vlan_adjust(priv->offset, priv->len)) { in nft_payload_eval() 179 priv->offset, priv->len)) in nft_payload_eval() 202 offset += priv->offset; in nft_payload_eval() 204 if (skb_copy_bits(skb, offset, dest, priv->len) < 0) in nft_payload_eval() 226 struct nft_payload *priv = nft_expr_priv(expr); in nft_payload_init() local [all …]
|
D | nft_nat.c | 35 const struct nft_nat *priv) in nft_nat_setup_addr() argument 37 switch (priv->family) { in nft_nat_setup_addr() 40 regs->data[priv->sreg_addr_min]; in nft_nat_setup_addr() 42 regs->data[priv->sreg_addr_max]; in nft_nat_setup_addr() 45 memcpy(range->min_addr.ip6, ®s->data[priv->sreg_addr_min], in nft_nat_setup_addr() 47 memcpy(range->max_addr.ip6, ®s->data[priv->sreg_addr_max], in nft_nat_setup_addr() 55 const struct nft_nat *priv) in nft_nat_setup_proto() argument 58 nft_reg_load16(®s->data[priv->sreg_proto_min]); in nft_nat_setup_proto() 60 nft_reg_load16(®s->data[priv->sreg_proto_max]); in nft_nat_setup_proto() 65 const struct nft_nat *priv) in nft_nat_setup_netmap() argument [all …]
|
D | nft_cmp.c | 30 const struct nft_cmp_expr *priv = nft_expr_priv(expr); in nft_cmp_eval() local 33 d = memcmp(®s->data[priv->sreg], &priv->data, priv->len); in nft_cmp_eval() 34 switch (priv->op) { in nft_cmp_eval() 75 struct nft_cmp_expr *priv = nft_expr_priv(expr); in nft_cmp_init() local 78 .size = sizeof(priv->data), in nft_cmp_init() 82 err = nft_data_init(NULL, &priv->data, &desc, tb[NFTA_CMP_DATA]); in nft_cmp_init() 86 err = nft_parse_register_load(tb[NFTA_CMP_SREG], &priv->sreg, desc.len); in nft_cmp_init() 90 priv->op = ntohl(nla_get_be32(tb[NFTA_CMP_OP])); in nft_cmp_init() 91 priv->len = desc.len; in nft_cmp_init() 98 const struct nft_cmp_expr *priv = nft_expr_priv(expr); in nft_cmp_dump() local [all …]
|
D | nft_immediate.c | 22 const struct nft_immediate_expr *priv = nft_expr_priv(expr); in nft_immediate_eval() local 24 nft_data_copy(®s->data[priv->dreg], &priv->data, priv->dlen); in nft_immediate_eval() 50 struct nft_immediate_expr *priv = nft_expr_priv(expr); in nft_immediate_init() local 52 .size = sizeof(priv->data), in nft_immediate_init() 61 err = nft_data_init(ctx, &priv->data, &desc, tb[NFTA_IMMEDIATE_DATA]); in nft_immediate_init() 65 priv->dlen = desc.len; in nft_immediate_init() 68 &priv->dreg, &priv->data, desc.type, in nft_immediate_init() 73 if (priv->dreg == NFT_REG_VERDICT) { in nft_immediate_init() 74 struct nft_chain *chain = priv->data.verdict.chain; in nft_immediate_init() 76 switch (priv->data.verdict.code) { in nft_immediate_init() [all …]
|
D | nft_ct.c | 54 const struct nft_ct *priv = nft_expr_priv(expr); in nft_ct_get_eval() local 55 u32 *dest = ®s->data[priv->dreg]; in nft_ct_get_eval() 65 switch (priv->key) { in nft_ct_get_eval() 82 switch (priv->key) { in nft_ct_get_eval() 131 priv->key, priv->dir); in nft_ct_get_eval() 141 NFT_CT_PKTS, priv->dir); in nft_ct_get_eval() 143 NFT_CT_BYTES, priv->dir); in nft_ct_get_eval() 162 if (priv->dir < IP_CT_DIR_MAX) in nft_ct_get_eval() 163 zoneid = nf_ct_zone_id(zone, priv->dir); in nft_ct_get_eval() 178 tuple = &ct->tuplehash[priv->dir].tuple; in nft_ct_get_eval() [all …]
|
D | nft_exthdr.c | 50 struct nft_exthdr *priv = nft_expr_priv(expr); in nft_exthdr_ipv6_eval() local 51 u32 *dest = ®s->data[priv->dreg]; in nft_exthdr_ipv6_eval() 58 err = ipv6_find_hdr(pkt->skb, &offset, priv->type, NULL, NULL); in nft_exthdr_ipv6_eval() 59 if (priv->flags & NFT_EXTHDR_F_PRESENT) { in nft_exthdr_ipv6_eval() 65 offset += priv->offset; in nft_exthdr_ipv6_eval() 67 if (nft_skb_copy_to_reg(pkt->skb, offset, dest, priv->len) < 0) in nft_exthdr_ipv6_eval() 145 struct nft_exthdr *priv = nft_expr_priv(expr); in nft_exthdr_ipv4_eval() local 146 u32 *dest = ®s->data[priv->dreg]; in nft_exthdr_ipv4_eval() 154 err = ipv4_find_option(nft_net(pkt), skb, &offset, priv->type); in nft_exthdr_ipv4_eval() 155 if (priv->flags & NFT_EXTHDR_F_PRESENT) { in nft_exthdr_ipv4_eval() [all …]
|
D | nft_quota.c | 21 static inline bool nft_overquota(struct nft_quota *priv, in nft_overquota() argument 24 return atomic64_add_return(skb->len, priv->consumed) >= in nft_overquota() 25 atomic64_read(&priv->quota); in nft_overquota() 28 static inline bool nft_quota_invert(struct nft_quota *priv) in nft_quota_invert() argument 30 return priv->flags & NFT_QUOTA_F_INV; in nft_quota_invert() 33 static inline void nft_quota_do_eval(struct nft_quota *priv, in nft_quota_do_eval() argument 37 if (nft_overquota(priv, pkt->skb) ^ nft_quota_invert(priv)) in nft_quota_do_eval() 53 struct nft_quota *priv = nft_obj_data(obj); in nft_quota_obj_eval() local 56 overquota = nft_overquota(priv, pkt->skb); in nft_quota_obj_eval() 57 if (overquota ^ nft_quota_invert(priv)) in nft_quota_obj_eval() [all …]
|
D | nft_fib.c | 32 const struct nft_fib *priv = nft_expr_priv(expr); in nft_fib_validate() local 35 switch (priv->result) { in nft_fib_validate() 43 if (priv->flags & NFTA_FIB_F_IIF) in nft_fib_validate() 47 else if (priv->flags & NFTA_FIB_F_OIF) in nft_fib_validate() 70 struct nft_fib *priv = nft_expr_priv(expr); in nft_fib_init() local 77 priv->flags = ntohl(nla_get_be32(tb[NFTA_FIB_FLAGS])); in nft_fib_init() 79 if (priv->flags == 0) in nft_fib_init() 82 if ((priv->flags & (NFTA_FIB_F_SADDR | NFTA_FIB_F_DADDR)) == in nft_fib_init() 85 if ((priv->flags & (NFTA_FIB_F_IIF | NFTA_FIB_F_OIF)) == in nft_fib_init() 88 if ((priv->flags & (NFTA_FIB_F_SADDR | NFTA_FIB_F_DADDR)) == 0) in nft_fib_init() [all …]
|
D | nft_xfrm.c | 37 struct nft_xfrm *priv = nft_expr_priv(expr); in nft_xfrm_get_init() local 54 priv->key = ntohl(nla_get_be32(tb[NFTA_XFRM_KEY])); in nft_xfrm_get_init() 55 switch (priv->key) { in nft_xfrm_get_init() 76 priv->dir = dir; in nft_xfrm_get_init() 88 priv->spnum = spnum; in nft_xfrm_get_init() 90 priv->len = len; in nft_xfrm_get_init() 91 return nft_parse_register_store(ctx, tb[NFTA_XFRM_DREG], &priv->dreg, in nft_xfrm_get_init() 118 static void nft_xfrm_state_get_key(const struct nft_xfrm *priv, in nft_xfrm_state_get_key() argument 122 u32 *dest = ®s->data[priv->dreg]; in nft_xfrm_state_get_key() 124 if (!xfrm_state_addr_ok(priv->key, in nft_xfrm_state_get_key() [all …]
|
D | nft_connlimit.c | 22 static inline void nft_connlimit_do_eval(struct nft_connlimit *priv, in nft_connlimit_do_eval() argument 46 if (nf_conncount_add(nft_net(pkt), priv->list, tuple_ptr, zone)) { in nft_connlimit_do_eval() 51 count = priv->list->count; in nft_connlimit_do_eval() 53 if ((count > priv->limit) ^ priv->invert) { in nft_connlimit_do_eval() 61 struct nft_connlimit *priv) in nft_connlimit_do_init() argument 80 priv->list = kmalloc(sizeof(*priv->list), GFP_KERNEL_ACCOUNT); in nft_connlimit_do_init() 81 if (!priv->list) in nft_connlimit_do_init() 84 nf_conncount_list_init(priv->list); in nft_connlimit_do_init() 85 priv->limit = limit; in nft_connlimit_do_init() 86 priv->invert = invert; in nft_connlimit_do_init() [all …]
|
D | nft_byteorder.c | 30 const struct nft_byteorder *priv = nft_expr_priv(expr); in nft_byteorder_eval() local 31 u32 *src = ®s->data[priv->sreg]; in nft_byteorder_eval() 32 u32 *dst = ®s->data[priv->dreg]; in nft_byteorder_eval() 39 switch (priv->size) { in nft_byteorder_eval() 44 switch (priv->op) { in nft_byteorder_eval() 46 for (i = 0; i < priv->len / 8; i++) { in nft_byteorder_eval() 53 for (i = 0; i < priv->len / 8; i++) { in nft_byteorder_eval() 63 switch (priv->op) { in nft_byteorder_eval() 65 for (i = 0; i < priv->len / 4; i++) in nft_byteorder_eval() 69 for (i = 0; i < priv->len / 4; i++) in nft_byteorder_eval() [all …]
|
D | nft_lookup.c | 62 const struct nft_lookup *priv = nft_expr_priv(expr); in nft_lookup_eval() local 63 const struct nft_set *set = priv->set; in nft_lookup_eval() 68 found = nft_set_do_lookup(net, set, ®s->data[priv->sreg], &ext) ^ in nft_lookup_eval() 69 priv->invert; in nft_lookup_eval() 79 if (priv->dreg_set) in nft_lookup_eval() 80 nft_data_copy(®s->data[priv->dreg], in nft_lookup_eval() 101 struct nft_lookup *priv = nft_expr_priv(expr); in nft_lookup_init() local 116 err = nft_parse_register_load(tb[NFTA_LOOKUP_SREG], &priv->sreg, in nft_lookup_init() 125 priv->invert = true; in nft_lookup_init() 129 if (priv->invert) in nft_lookup_init() [all …]
|
D | nft_queue.c | 32 struct nft_queue *priv = nft_expr_priv(expr); in nft_queue_eval() local 33 u32 queue = priv->queuenum; in nft_queue_eval() 36 if (priv->queues_total > 1) { in nft_queue_eval() 37 if (priv->flags & NFT_QUEUE_FLAG_CPU_FANOUT) { in nft_queue_eval() 40 queue = priv->queuenum + cpu % priv->queues_total; in nft_queue_eval() 43 priv->queues_total, nft_pf(pkt), in nft_queue_eval() 49 if (priv->flags & NFT_QUEUE_FLAG_BYPASS) in nft_queue_eval() 59 struct nft_queue *priv = nft_expr_priv(expr); in nft_queue_sreg_eval() local 62 queue = regs->data[priv->sreg_qnum]; in nft_queue_sreg_eval() 65 if (priv->flags & NFT_QUEUE_FLAG_BYPASS) in nft_queue_sreg_eval() [all …]
|
D | nft_set_hash.c | 83 struct nft_rhash *priv = nft_set_priv(set); in nft_rhash_lookup() local 91 he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params); in nft_rhash_lookup() 101 struct nft_rhash *priv = nft_set_priv(set); in nft_rhash_get() local 109 he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params); in nft_rhash_get() 124 struct nft_rhash *priv = nft_set_priv(set); in nft_rhash_update() local 132 he = rhashtable_lookup(&priv->ht, &arg, nft_rhash_params); in nft_rhash_update() 140 prev = rhashtable_lookup_get_insert_key(&priv->ht, &arg, &he->node, in nft_rhash_update() 167 struct nft_rhash *priv = nft_set_priv(set); in nft_rhash_insert() local 168 struct nft_rhash_elem *he = elem->priv; in nft_rhash_insert() 176 prev = rhashtable_lookup_get_insert_key(&priv->ht, &arg, &he->node, in nft_rhash_insert() [all …]
|
/net/can/j1939/ |
D | main.c | 36 struct j1939_priv *priv = data; in j1939_can_recv() local 54 j1939_priv_get(priv); in j1939_can_recv() 80 netdev_err_once(priv->ndev, "%s: sa is broadcast address, ignoring!\n", in j1939_can_recv() 96 read_lock_bh(&priv->lock); in j1939_can_recv() 98 priv->ents[skcb->addr.sa].nusers) in j1939_can_recv() 101 priv->ents[skcb->addr.da].nusers) in j1939_can_recv() 103 read_unlock_bh(&priv->lock); in j1939_can_recv() 106 j1939_ac_recv(priv, skb); in j1939_can_recv() 108 if (j1939_tp_recv(priv, skb)) in j1939_can_recv() 112 j1939_simple_recv(priv, skb); in j1939_can_recv() [all …]
|
D | bus.c | 20 struct j1939_priv *priv = ecu->priv; in __j1939_ecu_release() local 24 j1939_priv_put(priv); in __j1939_ecu_release() 39 struct j1939_priv *priv = ecu->priv; in j1939_ecu_is_mapped_locked() local 41 lockdep_assert_held(&priv->lock); in j1939_ecu_is_mapped_locked() 43 return j1939_ecu_find_by_addr_locked(priv, ecu->addr) == ecu; in j1939_ecu_is_mapped_locked() 50 struct j1939_priv *priv = ecu->priv; in j1939_ecu_map_locked() local 53 lockdep_assert_held(&priv->lock); in j1939_ecu_map_locked() 58 ent = &priv->ents[ecu->addr]; in j1939_ecu_map_locked() 61 …netdev_warn(priv->ndev, "Trying to map already mapped ECU, addr: 0x%02x, name: 0x%016llx. Skip it.… in j1939_ecu_map_locked() 74 struct j1939_priv *priv = ecu->priv; in j1939_ecu_unmap_locked() local [all …]
|
D | transport.c | 170 static int j1939_xtp_abort_to_errno(struct j1939_priv *priv, in j1939_xtp_abort_to_errno() argument 229 netdev_warn(priv->ndev, "Unknown abort code %i", abort); in j1939_xtp_abort_to_errno() 236 static inline void j1939_session_list_lock(struct j1939_priv *priv) in j1939_session_list_lock() argument 238 spin_lock_bh(&priv->active_session_list_lock); in j1939_session_list_lock() 241 static inline void j1939_session_list_unlock(struct j1939_priv *priv) in j1939_session_list_unlock() argument 243 spin_unlock_bh(&priv->active_session_list_lock); in j1939_session_list_unlock() 274 netdev_dbg(session->priv->ndev, "%s: 0x%p\n", __func__, session); in j1939_session_destroy() 285 j1939_priv_put(session->priv); in j1939_session_destroy() 357 struct j1939_priv *priv = session->priv; in j1939_session_skb_queue() local 359 j1939_ac_fixup(priv, skb); in j1939_session_skb_queue() [all …]
|
/net/caif/ |
D | chnl_net.c | 59 struct chnl_net *priv; in chnl_recv_cb() local 64 priv = container_of(layr, struct chnl_net, chnl); in chnl_recv_cb() 74 skb->dev = priv->netdev; in chnl_recv_cb() 92 priv->netdev->stats.rx_errors++; in chnl_recv_cb() 97 if (priv->conn_req.protocol == CAIFPROTO_DATAGRAM_LOOP) in chnl_recv_cb() 105 priv->netdev->stats.rx_packets++; in chnl_recv_cb() 106 priv->netdev->stats.rx_bytes += pktlen; in chnl_recv_cb() 137 struct chnl_net *priv = container_of(lyr, struct chnl_net, chnl); in chnl_hold() local 138 dev_hold(priv->netdev); in chnl_hold() 143 struct chnl_net *priv = container_of(lyr, struct chnl_net, chnl); in chnl_put() local [all …]
|
/net/atm/ |
D | lec.c | 67 static struct lec_arp_table *lec_arp_find(struct lec_priv *priv, 69 static int lec_arp_remove(struct lec_priv *priv, 79 static int lec_addr_delete(struct lec_priv *priv, const unsigned char *atm_addr, 81 static void lec_arp_check_empties(struct lec_priv *priv, 83 static void lec_arp_destroy(struct lec_priv *priv); 84 static void lec_arp_init(struct lec_priv *priv); 85 static struct atm_vcc *lec_arp_resolve(struct lec_priv *priv, 89 static void lec_arp_update(struct lec_priv *priv, const unsigned char *mac_addr, 93 static void lec_flush_complete(struct lec_priv *priv, unsigned long tran_id); 94 static int lec_mcast_make(struct lec_priv *priv, struct atm_vcc *vcc); [all …]
|
/net/9p/ |
D | trans_xen.c | 36 struct xen_9pfs_front_priv *priv; member 72 struct xen_9pfs_front_priv *priv; in p9_xen_create() local 78 list_for_each_entry(priv, &xen_9pfs_devs, list) { in p9_xen_create() 79 if (!strcmp(priv->tag, addr)) { in p9_xen_create() 80 priv->client = client; in p9_xen_create() 91 struct xen_9pfs_front_priv *priv; in p9_xen_close() local 94 list_for_each_entry(priv, &xen_9pfs_devs, list) { in p9_xen_close() 95 if (priv->client == client) { in p9_xen_close() 96 priv->client = NULL; in p9_xen_close() 118 struct xen_9pfs_front_priv *priv; in p9_xen_request() local [all …]
|