cregit-Linux how code gets into the kernel

Release 4.15 net/openvswitch/dp_notify.c

Directory: net/openvswitch
/*
 * Copyright (c) 2007-2012 Nicira, Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of version 2 of the GNU General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA
 */

#include <linux/netdevice.h>
#include <net/genetlink.h>
#include <net/netns/generic.h>

#include "datapath.h"
#include "vport-internal_dev.h"
#include "vport-netdev.h"


static void dp_detach_port_notify(struct vport *vport) { struct sk_buff *notify; struct datapath *dp; dp = vport->dp; notify = ovs_vport_cmd_build_info(vport, ovs_dp_get_net(dp), 0, 0, OVS_VPORT_CMD_DEL); ovs_dp_detach_port(vport); if (IS_ERR(notify)) { genl_set_err(&dp_vport_genl_family, ovs_dp_get_net(dp), 0, 0, PTR_ERR(notify)); return; } genlmsg_multicast_netns(&dp_vport_genl_family, ovs_dp_get_net(dp), notify, 0, 0, GFP_KERNEL); }

Contributors

PersonTokensPropCommitsCommitProp
Jesse Gross6060.61%114.29%
Pravin B Shelar2525.25%228.57%
Johannes Berg99.09%342.86%
Jiri Benc55.05%114.29%
Total99100.00%7100.00%


void ovs_dp_notify_wq(struct work_struct *work) { struct ovs_net *ovs_net = container_of(work, struct ovs_net, dp_notify_work); struct datapath *dp; ovs_lock(); list_for_each_entry(dp, &ovs_net->dps, list_node) { int i; for (i = 0; i < DP_VPORT_HASH_BUCKETS; i++) { struct vport *vport; struct hlist_node *n; hlist_for_each_entry_safe(vport, n, &dp->ports[i], dp_hash_node) { if (vport->ops->type == OVS_VPORT_TYPE_INTERNAL) continue; if (!(vport->dev->priv_flags & IFF_OVS_DATAPATH)) dp_detach_port_notify(vport); } } } ovs_unlock(); }

Contributors

PersonTokensPropCommitsCommitProp
Pravin B Shelar10692.17%125.00%
Alexei Starovoitov65.22%125.00%
Paolo Abeni21.74%125.00%
Thomas Graf10.87%125.00%
Total115100.00%4100.00%


static int dp_device_event(struct notifier_block *unused, unsigned long event, void *ptr) { struct ovs_net *ovs_net; struct net_device *dev = netdev_notifier_info_to_dev(ptr); struct vport *vport = NULL; if (!ovs_is_internal_dev(dev)) vport = ovs_netdev_get_vport(dev); if (!vport) return NOTIFY_DONE; if (event == NETDEV_UNREGISTER) { /* upper_dev_unlink and decrement promisc immediately */ ovs_netdev_detach_dev(vport); /* schedule vport destroy, dev_put and genl notification */ ovs_net = net_generic(dev_net(dev), ovs_net_id); queue_work(system_wq, &ovs_net->dp_notify_work); } return NOTIFY_DONE; }

Contributors

PersonTokensPropCommitsCommitProp
Pravin B Shelar8985.58%125.00%
Alexei Starovoitov76.73%125.00%
Jesse Gross54.81%125.00%
Jiri Pirko32.88%125.00%
Total104100.00%4100.00%

struct notifier_block ovs_dp_device_notifier = { .notifier_call = dp_device_event };

Overall Contributors

PersonTokensPropCommitsCommitProp
Pravin B Shelar22364.08%216.67%
Jesse Gross9126.15%18.33%
Alexei Starovoitov133.74%18.33%
Johannes Berg92.59%325.00%
Jiri Benc51.44%18.33%
Jiri Pirko30.86%18.33%
Paolo Abeni20.57%18.33%
Thomas Graf10.29%18.33%
Raju Subramanian10.29%18.33%
Total348100.00%12100.00%
Directory: net/openvswitch
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.