Lines Matching refs:dp
50 static struct hlist_head *meter_hash_bucket(const struct datapath *dp, in meter_hash_bucket() argument
53 return &dp->meters[meter_id & (METER_HASH_BUCKETS - 1)]; in meter_hash_bucket()
57 static struct dp_meter *lookup_meter(const struct datapath *dp, in lookup_meter() argument
63 head = meter_hash_bucket(dp, meter_id); in lookup_meter()
71 static void attach_meter(struct datapath *dp, struct dp_meter *meter) in attach_meter() argument
73 struct hlist_head *head = meter_hash_bucket(dp, meter->id); in attach_meter()
275 struct datapath *dp; in ovs_meter_cmd_set() local
296 dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); in ovs_meter_cmd_set()
297 if (!dp) { in ovs_meter_cmd_set()
305 old_meter = lookup_meter(dp, meter_id); in ovs_meter_cmd_set()
307 attach_meter(dp, meter); in ovs_meter_cmd_set()
343 struct datapath *dp; in ovs_meter_cmd_get() local
360 dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); in ovs_meter_cmd_get()
361 if (!dp) { in ovs_meter_cmd_get()
367 meter = lookup_meter(dp, meter_id); in ovs_meter_cmd_get()
396 struct datapath *dp; in ovs_meter_cmd_del() local
412 dp = get_dp(sock_net(skb->sk), ovs_header->dp_ifindex); in ovs_meter_cmd_del()
413 if (!dp) { in ovs_meter_cmd_del()
418 old_meter = lookup_meter(dp, meter_id); in ovs_meter_cmd_del()
442 bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb, in ovs_meter_execute() argument
454 meter = lookup_meter(dp, meter_id); in ovs_meter_execute()
570 int ovs_meters_init(struct datapath *dp) in ovs_meters_init() argument
574 dp->meters = kmalloc_array(METER_HASH_BUCKETS, in ovs_meters_init()
577 if (!dp->meters) in ovs_meters_init()
581 INIT_HLIST_HEAD(&dp->meters[i]); in ovs_meters_init()
586 void ovs_meters_exit(struct datapath *dp) in ovs_meters_exit() argument
591 struct hlist_head *head = &dp->meters[i]; in ovs_meters_exit()
599 kfree(dp->meters); in ovs_meters_exit()