597 lines · 15.5 KB · C
RawDownload
 	err = switchdev_port_obj_del_now(dev, obj);	if (err && err != -EOPNOTSUPP)		netdev_err(dev, "failed (err=%d) to del object (id=%d)\n",			   err, obj->id);	if (obj->complete)		obj->complete(dev, err, obj->complete_priv);} static int switchdev_port_obj_del_defer(struct net_device *dev,					const struct switchdev_obj *obj){	return switchdev_deferred_enqueue(dev, obj, switchdev_obj_size(obj),					  switchdev_port_obj_del_deferred);} /** *	switchdev_port_obj_del - Delete port object * *	@dev: port device *	@id: object ID *	@obj: object to delete * *	rtnl_lock must be held and must not be in atomic section, *	in case SWITCHDEV_F_DEFER flag is not set. */int switchdev_port_obj_del(struct net_device *dev,			   const struct switchdev_obj *obj){	if (obj->flags & SWITCHDEV_F_DEFER)		return switchdev_port_obj_del_defer(dev, obj);	ASSERT_RTNL();	return switchdev_port_obj_del_now(dev, obj);}EXPORT_SYMBOL_GPL(switchdev_port_obj_del); static ATOMIC_NOTIFIER_HEAD(switchdev_notif_chain); /** *	register_switchdev_notifier - Register notifier *	@nb: notifier_block * *	Register switch device notifier. */int register_switchdev_notifier(struct notifier_block *nb){	return atomic_notifier_chain_register(&switchdev_notif_chain, nb);}EXPORT_SYMBOL_GPL(register_switchdev_notifier); /** *	unregister_switchdev_notifier - Unregister notifier *	@nb: notifier_block * *	Unregister switch device notifier. */int unregister_switchdev_notifier(struct notifier_block *nb){	return atomic_notifier_chain_unregister(&switchdev_notif_chain, nb);}EXPORT_SYMBOL_GPL(unregister_switchdev_notifier); /** *	call_switchdev_notifiers - Call notifiers *	@val: value passed unmodified to notifier function *	@dev: port device *	@info: notifier information data * *	Call all network notifier blocks. */int call_switchdev_notifiers(unsigned long val, struct net_device *dev,			     struct switchdev_notifier_info *info){	info->dev = dev;	return atomic_notifier_call_chain(&switchdev_notif_chain, val, info);}EXPORT_SYMBOL_GPL(call_switchdev_notifiers); bool switchdev_port_same_parent_id(struct net_device *a,				   struct net_device *b){	struct switchdev_attr a_attr = {		.orig_dev = a,		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,	};	struct switchdev_attr b_attr = {		.orig_dev = b,		.id = SWITCHDEV_ATTR_ID_PORT_PARENT_ID,	}; 	if (switchdev_port_attr_get(a, &a_attr) ||	    switchdev_port_attr_get(b, &b_attr))		return false; 	return netdev_phys_item_id_same(&a_attr.u.ppid, &b_attr.u.ppid);}EXPORT_SYMBOL_GPL(switchdev_port_same_parent_id);

Lines 501–597 of 597. Previous lines

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t