Lines Matching full:mi
44 int ife_encode_meta_u16(u16 metaval, void *skbdata, struct tcf_meta_info *mi) in ife_encode_meta_u16() argument
48 if (mi->metaval) in ife_encode_meta_u16()
49 edata = *(u16 *)mi->metaval; in ife_encode_meta_u16()
57 return ife_tlv_meta_encode(skbdata, mi->metaid, 2, &edata); in ife_encode_meta_u16()
61 int ife_get_meta_u32(struct sk_buff *skb, struct tcf_meta_info *mi) in ife_get_meta_u32() argument
63 if (mi->metaval) in ife_get_meta_u32()
64 return nla_put_u32(skb, mi->metaid, *(u32 *)mi->metaval); in ife_get_meta_u32()
66 return nla_put(skb, mi->metaid, 0, NULL); in ife_get_meta_u32()
70 int ife_check_meta_u32(u32 metaval, struct tcf_meta_info *mi) in ife_check_meta_u32() argument
72 if (metaval || mi->metaval) in ife_check_meta_u32()
79 int ife_check_meta_u16(u16 metaval, struct tcf_meta_info *mi) in ife_check_meta_u16() argument
81 if (metaval || mi->metaval) in ife_check_meta_u16()
88 int ife_encode_meta_u32(u32 metaval, void *skbdata, struct tcf_meta_info *mi) in ife_encode_meta_u32() argument
92 if (mi->metaval) in ife_encode_meta_u32()
93 edata = *(u32 *)mi->metaval; in ife_encode_meta_u32()
101 return ife_tlv_meta_encode(skbdata, mi->metaid, 4, &edata); in ife_encode_meta_u32()
105 int ife_get_meta_u16(struct sk_buff *skb, struct tcf_meta_info *mi) in ife_get_meta_u16() argument
107 if (mi->metaval) in ife_get_meta_u16()
108 return nla_put_u16(skb, mi->metaid, *(u16 *)mi->metaval); in ife_get_meta_u16()
110 return nla_put(skb, mi->metaid, 0, NULL); in ife_get_meta_u16()
114 int ife_alloc_meta_u32(struct tcf_meta_info *mi, void *metaval, gfp_t gfp) in ife_alloc_meta_u32() argument
116 mi->metaval = kmemdup(metaval, sizeof(u32), gfp); in ife_alloc_meta_u32()
117 if (!mi->metaval) in ife_alloc_meta_u32()
124 int ife_alloc_meta_u16(struct tcf_meta_info *mi, void *metaval, gfp_t gfp) in ife_alloc_meta_u16() argument
126 mi->metaval = kmemdup(metaval, sizeof(u16), gfp); in ife_alloc_meta_u16()
127 if (!mi->metaval) in ife_alloc_meta_u16()
134 void ife_release_meta_gen(struct tcf_meta_info *mi) in ife_release_meta_gen() argument
136 kfree(mi->metaval); in ife_release_meta_gen()
299 struct tcf_meta_info *mi = NULL; in __add_metainfo() local
302 mi = kzalloc(sizeof(*mi), atomic ? GFP_ATOMIC : GFP_KERNEL); in __add_metainfo()
303 if (!mi) in __add_metainfo()
306 mi->metaid = metaid; in __add_metainfo()
307 mi->ops = ops; in __add_metainfo()
309 ret = ops->alloc(mi, metaval, atomic ? GFP_ATOMIC : GFP_KERNEL); in __add_metainfo()
311 kfree(mi); in __add_metainfo()
318 list_add_tail(&mi->metalist, &ife->metalist); in __add_metainfo()