Lines Matching refs:egdev
1535 struct tcf_action_egdev *egdev; in tcf_action_egdev_get() local
1538 egdev = tcf_action_egdev_lookup(dev); in tcf_action_egdev_get()
1539 if (egdev) in tcf_action_egdev_get()
1542 egdev = kzalloc(sizeof(*egdev), GFP_KERNEL); in tcf_action_egdev_get()
1543 if (!egdev) in tcf_action_egdev_get()
1545 INIT_LIST_HEAD(&egdev->cb_list); in tcf_action_egdev_get()
1546 egdev->dev = dev; in tcf_action_egdev_get()
1548 rhashtable_insert_fast(&tan->egdev_ht, &egdev->ht_node, in tcf_action_egdev_get()
1552 egdev->refcnt++; in tcf_action_egdev_get()
1553 return egdev; in tcf_action_egdev_get()
1556 static void tcf_action_egdev_put(struct tcf_action_egdev *egdev) in tcf_action_egdev_put() argument
1560 if (--egdev->refcnt) in tcf_action_egdev_put()
1562 tan = net_generic(dev_net(egdev->dev), tcf_action_net_id); in tcf_action_egdev_put()
1563 rhashtable_remove_fast(&tan->egdev_ht, &egdev->ht_node, in tcf_action_egdev_put()
1565 kfree(egdev); in tcf_action_egdev_put()
1569 tcf_action_egdev_cb_lookup(struct tcf_action_egdev *egdev, in tcf_action_egdev_cb_lookup() argument
1574 list_for_each_entry(egdev_cb, &egdev->cb_list, list) in tcf_action_egdev_cb_lookup()
1580 static int tcf_action_egdev_cb_call(struct tcf_action_egdev *egdev, in tcf_action_egdev_cb_call() argument
1588 list_for_each_entry(egdev_cb, &egdev->cb_list, list) { in tcf_action_egdev_cb_call()
1600 static int tcf_action_egdev_cb_add(struct tcf_action_egdev *egdev, in tcf_action_egdev_cb_add() argument
1605 egdev_cb = tcf_action_egdev_cb_lookup(egdev, cb, cb_priv); in tcf_action_egdev_cb_add()
1613 list_add(&egdev_cb->list, &egdev->cb_list); in tcf_action_egdev_cb_add()
1617 static void tcf_action_egdev_cb_del(struct tcf_action_egdev *egdev, in tcf_action_egdev_cb_del() argument
1622 egdev_cb = tcf_action_egdev_cb_lookup(egdev, cb, cb_priv); in tcf_action_egdev_cb_del()
1632 struct tcf_action_egdev *egdev = tcf_action_egdev_get(dev); in __tc_setup_cb_egdev_register() local
1635 if (!egdev) in __tc_setup_cb_egdev_register()
1637 err = tcf_action_egdev_cb_add(egdev, cb, cb_priv); in __tc_setup_cb_egdev_register()
1643 tcf_action_egdev_put(egdev); in __tc_setup_cb_egdev_register()
1661 struct tcf_action_egdev *egdev = tcf_action_egdev_lookup(dev); in __tc_setup_cb_egdev_unregister() local
1663 if (WARN_ON(!egdev)) in __tc_setup_cb_egdev_unregister()
1665 tcf_action_egdev_cb_del(egdev, cb, cb_priv); in __tc_setup_cb_egdev_unregister()
1666 tcf_action_egdev_put(egdev); in __tc_setup_cb_egdev_unregister()
1681 struct tcf_action_egdev *egdev = tcf_action_egdev_lookup(dev); in tc_setup_cb_egdev_call() local
1683 if (!egdev) in tc_setup_cb_egdev_call()
1685 return tcf_action_egdev_cb_call(egdev, type, type_data, err_stop); in tc_setup_cb_egdev_call()