linux/net/openvswitch/datapath.c
<<
val14./spa 14./form 14.a val14 href="../linux+v3.7.3/net" envswitch/datapath.c"> val14.img src="../.static/gfx/right.png" alt=">>"> v./spa v.spa class="lxr_search"> val ="+search" method="post" onsubmit="return do_search(this);"> val14.input typ hidden" nam navtarget" ion> "> val14.input typ text" nam search" id search"> val14.buttopttyp submit">Search val14Prefs 14./a> v./spa al14 4./div al14 4.form ac > ="ajax+*" method="post" onsubmit="return false;"> v.input typ hidden" nam ajax_lookup" id ajax_lookup" ion> "> al14 4./form al14 4.div class="headingbottom">
.div id file_contents"
4 41./a>.spa
 class="comment">/*./spa
  4 42./a>.spa
 class="comment"> * Copyright (c) 2007-2012 Nicira, Inc../spa
  4 43./a>.spa
 class="comment"> *./spa
  4 44./a>.spa
 class="comment"> * This program is free software; you ca
 redistribute it and/or./spa
  4 45./a>.spa
 class="comment"> * modify it under the terms of vers/opt2 of the GNU General Public./spa
  4 46./a>.spa
 class="comment"> * License as published by the Free Software Founda  >
../spa
  4 47./a>.spa
 class="comment"> *./spa
  4 48./a>.spa
 class="comment"> * This program is distributed in the h
	e that it will be useful, but./spa
  4 49./a>.spa
 class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of./spa
  4 .9"
a>.spa
 class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU./spa
  4 11./a>.spa
 class="comment"> * General Public License for more details../spa
  4 12./a>.spa
 class="comment"> *./spa
  4 13./a>.spa
 class="comment"> * You should have received a copy of the GNU General Public License./spa
  4 14./a>.spa
 class="comment"> * along with this program; if not, write to the Free Software./spa
  4 15./a>.spa
 class="comment"> * Founda  >
, Inc., 51 Franklin Street, Fifth Floor, Bost>
, MA./spa
  4 16./a>.spa
 class="comment"> * 02110-1301, USA./spa
  4 17./a>.spa
 class="comment"> */./spa
  4 18./a> 4 19./a>#define4.a href="+code=pr_fmt" class="sref">pr_fmt./a>(.a href="+code=fmt" class="sref">fmt./a>)4.a href="+code=KBUILD_MODNAME" class="sref">KBUILD_MODNAME./a> .spa
 class="string">": "./spa
 4.a href="+code=fmt" class="sref">fmt./a> 4 20./a> 4 21./a>#include <.a href="include/linux/init.h" class="fref">linux/init.h./a>> 4 22./a>#include <.a href="include/linux/module.h" class="fref">linux/module.h./a>> 4 23./a>#include <.a href="include/linux/if_arp.h" class="fref">linux/if_arp.h./a>> 4 24./a>#include <.a href="include/linux/if_vlan.h" class="fref">linux/if_vlan.h./a>> 4 25./a>#include <.a href="include/linux/in.h" class="fref">linux/in.h./a>> 4 26./a>#include <.a href="include/linux/ip.h" class="fref">linux/ip.h./a>> 4 27./a>#include <.a href="include/linux/jhash.h" class="fref">linux/jhash.h./a>> 4 28./a>#include <.a href="include/linux/delay.h" class="fref">linux/delay.h./a>> 4 29./a>#include <.a href="include/linux/time.h" class="fref">linux/time.h./a>> 4 30./a>#include <.a href="include/linux/etherdevice.h" class="fref">linux/etherdevice.h./a>> 4 31./a>#include <.a href="include/linux/genetlink.h" class="fref">linux/genetlink.h./a>> 4 32./a>#include <.a href="include/linux/kernel.h" class="fref">linux/kernel.h./a>> 4 33./a>#include <.a href="include/linux/kthread.h" class="fref">linux/kthread.h./a>> 4 34./a>#include <.a href="include/linux/mutex.h" class="fref">linux/mutex.h./a>> 4 35./a>#include <.a href="include/linux/percpu.h" class="fref">linux/percpu.h./a>> 4 36./a>#include <.a href="include/linux/rcupdate.h" class="fref">linux/rcupdate.h./a>> 4 37./a>#include <.a href="include/linux/tcp.h" class="fref">linux/tcp.h./a>> 4 38./a>#include <.a href="include/linux/udp.h" class="fref">linux/udp.h./a>> 4 39./a>#include <.a href="include/linux/ethtool.h" class="fref">linux/ethtool.h./a>> 4 40./a>#include <.a href="include/linux/wait.h" class="fref">linux/wait.h./a>> 4 41./a>#include <.a href="+ambig=include/asm-alpha/div64.h|include/asm-arm/div64.h|include/asm-avr32/div64.h|include/asm-blackfin/div64.h|include/asm-cris/div64.h|include/asm-frv/div64.h|include/asm-generic/div64.h|include/asm-h8300/div64.h|include/asm-i386/div64.h|include/asm-ia64/div64.h|include/asm-m32r/div64.h|include/asm-m68k/div64.h|include/asm-m68knommu/div64.h|include/asm-mips/div64.h|include/asm-mips64/div64.h|include/asm-parisc/div64.h|include/asm-powerpc/div64.h|include/asm-ppc/div64.h|include/asm-s390/div64.h|include/asm-sh/div64.h|include/asm-sh64/div64.h|include/asm-sparc/div64.h|include/asm-sparc64/div64.h|include/asm-um/div64.h|include/asm-v850/div64.h|include/asm-x86/div64.h|include/asm-x86_64/div64.h|include/asm-xtensa/div64.h" class="falt">asm/div64.h./a>> 4 42./a>#include <.a href="include/linux/highmem.h" class="fref">linux/highmem.h./a>> 4 43./a>#include <.a href="include/linux/netfilter_bridge.h" class="fref">linux/netfilter_bridge.h./a>> 4 44./a>#include <.a href="include/linux/netfilter_ipv4.h" class="fref">linux/netfilter_ipv4.h./a>> 4 45./a>#include <.a href="include/linux/inetdevice.h" class="fref">linux/inetdevice.h./a>> 4 46./a>#include <.a href="include/linux/list.h" class="fref">linux/list.h./a>> 4 47./a>#include <.a href="include/linux/
	envswitch.h" class="fref">linux/
	envswitch.h./a>> 4 48./a>#include <.a href="include/linux/rculist.h" class="fref">linux/rculist.h./a>> 4 49./a>#include <.a href="include/linux/dmi.h" class="fref">linux/dmi.h./a>> 4 50./a>#include <.a href="include/linux/workqueue.h" class="fref">linux/workqueue.h./a>> 4 51./a>#include <.a href="include/net"genetlink.h" class="fref">net"genetlink.h./a>> 4 52./a>#include <.a href="include/net"net_nam
space.h" class="fref">net"net_nam
space.h./a>> 4 53./a>#include <.a href="include/net"netns/generic.h" class="fref">net"netns/generic.h./a>> 4 54./a> 4 55./a>#include ".a href="net"
	envswitch/datapath.h" class="fref">datapath.h./a>" 4 56./a>#include ".a href="net"
	envswitch/flow.h" class="fref">flow.h./a>" 4 57./a>#include ".a href="net"
	envswitch/vport-internal_dev.h" class="fref">vport-internal_dev.h./a>" 4 58./a> 4 59./a>.spa
 class="comment">/**./spa
  4 69"
a>.spa
 class="comment"> * struct ovs_net - Per net-nam
space data for ovs../spa
  4 61./a>.spa
 class="comment"> * @dps: List of datapaths to enable dumping them all out../spa
  4 62./a>.spa
 class="comment"> * Protected by genl_mutex../spa
  4 63./a>.spa
 class="comment"> */./spa
  4 64./a>struct .a href="+code=ovs_net" class="sref">ovs_net./a> { 4 65./a>        struct .a href="+code=list_head" class="sref">list_head./a> .a href="+code=dps" class="sref">dps./a>; 4 66./a>}; 4 67./a> 4 68./a>static int .a href="+code=ovs_net_id" class="sref">ovs_net_id./a> .a href="+code=__read_mostly" class="sref">__read_mostly./a>; 4 69./a> 4 70./a>#define4.a href="+code=REHASH_FLOW_INTERVAL" class="sref">REHASH_FLOW_INTERVAL./a> (10 * 60 * .a href="+code=HZ" class="sref">HZ./a>) 4 71./a>static void .a href="+code=rehash_flow_table" class="sref">rehash_flow_table./a>(struct .a href="+code=work_struct" class="sref">work_struct./a> *.a href="+code=work" class="sref">work./a>); 4 72./a>static .a href="+code=DECLARE_DELAYED_WORK" class="sref">DECLARE_DELAYED_WORK./a>(.a href="+code=rehash_flow_wq" class="sref">rehash_flow_wq./a>, .a href="+code=rehash_flow_table" class="sref">rehash_flow_table./a>); 4 73./a> 4 74./a>.spa
 class="comment">/**./spa
  4 75./a>.spa
 class="comment"> * DOC: Locking:./spa
  4 76./a>.spa
 class="comment"> *./spa
  4 77./a>.spa
 class="comment"> * Writes to device state (add/remove datapath, port, set 
	era  >
s optiports,./spa
  4 78./a>.spa
 class="comment"> * etc.) are protected by RTNL../spa
  4 79./a>.spa
 class="comment"> *./spa
  4 89"
a>.spa
 class="comment"> * Writes to other state (flow table modifica  >
s, set miscellaneous datapath./spa
  4 81./a>.spa
 class="comment"> * param
ters, etc.) are protected by genl_mutex.  The RTNL lock nests inside./spa
  4 82./a>.spa
 class="comment"> * genl_mutex../spa
  4 83./a>.spa
 class="comment"> *./spa
  4 84./a>.spa
 class="comment"> * Reads are protected by RCU../spa
  4 85./a>.spa
 class="comment"> *./spa
  4 86./a>.spa
 class="comment"> * There are a few special cases (mostly stats) that have their own./spa
  4 87./a>.spa
 class="comment"> * synchroniza  >
 but they nest under all of above and don't interact with./spa
  4 88./a>.spa
 class="comment"> * each other../spa
  4 89./a>.spa
 class="comment"> */./spa
  4 90./a> 4 91./a>static struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=new_iport" class="sref">new_iport./a>(c>
st struct .a href="+code=iport_parms" class="sref">iport_parms./a> *); 4 92./a>static int .a href="+code=queue_gso_packets" class="sref">queue_gso_packets./a>(struct .a href="+code=net" class="sref">net./a> *, int .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, struct .a href="+code=sk_buff" class="sref">sk_buff./a> *, 4 93./a>                             c>
st struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> *); 4 94./a>static int .a href="+code=queue_userspace_packet" class="sref">queue_userspace_packet./a>(struct .a href="+code=net" class="sref">net./a> *, int .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, 4 95./a>                                  struct .a href="+code=sk_buff" class="sref">sk_buff./a> *, 4 96./a>                                  c>
st struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> *); 4 97./a> 4 98./a>.spa
 class="comment">/* Must be called with rcu_read_lock, genl_mutex, or RTNL lock. */./spa
  4 99./a>static struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=get_dp" class="sref">get_dp./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>, int .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>) 4100./a>{ 4101./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a> = .a href="+code=NULL" class="sref">NULL./a>; 4102./a>        struct .a href="+code=net_device" class="sref">net_device./a> *.a href="+code=dev" class="sref">dev./a>; 4103./a> 4104./a>        .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 4105./a>        .a href="+code=dev" class="sref">dev./a> = .a href="+code=dev_get_by_index_rcu" class="sref">dev_get_by_index_rcu./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 4106./a>        if (.a href="+code=dev" class="sref">dev./a>) { 4107./a>                struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=iport" class="sref">iport./a> = .a href="+code=ovs_internal_dev_get_iport" class="sref">ovs_internal_dev_get_iport./a>(.a href="+code=dev" class="sref">dev./a>); 4108./a>                if (.a href="+code=iport" class="sref">iport./a>) 4109./a>                        .a href="+code=dp" class="sref">dp./a> = .a href="+code=iport" class="sref">iport./a>->.a href="+code=dp" class="sref">dp./a>; 41.9"
a>        } 4111./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 4112./a> 4113./a>        return .a href="+code=dp" class="sref">dp./a>; 4114./a>} 4115./a> 4116./a>.spa
 class="comment">/* Must be called with rcu_read_lock or RTNL lock. */./spa
  4117./a>c>
st char *.a href="+code=ovs_dp_nam
" class="sref">ovs_dp_nam
./a>(c>
st struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>) 4118./a>{ 4119./a>        struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=iport" class="sref">iport./a> = .a href="+code=ovs_iport_rtnl_rcu" class="sref">ovs_iport_rtnl_rcu./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>); 4120./a>        return .a href="+code=iport" class="sref">iport./a>->.a href="+code=ops" class="sref">ops./a>->.a href="+code=get_nam
" class="sref">get_nam
./a>(.a href="+code=iport" class="sref">iport./a>); 4121./a>} 4122./a> 4123./a>static int .a href="+code=get_dpifindex" class="sref">get_dpifindex./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>) 4124./a>{ 4125./a>        struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=local" class="sref">local./a>; 4126./a>        int .a href="+code=ifindex" class="sref">ifindex./a>; 4127./a> 4128./a>        .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 4129./a> 4130./a>        .a href="+code=local" class="sref">local./a> = .a href="+code=ovs_iport_rcu" class="sref">ovs_iport_rcu./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>); 4131./a>        if (.a href="+code=local" class="sref">local./a>) 4132./a>                .a href="+code=ifindex" class="sref">ifindex./a> = .a href="+code=local" class="sref">local./a>->.a href="+code=ops" class="sref">ops./a>->.a href="+code=get_ifindex" class="sref">get_ifindex./a>(.a href="+code=local" class="sref">local./a>); 4133./a>        else 4134./a>                .a href="+code=ifindex" class="sref">ifindex./a> = 0; 4135./a> 4136./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 4137./a> 4138./a>        return .a href="+code=ifindex" class="sref">ifindex./a>; 4139./a>} 4140./a> 4141./a>static void .a href="+code=destroy_dp_rcu" class="sref">destroy_dp_rcu./a>(struct .a href="+code=rcu_head" class="sref">rcu_head./a> *.a href="+code=rcu" class="sref">rcu./a>) 4142./a>{ 4143./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a> = .a href="+code=container_of" class="sref">container_of./a>(.a href="+code=rcu" class="sref">rcu./a>, struct .a href="+code=datapath" class="sref">datapath./a>, .a href="+code=rcu" class="sref">rcu./a>); 4144./a> 4145./a>        .a href="+code=ovs_flow_tbl_destroy" class="sref">ovs_flow_tbl_destroy./a>((.a href="+code=__force" class="sref">__force./a> struct .a href="+code=flow_table" class="sref">flow_table./a> *).a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 4146./a>        .a href="+code=free_percpu" class="sref">free_percpu./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a>); 4147./a>        .a href="+code=release_net" class="sref">release_net./a>(.a href="+code=ovs_dp_get_net" class="sref">ovs_dp_get_net./a>(.a href="+code=dp" class="sref">dp./a>)); 4148./a>        .a href="+code=kfree" class="sref">kfree./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>); 4149./a>        .a href="+code=kfree" class="sref">kfree./a>(.a href="+code=dp" class="sref">dp./a>); 4150./a>} 4151./a> 4152./a>static struct .a href="+code=hlist_head" class="sref">hlist_head./a> *.a href="+code=iport_hash_bucket" class="sref">iport_hash_bucket./a>(c>
st struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, 4153./a>                                            .a href="+code=u16" class="sref">u16./a>4.a href="+code=port_no" class="sref">port_no./a>) 4154./a>{ 4155./a>        return &.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>[.a href="+code=port_no" class="sref">port_no./a> & (.a href="+code=DP_VPORT_HASH_BUCKETS" class="sref">DP_VPORT_HASH_BUCKETS./a> - 1)]; 4156./a>} 4157./a> 4158./a>struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=ovs_lookup_iport" class="sref">ovs_lookup_iport./a>(c>
st struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, .a href="+code=u16" class="sref">u16./a>4.a href="+code=port_no" class="sref">port_no./a>) 4159./a>{ 4160./a>        struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=iport" class="sref">iport./a>; 4161./a>        struct .a href="+code=hlist_node" class="sref">hlist_node./a> *.a href="+code=n" class="sref">n./a>; 4162./a>        struct .a href="+code=hlist_head" class="sref">hlist_head./a> *.a href="+code=head" class="sref">head./a>; 4163./a> 4164./a>        .a href="+code=head" class="sref">head./a> = .a href="+code=iport_hash_bucket" class="sref">iport_hash_bucket./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=port_no" class="sref">port_no./a>); 4165./a>        .a href="+code=hlist_for_each_entry_rcu" class="sref">hlist_for_each_entry_rcu./a>(.a href="+code=iport" class="sref">iport./a>, .a href="+code=n" class="sref">n./a>, .a href="+code=head" class="sref">head./a>, .a href="+code=dp_hash_node" class="sref">dp_hash_node./a>) { 4166./a>                if (.a href="+code=iport" class="sref">iport./a>->.a href="+code=port_no" class="sref">port_no./a> == .a href="+code=port_no" class="sref">port_no./a>) 4167./a>                        return .a href="+code=iport" class="sref">iport./a>; 4168./a>        } 4169./a>        return .a href="+code=NULL" class="sref">NULL./a>; 4170./a>} 4171./a> 4172./a>.spa
 class="comment">/* Called with RTNL lock and genl_lock. */./spa
  4173./a>static struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=new_iport" class="sref">new_iport./a>(c>
st struct .a href="+code=iport_parms" class="sref">iport_parms./a> *.a href="+code=parms" class="sref">parms./a>) 4174./a>{ 4175./a>        struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=iport" class="sref">iport./a>; 4176./a> 4177./a>        .a href="+code=iport" class="sref">iport./a> = .a href="+code=ovs_iport_add" class="sref">ovs_iport_add./a>(.a href="+code=parms" class="sref">parms./a>); 4178./a>        if (!.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=iport" class="sref">iport./a>)) { 4179./a>                struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a> = .a href="+code=parms" class="sref">parms./a>->.a href="+code=dp" class="sref">dp./a>; 4180./a>                struct .a href="+code=hlist_head" class="sref">hlist_head./a> *.a href="+code=head" class="sref">head./a> = .a href="+code=iport_hash_bucket" class="sref">iport_hash_bucket./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=iport" class="sref">iport./a>->.a href="+code=port_no" class="sref">port_no./a>); 4181./a> 4182./a>                .a href="+code=hlist_add_head_rcu" class="sref">hlist_add_head_rcu./a>(&.a href="+code=iport" class="sref">iport./a>->.a href="+code=dp_hash_node" class="sref">dp_hash_node./a>, .a href="+code=head" class="sref">head./a>); 4183./a>        } 4184./a> 4185./a>        return .a href="+code=iport" class="sref">iport./a>; 4186./a>} 4187./a> 4188./a>.spa
 class="comment">/* Called with RTNL lock. */./spa
  4189./a>void .a href="+code=ovs_dp_detach_port" class="sref">ovs_dp_detach_port./a>(struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=p" class="sref">p./a>) 4190./a>{ 4191./a>        .a href="+code=ASSERT_RTNL" class="sref">ASSERT_RTNL./a>(); 4192./a> 4193./a>        .spa
 class="comment">/* First drop references to device. */./spa
  4194./a>        .a href="+code=hlist_del_rcu" class="sref">hlist_del_rcu./a>(&.a href="+code=p" class="sref">p./a>->.a href="+code=dp_hash_node" class="sref">dp_hash_node./a>); 4195./a> 4196./a>        .spa
 class="comment">/* Then destroy it. */./spa
  4197./a>        .a href="+code=ovs_iport_del" class="sref">ovs_iport_del./a>(.a href="+code=p" class="sref">p./a>); 4198./a>} 4199./a> 4209"
a>.spa
 class="comment">/* Must be called with rcu_read_lock. */./spa
  4201./a>void .a href="+code=ovs_dp_process_received_packet" class="sref">ovs_dp_process_received_packet./a>(struct .a href="+code=iport" class="sref">iport./a> *.a href="+code=p" class="sref">p./a>, struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>) 4202./a>{ 4203./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a> = .a href="+code=p" class="sref">p./a>->.a href="+code=dp" class="sref">dp./a>; 4204./a>        struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>; 4205./a>        struct .a href="+code=dp_stats_percpu" class="sref">dp_stats_percpu./a> *.a href="+code=stats" class="sref">stats./a>; 4206./a>        struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4.a href="+code=key" class="sref">key./a>; 4207./a>        .a href="+code=u64" class="sref">u64./a> *.a href="+code=stats_counter" class="sref">stats_counter./a>; 4208./a>        int .a href="+code=error" class="sref">error./a>; 4209./a>        int .a href="+code=key_len" class="sref">key_len./a>; 4210./a> 4211./a>        .a href="+code=stats" class="sref">stats./a> = .a href="+code=per_cpu_ptr" class="sref">per_cpu_ptr./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a>, .a href="+code=smp_processor_id" class="sref">smp_processor_id./a>()); 4212./a> 4213./a>        .spa
 class="comment">/* Extract flow from 'skb' into 'key'. */./spa
  4214./a>        .a href="+code=error" class="sref">error./a> = .a href="+code=ovs_flow_extract" class="sref">ovs_flow_extract./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=p" class="sref">p./a>->.a href="+code=port_no" class="sref">port_no./a>, &.a href="+code=key" class="sref">key./a>, &.a href="+code=key_len" class="sref">key_len./a>); 4215./a>        if (.a href="+code=unlikely" class="sref">unlikely./a>(.a href="+code=error" class="sref">error./a>)) { 4216./a>                .a href="+code=kfree_skb" class="sref">kfree_skb./a>(.a href="+code=skb" class="sref">skb./a>); 4217./a>                return; 4218./a>        } 4219./a> 4220./a>        .spa
 class="comment">/* Look up flow. */./spa
  4221./a>        .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_tbl_lookup" class="sref">ovs_flow_tbl_lookup./a>(.a href="+code=rcu_dereference" class="sref">rcu_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>), &.a href="+code=key" class="sref">key./a>, .a href="+code=key_len" class="sref">key_len./a>); 4222./a>        if (.a href="+code=unlikely" class="sref">unlikely./a>(!.a href="+code=flow" class="sref">flow./a>)) { 4223./a>                struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> .a href="+code=upcall" class="sref">upcall./a>; 4224./a> 4225./a>                .a href="+code=upcall" class="sref">upcall./a>..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_PACKET_CMD_MISS" class="sref">OVS_PACKET_CMD_MISS./a>; 4226./a>                .a href="+code=upcall" class="sref">upcall./a>..a href="+code=key" class="sref">key./a> = &.a href="+code=key" class="sref">key./a>; 4227./a>                .a href="+code=upcall" class="sref">upcall./a>..a href="+code=userdata" class="sref">userdata./a> = .a href="+code=NULL" class="sref">NULL./a>; 4228./a>                .a href="+code=upcall" class="sref">upcall./a>..a href="+code=portid" class="sref">portid./a> = .a href="+code=p" class="sref">p./a>->.a href="+code=upcall_portid" class="sref">upcall_portid./a>; 4229./a>                .a href="+code=ovs_dp_upcall" class="sref">ovs_dp_upcall./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=skb" class="sref">skb./a>, &.a href="+code=upcall" class="sref">upcall./a>); 4230./a>                .a href="+code=consume_skb" class="sref">consume_skb./a>(.a href="+code=skb" class="sref">skb./a>); 4231./a>                .a href="+code=stats_counter" class="sref">stats_counter./a> = &.a href="+code=stats" class="sref">stats./a>->.a href="+code=n_missed" class="sref">n_missed./a>; 4232./a>                goto .a href="+code=out" class="sref">out./a>; 4233./a>        } 4234./a> 4235./a>        .a href="+code=OVS_CB" class="sref">OVS_CB./a>(.a href="+code=skb" class="sref">skb./a>)->.a href="+code=flow" class="sref">flow./a> = .a href="+code=flow" class="sref">flow./a>; 4236./a> 4237./a>        .a href="+code=stats_counter" class="sref">stats_counter./a> = &.a href="+code=stats" class="sref">stats./a>->.a href="+code=n_hit" class="sref">n_hit./a>; 4238./a>        .a href="+code=ovs_flow_used" class="sref">ovs_flow_used./a>(.a href="+code=OVS_CB" class="sref">OVS_CB./a>(.a href="+code=skb" class="sref">skb./a>)->.a href="+code=flow" class="sref">flow./a>, .a href="+code=skb" class="sref">skb./a>); 4239./a>        .a href="+code=ovs_execute_ac  >
s" class="sref">ovs_execute_ac  >
s./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=skb" class="sref">skb./a>); 4240./a> 4241./a>.a href="+code=out" class="sref">out./a>: 4242./a>        .spa
 class="comment">/* Update datapath statistics. */./spa
  4243./a>        .a href="+code=u64_stats_update_begin" class="sref">u64_stats_update_begin./a>(&.a href="+code=stats" class="sref">stats./a>->.a href="+code=sync" class="sref">sync./a>); 4244./a>        (*.a href="+code=stats_counter" class="sref">stats_counter./a>)++; 4245./a>        .a href="+code=u64_stats_update_end" class="sref">u64_stats_update_end./a>(&.a href="+code=stats" class="sref">stats./a>->.a href="+code=sync" class="sref">sync./a>); 4246./a>} 4247./a> 4248./a>static struct .a href="+code=genl_family" class="sref">genl_family./a> .a href="+code=dp_packet_genl_family" class="sref">dp_packet_genl_family./a> = { 4249./a>        ..a href="+code=id" class="sref">id./a> = .a href="+code=GENL_ID_GENERATE" class="sref">GENL_ID_GENERATE./a>, 4250./a>        ..a href="+code=hdrsize" class="sref">hdrsize./a> = sizeof(struct .a href="+code=ovs_header" class="sref">ovs_header./a>), 4251./a>        ..a href="+code=nam
" class="sref">name./a> = .a href="+code=OVS_PACKET_FAMILY" class="sref">OVS_PACKET_FAMILY./a>, 4252./a>        ..a href="+code=version" class="sref">version./a> = .a href="+code=OVS_PACKET_VERSION" class="sref">OVS_PACKET_VERSION./a>, 4253./a>        ..a href="+code=maxattr" class="sref">maxattr./a> = .a href="+code=OVS_PACKET_ATTR_MAX" class="sref">OVS_PACKET_ATTR_MAX./a>, 4254./a>        ..a href="+code=netnsok" class="sref">netnsok./a> = .a href="+code=true" class="sref">true./a> 4255./a>}; 4256./a> 4257./a>int .a href="+code=ovs_dp_upcall" class="sref">ovs_dp_upcall./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, 4258./a>                  c>
st struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> *.a href="+code=upcall_info" class="sref">upcall_info./a>) 4259./a>{ 4260./a>        struct .a href="+code=dp_stats_percpu" class="sref">dp_stats_percpu./a> *.a href="+code=stats" class="sref">stats./a>; 4261./a>        int .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>; 4262./a>        int .a href="+code=err" class="sref">err./a>; 4263./a> 4264./a>        if (.a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=portid" class="sref">portid./a> == 0) { 4265./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOTCONN" class="sref">ENOTCONN./a>; 4266./a>                goto .a href="+code=err" class="sref">err./a>; 4267./a>        } 4268./a> 4269./a>        .a href="+code=dp_ifindex" class="sref">dp_ifindex./a> = .a href="+code=get_dpifindex" class="sref">get_dpifindex./a>(.a href="+code=dp" class="sref">dp./a>); 4270./a>        if (!.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>) { 4271./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=ENODEV" class="sref">ENODEV./a>; 4272./a>                goto .a href="+code=err" class="sref">err./a>; 4273./a>        } 4274./a> 4275./a>        if (!.a href="+code=skb_is_gso" class="sref">skb_is_gso./a>(.a href="+code=skb" class="sref">skb./a>)) 4276./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=queue_userspace_packet" class="sref">queue_userspace_packet./a>(.a href="+code=ovs_dp_get_net" class="sref">ovs_dp_get_net./a>(.a href="+code=dp" class="sref">dp./a>), .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=upcall_info" class="sref">upcall_info./a>); 4277./a>        else 4278./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=queue_gso_packets" class="sref">queue_gso_packets./a>(.a href="+code=ovs_dp_get_net" class="sref">ovs_dp_get_net./a>(.a href="+code=dp" class="sref">dp./a>), .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=upcall_info" class="sref">upcall_info./a>); 4279./a>        if (.a href="+code=err" class="sref">err./a>) 4280./a>                goto .a href="+code=err" class="sref">err./a>; 4281./a> 4282./a>        return 0; 4283./a> 4284./a>.a href="+code=err" class="sref">err./a>: 4285./a>        .a href="+code=stats" class="sref">stats./a> = .a href="+code=per_cpu_ptr" class="sref">per_cpu_ptr./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a>, .a href="+code=smp_processor_id" class="sref">smp_processor_id./a>()); 4286./a> 4287./a>        .a href="+code=u64_stats_update_begin" class="sref">u64_stats_update_begin./a>(&.a href="+code=stats" class="sref">stats./a>->.a href="+code=sync" class="sref">sync./a>); 4288./a>        .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_lost" class="sref">n_lost./a>++; 4289./a>        .a href="+code=u64_stats_update_end" class="sref">u64_stats_update_end./a>(&.a href="+code=stats" class="sref">stats./a>->.a href="+code=sync" class="sref">sync./a>); 4290./a> 4291./a>        return .a href="+code=err" class="sref">err./a>; 4292./a>} 4293./a> 4294./a>static int .a href="+code=queue_gso_packets" class="sref">queue_gso_packets./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>, int .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, 4295./a>                             struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, 4296./a>                             c>
st struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> *.a href="+code=upcall_info" class="sref">upcall_info./a>) 4297./a>{ 4298./a>        unsigned short .a href="+code=gso_type" class="sref">gso_type./a> = .a href="+code=skb_shinfo" class="sref">skb_shinfo./a>(.a href="+code=skb" class="sref">skb./a>)->.a href="+code=gso_type" class="sref">gso_type./a>; 4299./a>        struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> .a href="+code=later_info" class="sref">later_info./a>; 4300./a>        struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4.a href="+code=later_key" class="sref">later_key./a>; 4301./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=segs" class="sref">segs./a>, *.a href="+code=nskb" class="sref">nskb./a>; 4302./a>        int .a href="+code=err" class="sref">err./a>; 4303./a> 4304./a>        .a href="+code=segs" class="sref">segs./a> = .a href="+code=skb_gso_segment" class="sref">skb_gso_segment./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=NETIF_F_SG" class="sref">NETIF_F_SG./a> | .a href="+code=NETIF_F_HW_CSUM" class="sref">NETIF_F_HW_CSUM./a>); 4305./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=segs" class="sref">segs./a>)) 4306./a>                return .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=segs" class="sref">segs./a>); 4307./a> 4308./a>        .spa
 class="comment">/* Queue all of the segments. */./spa
  4309./a>        .a href="+code=skb" class="sref">skb./a> = .a href="+code=segs" class="sref">segs./a>; 4310./a>        do { 4311./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=queue_userspace_packet" class="sref">queue_userspace_packet./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=upcall_info" class="sref">upcall_info./a>); 4312./a>                if (.a href="+code=err" class="sref">err./a>) 4313./a>                        break; 4314./a> 4315./a>                if (.a href="+code=skb" class="sref">skb./a> == .a href="+code=segs" class="sref">segs./a> && .a href="+code=gso_type" class="sref">gso_type./a> & .a href="+code=SKB_GSO_UDP" class="sref">SKB_GSO_UDP./a>) { 4316./a>                        .spa
 class="comment">/* The initial flow key extracted by ovs_flow_extract()./spa
  4317./a>.spa
 class="comment">                         * in this case is for a first fragment, so we need to./spa
  4318./a>.spa
 class="comment">                         * pr
	erly mark later fragments../spa
  4319./a>.spa
 class="comment">                         */./spa
  4320./a>                        .a href="+code=later_key" class="sref">later_key./a> = *.a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=key" class="sref">key./a>; 4321./a>                        .a href="+code=later_key" class="sref">later_key./a>..a href="+code=ip" class="sref">ip./a>..a href="+code=frag" class="sref">frag./a> = .a href="+code=OVS_FRAG_TYPE_LATER" class="sref">OVS_FRAG_TYPE_LATER./a>; 4322./a> 4323./a>                        .a href="+code=later_info" class="sref">later_info./a> = *.a href="+code=upcall_info" class="sref">upcall_info./a>; 4324./a>                        .a href="+code=later_info" class="sref">later_info./a>..a href="+code=key" class="sref">key./a> = &.a href="+code=later_key" class="sref">later_key./a>; 4325./a>                        .a href="+code=upcall_info" class="sref">upcall_info./a> = &.a href="+code=later_info" class="sref">later_info./a>; 4326./a>                } 4327./a>        } while ((.a href="+code=skb" class="sref">skb./a> = .a href="+code=skb" class="sref">skb./a>->.a href="+code=next" class="sref">next./a>)); 4328./a> 4329./a>        .spa
 class="comment">/* Free all of the segments. */./spa
  4330./a>        .a href="+code=skb" class="sref">skb./a> = .a href="+code=segs" class="sref">segs./a>; 4331./a>        do { 4332./a>                .a href="+code=nskb" class="sref">nskb./a> = .a href="+code=skb" class="sref">skb./a>->.a href="+code=next" class="sref">next./a>; 4333./a>                if (.a href="+code=err" class="sref">err./a>) 4334./a>                        .a href="+code=kfree_skb" class="sref">kfree_skb./a>(.a href="+code=skb" class="sref">skb./a>); 4335./a>                else 4336./a>                        .a href="+code=consume_skb" class="sref">consume_skb./a>(.a href="+code=skb" class="sref">skb./a>); 4337./a>        } while ((.a href="+code=skb" class="sref">skb./a> = .a href="+code=nskb" class="sref">nskb./a>)); 4338./a>        return .a href="+code=err" class="sref">err./a>; 4339./a>} 4340./a> 4341./a>static int .a href="+code=queue_userspace_packet" class="sref">queue_userspace_packet./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>, int .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>, 4342./a>                                  struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, 4343./a>                                  c>
st struct .a href="+code=dp_upcall_info" class="sref">dp_upcall_info./a> *.a href="+code=upcall_info" class="sref">upcall_info./a>) 4344./a>{ 4345./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=upcall" class="sref">upcall./a>; 4346./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=nskb" class="sref">nskb./a> = .a href="+code=NULL" class="sref">NULL./a>; 4347./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=user_skb" class="sref">user_skb./a>; .spa
 class="comment">/* to be queued to userspace */./spa
  4348./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=nla" class="sref">nla./a>; 4349./a>        unsigned int .a href="+code=len" class="sref">len./a>; 4350./a>        int .a href="+code=err" class="sref">err./a>; 4351./a> 4352./a>        if (.a href="+code=vlan_tx_tag_present" class="sref">vlan_tx_tag_present./a>(.a href="+code=skb" class="sref">skb./a>)) { 4353./a>                .a href="+code=nskb" class="sref">nskb./a> = .a href="+code=skb_clone" class="sref">skb_clone./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=GFP_ATOMIC" class="sref">GFP_ATOMIC./a>); 4354./a>                if (!.a href="+code=nskb" class="sref">nskb./a>) 4355./a>                        return -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 4356./a> 4357./a>                .a href="+code=nskb" class="sref">nskb./a> = .a href="+code=__vlan_put_tag" class="sref">__vlan_put_tag./a>(.a href="+code=nskb" class="sref">nskb./a>, .a href="+code=vlan_tx_tag_get" class="sref">vlan_tx_tag_get./a>(.a href="+code=nskb" class="sref">nskb./a>)); 4358./a>                if (!.a href="+code=nskb" class="sref">nskb./a>) 4359./a>                        return -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 4360./a> 4361./a>                .a href="+code=nskb" class="sref">nskb./a>->.a href="+code=vlan_tci" class="sref">vlan_tci./a> = 0; 4362./a>                .a href="+code=skb" class="sref">skb./a> = .a href="+code=nskb" class="sref">nskb./a>; 4363./a>        } 4364./a> 4365./a>        if (.a href="+code=nla_attr_size" class="sref">nla_attr_size./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>) > .a href="+code=USHRT_MAX" class="sref">USHRT_MAX./a>) { 4366./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=EFBIG" class="sref">EFBIG./a>; 4367./a>                goto .a href="+code=out" class="sref">out./a>; 4368./a>        } 4369./a> 4370./a>        .a href="+code=len" class="sref">len./a> = sizeof(struct .a href="+code=ovs_header" class="sref">ovs_header./a>); 4371./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>); 4372./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(.a href="+code=FLOW_BUFSIZE" class="sref">FLOW_BUFSIZE./a>); 4373./a>        if (.a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=cmd" class="sref">cmd./a> == .a href="+code=OVS_PACKET_CMD_ACTION" class="sref">OVS_PACKET_CMD_ACTION./a>) 4374./a>                .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(8); 4375./a> 4376./a>        .a href="+code=user_skb" class="sref">user_skb./a> = .a href="+code=genlmsg_new" class="sref">genlmsg_new./a>(.a href="+code=len" class="sref">len./a>, .a href="+code=GFP_ATOMIC" class="sref">GFP_ATOMIC./a>); 4377./a>        if (!.a href="+code=user_skb" class="sref">user_skb./a>) { 4378./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 4379./a>                goto .a href="+code=out" class="sref">out./a>; 4380./a>        } 4381./a> 4382./a>        .a href="+code=upcall" class="sref">upcall./a> = .a href="+code=genlmsg_put" class="sref">genlmsg_put./a>(.a href="+code=user_skb" class="sref">user_skb./a>, 0, 0, &.a href="+code=dp_packet_genl_family" class="sref">dp_packet_genl_family./a>, 4383./a>                             0, .a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=cmd" class="sref">cmd./a>); 4384./a>        .a href="+code=upcall" class="sref">upcall./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a> = .a href="+code=dp_ifindex" class="sref">dp_ifindex./a>; 4385./a> 4386./a>        .a href="+code=nla" class="sref">nla./a> = .a href="+code=nla_nest_start" class="sref">nla_nest_start./a>(.a href="+code=user_skb" class="sref">user_skb./a>, .a href="+code=OVS_PACKET_ATTR_KEY" class="sref">OVS_PACKET_ATTR_KEY./a>); 4387./a>        .a href="+code=ovs_flow_to_nlattrs" class="sref">ovs_flow_to_nlattrs./a>(.a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=key" class="sref">key./a>, .a href="+code=user_skb" class="sref">user_skb./a>); 4388./a>        .a href="+code=nla_nest_end" class="sref">nla_nest_end./a>(.a href="+code=user_skb" class="sref">user_skb./a>, .a href="+code=nla" class="sref">nla./a>); 4389./a> 4390./a>        if (.a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=userdata" class="sref">userdata./a>) 4391./a>                .a href="+code=nla_put_u64" class="sref">nla_put_u64./a>(.a href="+code=user_skb" class="sref">user_skb./a>, .a href="+code=OVS_PACKET_ATTR_USERDATA" class="sref">OVS_PACKET_ATTR_USERDATA./a>, 4392./a>                            .a href="+code=nla_get_u64" class="sref">nla_get_u64./a>(.a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=userdata" class="sref">userdata./a>)); 4393./a> 4394./a>        .a href="+code=nla" class="sref">nla./a> = .a href="+code=__nla_reserve" class="sref">__nla_reserve./a>(.a href="+code=user_skb" class="sref">user_skb./a>, .a href="+code=OVS_PACKET_ATTR_PACKET" class="sref">OVS_PACKET_ATTR_PACKET./a>, .a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>); 4395./a> 4396./a>        .a href="+code=skb_copy_and_csum_dev" class="sref">skb_copy_and_csum_dev./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=nla" class="sref">nla./a>)); 4397./a> 4398./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=genlmsg_unicast" class="sref">genlmsg_unicast./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=user_skb" class="sref">user_skb./a>, .a href="+code=upcall_info" class="sref">upcall_info./a>->.a href="+code=portid" class="sref">portid./a>); 4399./a> 4400./a>.a href="+code=out" class="sref">out./a>: 4401./a>        .a href="+code=kfree_skb" class="sref">kfree_skb./a>(.a href="+code=nskb" class="sref">nskb./a>); 4402./a>        return .a href="+code=err" class="sref">err./a>; 4403./a>} 4404./a> 4405./a>.spa
 class="comment">/* Called with genl_mutex. */./spa
  4406./a>static int .a href="+code=flush_flows" class="sref">flush_flows./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>) 4407./a>{ 4408./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=old_table" class="sref">old_table./a>; 4409./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=new_table" class="sref">new_table./a>; 4410./a> 4411./a>        .a href="+code=old_table" class="sref">old_table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 4412./a>        .a href="+code=new_table" class="sref">new_table./a> = .a href="+code=ovs_flow_tbl_alloc" class="sref">ovs_flow_tbl_alloc./a>(.a href="+code=TBL_MIN_BUCKETS" class="sref">TBL_MIN_BUCKETS./a>); 4413./a>        if (!.a href="+code=new_table" class="sref">new_table./a>) 4414./a>                return -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 4415./a> 4416./a>        .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>, .a href="+code=new_table" class="sref">new_table./a>); 4417./a> 4418./a>        .a href="+code=ovs_flow_tbl_deferred_destroy" class="sref">ovs_flow_tbl_deferred_destroy./a>(.a href="+code=old_table" class="sref">old_table./a>); 4419./a>        return 0; 4420./a>} 4421./a> 4422./a>static int .a href="+code=validate_actions" class="sref">validate_actions./a>(c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=attr" class="sref">attr./a>, 4423./a>                                c>
st struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4*.a href="+code=key" class="sref">key./a>, int .a href="+code=depth" class="sref">depth./a>); 4424./a> 4425./a>static int .a href="+code=validate_sample" class="sref">validate_sample./a>(c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=attr" class="sref">attr./a>, 4426./a>                                c>
st struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4*.a href="+code=key" class="sref">key./a>, int .a href="+code=depth" class="sref">depth./a>) 4427./a>{ 4428./a>        c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=attrs" class="sref">attrs./a>[.a href="+code=OVS_SAMPLE_ATTR_MAX" class="sref">OVS_SAMPLE_ATTR_MAX./a> + 1]; 4429./a>        c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=probability" class="sref">probability./a>, *.a href="+code=actions" class="sref">actions./a>; 4430./a>        c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=a" class="sref">a./a>; 4431./a>        int .a href="+code=rem" class="sref">rem./a>; 4432./a> 4433./a>        .a href="+code=memset" class="sref">memset./a>(.a href="+code=attrs" class="sref">attrs./a>, 0, sizeof(.a href="+code=attrs" class="sref">attrs./a>)); 4434./a>        .a href="+code=nla_for_each_nested" class="sref">nla_for_each_nested./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=attr" class="sref">attr./a>, .a href="+code=rem" class="sref">rem./a>) { 4435./a>                int .a href="+code=type" class="sref">type./a> = .a href="+code=nla_type" class="sref">nla_type./a>(.a href="+code=a" class="sref">a./a>); 4436./a>                if (!.a href="+code=type" class="sref">type./a> || .a href="+code=type" class="sref">type./a> > .a href="+code=OVS_SAMPLE_ATTR_MAX" class="sref">OVS_SAMPLE_ATTR_MAX./a> || .a href="+code=attrs" class="sref">attrs./a>[.a href="+code=type" class="sref">type./a>]) 4437./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4438./a>                .a href="+code=attrs" class="sref">attrs./a>[.a href="+code=type" class="sref">type./a>] = .a href="+code=a" class="sref">a./a>; 4439./a>        } 4440./a>        if (.a href="+code=rem" class="sref">rem./a>) 4441./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4442./a> 4443./a>        .a href="+code=probability" class="sref">probability./a> = .a href="+code=attrs" class="sref">attrs./a>[.a href="+code=OVS_SAMPLE_ATTR_PROBABILITY" class="sref">OVS_SAMPLE_ATTR_PROBABILITY./a>]; 4444./a>        if (!.a href="+code=probability" class="sref">probability./a> || .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=probability" class="sref">probability./a>) != sizeof(.a href="+code=u32" class="sref">u32./a>)) 4445./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4446./a> 4447./a>        .a href="+code=actions" class="sref">actions./a> = .a href="+code=attrs" class="sref">attrs./a>[.a href="+code=OVS_SAMPLE_ATTR_ACTIONS" class="sref">OVS_SAMPLE_ATTR_ACTIONS./a>]; 4448./a>        if (!.a href="+code=actions" class="sref">actions./a> || (.a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=actions" class="sref">actions./a>) && .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=actions" class="sref">actions./a>) < .a href="+code=NLA_HDRLEN" class="sref">NLA_HDRLEN./a>)) 4449./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4450./a>        return .a href="+code=validate_actions" class="sref">validate_actions./a>(.a href="+code=actions" class="sref">actions./a>, .a href="+code=key" class="sref">key./a>, .a href="+code=depth" class="sref">depth./a> + 1); 4451./a>} 4452./a> 4453./a>static int .a href="+code=validate_tp_port" class="sref">validate_tp_port./a>(c>
st struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4*.a href="+code=flow_key" class="sref">flow_key./a>) 4454./a>{ 4455./a>        if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=eth" class="sref">eth./a>..a href="+code=type" class="sref">type./a> == .a href="+code=htons" class="sref">htons./a>(.a href="+code=ETH_P_IP" class="sref">ETH_P_IP./a>)) { 4456./a>                if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ipv4" class="sref">ipv4./a>..a href="+code=tp" class="sref">tp./a>..a href="+code=src" class="sref">src./a> || .a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ipv4" class="sref">ipv4./a>..a href="+code=tp" class="sref">tp./a>..a href="+code=dst" class="sref">dst./a>) 4457./a>                        return 0; 4458./a>        } else if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=eth" class="sref">eth./a>..a href="+code=type" class="sref">type./a> == .a href="+code=htons" class="sref">htons./a>(.a href="+code=ETH_P_IPV6" class="sref">ETH_P_IPV6./a>)) { 4459./a>                if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ipv6" class="sref">ipv6./a>..a href="+code=tp" class="sref">tp./a>..a href="+code=src" class="sref">src./a> || .a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ipv6" class="sref">ipv6./a>..a href="+code=tp" class="sref">tp./a>..a href="+code=dst" class="sref">dst./a>) 4460./a>                        return 0; 4461./a>        } 4462./a> 4463./a>        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4464./a>} 4465./a> 4466./a>static int .a href="+code=validate_set" class="sref">validate_set./a>(c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=a" class="sref">a./a>, 4467./a>                        c>
st struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4*.a href="+code=flow_key" class="sref">flow_key./a>) 4468./a>{ 4469./a>        c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=ovs_key" class="sref">ovs_key./a> = .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>); 4470./a>        int .a href="+code=key_type" class="sref">key_type./a> = .a href="+code=nla_type" class="sref">nla_type./a>(.a href="+code=ovs_key" class="sref">ovs_key./a>); 4471./a> 4472./a>        .spa
 class="comment">/* There ca
 be only one key in a action */./spa
  4473./a>        if (.a href="+code=nla_total_size" class="sref">nla_total_size./a>(.a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=ovs_key" class="sref">ovs_key./a>)) != .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=a" class="sref">a./a>)) 4474./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4475./a> 4476./a>        if (.a href="+code=key_type" class="sref">key_type./a> > .a href="+code=OVS_KEY_ATTR_MAX" class="sref">OVS_KEY_ATTR_MAX./a> || 4477./a>            .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=ovs_key" class="sref">ovs_key./a>) != .a href="+code=ovs_key_lens" class="sref">ovs_key_lens./a>[.a href="+code=key_type" class="sref">key_type./a>]) 4478./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4479./a> 4480./a>        switch (.a href="+code=key_type" class="sref">key_type./a>) { 4481./a>        c>
st struct .a href="+code=ovs_key_ipv4" class="sref">ovs_key_ipv4./a> *.a href="+code=ipv4_key" class="sref">ipv4_key./a>; 4482./a> 4483./a>        case .a href="+code=OVS_KEY_ATTR_PRIORITY" class="sref">OVS_KEY_ATTR_PRIORITY./a>: 4484./a>        case .a href="+code=OVS_KEY_ATTR_ETHERNET" class="sref">OVS_KEY_ATTR_ETHERNET./a>: 4485./a>                break; 4486./a> 4487./a>        case .a href="+code=OVS_KEY_ATTR_IPV4" class="sref">OVS_KEY_ATTR_IPV4./a>: 4488./a>                if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=eth" class="sref">eth./a>..a href="+code=type" class="sref">type./a> != .a href="+code=htons" class="sref">htons./a>(.a href="+code=ETH_P_IP" class="sref">ETH_P_IP./a>)) 4489./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4490./a> 4491./a>                if (!.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ip" class="sref">ip./a>..a href="+code=proto" class="sref">proto./a>) 4492./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4493./a> 4494./a>                .a href="+code=ipv4_key" class="sref">ipv4_key./a> = .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=ovs_key" class="sref">ovs_key./a>); 4495./a>                if (.a href="+code=ipv4_key" class="sref">ipv4_key./a>->.a href="+code=ipv4_proto" class="sref">ipv4_proto./a> != .a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ip" class="sref">ip./a>..a href="+code=proto" class="sref">proto./a>) 4496./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4497./a> 4498./a>                if (.a href="+code=ipv4_key" class="sref">ipv4_key./a>->.a href="+code=ipv4_frag" class="sref">ipv4_frag./a> != .a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ip" class="sref">ip./a>..a href="+code=frag" class="sref">frag./a>) 4499./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4500./a> 4501./a>                break; 4502./a> 4503./a>        case .a href="+code=OVS_KEY_ATTR_TCP" class="sref">OVS_KEY_ATTR_TCP./a>: 4504./a>                if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ip" class="sref">ip./a>..a href="+code=proto" class="sref">proto./a> != .a href="+code=IPPROTO_TCP" class="sref">IPPROTO_TCP./a>) 4505./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4506./a> 4507./a>                return .a href="+code=validate_tp_port" class="sref">validate_tp_port./a>(.a href="+code=flow_key" class="sref">flow_key./a>); 4508./a> 4509./a>        case .a href="+code=OVS_KEY_ATTR_UDP" class="sref">OVS_KEY_ATTR_UDP./a>: 4510./a>                if (.a href="+code=flow_key" class="sref">flow_key./a>->.a href="+code=ip" class="sref">ip./a>..a href="+code=proto" class="sref">proto./a> != .a href="+code=IPPROTO_UDP" class="sref">IPPROTO_UDP./a>) 4511./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4512./a> 4513./a>                return .a href="+code=validate_tp_port" class="sref">validate_tp_port./a>(.a href="+code=flow_key" class="sref">flow_key./a>); 4514./a> 4515./a>        default: 4516./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4517./a>        } 4518./a> 4519./a>        return 0; 4520./a>} 4521./a> 4522./a>static int .a href="+code=validate_userspace" class="sref">validate_userspace./a>(c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=attr" class="sref">attr./a>) 4523./a>{ 4524./a>        static c>
st struct .a href="+code=nla_policy" class="sref">nla_policy./a> .a href="+code=userspace_policy" class="sref">userspace_policy./a>[.a href="+code=OVS_USERSPACE_ATTR_MAX" class="sref">OVS_USERSPACE_ATTR_MAX./a> + 1] =   { 4525./a>                [.a href="+code=OVS_USERSPACE_ATTR_PID" class="sref">OVS_USERSPACE_ATTR_PID./a>] = {..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_U32" class="sref">NLA_U32./a> }, 4526./a>                [.a href="+code=OVS_USERSPACE_ATTR_USERDATA" class="sref">OVS_USERSPACE_ATTR_USERDATA./a>] = {..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_U64" class="sref">NLA_U64./a> }, 4527./a>        }; 4528./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_USERSPACE_ATTR_MAX" class="sref">OVS_USERSPACE_ATTR_MAX./a> + 1]; 4529./a>        int .a href="+code=error" class="sref">error./a>; 4530./a> 4531./a>        .a href="+code=error" class="sref">error./a> = .a href="+code=nla_parse_nested" class="sref">nla_parse_nested./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=OVS_USERSPACE_ATTR_MAX" class="sref">OVS_USERSPACE_ATTR_MAX./a>, 4532./a>                                 .a href="+code=attr" class="sref">attr./a>, .a href="+code=userspace_policy" class="sref">userspace_policy./a>); 4533./a>        if (.a href="+code=error" class="sref">error./a>) 4534./a>                return .a href="+code=error" class="sref">error./a>; 4535./a> 4536./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_USERSPACE_ATTR_PID" class="sref">OVS_USERSPACE_ATTR_PID./a>] || 4537./a>            !.a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_USERSPACE_ATTR_PID" class="sref">OVS_USERSPACE_ATTR_PID./a>])) 4538./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4539./a> 4540./a>        return 0; 4541./a>} 4542./a> 4543./a>static int .a href="+code=validate_actions" class="sref">validate_actions./a>(c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=attr" class="sref">attr./a>, 4544./a>                                c>
st struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a>4*.a href="+code=key" class="sref">key./a>,  int .a href="+code=depth" class="sref">depth./a>) 4545./a>{ 4546./a>        c>
st struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=a" class="sref">a./a>; 4547./a>        int .a href="+code=rem" class="sref">rem./a>, .a href="+code=err" class="sref">err./a>; 4548./a> 4549./a>        if (.a href="+code=depth" class="sref">depth./a> >= .a href="+code=SAMPLE_ACTION_DEPTH" class="sref">SAMPLE_ACTION_DEPTH./a>) 4550./a>                return -.a href="+code=EOVERFLOW" class="sref">EOVERFLOW./a>; 4551./a> 4552./a>        .a href="+code=nla_for_each_nested" class="sref">nla_for_each_nested./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=attr" class="sref">attr./a>, .a href="+code=rem" class="sref">rem./a>) { 4553./a>                .spa
 class="comment">/* Expected argument lengths, (u32)-1 for variable length. */./spa
  4554./a>                static c>
st .a href="+code=u32" class="sref">u32./a> .a href="+code=action_lens" class="sref">action_lens./a>[.a href="+code=OVS_ACTION_ATTR_MAX" class="sref">OVS_ACTION_ATTR_MAX./a> + 1] = { 4555./a>                        [.a href="+code=OVS_ACTION_ATTR_OUTPUT" class="sref">OVS_ACTION_ATTR_OUTPUT./a>] = sizeof(.a href="+code=u32" class="sref">u32./a>), 4556./a>                        [.a href="+code=OVS_ACTION_ATTR_USERSPACE" class="sref">OVS_ACTION_ATTR_USERSPACE./a>] = (.a href="+code=u32" class="sref">u32./a>)-1, 4557./a>                        [.a href="+code=OVS_ACTION_ATTR_PUSH_VLAN" class="sref">OVS_ACTION_ATTR_PUSH_VLAN./a>] = sizeof(struct .a href="+code=ovs_action_push_vlan" class="sref">ovs_action_push_vlan./a>), 4558./a>                        [.a href="+code=OVS_ACTION_ATTR_POP_VLAN" class="sref">OVS_ACTION_ATTR_POP_VLAN./a>] = 0, 4559./a>                        [.a href="+code=OVS_ACTION_ATTR_SET" class="sref">OVS_ACTION_ATTR_SET./a>] = (.a href="+code=u32" class="sref">u32./a>)-1, 4560./a>                        [.a href="+code=OVS_ACTION_ATTR_SAMPLE" class="sref">OVS_ACTION_ATTR_SAMPLE./a>] = (.a href="+code=u32" class="sref">u32./a>)-1 4561./a>                }; 4562./a>                c>
st struct .a href="+code=ovs_action_push_vlan" class="sref">ovs_action_push_vlan./a> *.a href="+code=vlan" class="sref">vlan./a>; 4563./a>                int .a href="+code=type" class="sref">type./a> = .a href="+code=nla_type" class="sref">nla_type./a>(.a href="+code=a" class="sref">a./a>); 4564./a> 4565./a>                if (.a href="+code=type" class="sref">type./a> > .a href="+code=OVS_ACTION_ATTR_MAX" class="sref">OVS_ACTION_ATTR_MAX./a> || 4566./a>                    (.a href="+code=action_lens" class="sref">action_lens./a>[.a href="+code=type" class="sref">type./a>] != .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=a" class="sref">a./a>) && 4567./a>                     .a href="+code=action_lens" class="sref">action_lens./a>[.a href="+code=type" class="sref">type./a>] != (.a href="+code=u32" class="sref">u32./a>)-1)) 4568./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4569./a> 4570./a>                switch (.a href="+code=type" class="sref">type./a>) { 4571./a>                case .a href="+code=OVS_ACTION_ATTR_UNSPEC" class="sref">OVS_ACTION_ATTR_UNSPEC./a>: 4572./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4573./a> 4574./a>                case .a href="+code=OVS_ACTION_ATTR_USERSPACE" class="sref">OVS_ACTION_ATTR_USERSPACE./a>: 4575./a>                        .a href="+code=err" class="sref">err./a> = .a href="+code=validate_userspace" class="sref">validate_userspace./a>(.a href="+code=a" class="sref">a./a>); 4576./a>                        if (.a href="+code=err" class="sref">err./a>) 4577./a>                                return .a href="+code=err" class="sref">err./a>; 4578./a>                        break; 4579./a> 4580./a>                case .a href="+code=OVS_ACTION_ATTR_OUTPUT" class="sref">OVS_ACTION_ATTR_OUTPUT./a>: 4581./a>                        if (.a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>) >= .a href="+code=DP_MAX_PORTS" class="sref">DP_MAX_PORTS./a>) 4582./a>                                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4583./a>                        break; 4584./a> 4585./a> 4586./a>                case .a href="+code=OVS_ACTION_ATTR_POP_VLAN" class="sref">OVS_ACTION_ATTR_POP_VLAN./a>: 4587./a>                        break; 4588./a> 4589./a>                case .a href="+code=OVS_ACTION_ATTR_PUSH_VLAN" class="sref">OVS_ACTION_ATTR_PUSH_VLAN./a>: 4590./a>                        .a href="+code=vlan" class="sref">vlan./a> = .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>); 4591./a>                        if (.a href="+code=vlan" class="sref">vlan./a>->.a href="+code=vlan_tpid" class="sref">vlan_tpid./a> != .a href="+code=htons" class="sref">htons./a>(.a href="+code=ETH_P_8021Q" class="sref">ETH_P_8021Q./a>)) 4592./a>                                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4593./a>                        if (!(.a href="+code=vlan" class="sref">vlan./a>->.a href="+code=vlan_tci" class="sref">vlan_tci./a> & .a href="+code=htons" class="sref">htons./a>(.a href="+code=VLAN_TAG_PRESENT" class="sref">VLAN_TAG_PRESENT./a>))) 4594./a>                                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4595./a>                        break; 4596./a> 4597./a>                case .a href="+code=OVS_ACTION_ATTR_SET" class="sref">OVS_ACTION_ATTR_SET./a>: 4598./a>                        .a href="+code=err" class="sref">err./a> = .a href="+code=validate_set" class="sref">validate_set./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=key" class="sref">key./a>); 4599./a>                        if (.a href="+code=err" class="sref">err./a>) 4600./a>                                return .a href="+code=err" class="sref">err./a>; 4601./a>                        break; 4602./a> 4603./a>                case .a href="+code=OVS_ACTION_ATTR_SAMPLE" class="sref">OVS_ACTION_ATTR_SAMPLE./a>: 4604./a>                        .a href="+code=err" class="sref">err./a> = .a href="+code=validate_sample" class="sref">validate_sample./a>(.a href="+code=a" class="sref">a./a>, .a href="+code=key" class="sref">key./a>, .a href="+code=depth" class="sref">depth./a>); 4605./a>                        if (.a href="+code=err" class="sref">err./a>) 4606./a>                                return .a href="+code=err" class="sref">err./a>; 4607./a>                        break; 4608./a> 4609./a>                default: 4610./a>                        return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4611./a>                } 4612./a>        } 4613./a> 4614./a>        if (.a href="+code=rem" class="sref">rem./a> > 0) 4615./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4616./a> 4617./a>        return 0; 4618./a>} 4619./a> 4620./a>static void .a href="+code=clear_stats" class="sref">clear_stats./a>(struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>) 4621./a>{ 4622./a>        .a href="+code=flow" class="sref">flow./a>->.a href="+code=used" class="sref">used./a> = 0; 4623./a>        .a href="+code=flow" class="sref">flow./a>->.a href="+code=tcp_flags" class="sref">tcp_flags./a> = 0; 4624./a>        .a href="+code=flow" class="sref">flow./a>->.a href="+code=packet_count" class="sref">packet_count./a> = 0; 4625./a>        .a href="+code=flow" class="sref">flow./a>->.a href="+code=byte_count" class="sref">byte_count./a> = 0; 4626./a>} 4627./a> 4628./a>static int .a href="+code=ovs_packet_cmd_execute" class="sref">ovs_packet_cmd_execute./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 4629./a>{ 4630./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>; 4631./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 4632./a>        struct .a href="+code=sw_flow_actions" class="sref">sw_flow_actions./a> *.a href="+code=acts" class="sref">acts./a>; 4633./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=packet" class="sref">packet./a>; 4634./a>        struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>; 4635./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 4636./a>        struct .a href="+code=ethhdr" class="sref">ethhdr./a> *.a href="+code=eth" class="sref">eth./a>; 4637./a>        int .a href="+code=len" class="sref">len./a>; 4638./a>        int .a href="+code=err" class="sref">err./a>; 4639./a>        int .a href="+code=key_len" class="sref">key_len./a>; 4640./a> 4641./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4642./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_PACKET" class="sref">OVS_PACKET_ATTR_PACKET./a>] || !.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_KEY" class="sref">OVS_PACKET_ATTR_KEY./a>] || 4643./a>            !.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_ACTIONS" class="sref">OVS_PACKET_ATTR_ACTIONS./a>] || 4644./a>            .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_PACKET" class="sref">OVS_PACKET_ATTR_PACKET./a>]) < .a href="+code=ETH_HLEN" class="sref">ETH_HLEN./a>) 4645./a>                goto .a href="+code=err" class="sref">err./a>; 4646./a> 4647./a>        .a href="+code=len" class="sref">len./a> = .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_PACKET" class="sref">OVS_PACKET_ATTR_PACKET./a>]); 4648./a>        .a href="+code=packet" class="sref">packet./a> = .a href="+code=__dev_alloc_skb" class="sref">__dev_alloc_skb./a>(.a href="+code=NET_IP_ALIGN" class="sref">NET_IP_ALIGN./a> + .a href="+code=len" class="sref">len./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 4649./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 4650./a>        if (!.a href="+code=packet" class="sref">packet./a>) 4651./a>                goto .a href="+code=err" class="sref">err./a>; 4652./a>        .a href="+code=skb_reserve" class="sref">ode=skb_res./a>(.a href="+code=./a>        if (!.a href="+code  L649">4649./a> NET_IP_ALIGN" class="sref">NET_IP_ALIGN./a>); 4653./a> 4654./a>        .a href="+code=memcpy" class="sref">memcpy./a>(.a href="+code=__skb_pu       if (!.a h__skb_pu ./a>(.a href="+code=./a>        if (!.a href="+code  L649">4649./a> len" class="sref">len./a>)  L649">4649./a> nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_PACKET" class="sref">OVS_PACKET_ATTR_PACKET./a>])  L649">4649./a> len" class="sref">len./a>); 4655./a> 4656./a>        .a href="+code=skb_reset_mac_header" class="sref">skb_reset_mac_header./a>(.a href="+code=./a>        if (!.a href="+code); 4657./a>        .a href="+code=eth" class="sref">eth./a> = .a href="+code=eth_hdr" class="sref">eth_hdr./a>(.a href="+code=./a>        if (!.a href="+code); 4658./a> 4659./a>        .spa
 class="comment">/* Normally, setting the skb 'protocol' field would be handled by a./spa
  4660./a>.spa
 class="comment">         * call to eth_type_trans()  but it assumes there's a sending./spa
  4661./a>.spa
 class="comment">         * device, which we may not have. */./spa
  4662./a>        if (L649">4649./a> ntohs" class="sref">ntohs./a>(.a href="+code=eth" class="sref">eth./a>->.a href="+code=h_proto" class="sref">h_proto./a>) >= 1536) 4663./a>                .a href="+code=./a>        if (!.a href="+code->.a href="+code=protocol      if (!.a hrrotocol./a> = .a href="+code=eth" class="sref">eth./a>->.a href="+code=h_proto" class="sref">h_proto./a>; 4664./a>        else 4665./a>                .a href="+code=./a>        if (!.a href="+code->.a href="+code=protocol      if (!.a hrrotocol./a> = .a href="+code=htons" class="sref">htons./a>(.a href="+code=ETH_P_802_2" class="sref">ETH_P_802_2code); 4666./a> 4667./a>        .spa
 class="comment">/* Build a
 sw_flow for sending this ref="+. */./spa
  4668./a>        .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_alloc" class="sref">ovs_flow_alloc./a>(); 4669./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=flow" class="sref">flow./a>); 4670./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=flow" class="sref">flow./a>)) 4671./a>                goto .a href="+code=err_kfree_skb" class="sref">err_kfree_skb./a>; 4672./a> 4673./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_extrac       if (!.a hovs_flow_extrac ./a>(.a href="+code=./a>        if (!.a href="+code  -1, &.a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>, &.a href="+code=key_len" class="sref">key_len./a>); 4674./a>        if (.a href="+code=err" class="sref">err./a>) 4675./a>                goto .a href="+code=err_flow_free" class="sref">err_flow_free./a>; 4676./a> 4677./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_metadata_from_nlattrs" class="sref">ovs_flow_metadata_from_nlattrs./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>..a href="+code=phy" class="sref">phy./a>..a href="+code=priority" class="sref">priority./a>, 4678./a>                                             &.a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>..a href="+code=phy" class="sref">phy./a>..a href="+code=in_port" class="sref">in_port./a>, 4679./a>                                             .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_KEY" class="sref">OVS_PACKET_ATTR_KEY./a>]); 4680./a>        if (.a href="+code=err" class="sref">err./a>) 4681./a>                goto .a href="+code=err_flow_free" class="sref">err_flow_free./a>; 4682./a> 4683./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=validate_actions" class="sref">validate_actions./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_ACTIONS" class="sref">OVS_PACKET_ATTR_ACTIONS./a>], &.a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>, 0); 4684./a>        if (.a href="+code=err" class="sref">err./a>) 4685./a>                goto .a href="+code=err_flow_free" class="sref">err_flow_free./a>; 4686./a> 4687./a>        .a href="+code=flow" class="sref">flow./a>->.a href="+code=hash" class="sref">hash./a> = .a href="+code=ovs_flow_hash" class="sref">ovs_flow_hash./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>, .a href="+code=key_len" class="sref">key_len./a>); 4688./a> 4689./a>        .a href="+code=acts" class="sref">acts./a> = .a href="+code=ovs_flow_actions_alloc" class="sref">ovs_flow_actions_alloc./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_PACKET_ATTR_ACTIONS" class="sref">OVS_PACKET_ATTR_ACTIONS./a>]); 4690./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=acts" class="sref">acts./a>); 4691./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=acts" class="sref">acts./a>)) 4692./a>                goto .a href="+code=err_flow_free" class="sref">err_flow_free./a>; 4693./a>        .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=flow" class="sref">flow./a>->.a href="+code=sf_acts" class="sref">sf_acts./a>, .a href="+code=acts" class="sref">acts./a>); 4694./a> 4695./a>        .a href="+code=OVS_CB" class="sref">OVS_CB./a>(.a href="+code=./a>        if (!.a href="+code)->.a href="+code=flow" class="sref">flow./a> = .a href="+code=flow" class="sref">flow./a>; 4696./a>        .a href="+code=./a>        if (!.a href="+code->.a href="+code=priority" class="sref">priority./a> = .a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>..a href="+code=phy" class="sref">phy./a>..a href="+code=priority" class="sref">priority./a>; 4697./a> 4698./a>        .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 4699./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_n        if (!.a hsock_n  ./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>)  L649">4649./a> ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 4700./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=ENODEV" class="sref">ENODEV./a>; 4701./a>        if (!.a href="+code=dp" class="sref">dp./a>) 4702./a>                goto .a href="+code=err_unlock" class="sref">err_unlock./a>; 4703./a> 4704./a>        .a href="+code=local_bh_disable" class="sref">local_bh_disable./a>(); 4705./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_execute_actions" class="sref">ovs_execute_actions./a>(.a href="+code=dp" class="sref">dp./a>  L649">4649./a> ./a>        if (!.a href="+code); 4706./a>        .a href="+code=local_bh_enable" class="sref">local_bh_enable./a>(); 4707./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 4708./a> 4709./a>        .a href="+code=ovs_flow_free" class="sref">ovs_flow_free./a>(.a href="+code=flow" class="sref">flow./a>); 4710./a>        return .a href="+code=err" class="sref">err./a>; 4711./a> 4712./a>.a href="+code=err_unlock" class="sref">err_unlock./a>: 4713./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 4714./a>.a href="+code=err_flow_free" class="sref">err_flow_free./a>: 4715./a>        .a href="+code=ovs_flow_free" class="sref">ovs_flow_free./a>(.a href="+code=flow" class="sref">flow./a>); 4716./a>.a href="+code=err_kfree_skb" class="sref">err_kfree_skb./a>: 4717./a>        .a href="+code=kfree_skb" class="sref">kfree_skb./a>(.a href="+code=./a>        if (!.a href="+code); 4718./a>.a href="+code=err" class="sref">err./a>: 4719./a>        return .a href="+code=err" class="sref">err./a>; 4720./a>} 4721./a> 4722./a>static c>
st struct .a href="+code=nla_policy" class="sref">nla_policy./a> .a href="+code=./a>  _policy" class="sref">./a>  _policy./a>[.a href="+code=OVS_PACKET_ATTR_MAX" class="sref">OVS_PACKET_ATTR_MAX./a> + 1] = { 4723./a>        [.a href="+code=OVS_PACKET_ATTR_PACKET" class="sref">OVS_PACKET_ATTR_PACKET./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_UNSPEC" class="sref">NLA_UNSPEC./a> }, 4724./a>        [.a href="+code=OVS_PACKET_ATTR_KEY" class="sref">OVS_PACKET_ATTR_KEY./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NESTED" class="sref">NLA_NESTED./a> }, 4725./a>        [.a href="+code=OVS_PACKET_ATTR_ACTIONS" class="sref">OVS_PACKET_ATTR_ACTIONS./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NESTED" class="sref">NLA_NESTED./a> }, 4726./a>}; 4727./a> 4728./a>static struct .a href="+code=genl_ops" class="sref">genl_ops./a> .a href="+code=dp_packet_genl_ops" class="sref">dp_packet_genl_ops./a>[] = { 4729./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_PACKET_CMD_EXECUTE" class="sref">OVS_PACKET_CMD_EXECUTE./a>  4730./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>  Lspa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  4731./a>          ..a href="+code=policy" class="sref">.olicy./a> = .a href="+code=./a>  _policy" class="sref">./a>  _policy./a>  4732./a>          ..a href="+code=doi       if (!.a hdoi ./a> = .a href="+code=ovs_packet_cmd_execute" class="sref">ovs_packet_cmd_execute./a> 4733./a>        } 4734./a>}; 4735./a> 4736./a>static void .a href="+code=get_dp_stats" class="sref">get_dp_stats./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, struct .a href="+code=ovs_dp_stats" class="sref">ovs_dp_stats./a> *.a href="+code=stats" class="sref">stats./a>) 4737./a>{ 4738./a>        int .a href="+code=i" class="sref">i./a>; 4739./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=table" class="sref">table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 4740./a> 4741./a>        .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_flows" class="sref">n_flows./a> = .a href="+code=ovs_flow_tbl_count" class="sref">ovs_flow_tbl_count./a>(.a href="+code=table" class="sref">table./a>); 4742./a> 4743./a>        .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_hi       if (!.a hn_hi ./a> = .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_missed" class="sref">n_missed./a> = .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_los       if (!.a hn_los ./a> = 0; 4744./a>        .a href="+code=for_each_possible_cpu" class="sref">for_each_possible_cpu./a>(.a href="+code=i" class="sref">i./a>) { 4745./a>                c>
st struct .a href="+code=dp_stats_percpu" class="sref">dp_stats_percpu./a> *.a href="+code=percpu_stats" class="sref">percpu_stats./a>; 4746./a>                struct .a href="+code=dp_stats_percpu" class="sref">dp_stats_percpu./a> .a href="+code=local_stats" class="sref">local_stats./a>; 4747./a>                unsigned int .a href="+code=start" class="sref">start./a>; 4748./a> 4749./a>                .a href="+code=percpu_stats" class="sref">percpu_stats./a> = .a href="+code=.er_cpu_ptr" class="sref">.er_cpu_ptr./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a>  L649">4649./a> i" class="sref">i./a>); 4750./a> 4751./a>                do { 4752./a>                        .a href="+code=start" class="sref">start./a> = .a href="+code=u64_stats_fetch_begin_bh" class="sref">u64_stats_fetch_begin_bh./a>(&.a href="+code=percpu_stats" class="sref">percpu_stats./a>->.a href="+code=sync" class="sref">sync./a>); 4753./a>                        .a href="+code=local_stats" class="sref">local_stats./a> = *.a href="+code=percpu_stats" class="sref">percpu_stats./a>; 4754./a>                } while (.a href="+code=u64_stats_fetch_retry_bh" class="sref">u64_stats_fetch_retry_bh./a>(&.a href="+code=percpu_stats" class="sref">percpu_stats./a>->.a href="+code=sync" class="sref">sync./a>  L649">4649./a> start" class="sref">start./a>)); 4755./a> 4756./a>                .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_hi       if (!.a hn_hi ./a> += .a href="+code=local_stats" class="sref">local_stats./a>..a href="+code=n_hi       if (!.a hn_hi ./a>; 4757./a>                .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_missed" class="sref">n_missed./a> += .a href="+code=local_stats" class="sref">local_stats./a>..a href="+code=n_missed" class="sref">n_missed./a>; 4758./a>                .a href="+code=stats" class="sref">stats./a>->.a href="+code=n_los       if (!.a hn_los ./a> += .a href="+code=local_stats" class="sref">local_stats./a>..a href="+code=n_los       if (!.a hn_los ./a>; 4759./a>        } 4760./a>} 4761./a> 4762./a>static c>
st struct .a href="+code=nla_policy" class="sref">nla_policy./a> .a href="+code=flow_policy" class="sref">flow_policy./a>[.a href="+code=OVS_FLOW_ATTR_MAX" class="sref">OVS_FLOW_ATTR_MAX./a> + 1] = { 4763./a>        [.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NESTED" class="sref">NLA_NESTED./a> }, 4764./a>        [.a href="+code=OVS_FLOW_ATTR_ACTIONS" class="sref">OVS_FLOW_ATTR_ACTIONS./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NESTED" class="sref">NLA_NESTED./a> }, 4765./a>        [.a href="+code=OVS_FLOW_ATTR_CLEAR" class="sref">OVS_FLOW_ATTR_CLEAR./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_FLAG" class="sref">NLA_FLAG./a> }, 4766./a>}; 4767./a> 4768./a>static struct .a href="+code=genl_family" class="sref">genl_family./a> .a href="+code=dp_flow_genl_family" class="sref">dp_flow_genl_family./a> = { 4769./a>        ..a href="+code=id" class="sref">id./a> = .a href="+code=GENL_ID_GENERATE" class="sref">GENL_ID_GENERATE./a>  4770./a>        ..a href="+code=hdrsize" class="sref">hdrsize./a> = sizeof(struct .a href="+code=ovs_header" class="sref">ovs_header./a>)  4771./a>        ..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=OVS_FLOW_FAMILY" class="sref">OVS_FLOW_FAMILY./a>  4772./a>        ..a href="+code=version" class="sref">version./a> = .a href="+code=OVS_FLOW_VERSION" class="sref">OVS_FLOW_VERSION./a>  4773./a>        ..a href="+code=maxattr" class="sref">maxattr./a> = .a href="+code=OVS_FLOW_ATTR_MAX" class="sref">OVS_FLOW_ATTR_MAX./a>  4774./a>        ..a href="+code=netnsok" class="sref">netnsok./a> = .a href="+code=true" class="sref">true./a> 4775./a>}; 4776./a> 4777./a>static struct .a href="+code=genl_multicast_group" class="sref">genl_multicast_group./a> .a href="+code=ovs_dp_flow_multicast_group" class="sref">ovs_dp_flow_multicast_group./a> = { 4778./a>        ..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=OVS_FLOW_MCGROUP" class="sref">OVS_FLOW_MCGROUP./a> 4779./a>}; 4780./a> 4781./a>.spa
 class="comment">/* Called with genl_lock. */./spa
  4782./a>static int .a href="+code=ovs_flow_cmd_fill_info" class="sref">ovs_flow_cmd_fill_info./a>(struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>, struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, 4783./a>                                  struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=portid" class="sref">portid./a>, 4784./a>                                  .a href="+code=u32" class="sref">u32./a> .a href="+code=seq" class="sref">seq./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=flags" class="sref">flags./a>, .a href="+code=u8" class="sref">u8./a> .a href="+code=cmd" class="sref">cmd./a>) 4785./a>{ 4786./a>        c>
st int .a href="+code=skb_orig_len" class="sref">skb_orig_len./a> = .a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>; 4787./a>        c>
st struct .a href="+code=sw_flow_actions" class="sref">sw_flow_actions./a> *.a href="+code=sf_acts" class="sref">sf_acts./a>; 4788./a>        struct .a href="+code=ovs_flow_stats" class="sref">ovs_flow_stats./a> .a href="+code=stats" class="sref">stats./a>; 4789./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a>; 4790./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=nla" class="sref">nla./a>; 4791./a>        unsigned long .a href="+code=used" class="sref">used./a>; 4792./a>        .a href="+code=u8" class="sref">u8./a> .a href="+code=tcp_flags" class="sref">tcp_flags./a>; 4793./a>        int .a href="+code=err" class="sref">err./a>; 4794./a> 4795./a>        .a href="+code=sf_acts" class="sref">sf_acts./a> = .a href="+code=rcu_dereference_protected" class="sref">rcu_dereference_protected./a>(.a href="+code=flow" class="sref">flow./a>->.a href="+code=sf_acts" class="sref">sf_acts./a>, 4796./a>                                            .a href="+code=lockdep_genl_is_held" class="sref">lockdep_genl_is_held./a>()); 4797./a> 4798./a>        .a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=genlmsg_pu       if (!.a hgenlmsg_pu ./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=portid" class="sref">portid./a>, .a href="+code=seq" class="sref">seq./a>, &.a href="+code=dp_flow_genl_family" class="sref">dp_flow_genl_family./a>, .a href="+code=flags" class="sref">flags./a>, .a href="+code=cmd" class="sref">cmd./a>); 4799./a>        if (!.a href="+code=ovs_header" class="sref">ovs_header./a>) 4800./a>                return -.a href="+code=EMSGSIZE" class="sref">EMSGSIZE./a>; 4801./a> 4802./a>        .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a> = .a href="+code=get_dpifindex" class="sref">get_dpifindex./a>(.a href="+code=dp" class="sref">dp./a>); 4803./a> 4804./a>        .a href="+code=nla" class="sref">nla./a> = .a href="+code=nla_nest_start" class="sref">nla_nest_start./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>); 4805./a>        if (!.a href="+code=nla" class="sref">nla./a>) 4806./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 4807./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_to_nlattrs" class="sref">ovs_flow_to_nlattrs./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a>, .a href="+code=skb" class="sref">skb./a>); 4808./a>        if (.a href="+code=err" class="sref">err./a>) 4809./a>                goto .a href="+code=error" class="sref">error./a>; 4810./a>        .a href="+code=nla_nest_end" class="sref">nla_nest_end./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=nla" class="sref">nla./a>); 4811./a> 4812./a>        .a href="+code=spin_lock_bh" class="sref">spin_lock_bh./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=lock" class="sref">lock./a>); 4813./a>        .a href="+code=used" class="sref">used./a> = .a href="+code=flow" class="sref">flow./a>->.a href="+code=used" class="sref">used./a>; 4814./a>        .a href="+code=stats" class="sref">stats./a>..a href="+code=n_packets" class="sref">n_packets./a> = .a href="+code=flow" class="sref">flow./a>->.a href="+code=packet_count" class="sref">packet_count./a>; 4815./a>        .a href="+code=stats" class="sref">stats./a>..a href="+code=n_bytes" class="sref">n_bytes./a> = .a href="+code=flow" class="sref">flow./a>->.a href="+code=byte_count" class="sref">byte_count./a>; 4816./a>        .a href="+code=tcp_flags" class="sref">tcp_flags./a> = .a href="+code=flow" class="sref">flow./a>->.a href="+code=tcp_flags" class="sref">tcp_flags./a>; 4817./a>        .a href="+code=spin_unlock_bh" class="sref">spin_unlock_bh./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=lock" class="sref">lock./a>); 4818./a> 4819./a>        if (.a href="+code=used" class="sref">used./a> && 4820./a>            .a href="+code=nla_put_u64" class="sref">nla_put_u64./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_FLOW_ATTR_USED" class="sref">OVS_FLOW_ATTR_USED./a>, .a href="+code=ovs_flow_used_tim
" class="sref">ovs_flow_used_tim
./a>(.a href="+code=used" class="sref">used./a>))) 4821./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 4822./a> 4823./a>        if (.a href="+code=stats" class="sref">stats./a>..a href="+code=n_packets" class="sref">n_packets./a> && 4824./a>            .a href="+code=nla_put" class="sref">nla_put./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_FLOW_ATTR_STATS" class="sref">OVS_FLOW_ATTR_STATS./a>, 4825./a>                    sizeof(struct .a href="+code=ovs_flow_stats" class="sref">ovs_flow_stats./a>), &.a href="+code=stats" class="sref">stats./a>)) 4826./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 4827./a> 4828./a>        if (.a href="+code=tcp_flags" class="sref">tcp_flags./a> && 4829./a>            .a href="+code=nla_put_u8" class="sref">nla_put_u8./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_FLOW_ATTR_TCP_FLAGS" class="sref">OVS_FLOW_ATTR_TCP_FLAGS./a>, .a href="+code=tcp_flags" class="sref">tcp_flags./a>)) 4830./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 4831./a> 4832./a>        .spa
 class="comment">/* If OVS_FLOW_ATTR_ACTIONS doesn't fit, skip dumping the actions if./spa
  4833./a>.spa
 class="comment">         * this is the first flow to be dumped into 'skb'.  This is unusual for./spa
  4834./a>.spa
 class="comment">         * Netlink but individual action lists ca
 be longer than./spa
  4835./a>.spa
 class="comment">         * NLMSG_GOODSIZE and thus entirely undumpable if we didn't do this../spa
  4836./a>.spa
 class="comment">         * The userspace caller ca
 always fetch the actions separately if i ./spa
  4837./a>.spa
 class="comment">         * really wants them.  (Most userspace callers in fact don't care.)./spa
  4838./a>.spa
 class="comment">         *./spa
  4839./a>.spa
 class="comment">         * This ca
 only fail for dump 
	erations because the skb is always./spa
  4840./a>.spa
 class="comment">         * pr
	erly sized for single flows../spa
  4841./a>.spa
 class="comment">         */./spa
  4842./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=nla_put" class="sref">nla_put./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_FLOW_ATTR_ACTIONS" class="sref">OVS_FLOW_ATTR_ACTIONS./a>, .a href="+code=sf_acts" class="sref">sf_acts./a>->.a href="+code=actions_len" class="sref">actions_len./a>, 4843./a>                      .a href="+code=sf_acts" class="sref">sf_acts./a>->.a href="+code=actions" class="sref">actions./a>); 4844./a>        if (.a href="+code=err" class="sref">err./a> < 0 && .a href="+code=skb_orig_len" class="sref">skb_orig_len./a>) 4845./a>                goto .a href="+code=error" class="sref">error./a>; 4846./a> 4847./a>        return .a href="+code=genlmsg_end" class="sref">genlmsg_end./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>); 4848./a> 4849./a>.a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>: 4850./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=EMSGSIZE" class="sref">EMSGSIZE./a>; 4851./a>.a href="+code=error" class="sref">error./a>: 4852./a>        .a href="+code=genlmsg_ca
cel" class="sref">genlmsg_ca
cel./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>); 4853./a>        return .a href="+code=err" class="sref">err./a>; 4854./a>} 4855./a> 4856./a>static struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=ovs_flow_cmd_alloc_info" class="sref">ovs_flow_cmd_alloc_info./a>(struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>) 4857./a>{ 4858./a>        c>
st struct .a href="+code=sw_flow_actions" class="sref">sw_flow_actions./a> *.a href="+code=sf_acts" class="sref">sf_acts./a>; 4859./a>        int .a href="+code=len" class="sref">len./a>; 4860./a> 4861./a>        .a href="+code=sf_acts" class="sref">sf_acts./a> = .a href="+code=rcu_dereference_protected" class="sref">rcu_dereference_protected./a>(.a href="+code=flow" class="sref">flow./a>->.a href="+code=sf_acts" class="sref">sf_acts./a>, 4862./a>                                            .a href="+code=lockdep_genl_is_held" class="sref">lockdep_genl_is_held./a>()); 4863./a> 4864./a>        .spa
 class="comment">/* OVS_FLOW_ATTR_KEY */./spa
  4865./a>        .a href="+code=len" class="sref">len./a> = .a href="+code=nla_total_size" class="sref">nla_total_size./a>(.a href="+code=FLOW_BUFSIZE" class="sref">FLOW_BUFSIZE./a>); 4866./a>        .spa
 class="comment">/* OVS_FLOW_ATTR_ACTIONS */./spa
  4867./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(.a href="+code=sf_acts" class="sref">sf_acts./a>->.a href="+code=actions_len" class="sref">actions_len./a>); 4868./a>        .spa
 class="comment">/* OVS_FLOW_ATTR_STATS */./spa
  4869./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(sizeof(struct .a href="+code=ovs_flow_stats" class="sref">ovs_flow_stats./a>)); 4870./a>        .spa
 class="comment">/* OVS_FLOW_ATTR_TCP_FLAGS */./spa
  4871./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(1); 4872./a>        .spa
 class="comment">/* OVS_FLOW_ATTR_USED */./spa
  4873./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=nla_total_size" class="sref">nla_total_size./a>(8); 4874./a> 4875./a>        .a href="+code=len" class="sref">len./a> += .a href="+code=NLMSG_ALIGN" class="sref">NLMSG_ALIGN./a>(sizeof(struct .a href="+code=ovs_header" class="sref">ovs_header./a>)); 4876./a> 4877./a>        return .a href="+code=genlmsg_new" class="sref">genlmsg_new./a>(.a href="+code=len" class="sref">len./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 4878./a>} 4879./a> 4880./a>static struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=ovs_flow_cmd_build_info" class="sref">ovs_flow_cmd_build_info./a>(struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>, 4881./a>                                               struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, 4882./a>                                               .a href="+code=u32" class="sref">u32./a> .a href="+code=portid" class="sref">portid./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=seq" class="sref">seq./a>, .a href="+code=u8" class="sref">u8./a> .a href="+code=cmd" class="sref">cmd./a>) 4883./a>{ 4884./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>; 4885./a>        int .a href="+code=retval" class="sref">retval./a>; 4886./a> 4887./a>        .a href="+code=skb" class="sref">skb./a> = .a href="+code=ovs_flow_cmd_alloc_info" class="sref">ovs_flow_cmd_alloc_info./a>(.a href="+code=flow" class="sref">flow./a>); 4888./a>        if (!.a href="+code=skb" class="sref">skb./a>) 4889./a>                return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENOMEM" class="sref">ENOMEM./a>); 4890./a> 4891./a>        .a href="+code=retval" class="sref">retval./a> = .a href="+code=ovs_flow_cmd_fill_info" class="sref">ovs_flow_cmd_fill_info./a>(.a href="+code=flow" class="sref">flow./a>, .a href="+code=dp" class="sref">dp./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=portid" class="sref">portid./a>, .a href="+code=seq" class="sref">seq./a>, 0, .a href="+code=cmd" class="sref">cmd./a>); 4892./a>        .a href="+code=BUG_ON" class="sref">BUG_ON./a>(.a href="+code=retval" class="sref">retval./a> < 0); 4893./a>        return .a href="+code=skb" class="sref">skb./a>; 4894./a>} 4895./a> 4896./a>static int .a href="+code=ovs_flow_cmd_new_or_set" class="sref">ovs_flow_cmd_new_or_set./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 4897./a>{ 4898./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 4899./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>; 4900./a>        struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a> .a href="+code=key" class="sref">key./a>; 4901./a>        struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>; 4902./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 4903./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 4904./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=table" class="sref">table./a>; 4905./a>        int .a href="+code=error" class="sref">error./a>; 4906./a>        int .a href="+code=key_len" class="sref">key_len./a>; 4907./a> 4908./a>        .spa
 class="comment">/* Extract key. */./spa
  4909./a>        .a href="+code=error" class="sref">error./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4910./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>]) 4911./a>                goto .a href="+code=error" class="sref">error./a>; 4912./a>        .a href="+code=error" class="sref">error./a> = .a href="+code=ovs_flow_from_nlattrs" class="sref">ovs_flow_from_nlattrs./a>(&.a href="+code=key" class="sref">key./a>, &.a href="+code=key_len" class="sref">key_len./a>, .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>]); 4913./a>        if (.a href="+code=error" class="sref">error./a>) 4914./a>                goto .a href="+code=error" class="sref">error./a>; 4915./a> 4916./a>        .spa
 class="comment">/* Validate actions. */./spa
  4917./a>        if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_ACTIONS" class="sref">OVS_FLOW_ATTR_ACTIONS./a>]) { 4918./a>                .a href="+code=error" class="sref">error./a> = .a href="+code=validate_actions" class="sref">validate_actions./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_ACTIONS" class="sref">OVS_FLOW_ATTR_ACTIONS./a>], &.a href="+code=key" class="sref">key./a>,  0); 4919./a>                if (.a href="+code=error" class="sref">error./a>) 4920./a>                        goto .a href="+code=error" class="sref">error./a>; 4921./a>        } else if (.a href="+code=info" class="sref">info./a>->.a href="+code=genlhdr" class="sref">genlhdr./a>->.a href="+code=cmd" class="sref">cmd./a> == .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a>) { 4922./a>                .a href="+code=error" class="sref">error./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 4923./a>                goto .a href="+code=error" class="sref">error./a>; 4924./a>        } 4925./a> 4926./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 4927./a>        .a href="+code=error" class="sref">error./a> = -.a href="+code=ENODEV" class="sref">ENODEV./a>; 4928./a>        if (!.a href="+code=dp" class="sref">dp./a>) 4929./a>                goto .a href="+code=error" class="sref">error./a>; 4930./a> 4931./a>        .a href="+code=table" class="sref">table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 4932./a>        .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_tbl_lookup" class="sref">ovs_flow_tbl_lookup./a>(.a href="+code=table" class="sref">table./a>, &.a href="+code=key" class="sref">key./a>, .a href="+code=key_len" class="sref">key_len./a>); 4933./a>        if (!.a href="+code=flow" class="sref">flow./a>) { 4934./a>                struct .a href="+code=sw_flow_actions" class="sref">sw_flow_actions./a> *.a href="+code=acts" class="sref">acts./a>; 4935./a> 4936./a>                .spa
 class="comment">/* Bail out if we're not allowed to create a new flow. */./spa
  4937./a>                .a href="+code=error" class="sref">error./a> = -.a href="+code=ENOENT" class="sref">ENOENT./a>; 4938./a>                if (.a href="+code=info" class="sref">info./a>->.a href="+code=genlhdr" class="sref">genlhdr./a>->.a href="+code=cmd" class="sref">cmd./a> == .a href="+code=OVS_FLOW_CMD_SET" class="sref">OVS_FLOW_CMD_SET./a>) 4939./a>                        goto .a href="+code=error" class="sref">error./a>; 4940./a> 4941./a>                .spa
 class="comment">/* Expand table, if necessary, to make room. */./spa
  4942./a>                if (.a href="+code=ovs_flow_tbl_need_to_expand" class="sref">ovs_flow_tbl_need_to_expand./a>(.a href="+code=table" class="sref">table./a>)) { 4943./a>                        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=new_table" class="sref">new_table./a>; 4944./a> 4945./a>                        .a href="+code=new_table" class="sref">new_table./a> = .a href="+code=ovs_flow_tbl_expand" class="sref">ovs_flow_tbl_expand./a>(.a href="+code=table" class="sref">table./a>); 4946./a>                        if (!.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=new_table" class="sref">new_table./a>)) { 4947./a>                                .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>, .a href="+code=new_table" class="sref">new_table./a>); 4948./a>                                .a href="+code=ovs_flow_tbl_deferred_destroy" class="sref">ovs_flow_tbl_deferred_destroy./a>(.a href="+code=table" class="sref">table./a>); 4949./a>                                .a href="+code=table" class="sref">table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 4950./a>                        } 4951./a>                } 4952./a> 4953./a>                .spa
 class="comment">/* Allocate flow. */./spa
  4954./a>                .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_alloc" class="sref">ovs_flow_alloc./a>(); 4955./a>                if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=flow" class="sref">flow./a>)) { 4956./a>                        .a href="+code=error" class="sref">error./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=flow" class="sref">flow./a>); 4957./a>                        goto .a href="+code=error" class="sref">error./a>; 4958./a>                } 4959./a>                .a href="+code=flow" class="sref">flow./a>->.a href="+code=key" class="sref">key./a> = .a href="+code=key" class="sref">key./a>; 4960./a>                .a href="+code=clear_stats" class="sref">clear_stats./a>(.a href="+code=flow" class="sref">flow./a>); 4961./a> 4962./a>                .spa
 class="comment">/* Obtain actions. */./spa
  4963./a>                .a href="+code=acts" class="sref">acts./a> = .a href="+code=ovs_flow_actions_alloc" class="sref">ovs_flow_actions_alloc./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_ACTIONS" class="sref">OVS_FLOW_ATTR_ACTIONS./a>]); 4964./a>                .a href="+code=error" class="sref">error./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=acts" class="sref">acts./a>); 4965./a>                if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=acts" class="sref">acts./a>)) 4966./a>                        goto .a href="+code=error_free_flow" class="sref">error_free_flow./a>; 4967./a>                .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=flow" class="sref">flow./a>->.a href="+code=sf_acts" class="sref">sf_acts./a>, .a href="+code=acts" class="sref">acts./a>); 4968./a> 4969./a>                .spa
 class="comment">/* Put flow in bucket. */./spa
  4970./a>                .a href="+code=flow" class="sref">flow./a>->.a href="+code=hash" class="sref">hash./a> = .a href="+code=ovs_flow_hash" class="sref">ovs_flow_hash./a>(&.a href="+code=key" class="sref">key./a>, .a href="+code=key_len" class="sref">key_len./a>); 4971./a>                .a href="+code=ovs_flow_tbl_insert" class="sref">ovs_flow_tbl_insert./a>(.a href="+code=table" class="sref">table./a>, .a href="+code=flow" class="sref">flow./a>); 4972./a> 4973./a>                .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_flow_cmd_build_info" class="sref">ovs_flow_cmd_build_info./a>(.a href="+code=flow" class="sref">flow./a>, .a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 4974./a>                                                .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, 4975./a>                                                .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a>); 4976./a>        } else { 4977./a>                .spa
 class="comment">/* We found a matching flow. */./spa
  4978./a>                struct .a href="+code=sw_flow_actions" class="sref">sw_flow_actions./a> *.a href="+code=old_acts" class="sref">old_acts./a>; 4979./a>                struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=acts_attrs" class="sref">acts_attrs./a>; 4980./a> 4981./a>                .spa
 class="comment">/* Bail out if we're not allowed to modify a
 existing flow../spa
  4982./a>.spa
 class="comment">                 * We accept NLM_F_CREATE in place of the intended NLM_F_EXCL./spa
  4983./a>.spa
 class="comment">                 * because Generic Netlink treats the latter as a dump./spa
  4984./a>.spa
 class="comment">                 * request.  We also accept NLM_F_EXCL in case that bug ever./spa
  4985./a>.spa
 class="comment">                 * gets fixed../spa
  4986./a>.spa
 class="comment">                 */./spa
  4987./a>                .a href="+code=error" class="sref">error./a> = -.a href="+code=EEXIST" class="sref">EEXIST./a>; 4988./a>                if (.a href="+code=info" class="sref">info./a>->.a href="+code=genlhdr" class="sref">genlhdr./a>->.a href="+code=cmd" class="sref">cmd./a> == .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a> && 4989./a>                    .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>->.a href="+code=nlmsg_flags" class="sref">nlmsg_flags./a> & (.a href="+code=NLM_F_CREATE" class="sref">NLM_F_CREATE./a> | .a href="+code=NLM_F_EXCL" class="sref">NLM_F_EXCL./a>)) 4990./a>                        goto .a href="+code=error" class="sref">error./a>; 4991./a> 4992./a>                .spa
 class="comment">/* Update actions. */./spa
  4993./a>                .a href="+code=old_acts" class="sref">old_acts./a> = .a href="+code=rcu_dereference_protected" class="sref">rcu_dereference_protected./a>(.a href="+code=flow" class="sref">flow./a>->.a href="+code=sf_acts" class="sref">sf_acts./a>, 4994./a>                                                     .a href="+code=lockdep_genl_is_held" class="sref">lockdep_genl_is_held./a>()); 4995./a>                .a href="+code=acts_attrs" class="sref">acts_attrs./a> = .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_ACTIONS" class="sref">OVS_FLOW_ATTR_ACTIONS./a>]; 4996./a>                if (.a href="+code=acts_attrs" class="sref">acts_attrs./a> && 4997./a>                   (.a href="+code=old_acts" class="sref">old_acts./a>->.a href="+code=actions_len" class="sref">actions_len./a> != .a href="+code=nla_len" class="sref">nla_len./a>(.a href="+code=acts_attrs" class="sref">acts_attrs./a>) || 4998./a>                   .a href="+code=memcmp" class="sref">memcmp./a>(.a href="+code=old_acts" class="sref">old_acts./a>->.a href="+code=actions" class="sref">actions./a>, .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=acts_attrs" class="sref">acts_attrs./a>), 4999./a>                          .a href="+code=old_acts" class="sref">old_acts./a>->.a href="+code=actions_len" class="sref">actions_len./a>))) { 1000./a>                        struct .a href="+code=sw_flow_actions" class="sref">sw_flow_actions./a> *.a href="+code=new_acts" class="sref">new_acts./a>; 
1001./a> 1002./a>                        .a href="+code=new_acts" class="sref">new_acts./a> = .a href="+code=ovs_flow_actions_alloc" class="sref">ovs_flow_actions_alloc./a>(.a href="+code=acts_attrs" class="sref">acts_attrs./a>); 1003./a>                        .a href="+code=error" class="sref">error./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=new_acts" class="sref">new_acts./a>); 1004./a>                        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=new_acts" class="sref">new_acts./a>)) 1005./a>                                goto .a href="+code=error" class="sref">error./a>; 1006./a> 1007./a>                        .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=flow" class="sref">flow./a>->.a href="+code=sf_acts" class="sref">sf_acts./a>, .a href="+code=new_acts" class="sref">new_acts./a>); 1008./a>                        .a href="+code=ovs_flow_deferred_free_acts" class="sref">ovs_flow_deferred_free_acts./a>(.a href="+code=old_acts" class="sref">old_acts./a>); 1009./a>                } 1010./a> 1011./a>                .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_flow_cmd_build_info" class="sref">ovs_flow_cmd_build_info./a>(.a href="+code=flow" class="sref">flow./a>, .a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1012./a>                                               .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a>); 1013./a> 1014./a>                .spa
 class="comment">/* Clear stats. */./spa
  1015./a>                if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_CLEAR" class="sref">OVS_FLOW_ATTR_CLEAR./a>]) { 1016./a>                        .a href="+code=spin_lock_bh" class="sref">spin_lock_bh./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=lock" class="sref">lock./a>); 1017./a>                        .a href="+code=clear_stats" class="sref">clear_stats./a>(.a href="+code=flow" class="sref">flow./a>); 1018./a>                        .a href="+code=spin_unlock_bh" class="sref">spin_unlock_bh./a>(&.a href="+code=flow" class="sref">flow./a>->.a href="+code=lock" class="sref">lock./a>); 1019./a>                } 1020./a>        } 1021./a> 1022./a>        if (!.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1023./a>                .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1024./a>                           .a href="+code=ovs_dp_flow_multicast_group" class="sref">ovs_dp_flow_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, 1025./a>                           .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1026./a>        else 1027./a>                .a href="+code=netlink_set_err" class="sref">netlink_set_err./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>)->.a href="+code=genl_sock" class="sref">genl_sock./a>, 0, 1028./a>                                .a href="+code=ovs_dp_flow_multicast_group" class="sref">ovs_dp_flow_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>)); 1029./a>        return 0; 1030./a> 1031./a>.a href="+code=error_free_flow" class="sref">error_free_flow./a>: 1032./a>        .a href="+code=ovs_flow_free" class="sref">ovs_flow_free./a>(.a href="+code=flow" class="sref">flow./a>); 1033./a>.a href="+code=error" class="sref">error./a>: 1034./a>        return .a href="+code=error" class="sref">error./a>; 1035./a>} 1036./a> 1037./a>static int .a href="+code=ovs_flow_cmd_get" class="sref">ovs_flow_cmd_get./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1038./a>{ 1039./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1040./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>; 1041./a>        struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a> .a href="+code=key" class="sref">key./a>; 1042./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1043./a>        struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>; 1044./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1045./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=table" class="sref">table./a>; 1046./a>        int .a href="+code=err" class="sref">err./a>; 1047./a>        int .a href="+code=key_len" class="sref">key_len./a>; 1048./a> 1049./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>]) 1050./a>                return -.a href="+code=EINVAL" class="sref">EINVAL./a>; 1051./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_from_nlattrs" class="sref">ovs_flow_from_nlattrs./a>(&.a href="+code=key" class="sref">key./a>, &.a href="+code=key_len" class="sref">key_len./a>, .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>]); 1052./a>        if (.a href="+code=err" class="sref">err./a>) 1053./a>                return .a href="+code=err" class="sref">err./a>; 1054./a> 1055./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1056./a>        if (!.a href="+code=dp" class="sref">dp./a>) 1057./a>                return -.a href="+code=ENODEV" class="sref">ENODEV./a>; 1058./a> 1059./a>        .a href="+code=table" class="sref">table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 1060./a>        .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_tbl_lookup" class="sref">ovs_flow_tbl_lookup./a>(.a href="+code=table" class="sref">table./a>, &.a href="+code=key" class="sref">key./a>, .a href="+code=key_len" class="sref">key_len./a>); 1061./a>        if (!.a href="+code=flow" class="sref">flow./a>) 1062./a>                return -.a href="+code=ENOENT" class="sref">ENOENT./a>; 1063./a> 1064./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_flow_cmd_build_info" class="sref">ovs_flow_cmd_build_info./a>(.a href="+code=flow" class="sref">flow./a>, .a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1065./a>                                        .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a>); 1066./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1067./a>                return .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1068./a> 1069./a>        return .a href="+code=genlmsg_reply" class="sref">genlmsg_reply./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=info" class="sref">info./a>); 1070./a>} 1071./a> 1072./a>static int .a href="+code=ovs_flow_cmd_del" class="sref">ovs_flow_cmd_del./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1073./a>{ 1074./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1075./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>; 1076./a>        struct .a href="+code=sw_flow_key" class="sref">sw_flow_key./a> .a href="+code=key" class="sref">key./a>; 1077./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1078./a>        struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>; 1079./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1080./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=table" class="sref">table./a>; 1081./a>        int .a href="+code=err" class="sref">err./a>; 1082./a>        int .a href="+code=key_len" class="sref">key_len./a>; 1083./a> 1084./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1085./a>        if (!.a href="+code=dp" class="sref">dp./a>) 1086./a>                return -.a href="+code=ENODEV" class="sref">ENODEV./a>; 1087./a> 1088./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>]) 1089./a>                return .a href="+code=flush_flows" class="sref">flush_flows./a>(.a href="+code=dp" class="sref">dp./a>); 1090./a> 1091./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_from_nlattrs" class="sref">ovs_flow_from_nlattrs./a>(&.a href="+code=key" class="sref">key./a>, &.a href="+code=key_len" class="sref">key_len./a>, .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_FLOW_ATTR_KEY" class="sref">OVS_FLOW_ATTR_KEY./a>]); 1092./a>        if (.a href="+code=err" class="sref">err./a>) 1093./a>                return .a href="+code=err" class="sref">err./a>; 1094./a> 1095./a>        .a href="+code=table" class="sref">table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 1096./a>        .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_tbl_lookup" class="sref">ovs_flow_tbl_lookup./a>(.a href="+code=table" class="sref">table./a>, &.a href="+code=key" class="sref">key./a>, .a href="+code=key_len" class="sref">key_len./a>); 1097./a>        if (!.a href="+code=flow" class="sref">flow./a>) 1098./a>                return -.a href="+code=ENOENT" class="sref">ENOENT./a>; 1099./a> 1100./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_flow_cmd_alloc_info" class="sref">ovs_flow_cmd_alloc_info./a>(.a href="+code=flow" class="sref">flow./a>); 1101./a>        if (!.a href="+code=reply" class="sref">reply./a>) 1102./a>                return -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 1103./a> 1104./a>        .a href="+code=ovs_flow_tbl_remove" class="sref">ovs_flow_tbl_remove./a>(.a href="+code=table" class="sref">table./a>, .a href="+code=flow" class="sref">flow./a>); 1105./a> 1106./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_cmd_fill_info" class="sref">ovs_flow_cmd_fill_info./a>(.a href="+code=flow" class="sref">flow./a>, .a href="+code=dp" class="sref">dp./a>, .a href="+code=reply" class="sref">reply./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1107./a>                                     .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, 0, .a href="+code=OVS_FLOW_CMD_DEL" class="sref">OVS_FLOW_CMD_DEL./a>); 1108./a>        .a href="+code=BUG_ON" class="sref">BUG_ON./a>(.a href="+code=err" class="sref">err./a> < 0); 1109./a> 1110./a>        .a href="+code=ovs_flow_deferred_free" class="sref">ovs_flow_deferred_free./a>(.a href="+code=flow" class="sref">flow./a>); 1111./a> 1112./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1113./a>                    .a href="+code=ovs_dp_flow_multicast_group" class="sref">ovs_dp_flow_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1114./a>        return 0; 1115./a>} 1116./a> 1117./a>static int .a href="+code=ovs_flow_cmd_dump" class="sref">ovs_flow_cmd_dump./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=netlink_callback" class="sref">netlink_callback./a> *.a href="+code=cb" class="sref">cb./a>) 1118./a>{ 1119./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=genlmsg_data" class="sref">genlmsg_data./a>(.a href="+code=nlmsg_data" class="sref">nlmsg_data./a>(.a href="+code=cb" class="sref">cb./a>->.a href="+code=nlh" class="sref">nlh./a>)); 1120./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1121./a>        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=table" class="sref">table./a>; 1122./a> 1123./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1124./a>        if (!.a href="+code=dp" class="sref">dp./a>) 1125./a>                return -.a href="+code=ENODEV" class="sref">ENODEV./a>; 1126./a> 1127./a>        .a href="+code=table" class="sref">table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 1128./a> 1129./a>        for (;;) { 1130./a>                struct .a href="+code=sw_flow" class="sref">sw_flow./a> *.a href="+code=flow" class="sref">flow./a>; 1131./a>                .a href="+code=u32" class="sref">u32./a> .a href="+code=bucket" class="sref">bucket./a>, .a href="+code=obj" class="sref">obj./a>; 1132./a> 1133./a>                .a href="+code=bucket" class="sref">bucket./a> = .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[0]; 1134./a>                .a href="+code=obj" class="sref">obj./a> = .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[1]; 1135./a>                .a href="+code=flow" class="sref">flow./a> = .a href="+code=ovs_flow_tbl_next" class="sref">ovs_flow_tbl_next./a>(.a href="+code=table" class="sref">table./a>, &.a href="+code=bucket" class="sref">bucket./a>, &.a href="+code=obj" class="sref">obj./a>); 1136./a>                if (!.a href="+code=flow" class="sref">flow./a>) 1137./a>                        break; 1138./a> 1139./a>                if (.a href="+code=ovs_flow_cmd_fill_info" class="sref">ovs_flow_cmd_fill_info./a>(.a href="+code=flow" class="sref">flow./a>, .a href="+code=dp" class="sref">dp./a>, .a href="+code=skb" class="sref">skb./a>, 1140./a>                                           .a href="+code=NETLINK_CB" class="sref">NETLINK_CB./a>(.a href="+code=cb" class="sref">cb./a>->.a href="+code=skb" class="sref">skb./a>)..a href="+code=portid" class="sref">portid./a>, 1141./a>                                           .a href="+code=cb" class="sref">cb./a>->.a href="+code=nlh" class="sref">nlh./a>->.a href="+code=nlmsg_seq" class="sref">nlmsg_seq./a>, .a href="+code=NLM_F_MULTI" class="sref">NLM_F_MULTI./a>, 1142./a>                                           .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a>) < 0) 1143./a>                        break; 1144./a> 1145./a>                .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[0] = .a href="+code=bucket" class="sref">bucket./a>; 1146./a>                .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[1] = .a href="+code=obj" class="sref">obj./a>; 1147./a>        } 1148./a>        return .a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>; 1149./a>} 1150./a> 1151./a>static struct .a href="+code=genl_ops" class="sref">genl_ops./a> .a href="+code=dp_flow_genl_ops" class="sref">dp_flow_genl_ops./a>[] = { 1152./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_FLOW_CMD_NEW" class="sref">OVS_FLOW_CMD_NEW./a>, 1153./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .spa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  1154./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=flow_policy" class="sref">flow_policy./a>, 1155./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_flow_cmd_new_or_set" class="sref">ovs_flow_cmd_new_or_set./a> 1156./a>        }, 1157./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_FLOW_CMD_DEL" class="sref">OVS_FLOW_CMD_DEL./a>, 1158./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .spa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  1159./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=flow_policy" class="sref">flow_policy./a>, 1160./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_flow_cmd_del" class="sref">ovs_flow_cmd_del./a> 1161./a>        }, 1162./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_FLOW_CMD_GET" class="sref">OVS_FLOW_CMD_GET./a>, 1163./a>          ..a href="+code=flags" class="sref">flags./a> = 0,               .spa
 class="comment">/* OK for unprivileged users. */./spa
  1164./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=flow_policy" class="sref">flow_policy./a>, 1165./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_flow_cmd_get" class="sref">ovs_flow_cmd_get./a>, 1166./a>          ..a href="+code=dumpit" class="sref">dumpit./a> = .a href="+code=ovs_flow_cmd_dump" class="sref">ovs_flow_cmd_dump./a> 1167./a>        }, 1168./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_FLOW_CMD_SET" class="sref">OVS_FLOW_CMD_SET./a>, 1169./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .spa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  1170./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=flow_policy" class="sref">flow_policy./a>, 1171./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_flow_cmd_new_or_set" class="sref">ovs_flow_cmd_new_or_set./a>, 1172./a>        }, 1173./a>}; 1174./a> 1175./a>static const struct .a href="+code=nla_policy" class="sref">nla_policy./a> .a href="+code=datapath_policy" class="sref">datapath_policy./a>[.a href="+code=OVS_DP_ATTR_MAX" class="sref">OVS_DP_ATTR_MAX./a> + 1] = { 1176./a>        [.a href="+code=OVS_DP_ATTR_NAME" class="sref">OVS_DP_ATTR_NAME./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NUL_STRING" class="sref">NLA_NUL_STRING./a>, ..a href="+code=len" class="sref">len./a> = .a href="+code=IFNAMSIZ" class="sref">IFNAMSIZ./a> - 1 }, 1177./a>        [.a href="+code=OVS_DP_ATTR_UPCALL_PID" class="sref">OVS_DP_ATTR_UPCALL_PID./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_U32" class="sref">NLA_U32./a> }, 1178./a>}; 1179./a> 1180./a>static struct .a href="+code=genl_family" class="sref">genl_family./a> .a href="+code=dp_datapath_genl_family" class="sref">dp_datapath_genl_family./a> = { 1181./a>        ..a href="+code=id" class="sref">id./a> = .a href="+code=GENL_ID_GENERATE" class="sref">GENL_ID_GENERATE./a>, 1182./a>        ..a href="+code=hdrsize" class="sref">hdrsize./a> = sizeof(struct .a href="+code=ovs_header" class="sref">ovs_header./a>), 1183./a>        ..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=OVS_DATAPATH_FAMILY" class="sref">OVS_DATAPATH_FAMILY./a>, 1184./a>        ..a href="+code=version" class="sref">version./a> = .a href="+code=OVS_DATAPATH_VERSION" class="sref">OVS_DATAPATH_VERSION./a>, 1185./a>        ..a href="+code=maxattr" class="sref">maxattr./a> = .a href="+code=OVS_DP_ATTR_MAX" class="sref">OVS_DP_ATTR_MAX./a>, 1186./a>        ..a href="+code=netnsok" class="sref">netnsok./a> = .a href="+code=true" class="sref">true./a> 1187./a>}; 1188./a> 1189./a>static struct .a href="+code=genl_multicast_group" class="sref">genl_multicast_group./a> .a href="+code=ovs_dp_datapath_multicast_group" class="sref">ovs_dp_datapath_multicast_group./a> = { 1190./a>        ..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=OVS_DATAPATH_MCGROUP" class="sref">OVS_DATAPATH_MCGROUP./a> 1191./a>}; 1192./a> 1193./a>static int .a href="+code=ovs_dp_cmd_fill_info" class="sref">ovs_dp_cmd_fill_info./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, 1194./a>                                .a href="+code=u32" class="sref">u32./a> .a href="+code=portid" class="sref">portid./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=seq" class="sref">seq./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=flags" class="sref">flags./a>, .a href="+code=u8" class="sref">u8./a> .a href="+code=cmd" class="sref">cmd./a>) 1195./a>{ 1196./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a>; 1197./a>        struct .a href="+code=ovs_dp_stats" class="sref">ovs_dp_stats./a> .a href="+code=dp_stats" class="sref">dp_stats./a>; 1198./a>        int .a href="+code=err" class="sref">err./a>; 1199./a> 1200./a>        .a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=genlmsg_put" class="sref">genlmsg_put./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=portid" class="sref">portid./a>, .a href="+code=seq" class="sref">seq./a>, &.a href="+code=dp_datapath_genl_family" class="sref">dp_datapath_genl_family./a>, 1201./a>                                   .a href="+code=flags" class="sref">flags./a>, .a href="+code=cmd" class="sref">cmd./a>); 1202./a>        if (!.a href="+code=ovs_header" class="sref">ovs_header./a>) 1203./a>                goto .a href="+code=error" class="sref">error./a>; 1204./a> 1205./a>        .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a> = .a href="+code=get_dpifindex" class="sref">get_dpifindex./a>(.a href="+code=dp" class="sref">dp./a>); 1206./a> 1207./a>        .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 1208./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=nla_put_string" class="sref">nla_put_string./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_DP_ATTR_NAME" class="sref">OVS_DP_ATTR_NAME./a>, .a href="+code=ovs_dp_nam
" class="sref">ovs_dp_nam
./a>(.a href="+code=dp" class="sref">dp./a>)); 1209./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 1210./a>        if (.a href="+code=err" class="sref">err./a>) 1211./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 1212./a> 1213./a>        .a href="+code=get_dp_stats" class="sref">get_dp_stats./a>(.a href="+code=dp" class="sref">dp./a>, &.a href="+code=dp_stats" class="sref">dp_stats./a>); 1214./a>        if (.a href="+code=nla_put" class="sref">nla_put./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_DP_ATTR_STATS" class="sref">OVS_DP_ATTR_STATS./a>, sizeof(struct .a href="+code=ovs_dp_stats" class="sref">ovs_dp_stats./a>), &.a href="+code=dp_stats" class="sref">dp_stats./a>)) 1215./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 1216./a> 1217./a>        return .a href="+code=genlmsg_end" class="sref">genlmsg_end./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>); 1218./a> 1219./a>.a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>: 1220./a>        .a href="+code=genlmsg_cancel" class="sref">genlmsg_cancel./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>); 1221./a>.a href="+code=error" class="sref">error./a>: 1222./a>        return -.a href="+code=EMSGSIZE" class="sref">EMSGSIZE./a>; 1223./a>} 1224./a> 1225./a>static struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=ovs_dp_cmd_build_info" class="sref">ovs_dp_cmd_build_info./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=portid" class="sref">portid./a>, 1226./a>                                             .a href="+code=u32" class="sref">u32./a> .a href="+code=seq" class="sref">seq./a>, .a href="+code=u8" class="sref">u8./a> .a href="+code=cmd" class="sref">cmd./a>) 1227./a>{ 1228./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>; 1229./a>        int .a href="+code=retval" class="sref">retval./a>; 1230./a> 1231./a>        .a href="+code=skb" class="sref">skb./a> = .a href="+code=nlmsg_new" class="sref">nlmsg_new./a>(.a href="+code=NLMSG_DEFAULT_SIZE" class="sref">NLMSG_DEFAULT_SIZE./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1232./a>        if (!.a href="+code=skb" class="sref">skb./a>) 1233./a>                return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENOMEM" class="sref">ENOMEM./a>); 1234./a> 1235./a>        .a href="+code=retval" class="sref">retval./a> = .a href="+code=ovs_dp_cmd_fill_info" class="sref">ovs_dp_cmd_fill_info./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=portid" class="sref">portid./a>, .a href="+code=seq" class="sref">seq./a>, 0, .a href="+code=cmd" class="sref">cmd./a>); 1236./a>        if (.a href="+code=retval" class="sref">retval./a> < 0) { 1237./a>                .a href="+code=kfree_skb" class="sref">kfree_skb./a>(.a href="+code=skb" class="sref">skb./a>); 1238./a>                return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(.a href="+code=retval" class="sref">retval./a>); 1239./a>        } 1240./a>        return .a href="+code=skb" class="sref">skb./a>; 1241./a>} 1242./a> 1243./a>.spa
 class="comment">/* Called with genl_mutex and optionally with RTNL lock also. */./spa
  1244./a>static struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=lookup_datapath" class="sref">lookup_datapath./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>, 1245./a>                                        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a>, 1246./a>                                        struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_MAX" class="sref">OVS_DP_ATTR_MAX./a> + 1]) 1247./a>{ 1248./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1249./a> 1250./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_NAME" class="sref">OVS_DP_ATTR_NAME./a>]) 1251./a>                .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1252./a>        else { 1253./a>                struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1254./a> 1255./a>                .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 1256./a>                .a href="+code=vport" class="sref">vport./a> = .a href="+code=ovs_vport_locat
" class="sref">ovs_vport_locat
./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_NAME" class="sref">OVS_DP_ATTR_NAME./a>])); 1257./a>                .a href="+code=dp" class="sref">dp./a> = .a href="+code=vport" class="sref">vport./a> && .a href="+code=vport" class="sref">vport./a>->.a href="+code=port_no" class="sref">port_no./a> == .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a> ? .a href="+code=vport" class="sref">vport./a>->.a href="+code=dp" class="sref">dp./a> : .a href="+code=NULL" class="sref">NULL./a>; 1258./a>                .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 1259./a>        } 1260./a>        return .a href="+code=dp" class="sref">dp./a> ? .a href="+code=dp" class="sref">dp./a> : .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENODEV" class="sref">ENODEV./a>); 1261./a>} 1262./a> 1263./a>static int .a href="+code=ovs_dp_cmd_new" class="sref">ovs_dp_cmd_new./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1264./a>{ 1265./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1266./a>        struct .a href="+code=vport_parms" class="sref">vport_parms./a> .a href="+code=parms" class="sref">parms./a>; 1267./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1268./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1269./a>        struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1270./a>        struct .a href="+code=ovs_net" class="sref">ovs_net./a> *.a href="+code=ovs_net" class="sref">ovs_net./a>; 1271./a>        int .a href="+code=err" class="sref">err./a>, .a href="+code=i" class="sref">i./a>; 1272./a> 1273./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 1274./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_NAME" class="sref">OVS_DP_ATTR_NAME./a>] || !.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_UPCALL_PID" class="sref">OVS_DP_ATTR_UPCALL_PID./a>]) 1275./a>                goto .a href="+code=err" class="sref">err./a>; 1276./a> 1277./a>        .a href="+code=rtnl_lock" class="sref">rtnl_lock./a>(); 1278./a> 1279./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 1280./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=kzalloc" class="sref">kzalloc./a>(sizeof(*.a href="+code=dp" class="sref">dp./a>), .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1281./a>        if (.a href="+code=dp" class="sref">dp./a> == .a href="+code=NULL" class="sref">NULL./a>) 1282./a>                goto .a href="+code=err_unlock_rtnl" class="sref">err_unlock_rtnl./a>; 1283./a> 1284./a>        .a href="+code=ovs_dp_set_net" class="sref">ovs_dp_set_net./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=hold_net" class="sref">hold_net./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>))); 1285./a> 1286./a>        .spa
 class="comment">/* Allocat
 table. */./spa
  1287./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 1288./a>        .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>, .a href="+code=ovs_flow_tbl_alloc" class="sref">ovs_flow_tbl_alloc./a>(.a href="+code=TBL_MIN_BUCKETS" class="sref">TBL_MIN_BUCKETS./a>)); 1289./a>        if (!.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>) 1290./a>                goto .a href="+code=err_free_dp" class="sref">err_free_dp./a>; 1291./a> 1292./a>        .a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a> = .a href="+code=alloc_percpu" class="sref">alloc_percpu./a>(struct .a href="+code=dp_stats_percpu" class="sref">dp_stats_percpu./a>); 1293./a>        if (!.a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a>) { 1294./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 1295./a>                goto .a href="+code=err_destroy_table" class="sref">err_destroy_table./a>; 1296./a>        } 1297./a> 1298./a>        .a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a> = .a href="+code=kmalloc" class="sref">kmalloc./a>(.a href="+code=DP_VPORT_HASH_BUCKETS" class="sref">DP_VPORT_HASH_BUCKETS./a> * sizeof(struct .a href="+code=hlist_head" class="sref">hlist_head./a>), 1299./a>                        .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1300./a>        if (!.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>) { 1301./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=ENOMEM" class="sref">ENOMEM./a>; 1302./a>                goto .a href="+code=err_destroy_percpu" class="sref">err_destroy_percpu./a>; 1303./a>        } 1304./a> 1305./a>        for (.a href="+code=i" class="sref">i./a> = 0; .a href="+code=i" class="sref">i./a> < .a href="+code=DP_VPORT_HASH_BUCKETS" class="sref">DP_VPORT_HASH_BUCKETS./a>; .a href="+code=i" class="sref">i./a>++) 1306./a>                .a href="+code=INIT_HLIST_HEAD" class="sref">INIT_HLIST_HEAD./a>(&.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>[.a href="+code=i" class="sref">i./a>]); 1307./a> 1308./a>        .spa
 class="comment">/* Set up our datapath device. */./spa
  1309./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_NAME" class="sref">OVS_DP_ATTR_NAME./a>]); 1310./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=type" class="sref">type./a> = .a href="+code=OVS_VPORT_TYPE_INTERNAL" class="sref">OVS_VPORT_TYPE_INTERNAL./a>; 1311./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=options" class="sref">options./a> = .a href="+code=NULL" class="sref">NULL./a>; 1312./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=dp" class="sref">dp./a> = .a href="+code=dp" class="sref">dp./a>; 1313./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=port_no" class="sref">port_no./a> = .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>; 1314./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=upcall_portid" class="sref">upcall_portid./a> = .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_DP_ATTR_UPCALL_PID" class="sref">OVS_DP_ATTR_UPCALL_PID./a>]); 1315./a> 1316./a>        .a href="+code=vport" class="sref">vport./a> = .a href="+code=new_vport" class="sref">new_vport./a>(&.a href="+code=parms" class="sref">parms./a>); 1317./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=vport" class="sref">vport./a>)) { 1318./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=vport" class="sref">vport./a>); 1319./a>                if (.a href="+code=err" class="sref">err./a> == -.a href="+code=EBUSY" class="sref">EBUSY./a>) 1320./a>                        .a href="+code=err" class="sref">err./a> = -.a href="+code=EEXIST" class="sref">EEXIST./a>; 1321./a> 1322./a>                goto .a href="+code=err_destroy_ports_array" class="sref">err_destroy_ports_array./a>; 1323./a>        } 1324./a> 1325./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_dp_cmd_build_info" class="sref">ovs_dp_cmd_build_info./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1326./a>                                      .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, .a href="+code=OVS_DP_CMD_NEW" class="sref">OVS_DP_CMD_NEW./a>); 1327./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1328./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1329./a>                goto .a href="+code=err_destroy_local_port" class="sref">err_destroy_local_port./a>; 1330./a> 1331./a>        .a href="+code=ovs_net" class="sref">ovs_net./a> = .a href="+code=net_generic" class="sref">net_generic./a>(.a href="+code=ovs_dp_get_net" class="sref">ovs_dp_get_net./a>(.a href="+code=dp" class="sref">dp./a>), .a href="+code=ovs_net_id" class="sref">ovs_net_id./a>); 1332./a>        .a href="+code=list_add_tail" class="sref">list_add_tail./a>(&.a href="+code=dp" class="sref">dp./a>->.a href="+code=list_node" class="sref">list_node./a>, &.a href="+code=ovs_net" class="sref">ovs_net./a>->.a href="+code=dps" class="sref">dps./a>); 1333./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1334./a> 1335./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1336./a>                    .a href="+code=ovs_dp_datapath_multicast_group" class="sref">ovs_dp_datapath_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, 1337./a>                    .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1338./a>        return 0; 1339./a> 1340./a>.a href="+code=err_destroy_local_port" class="sref">err_destroy_local_port./a>: 1341./a>        .a href="+code=ovs_dp_detach_port" class="sref">ovs_dp_detach_port./a>(.a href="+code=ovs_vport_rtnl" class="sref">ovs_vport_rtnl./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>)); 1342./a>.a href="+code=err_destroy_ports_array" class="sref">err_destroy_ports_array./a>: 1343./a>        .a href="+code=kfree" class="sref">kfree./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>); 1344./a>.a href="+code=err_destroy_percpu" class="sref">err_destroy_percpu./a>: 1345./a>        .a href="+code=free_percpu" class="sref">free_percpu./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=stats_percpu" class="sref">stats_percpu./a>); 1346./a>.a href="+code=err_destroy_table" class="sref">err_destroy_table./a>: 1347./a>        .a href="+code=ovs_flow_tbl_destroy" class="sref">ovs_flow_tbl_destroy./a>(.a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>)); 1348./a>.a href="+code=err_free_dp" class="sref">err_free_dp./a>: 1349./a>        .a href="+code=release_net" class="sref">release_net./a>(.a href="+code=ovs_dp_get_net" class="sref">ovs_dp_get_net./a>(.a href="+code=dp" class="sref">dp./a>)); 1350./a>        .a href="+code=kfree" class="sref">kfree./a>(.a href="+code=dp" class="sref">dp./a>); 1351./a>.a href="+code=err_unlock_rtnl" class="sref">err_unlock_rtnl./a>: 1352./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1353./a>.a href="+code=err" class="sref">err./a>: 1354./a>        return .a href="+code=err" class="sref">err./a>; 1355./a>} 1356./a> 1357./a>.spa
 class="comment">/* Called with genl_mutex. */./spa
  1358./a>static void .a href="+code=__dp_destroy" class="sref">__dp_destroy./a>(struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>) 1359./a>{ 1360./a>        int .a href="+code=i" class="sref">i./a>; 1361./a> 1362./a>        .a href="+code=rtnl_lock" class="sref">rtnl_lock./a>(); 1363./a> 1364./a>        for (.a href="+code=i" class="sref">i./a> = 0; .a href="+code=i" class="sref">i./a> < .a href="+code=DP_VPORT_HASH_BUCKETS" class="sref">DP_VPORT_HASH_BUCKETS./a>; .a href="+code=i" class="sref">i./a>++) { 1365./a>                struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1366./a>                struct .a href="+code=hlist_node" class="sref">hlist_node./a> *.a href="+code=node" class="sref">node./a>, *.a href="+code=n" class="sref">n./a>; 1367./a> 1368./a>                .a href="+code=hlist_for_each_entry_safe" class="sref">hlist_for_each_entry_safe./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=node" class="sref">node./a>, .a href="+code=n" class="sref">n./a>, &.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>[.a href="+code=i" class="sref">i./a>], .a href="+code=dp_hash_node" class="sref">dp_hash_node./a>) 1369./a>                        if (.a href="+code=vport" class="sref">vport./a>->.a href="+code=port_no" class="sref">port_no./a> != .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>) 1370./a>                                .a href="+code=ovs_dp_detach_port" class="sref">ovs_dp_detach_port./a>(.a href="+code=vport" class="sref">vport./a>); 1371./a>        } 1372./a> 1373./a>        .a href="+code=list_del" class="sref">list_del./a>(&.a href="+code=dp" class="sref">dp./a>->.a href="+code=list_node" class="sref">list_node./a>); 1374./a>        .a href="+code=ovs_dp_detach_port" class="sref">ovs_dp_detach_port./a>(.a href="+code=ovs_vport_rtnl" class="sref">ovs_vport_rtnl./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>)); 1375./a> 1376./a>        .spa
 class="comment">/* rtnl_unlock() will wait until all the references to devices that./spa
  1377./a>.spa
 class="comment">         * are 	ending unregistration have been dropped.  We do it here to./spa
  1378./a>.spa
 class="comment">         * ensure that any internal devices (which contain DP pointers) are./spa
  1379./a>.spa
 class="comment">         * fully destroyed before freeing the datapath../spa
  1380./a>.spa
 class="comment">         */./spa
  1381./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1382./a> 1383./a>        .a href="+code=call_rcu" class="sref">call_rcu./a>(&.a href="+code=dp" class="sref">dp./a>->.a href="+code=rcu" class="sref">rcu./a>, .a href="+code=destroy_dp_rcu" class="sref">destroy_dp_rcu./a>); 1384./a>} 1385./a> 1386./a>static int .a href="+code=ovs_dp_cmd_del" class="sref">ovs_dp_cmd_del./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1387./a>{ 1388./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1389./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1390./a>        int .a href="+code=err" class="sref">err./a>; 1391./a> 1392./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=lookup_datapath" class="sref">lookup_datapath./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>); 1393./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=dp" class="sref">dp./a>); 1394./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=dp" class="sref">dp./a>)) 1395./a>                return .a href="+code=err" class="sref">err./a>; 1396./a> 1397./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_dp_cmd_build_info" class="sref">ovs_dp_cmd_build_info./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1398./a>                                      .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, .a href="+code=OVS_DP_CMD_DEL" class="sref">OVS_DP_CMD_DEL./a>); 1399./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1400./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1401./a>                return .a href="+code=err" class="sref">err./a>; 1402./a> 1403./a>        .a href="+code=__dp_destroy" class="sref">__dp_destroy./a>(.a href="+code=dp" class="sref">dp./a>); 1404./a> 1405./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1406./a>                    .a href="+code=ovs_dp_datapath_multicast_group" class="sref">ovs_dp_datapath_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, 1407./a>                    .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1408./a> 1409./a>        return 0; 1410./a>} 1411./a> 1412./a>static int .a href="+code=ovs_dp_cmd_set" class="sref">ovs_dp_cmd_set./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1413./a>{ 1414./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1415./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1416./a>        int .a href="+code=err" class="sref">err./a>; 1417./a> 1418./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=lookup_datapath" class="sref">lookup_datapath./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>); 1419./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=dp" class="sref">dp./a>)) 1420./a>                return .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=dp" class="sref">dp./a>); 1421./a> 1422./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_dp_cmd_build_info" class="sref">ovs_dp_cmd_build_info./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1423./a>                                      .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, .a href="+code=OVS_DP_CMD_NEW" class="sref">OVS_DP_CMD_NEW./a>); 1424./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) { 1425./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1426./a>                .a href="+code=netlink_set_err" class="sref">netlink_set_err./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>)->.a href="+code=genl_sock" class="sref">genl_sock./a>, 0, 1427./a>                                .a href="+code=ovs_dp_datapath_multicast_group" class="sref">ovs_dp_datapath_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=err" class="sref">err./a>); 1428./a>                return 0; 1429./a>        } 1430./a> 1431./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1432./a>                    .a href="+code=ovs_dp_datapath_multicast_group" class="sref">ovs_dp_datapath_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, 1433./a>                    .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1434./a> 1435./a>        return 0; 1436./a>} 1437./a> 1438./a>static int .a href="+code=ovs_dp_cmd_get" class="sref">ovs_dp_cmd_get./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1439./a>{ 1440./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1441./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1442./a> 1443./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=lookup_datapath" class="sref">lookup_datapath./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>); 1444./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=dp" class="sref">dp./a>)) 1445./a>                return .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=dp" class="sref">dp./a>); 1446./a> 1447./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_dp_cmd_build_info" class="sref">ovs_dp_cmd_build_info./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1448./a>                                      .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, .a href="+code=OVS_DP_CMD_NEW" class="sref">OVS_DP_CMD_NEW./a>); 1449./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1450./a>                return .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1451./a> 1452./a>        return .a href="+code=genlmsg_reply" class="sref">genlmsg_reply./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=info" class="sref">info./a>); 1453./a>} 1454./a> 1455./a>static int .a href="+code=ovs_dp_cmd_dump" class="sref">ovs_dp_cmd_dump./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=netlink_callback" class="sref">netlink_callback./a> *.a href="+code=cb" class="sref">cb./a>) 1456./a>{ 1457./a>        struct .a href="+code=ovs_net" class="sref">ovs_net./a> *.a href="+code=ovs_net" class="sref">ovs_net./a> = .a href="+code=net_generic" class="sref">net_generic./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_net_id" class="sref">ovs_net_id./a>); 1458./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1459./a>        int .a href="+code=skip" class="sref">skip./a> = .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[0]; 1460./a>        int .a href="+code=i" class="sref">i./a> = 0; 1461./a> 1462./a>        .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=dp" class="sref">dp./a>, &.a href="+code=ovs_net" class="sref">ovs_net./a>->.a href="+code=dps" class="sref">dps./a>, .a href="+code=list_node" class="sref">list_node./a>) { 1463./a>                if (.a href="+code=i" class="sref">i./a> >= .a href="+code=skip" class="sref">skip./a> && 1464./a>                    .a href="+code=ovs_dp_cmd_fill_info" class="sref">ovs_dp_cmd_fill_info./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=NETLINK_CB" class="sref">NETLINK_CB./a>(.a href="+code=cb" class="sref">cb./a>->.a href="+code=skb" class="sref">skb./a>)..a href="+code=portid" class="sref">portid./a>, 1465./a>                                         .a href="+code=cb" class="sref">cb./a>->.a href="+code=nlh" class="sref">nlh./a>->.a href="+code=nlmsg_seq" class="sref">nlmsg_seq./a>, .a href="+code=NLM_F_MULTI" class="sref">NLM_F_MULTI./a>, 1466./a>                                         .a href="+code=OVS_DP_CMD_NEW" class="sref">OVS_DP_CMD_NEW./a>) < 0) 1467./a>                        break; 1468./a>                .a href="+code=i" class="sref">i./a>++; 1469./a>        } 1470./a> 1471./a>        .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[0] = .a href="+code=i" class="sref">i./a>; 1472./a> 1473./a>        return .a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>; 1474./a>} 1475./a> 1476./a>static struct .a href="+code=genl_ops" class="sref">genl_ops./a> .a href="+code=dp_datapath_genl_ops" class="sref">dp_datapath_genl_ops./a>[] = { 1477./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_DP_CMD_NEW" class="sref">OVS_DP_CMD_NEW./a>, 1478./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .spa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  1479./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=datapath_policy" class="sref">datapath_policy./a>, 1480./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_dp_cmd_new" class="sref">ovs_dp_cmd_new./a> 1481./a>        }, 1482./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_DP_CMD_DEL" class="sref">OVS_DP_CMD_DEL./a>, 1483./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .spa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  1484./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=datapath_policy" class="sref">datapath_policy./a>, 1485./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_dp_cmd_del" class="sref">ovs_dp_cmd_del./a> 1486./a>        }, 1487./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_DP_CMD_GET" class="sref">OVS_DP_CMD_GET./a>, 1488./a>          ..a href="+code=flags" class="sref">flags./a> = 0,               .spa
 class="comment">/* OK for unprivileged users. */./spa
  1489./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=datapath_policy" class="sref">datapath_policy./a>, 1490./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_dp_cmd_get" class="sref">ovs_dp_cmd_get./a>, 1491./a>          ..a href="+code=dumpit" class="sref">dumpit./a> = .a href="+code=ovs_dp_cmd_dump" class="sref">ovs_dp_cmd_dump./a> 1492./a>        }, 1493./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_DP_CMD_SET" class="sref">OVS_DP_CMD_SET./a>, 1494./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .spa
 class="comment">/* Requires CAP_NET_ADMIN privilege. */./spa
  1495./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=datapath_policy" class="sref">datapath_policy./a>, 1496./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_dp_cmd_set" class="sref">ovs_dp_cmd_set./a>, 1497./a>        }, 1498./a>}; 1499./a> 1500./a>static const struct .a href="+code=nla_policy" class="sref">nla_policy./a> .a href="+code=vport_policy" class="sref">vport_policy./a>[.a href="+code=OVS_VPORT_ATTR_MAX" class="sref">OVS_VPORT_ATTR_MAX./a> + 1] = { 1501./a>        [.a href="+code=OVS_VPORT_ATTR_NAME" class="sref">OVS_VPORT_ATTR_NAME./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NUL_STRING" class="sref">NLA_NUL_STRING./a>, ..a href="+code=len" class="sref">len./a> = .a href="+code=IFNAMSIZ" class="sref">IFNAMSIZ./a> - 1 }, 1502./a>        [.a href="+code=OVS_VPORT_ATTR_STATS" class="sref">OVS_VPORT_ATTR_STATS./a>] = { ..a href="+code=len" class="sref">len./a> = sizeof(struct .a href="+code=ovs_vport_stats" class="sref">ovs_vport_stats./a>) }, 1503./a>        [.a href="+code=OVS_VPORT_ATTR_PORT_NO" class="sref">OVS_VPORT_ATTR_PORT_NO./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_U32" class="sref">NLA_U32./a> }, 1504./a>        [.a href="+code=OVS_VPORT_ATTR_TYPE" class="sref">OVS_VPORT_ATTR_TYPE./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_U32" class="sref">NLA_U32./a> }, 1505./a>        [.a href="+code=OVS_VPORT_ATTR_UPCALL_PID" class="sref">OVS_VPORT_ATTR_UPCALL_PID./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_U32" class="sref">NLA_U32./a> }, 1506./a>        [.a href="+code=OVS_VPORT_ATTR_OPTIONS" class="sref">OVS_VPORT_ATTR_OPTIONS./a>] = { ..a href="+code=type" class="sref">type./a> = .a href="+code=NLA_NESTED" class="sref">NLA_NESTED./a> }, 1507./a>}; 1508./a> 1509./a>static struct .a href="+code=genl_family" class="sref">genl_family./a> .a href="+code=dp_vport_genl_family" class="sref">dp_vport_genl_family./a> = { 1510./a>        ..a href="+code=id" class="sref">id./a> = .a href="+code=GENL_ID_GENERATE" class="sref">GENL_ID_GENERATE./a>, 1511./a>        ..a href="+code=hdrsize" class="sref">hdrsize./a> = sizeof(struct .a href="+code=ovs_header" class="sref">ovs_header./a>), 1512./a>        ..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=OVS_VPORT_FAMILY" class="sref">OVS_VPORT_FAMILY./a>, 1513./a>        ..a href="+code=version" class="sref">version./a> = .a href="+code=OVS_VPORT_VERSION" class="sref">OVS_VPORT_VERSION./a>, 1514./a>        ..a href="+code=maxattr" class="sref">maxattr./a> = .a href="+code=OVS_VPORT_ATTR_MAX" class="sref">OVS_VPORT_ATTR_MAX./a>, 1515./a>        ..a href="+code=netnsok" class="sref">netnsok./a> = .a href="+code=true" class="sref">true./a> 1516./a>}; 1517./a> 1518./a>struct .a href="+code=genl_multicast_group" class="sref">genl_multicast_group./a> .a href="+code=ovs_dp_vport_multicast_group" class="sref">ovs_dp_vport_multicast_group./a> = { 1519./a>        ..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=OVS_VPORT_MCGROUP" class="sref">OVS_VPORT_MCGROUP./a> 1520./a>}; 1521./a> 1522./a>.spa
 class="comment">/* Called with RTNL lock or RCU read lock. */./spa
  1523./a>static int .a href="+code=ovs_vport_cmd_fill_info" class="sref">ovs_vport_cmd_fill_info./a>(struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>, struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, 1524./a>                                   .a href="+code=u32" class="sref">u32./a> .a href="+code=portid" class="sref">portid./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=seq" class="sref">seq./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=flags" class="sref">flags./a>, .a href="+code=u8" class="sref">u8./a> .a href="+code=cmd" class="sref">cmd./a>) 1525./a>{ 1526./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a>; 1527./a>        struct .a href="+code=ovs_vport_stats" class="sref">ovs_vport_stats./a> .a href="+code=vport_stats" class="sref">vport_stats./a>; 1528./a>        int .a href="+code=err" class="sref">err./a>; 1529./a> 1530./a>        .a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=genlmsg_put" class="sref">genlmsg_put./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=portid" class="sref">portid./a>, .a href="+code=seq" class="sref">seq./a>, &.a href="+code=dp_vport_genl_family" class="sref">dp_vport_genl_family./a>, 1531./a>                                 .a href="+code=flags" class="sref">flags./a>, .a href="+code=cmd" class="sref">cmd./a>); 1532./a>        if (!.a href="+code=ovs_header" class="sref">ovs_header./a>) 1533./a>                return -.a href="+code=EMSGSIZE" class="sref">EMSGSIZE./a>; 1534./a> 1535./a>        .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a> = .a href="+code=get_dpifindex" class="sref">get_dpifindex./a>(.a href="+code=vport" class="sref">vport./a>->.a href="+code=dp" class="sref">dp./a>); 1536./a> 1537./a>        if (.a href="+code=nla_put_u32" class="sref">nla_put_u32./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_VPORT_ATTR_PORT_NO" class="sref">OVS_VPORT_ATTR_PORT_NO./a>, .a href="+code=vport" class="sref">vport./a>->.a href="+code=port_no" class="sref">port_no./a>) || 1538./a>            .a href="+code=nla_put_u32" class="sref">nla_put_u32./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_VPORT_ATTR_TYPE" class="sref">OVS_VPORT_ATTR_TYPE./a>, .a href="+code=vport" class="sref">vport./a>->.a href="+code=ops" class="sref">ops./a>->.a href="+code=type" class="sref">type./a>) || 1539./a>            .a href="+code=nla_put_string" class="sref">nla_put_string./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_VPORT_ATTR_NAME" class="sref">OVS_VPORT_ATTR_NAME./a>, .a href="+code=vport" class="sref">vport./a>->.a href="+code=ops" class="sref">ops./a>->.a href="+code=get_nam
" class="sref">get_nam
./a>(.a href="+code=vport" class="sref">vport./a>)) || 1540./a>            .a href="+code=nla_put_u32" class="sref">nla_put_u32./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_VPORT_ATTR_UPCALL_PID" class="sref">OVS_VPORT_ATTR_UPCALL_PID./a>, .a href="+code=vport" class="sref">vport./a>->.a href="+code=upcall_portid" class="sref">upcall_portid./a>)) 1541./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 1542./a> 1543./a>        .a href="+code=ovs_vport_get_stats" class="sref">ovs_vport_get_stats./a>(.a href="+code=vport" class="sref">vport./a>, &.a href="+code=vport_stats" class="sref">vport_stats./a>); 1544./a>        if (.a href="+code=nla_put" class="sref">nla_put./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=OVS_VPORT_ATTR_STATS" class="sref">OVS_VPORT_ATTR_STATS./a>, sizeof(struct .a href="+code=ovs_vport_stats" class="sref">ovs_vport_stats./a>), 1545./a>                    &.a href="+code=vport_stats" class="sref">vport_stats./a>)) 1546./a>                goto .a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>; 1547./a> 1548./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_vport_get_options" class="sref">ovs_vport_get_options./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=skb" class="sref">skb./a>); 1549./a>        if (.a href="+code=err" class="sref">err./a> == -.a href="+code=EMSGSIZE" class="sref">EMSGSIZE./a>) 1550./a>                goto .a href="+code=error" class="sref">error./a>; 1551./a> 1552./a>        return .a href="+code=genlmsg_end" class="sref">genlmsg_end./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>); 1553./a> 1554./a>.a href="+code=nla_put_failur
" class="sref">nla_put_failur
./a>: 1555./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=EMSGSIZE" class="sref">EMSGSIZE./a>; 1556./a>.a href="+code=error" class="sref">error./a>: 1557./a>        .a href="+code=genlmsg_cancel" class="sref">genlmsg_cancel./a>(.a href="+code=skb" class="sref">skb./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>); 1558./a>        return .a href="+code=err" class="sref">err./a>; 1559./a>} 1560./a> 1561./a>.spa
 class="comment">/* Called with RTNL lock or RCU read lock. */./spa
  1562./a>struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=ovs_vport_cmd_build_info" class="sref">ovs_vport_cmd_build_info./a>(struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>, .a href="+code=u32" class="sref">u32./a> .a href="+code=portid" class="sref">portid./a>, 1563./a>                                         .a href="+code=u32" class="sref">u32./a> .a href="+code=seq" class="sref">seq./a>, .a href="+code=u8" class="sref">u8./a> .a href="+code=cmd" class="sref">cmd./a>) 1564./a>{ 1565./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>; 1566./a>        int .a href="+code=retval" class="sref">retval./a>; 1567./a> 1568./a>        .a href="+code=skb" class="sref">skb./a> = .a href="+code=nlmsg_new" class="sref">nlmsg_new./a>(.a href="+code=NLMSG_DEFAULT_SIZE" class="sref">NLMSG_DEFAULT_SIZE./a>, .a href="+code=GFP_ATOMIC" class="sref">GFP_ATOMIC./a>); 1569./a>        if (!.a href="+code=skb" class="sref">skb./a>) 1570./a>                return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENOMEM" class="sref">ENOMEM./a>); 1571./a> 1572./a>        .a href="+code=retval" class="sref">retval./a> = .a href="+code=ovs_vport_cmd_fill_info" class="sref">ovs_vport_cmd_fill_info./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=skb" class="sref">skb./a>, .a href="+code=portid" class="sref">portid./a>, .a href="+code=seq" class="sref">seq./a>, 0, .a href="+code=cmd" class="sref">cmd./a>); 1573./a>        if (.a href="+code=retval" class="sref">retval./a> < 0) { 1574./a>                .a href="+code=kfree_skb" class="sref">kfree_skb./a>(.a href="+code=skb" class="sref">skb./a>); 1575./a>                return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(.a href="+code=retval" class="sref">retval./a>); 1576./a>        } 1577./a>        return .a href="+code=skb" class="sref">skb./a>; 1578./a>} 1579./a> 1580./a>.spa
 class="comment">/* Called with RTNL lock or RCU read lock. */./spa
  1581./a>static struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=lookup_vport" class="sref">lookup_vport./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>, 1582./a>                                  struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a>, 1583./a>                                  struct .a href="+code=nlattr" class="sref">nlattr./a> *.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_MAX" class="sref">OVS_VPORT_ATTR_MAX./a> + 1]) 1584./a>{ 1585./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1586./a>        struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1587./a> 1588./a>        if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_NAME" class="sref">OVS_VPORT_ATTR_NAME./a>]) { 1589./a>                .a href="+code=vport" class="sref">vport./a> = .a href="+code=ovs_vport_locat
" class="sref">ovs_vport_locat
./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_NAME" class="sref">OVS_VPORT_ATTR_NAME./a>])); 1590./a>                if (!.a href="+code=vport" class="sref">vport./a>) 1591./a>                        return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENODEV" class="sref">ENODEV./a>); 1592./a>                if (.a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a> && 1593./a>                    .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a> != .a href="+code=get_dpifindex" class="sref">get_dpifindex./a>(.a href="+code=vport" class="sref">vport./a>->.a href="+code=dp" class="sref">dp./a>)) 1594./a>                        return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENODEV" class="sref">ENODEV./a>); 1595./a>                return .a href="+code=vport" class="sref">vport./a>; 1596./a>        } else if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_PORT_NO" class="sref">OVS_VPORT_ATTR_PORT_NO./a>]) { 1597./a>                .a href="+code=u32" class="sref">u32./a> .a href="+code=port_no" class="sref">port_no./a> = .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_PORT_NO" class="sref">OVS_VPORT_ATTR_PORT_NO./a>]); 1598./a> 1599./a>                if (.a href="+code=port_no" class="sref">port_no./a> >= .a href="+code=DP_MAX_PORTS" class="sref">DP_MAX_PORTS./a>) 1600./a>                        return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=EFBIG" class="sref">EFBIG./a>); 1601./a> 1602./a>                .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1603./a>                if (!.a href="+code=dp" class="sref">dp./a>) 1604./a>                        return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENODEV" class="sref">ENODEV./a>); 1605./a> 1606./a>                .a href="+code=vport" class="sref">vport./a> = .a href="+code=ovs_vport_rtnl_rcu" class="sref">ovs_vport_rtnl_rcu./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=port_no" class="sref">port_no./a>); 1607./a>                if (!.a href="+code=vport" class="sref">vport./a>) 1608./a>                        return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=ENOENT" class="sref">ENOENT./a>); 1609./a>                return .a href="+code=vport" class="sref">vport./a>; 1610./a>        } else 1611./a>                return .a href="+code=ERR_PTR" class="sref">ERR_PTR./a>(-.a href="+code=EINVAL" class="sref">EINVAL./a>); 1612./a>} 1613./a> 1614./a>static int .a href="+code=ovs_vport_cmd_new" class="sref">ovs_vport_cmd_new./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1615./a>{ 1616./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1617./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>; 1618./a>        struct .a href="+code=vport_parms" class="sref">vport_parms./a> .a href="+code=parms" class="sref">parms./a>; 1619./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1620./a>        struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1621./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1622./a>        .a href="+code=u32" class="sref">u32./a> .a href="+code=port_no" class="sref">port_no./a>; 1623./a>        int .a href="+code=err" class="sref">err./a>; 1624./a> 1625./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 1626./a>        if (!.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_NAME" class="sref">OVS_VPORT_ATTR_NAME./a>] || !.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_TYPE" class="sref">OVS_VPORT_ATTR_TYPE./a>] || 1627./a>            !.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_UPCALL_PID" class="sref">OVS_VPORT_ATTR_UPCALL_PID./a>]) 1628./a>                goto .a href="+code=exit" class="sref">exit./a>; 1629./a> 1630./a>        .a href="+code=rtnl_lock" class="sref">rtnl_lock./a>(); 1631./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1632./a>        .a href="+code=err" class="sref">err./a> = -.a href="+code=ENODEV" class="sref">ENODEV./a>; 1633./a>        if (!.a href="+code=dp" class="sref">dp./a>) 1634./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1635./a> 1636./a>        if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_PORT_NO" class="sref">OVS_VPORT_ATTR_PORT_NO./a>]) { 1637./a>                .a href="+code=port_no" class="sref">port_no./a> = .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_PORT_NO" class="sref">OVS_VPORT_ATTR_PORT_NO./a>]); 1638./a> 1639./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=EFBIG" class="sref">EFBIG./a>; 1640./a>                if (.a href="+code=port_no" class="sref">port_no./a> >= .a href="+code=DP_MAX_PORTS" class="sref">DP_MAX_PORTS./a>) 1641./a>                        goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1642./a> 1643./a>                .a href="+code=vport" class="sref">vport./a> = .a href="+code=ovs_vport_rtnl_rcu" class="sref">ovs_vport_rtnl_rcu./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=port_no" class="sref">port_no./a>); 1644./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=EBUSY" class="sref">EBUSY./a>; 1645./a>                if (.a href="+code=vport" class="sref">vport./a>) 1646./a>                        goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1647./a>        } else { 1648./a>                for (.a href="+code=port_no" class="sref">port_no./a> = 1; ; .a href="+code=port_no" class="sref">port_no./a>++) { 1649./a>                        if (.a href="+code=port_no" class="sref">port_no./a> >= .a href="+code=DP_MAX_PORTS" class="sref">DP_MAX_PORTS./a>) { 1650./a>                                .a href="+code=err" class="sref">err./a> = -.a href="+code=EFBIG" class="sref">EFBIG./a>; 1651./a>                                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1652./a>                        } 1653./a>                        .a href="+code=vport" class="sref">vport./a> = .a href="+code=ovs_vport_rtnl" class="sref">ovs_vport_rtnl./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=port_no" class="sref">port_no./a>); 1654./a>                        if (!.a href="+code=vport" class="sref">vport./a>) 1655./a>                                break; 1656./a>                } 1657./a>        } 1658./a> 1659./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=nam
" class="sref">nam
./a> = .a href="+code=nla_data" class="sref">nla_data./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_NAME" class="sref">OVS_VPORT_ATTR_NAME./a>]); 1660./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=type" class="sref">type./a> = .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_TYPE" class="sref">OVS_VPORT_ATTR_TYPE./a>]); 1661./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=options" class="sref">options./a> = .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_OPTIONS" class="sref">OVS_VPORT_ATTR_OPTIONS./a>]; 1662./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=dp" class="sref">dp./a> = .a href="+code=dp" class="sref">dp./a>; 1663./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=port_no" class="sref">port_no./a> = .a href="+code=port_no" class="sref">port_no./a>; 1664./a>        .a href="+code=parms" class="sref">parms./a>..a href="+code=upcall_portid" class="sref">upcall_portid./a> = .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_UPCALL_PID" class="sref">OVS_VPORT_ATTR_UPCALL_PID./a>]); 1665./a> 1666./a>        .a href="+code=vport" class="sref">vport./a> = .a href="+code=new_vport" class="sref">new_vport./a>(&.a href="+code=parms" class="sref">parms./a>); 1667./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=vport" class="sref">vport./a>); 1668./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=vport" class="sref">vport./a>)) 1669./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1670./a> 1671./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_vport_cmd_build_info" class="sref">ovs_vport_cmd_build_info./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, 1672./a>                                         .a href="+code=OVS_VPORT_CMD_NEW" class="sref">OVS_VPORT_CMD_NEW./a>); 1673./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) { 1674./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1675./a>                .a href="+code=ovs_dp_detach_port" class="sref">ovs_dp_detach_port./a>(.a href="+code=vport" class="sref">vport./a>); 1676./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1677./a>        } 1678./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1679./a>                    .a href="+code=ovs_dp_vport_multicast_group" class="sref">ovs_dp_vport_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1680./a> 1681./a>.a href="+code=exit_unlock" class="sref">exit_unlock./a>: 1682./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1683./a>.a href="+code=exit" class="sref">exit./a>: 1684./a>        return .a href="+code=err" class="sref">err./a>; 1685./a>} 1686./a> 1687./a>static int .a href="+code=ovs_vport_cmd_set" class="sref">ovs_vport_cmd_set./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1688./a>{ 1689./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1690./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1691./a>        struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1692./a>        int .a href="+code=err" class="sref">err./a>; 1693./a> 1694./a>        .a href="+code=rtnl_lock" class="sref">rtnl_lock./a>(); 1695./a>        .a href="+code=vport" class="sref">vport./a> = .a href="+code=lookup_vport" class="sref">lookup_vport./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>, .a href="+code=a" class="sref">a./a>); 1696./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=vport" class="sref">vport./a>); 1697./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=vport" class="sref">vport./a>)) 1698./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1699./a> 1700./a>        .a href="+code=err" class="sref">err./a> = 0; 1701./a>        if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_TYPE" class="sref">OVS_VPORT_ATTR_TYPE./a>] && 1702./a>            .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_TYPE" class="sref">OVS_VPORT_ATTR_TYPE./a>]) != .a href="+code=vport" class="sref">vport./a>->.a href="+code=ops" class="sref">ops./a>->.a href="+code=type" class="sref">type./a>) 1703./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 1704./a> 1705./a>        if (!.a href="+code=err" class="sref">err./a> && .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_OPTIONS" class="sref">OVS_VPORT_ATTR_OPTIONS./a>]) 1706./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_vport_set_options" class="sref">ovs_vport_set_options./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_OPTIONS" class="sref">OVS_VPORT_ATTR_OPTIONS./a>]); 1707./a>        if (.a href="+code=err" class="sref">err./a>) 1708./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1709./a>        if (.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_UPCALL_PID" class="sref">OVS_VPORT_ATTR_UPCALL_PID./a>]) 1710./a>                .a href="+code=vport" class="sref">vport./a>->.a href="+code=upcall_portid" class="sref">upcall_portid./a> = .a href="+code=nla_get_u32" class="sref">nla_get_u32./a>(.a href="+code=a" class="sref">a./a>[.a href="+code=OVS_VPORT_ATTR_UPCALL_PID" class="sref">OVS_VPORT_ATTR_UPCALL_PID./a>]); 1711./a> 1712./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_vport_cmd_build_info" class="sref">ovs_vport_cmd_build_info./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, 1713./a>                                         .a href="+code=OVS_VPORT_CMD_NEW" class="sref">OVS_VPORT_CMD_NEW./a>); 1714./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) { 1715./a>                .a href="+code=netlink_set_err" class="sref">netlink_set_err./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>)->.a href="+code=genl_sock" class="sref">genl_sock./a>, 0, 1716./a>                                .a href="+code=ovs_dp_vport_multicast_group" class="sref">ovs_dp_vport_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>)); 1717./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1718./a>        } 1719./a> 1720./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1721./a>                    .a href="+code=ovs_dp_vport_multicast_group" class="sref">ovs_dp_vport_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1722./a> 1723./a>.a href="+code=exit_unlock" class="sref">exit_unlock./a>: 1724./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1725./a>        return .a href="+code=err" class="sref">err./a>; 1726./a>} 1727./a> 1728./a>static int .a href="+code=ovs_vport_cmd_del" class="sref">ovs_vport_cmd_del./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1729./a>{ 1730./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1731./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1732./a>        struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1733./a>        int .a href="+code=err" class="sref">err./a>; 1734./a> 1735./a>        .a href="+code=rtnl_lock" class="sref">rtnl_lock./a>(); 1736./a>        .a href="+code=vport" class="sref">vport./a> = .a href="+code=lookup_vport" class="sref">lookup_vport./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>, .a href="+code=a" class="sref">a./a>); 1737./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=vport" class="sref">vport./a>); 1738./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=vport" class="sref">vport./a>)) 1739./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1740./a> 1741./a>        if (.a href="+code=vport" class="sref">vport./a>->.a href="+code=port_no" class="sref">port_no./a> == .a href="+code=OVSP_LOCAL" class="sref">OVSP_LOCAL./a>) { 1742./a>                .a href="+code=err" class="sref">err./a> = -.a href="+code=EINVAL" class="sref">EINVAL./a>; 1743./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1744./a>        } 1745./a> 1746./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_vport_cmd_build_info" class="sref">ovs_vport_cmd_build_info./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, 1747./a>                                         .a href="+code=OVS_VPORT_CMD_DEL" class="sref">OVS_VPORT_CMD_DEL./a>); 1748./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1749./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1750./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1751./a> 1752./a>        .a href="+code=ovs_dp_detach_port" class="sref">ovs_dp_detach_port./a>(.a href="+code=vport" class="sref">vport./a>); 1753./a> 1754./a>        .a href="+code=genl_notify" class="sref">genl_notify./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=genl_info_net" class="sref">genl_info_net./a>(.a href="+code=info" class="sref">info./a>), .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, 1755./a>                    .a href="+code=ovs_dp_vport_multicast_group" class="sref">ovs_dp_vport_multicast_group./a>..a href="+code=id" class="sref">id./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=nlhdr" class="sref">nlhdr./a>, .a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL./a>); 1756./a> 1757./a>.a href="+code=exit_unlock" class="sref">exit_unlock./a>: 1758./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1759./a>        return .a href="+code=err" class="sref">err./a>; 1760./a>} 1761./a> 1762./a>static int .a href="+code=ovs_vport_cmd_get" class="sref">ovs_vport_cmd_get./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=genl_info" class="sref">genl_info./a> *.a href="+code=info" class="sref">info./a>) 1763./a>{ 1764./a>        struct .a href="+code=nlattr" class="sref">nlattr./a> **.a href="+code=a" class="sref">a./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=attrs" class="sref">attrs./a>; 1765./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=info" class="sref">info./a>->.a href="+code=userhdr" class="sref">userhdr./a>; 1766./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=reply" class="sref">reply./a>; 1767./a>        struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1768./a>        int .a href="+code=err" class="sref">err./a>; 1769./a> 1770./a>        .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 1771./a>        .a href="+code=vport" class="sref">vport./a> = .a href="+code=lookup_vport" class="sref">lookup_vport./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>, .a href="+code=a" class="sref">a./a>); 1772./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=vport" class="sref">vport./a>); 1773./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=vport" class="sref">vport./a>)) 1774./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1775./a> 1776./a>        .a href="+code=reply" class="sref">reply./a> = .a href="+code=ovs_vport_cmd_build_info" class="sref">ovs_vport_cmd_build_info./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_portid" class="sref">snd_portid./a>, .a href="+code=info" class="sref">info./a>->.a href="+code=snd_seq" class="sref">snd_seq./a>, 1777./a>                                         .a href="+code=OVS_VPORT_CMD_NEW" class="sref">OVS_VPORT_CMD_NEW./a>); 1778./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=PTR_ERR" class="sref">PTR_ERR./a>(.a href="+code=reply" class="sref">reply./a>); 1779./a>        if (.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=reply" class="sref">reply./a>)) 1780./a>                goto .a href="+code=exit_unlock" class="sref">exit_unlock./a>; 1781./a> 1782./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 1783./a> 1784./a>        return .a href="+code=genlmsg_reply" class="sref">genlmsg_reply./a>(.a href="+code=reply" class="sref">reply./a>, .a href="+code=info" class="sref">info./a>); 1785./a> 1786./a>.a href="+code=exit_unlock" class="sref">exit_unlock./a>: 1787./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 1788./a>        return .a href="+code=err" class="sref">err./a>; 1789./a>} 1790./a> 1791./a>static int .a href="+code=ovs_vport_cmd_dump" class="sref">ovs_vport_cmd_dump./a>(struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=skb" class="sref">skb./a>, struct .a href="+code=netlink_callback" class="sref">netlink_callback./a> *.a href="+code=cb" class="sref">cb./a>) 1792./a>{ 1793./a>        struct .a href="+code=ovs_header" class="sref">ovs_header./a> *.a href="+code=ovs_header" class="sref">ovs_header./a> = .a href="+code=genlmsg_data" class="sref">genlmsg_data./a>(.a href="+code=nlmsg_data" class="sref">nlmsg_data./a>(.a href="+code=cb" class="sref">cb./a>->.a href="+code=nlh" class="sref">nlh./a>)); 1794./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1795./a>        int .a href="+code=bucket" class="sref">bucket./a> = .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[0], .a href="+code=skip" class="sref">skip./a> = .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[1]; 1796./a>        int .a href="+code=i" class="sref">i./a>, .a href="+code=j" class="sref">j./a> = 0; 1797./a> 1798./a>        .a href="+code=dp" class="sref">dp./a> = .a href="+code=get_dp" class="sref">get_dp./a>(.a href="+code=sock_net" class="sref">sock_net./a>(.a href="+code=skb" class="sref">skb./a>->.a href="+code=sk" class="sref">sk./a>), .a href="+code=ovs_header" class="sref">ovs_header./a>->.a href="+code=dp_ifindex" class="sref">dp_ifindex./a>); 1799./a>        if (!.a href="+code=dp" class="sref">dp./a>) 1800./a>                return -.a href="+code=ENODEV" class="sref">ENODEV./a>; 1801./a> 1802./a>        .a href="+code=rcu_read_lock" class="sref">rcu_read_lock./a>(); 1803./a>        for (.a href="+code=i" class="sref">i./a> = .a href="+code=bucket" class="sref">bucket./a>; .a href="+code=i" class="sref">i./a> < .a href="+code=DP_VPORT_HASH_BUCKETS" class="sref">DP_VPORT_HASH_BUCKETS./a>; .a href="+code=i" class="sref">i./a>++) { 1804./a>                struct .a href="+code=vport" class="sref">vport./a> *.a href="+code=vport" class="sref">vport./a>; 1805./a>                struct .a href="+code=hlist_node" class="sref">hlist_node./a> *.a href="+code=n" class="sref">n./a>; 1806./a> 1807./a>                .a href="+code=j" class="sref">j./a> = 0; 1808./a>                .a href="+code=hlist_for_each_entry_rcu" class="sref">hlist_for_each_entry_rcu./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=n" class="sref">n./a>, &.a href="+code=dp" class="sref">dp./a>->.a href="+code=ports" class="sref">ports./a>[.a href="+code=i" class="sref">i./a>], .a href="+code=dp_hash_node" class="sref">dp_hash_node./a>) { 1809./a>                        if (.a href="+code=j" class="sref">j./a> >= .a href="+code=skip" class="sref">skip./a> && 1810./a>                            .a href="+code=ovs_vport_cmd_fill_info" class="sref">ovs_vport_cmd_fill_info./a>(.a href="+code=vport" class="sref">vport./a>, .a href="+code=skb" class="sref">skb./a>, 1811./a>                                                    .a href="+code=NETLINK_CB" class="sref">NETLINK_CB./a>(.a href="+code=cb" class="sref">cb./a>->.a href="+code=skb" class="sref">skb./a>)..a href="+code=portid" class="sref">portid./a>, 1812./a>                                                    .a href="+code=cb" class="sref">cb./a>->.a href="+code=nlh" class="sref">nlh./a>->.a href="+code=nlmsg_seq" class="sref">nlmsg_seq./a>, 1813./a>                                                    .a href="+code=NLM_F_MULTI" class="sref">NLM_F_MULTI./a>, 1814./a>                                                    .a href="+code=OVS_VPORT_CMD_NEW" class="sref">OVS_VPORT_CMD_NEW./a>) < 0) 1815./a>                                goto .a href="+code=out" class="sref">out./a>; 1816./a> 1817./a>                        .a href="+code=j" class="sref">j./a>++; 1818./a>                } 1819./a>                .a href="+code=skip" class="sref">skip./a> = 0; 1820./a>        } 1821./a>.a href="+code=out" class="sref">out./a>: 1822./a>        .a href="+code=rcu_read_unlock" class="sref">rcu_read_unlock./a>(); 1823./a> 1824./a>        .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[0] = .a href="+code=i" class="sref">i./a>; 1825./a>        .a href="+code=cb" class="sref">cb./a>->.a href="+code=args" class="sref">args./a>[1] = .a href="+code=j" class="sref">j./a>; 1826./a> 1827./a>        return .a href="+code=skb" class="sref">skb./a>->.a href="+code=len" class="sref">len./a>; 1828./a>} 1829./a> 1830./a>static struct .a href="+code=genl_ops" class="sref">genl_ops./a> .a href="+code=dp_vport_genl_ops" class="sref">dp_vport_genl_ops./a>[] = { 1831./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_VPORT_CMD_NEW" class="sref">OVS_VPORT_CMD_NEW./a>, 1832./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .span class="comment">/* Requires CAP_NET_ADMIN privilege. */ 1833./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=vport_policy" class="sref">vport_policy./a>, 1834./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_vport_cmd_new" class="sref">ovs_vport_cmd_new./a> 1835./a>        }, 1836./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_VPORT_CMD_DEL" class="sref">OVS_VPORT_CMD_DEL./a>, 1837./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .span class="comment">/* Requires CAP_NET_ADMIN privilege. */ 1838./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=vport_policy" class="sref">vport_policy./a>, 1839./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_vport_cmd_del" class="sref">ovs_vport_cmd_del./a> 1840./a>        }, 1841./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_VPORT_CMD_GET" class="sref">OVS_VPORT_CMD_GET./a>, 1842./a>          ..a href="+code=flags" class="sref">flags./a> = 0,               .span class="comment">/* OK for unprivileged users. */ 1843./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=vport_policy" class="sref">vport_policy./a>, 1844./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_vport_cmd_get" class="sref">ovs_vport_cmd_get./a>, 1845./a>          ..a href="+code=dumpit" class="sref">dumpit./a> = .a href="+code=ovs_vport_cmd_dump" class="sref">ovs_vport_cmd_dump./a> 1846./a>        }, 1847./a>        { ..a href="+code=cmd" class="sref">cmd./a> = .a href="+code=OVS_VPORT_CMD_SET" class="sref">OVS_VPORT_CMD_SET./a>, 1848./a>          ..a href="+code=flags" class="sref">flags./a> = .a href="+code=GENL_ADMIN_PERM" class="sref">GENL_ADMIN_PERM./a>, .span class="comment">/* Requires CAP_NET_ADMIN privilege. */ 1849./a>          ..a href="+code=policy" class="sref">policy./a> = .a href="+code=vport_policy" class="sref">vport_policy./a>, 1850./a>          ..a href="+code=doit" class="sref">doit./a> = .a href="+code=ovs_vport_cmd_set" class="sref">ovs_vport_cmd_set./a>, 1851./a>        }, 1852./a>}; 1853./a> 1854./a>struct .a href="+code=genl_family_and_ops" class="sref">genl_family_and_ops./a> { 1855./a>        struct .a href="+code=genl_family" class="sref">genl_family./a> *.a href="+code=family" class="sref">family./a>; 1856./a>        struct .a href="+code=genl_ops" class="sref">genl_ops./a> *.a href="+code=ops" class="sref">ops./a>; 1857./a>        int .a href="+code=n_ops" class="sref">n_ops./a>; 1858./a>        struct .a href="+code=genl_multicast_group" class="sref">genl_multicast_group./a> *.a href="+code=group" class="sref">group./a>; 1859./a>}; 1860./a> 1861./a>static const struct .a href="+code=genl_family_and_ops" class="sref">genl_family_and_ops./a> .a href="+code=dp_genl_families" class="sref">dp_genl_families./a>[] = { 1862./a>        { &.a href="+code=dp_datapath_genl_family" class="sref">dp_datapath_genl_family./a>, 1863./a>          .a href="+code=dp_datapath_genl_ops" class="sref">dp_datapath_genl_ops./a>, .a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE./a>(.a href="+code=dp_datapath_genl_ops" class="sref">dp_datapath_genl_ops./a>), 1864./a>          &.a href="+code=ovs_dp_datapath_multicast_group" class="sref">ovs_dp_datapath_multicast_group./a> }, 1865./a>        { &.a href="+code=dp_vport_genl_family" class="sref">dp_vport_genl_family./a>, 1866./a>          .a href="+code=dp_vport_genl_ops" class="sref">dp_vport_genl_ops./a>, .a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE./a>(.a href="+code=dp_vport_genl_ops" class="sref">dp_vport_genl_ops./a>), 1867./a>          &.a href="+code=ovs_dp_vport_multicast_group" class="sref">ovs_dp_vport_multicast_group./a> }, 1868./a>        { &.a href="+code=dp_flow_genl_family" class="sref">dp_flow_genl_family./a>, 1869./a>          .a href="+code=dp_flow_genl_ops" class="sref">dp_flow_genl_ops./a>, .a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE./a>(.a href="+code=dp_flow_genl_ops" class="sref">dp_flow_genl_ops./a>), 1870./a>          &.a href="+code=ovs_dp_flow_multicast_group" class="sref">ovs_dp_flow_multicast_group./a> }, 1871./a>        { &.a href="+code=dp_packet_genl_family" class="sref">dp_packet_genl_family./a>, 1872./a>          .a href="+code=dp_packet_genl_ops" class="sref">dp_packet_genl_ops./a>, .a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE./a>(.a href="+code=dp_packet_genl_ops" class="sref">dp_packet_genl_ops./a>), 1873./a>          .a href="+code=NULL" class="sref">NULL./a> }, 1874./a>}; 1875./a> 1876./a>static void .a href="+code=dp_unregister_genl" class="sref">dp_unregister_genl./a>(int .a href="+code=n_families" class="sref">n_families./a>) 1877./a>{ 1878./a>        int .a href="+code=i" class="sref">i./a>; 1879./a> 1880./a>        for (.a href="+code=i" class="sref">i./a> = 0; .a href="+code=i" class="sref">i./a> < .a href="+code=n_families" class="sref">n_families./a>; .a href="+code=i" class="sref">i./a>++) 1881./a>                .a href="+code=genl_unregister_family" class="sref">genl_unregister_family./a>(.a href="+code=dp_genl_families" class="sref">dp_genl_families./a>[.a href="+code=i" class="sref">i./a>]..a href="+code=family" class="sref">family./a>); 1882./a>} 1883./a> 1884./a>static int .a href="+code=dp_register_genl" class="sref">dp_register_genl./a>(void) 1885./a>{ 1886./a>        int .a href="+code=n_registered" class="sref">n_registered./a>; 1887./a>        int .a href="+code=err" class="sref">err./a>; 1888./a>        int .a href="+code=i" class="sref">i./a>; 1889./a> 1890./a>        .a href="+code=n_registered" class="sref">n_registered./a> = 0; 1891./a>        for (.a href="+code=i" class="sref">i./a> = 0; .a href="+code=i" class="sref">i./a> < .a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE./a>(.a href="+code=dp_genl_families" class="sref">dp_genl_families./a>); .a href="+code=i" class="sref">i./a>++) { 1892./a>                const struct .a href="+code=genl_family_and_ops" class="sref">genl_family_and_ops./a> *.a href="+code=f" class="sref">f./a> = &.a href="+code=dp_genl_families" class="sref">dp_genl_families./a>[.a href="+code=i" class="sref">i./a>]; 1893./a> 1894./a>                .a href="+code=err" class="sref">err./a> = .a href="+code=genl_register_family_with_ops" class="sref">genl_register_family_with_ops./a>(.a href="+code=f" class="sref">f./a>->.a href="+code=family" class="sref">family./a>, .a href="+code=f" class="sref">f./a>->.a href="+code=ops" class="sref">ops./a>, 1895./a>                                                    .a href="+code=f" class="sref">f./a>->.a href="+code=n_ops" class="sref">n_ops./a>); 1896./a>                if (.a href="+code=err" class="sref">err./a>) 1897./a>                        goto .a href="+code=error" class="sref">error./a>; 1898./a>                .a href="+code=n_registered" class="sref">n_registered./a>++; 1899./a> 1900./a>                if (.a href="+code=f" class="sref">f./a>->.a href="+code=group" class="sref">group./a>) { 1901./a>                        .a href="+code=err" class="sref">err./a> = .a href="+code=genl_register_mc_group" class="sref">genl_register_mc_group./a>(.a href="+code=f" class="sref">f./a>->.a href="+code=family" class="sref">family./a>, .a href="+code=f" class="sref">f./a>->.a href="+code=group" class="sref">group./a>); 1902./a>                        if (.a href="+code=err" class="sref">err./a>) 1903./a>                                goto .a href="+code=error" class="sref">error./a>; 1904./a>                } 1905./a>        } 1906./a> 1907./a>        return 0; 1908./a> 1909./a>.a href="+code=error" class="sref">error./a>: 1910./a>        .a href="+code=dp_unregister_genl" class="sref">dp_unregister_genl./a>(.a href="+code=n_registered" class="sref">n_registered./a>); 1911./a>        return .a href="+code=err" class="sref">err./a>; 1912./a>} 1913./a> 1914./a>static void .a href="+code=rehash_flow_table" class="sref">rehash_flow_table./a>(struct .a href="+code=work_struct" class="sref">work_struct./a> *.a href="+code=work" class="sref">work./a>) 1915./a>{ 1916./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>; 1917./a>        struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>; 1918./a> 1919./a>        .a href="+code=genl_lock" class="sref">genl_lock./a>(); 1920./a>        .a href="+code=rtnl_lock" class="sref">rtnl_lock./a>(); 1921./a>        .a href="+code=for_each_net" class="sref">for_each_net./a>(.a href="+code=net" class="sref">net./a>) { 1922./a>                struct .a href="+code=ovs_net" class="sref">ovs_net./a> *.a href="+code=ovs_net" class="sref">ovs_net./a> = .a href="+code=net_generic" class="sref">net_generic./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=ovs_net_id" class="sref">ovs_net_id./a>); 1923./a> 1924./a>                .a href="+code=list_for_each_entry" class="sref">list_for_each_entry./a>(.a href="+code=dp" class="sref">dp./a>, &.a href="+code=ovs_net" class="sref">ovs_net./a>->.a href="+code=dps" class="sref">dps./a>, .a href="+code=list_node" class="sref">list_node./a>) { 1925./a>                        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=old_table" class="sref">old_table./a> = .a href="+code=genl_dereference" class="sref">genl_dereference./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>); 1926./a>                        struct .a href="+code=flow_table" class="sref">flow_table./a> *.a href="+code=new_table" class="sref">new_table./a>; 1927./a> 1928./a>                        .a href="+code=new_table" class="sref">new_table./a> = .a href="+code=ovs_flow_tbl_rehash" class="sref">ovs_flow_tbl_rehash./a>(.a href="+code=old_table" class="sref">old_table./a>); 1929./a>                        if (!.a href="+code=IS_ERR" class="sref">IS_ERR./a>(.a href="+code=new_table" class="sref">new_table./a>)) { 1930./a>                                .a href="+code=rcu_assign_pointer" class="sref">rcu_assign_pointer./a>(.a href="+code=dp" class="sref">dp./a>->.a href="+code=table" class="sref">table./a>, .a href="+code=new_table" class="sref">new_table./a>); 1931./a>                                .a href="+code=ovs_flow_tbl_deferred_destroy" class="sref">ovs_flow_tbl_deferred_destroy./a>(.a href="+code=old_table" class="sref">old_table./a>); 1932./a>                        } 1933./a>                } 1934./a>        } 1935./a>        .a href="+code=rtnl_unlock" class="sref">rtnl_unlock./a>(); 1936./a>        .a href="+code=genl_unlock" class="sref">genl_unlock./a>(); 1937./a> 1938./a>        .a href="+code=schedule_delayed_work" class="sref">schedule_delayed_work./a>(&.a href="+code=rehash_flow_wq" class="sref">rehash_flow_wq./a>, .a href="+code=REHASH_FLOW_INTERVAL" class="sref">REHASH_FLOW_INTERVAL./a>); 1939./a>} 1940./a> 1941./a>static int .a href="+code=__net_init" class="sref">__net_init./a> .a href="+code=ovs_init_net" class="sref">ovs_init_net./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>) 1942./a>{ 1943./a>        struct .a href="+code=ovs_net" class="sref">ovs_net./a> *.a href="+code=ovs_net" class="sref">ovs_net./a> = .a href="+code=net_generic" class="sref">net_generic./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=ovs_net_id" class="sref">ovs_net_id./a>); 1944./a> 1945./a>        .a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD./a>(&.a href="+code=ovs_net" class="sref">ovs_net./a>->.a href="+code=dps" class="sref">dps./a>); 1946./a>        return 0; 1947./a>} 1948./a> 1949./a>static void .a href="+code=__net_exit" class="sref">__net_exit./a> .a href="+code=ovs_exit_net" class="sref">ovs_exit_net./a>(struct .a href="+code=net" class="sref">net./a> *.a href="+code=net" class="sref">net./a>) 1950./a>{ 1951./a>        struct .a href="+code=ovs_net" class="sref">ovs_net./a> *.a href="+code=ovs_net" class="sref">ovs_net./a> = .a href="+code=net_generic" class="sref">net_generic./a>(.a href="+code=net" class="sref">net./a>, .a href="+code=ovs_net_id" class="sref">ovs_net_id./a>); 1952./a>        struct .a href="+code=datapath" class="sref">datapath./a> *.a href="+code=dp" class="sref">dp./a>, *.a href="+code=dp_next" class="sref">dp_next./a>; 1953./a> 1954./a>        .a href="+code=genl_lock" class="sref">genl_lock./a>(); 1955./a>        .a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe./a>(.a href="+code=dp" class="sref">dp./a>, .a href="+code=dp_next" class="sref">dp_next./a>, &.a href="+code=ovs_net" class="sref">ovs_net./a>->.a href="+code=dps" class="sref">dps./a>, .a href="+code=list_node" class="sref">list_node./a>) 1956./a>                .a href="+code=__dp_destroy" class="sref">__dp_destroy./a>(.a href="+code=dp" class="sref">dp./a>); 1957./a>        .a href="+code=genl_unlock" class="sref">genl_unlock./a>(); 1958./a>} 1959./a> 1960./a>static struct .a href="+code=pernet_
	erations" class="sref">pernet_
	erations./a> .a href="+code=ovs_net_
	s" class="sref">ovs_net_
	s./a> = { 1961./a>        ..a href="+code=init" class="sref">init./a> = .a href="+code=ovs_init_net" class="sref">ovs_init_net./a>, 1962./a>        ..a href="+code=exit" class="sref">exit./a> = .a href="+code=ovs_exit_net" class="sref">ovs_exit_net./a>, 1963./a>        ..a href="+code=id" class="sref">id./a>   = &.a href="+code=ovs_net_id" class="sref">ovs_net_id./a>, 1964./a>        ..a href="+code=size" class="sref">size./a> = sizeof(struct .a href="+code=ovs_net" class="sref">ovs_net./a>), 1965./a>}; 1966./a> 1967./a>static int .a href="+code=__init" class="sref">__init./a> .a href="+code=dp_init" class="sref">dp_init./a>(void) 1968./a>{ 1969./a>        struct .a href="+code=sk_buff" class="sref">sk_buff./a> *.a href="+code=dummy_skb" class="sref">dummy_skb./a>; 1970./a>        int .a href="+code=err" class="sref">err./a>; 1971./a> 1972./a>        .a href="+code=BUILD_BUG_ON" class="sref">BUILD_BUG_ON./a>(sizeof(struct .a href="+code=ovs_skb_cb" class="sref">ovs_skb_cb./a>) > sizeof(.a href="+code=dummy_skb" class="sref">dummy_skb./a>->.a href="+code=cb" class="sref">cb./a>)); 1973./a> 1974./a>        .a href="+code=pr_info" class="sref">pr_info./a>(.span class="string">"O	en vSwitch switching datapath\n"); 1975./a> 1976./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_flow_init" class="sref">ovs_flow_init./a>(); 1977./a>        if (.a href="+code=err" class="sref">err./a>) 1978./a>                goto .a href="+code=error" class="sref">error./a>; 1979./a> 1980./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=ovs_vport_init" class="sref">ovs_vport_init./a>(); 1981./a>        if (.a href="+code=err" class="sref">err./a>) 1982./a>                goto .a href="+code=error_flow_exit" class="sref">error_flow_exit./a>; 1983./a> 1984./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=register_pernet_device" class="sref">register_pernet_device./a>(&.a href="+code=ovs_net_
	s" class="sref">ovs_net_
	s./a>); 1985./a>        if (.a href="+code=err" class="sref">err./a>) 1986./a>                goto .a href="+code=error_vport_exit" class="sref">error_vport_exit./a>; 1987./a> 1988./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=register_netdevice_notifier" class="sref">register_netdevice_notifier./a>(&.a href="+code=ovs_dp_device_notifier" class="sref">ovs_dp_device_notifier./a>); 1989./a>        if (.a href="+code=err" class="sref">err./a>) 1990./a>                goto .a href="+code=error_netns_exit" class="sref">error_netns_exit./a>; 1991./a> 1992./a>        .a href="+code=err" class="sref">err./a> = .a href="+code=dp_register_genl" class="sref">dp_register_genl./a>(); 1993./a>        if (.a href="+code=err" class="sref">err./a> < 0) 1994./a>                goto .a href="+code=error_unreg_notifier" class="sref">error_unreg_notifier./a>; 1995./a> 1996./a>        .a href="+code=schedule_delayed_work" class="sref">schedule_delayed_work./a>(&.a href="+code=rehash_flow_wq" class="sref">rehash_flow_wq./a>, .a href="+code=REHASH_FLOW_INTERVAL" class="sref">REHASH_FLOW_INTERVAL./a>); 1997./a> 1998./a>        return 0; 1999./a> 2000./a>.a href="+code=error_unreg_notifier" class="sref">error_unreg_notifier./a>:
2001./a>        .a href="+code=unregister_netdevice_notifier" class="sref">unregister_netdevice_notifier./a>(&.a href="+code=ovs_dp_device_notifier" class="sref">ovs_dp_device_notifier./a>); 2002./a>.a href="+code=error_netns_exit" class="sref">error_netns_exit./a>: 2003./a>        .a href="+code=unregister_pernet_device" class="sref">unregister_pernet_device./a>(&.a href="+code=ovs_net_
	s" class="sref">ovs_net_
	s./a>); 2004./a>.a href="+code=error_vport_exit" class="sref">error_vport_exit./a>: 2005./a>        .a href="+code=ovs_vport_exit" class="sref">ovs_vport_exit./a>(); 2006./a>.a href="+code=error_flow_exit" class="sref">error_flow_exit./a>: 2007./a>        .a href="+code=ovs_flow_exit" class="sref">ovs_flow_exit./a>(); 2008./a>.a href="+code=error" class="sref">error./a>: 2009./a>        return .a href="+code=err" class="sref">err./a>; 2010./a>} 2011./a> 2012./a>static void .a href="+code=dp_cleanup" class="sref">dp_cleanup./a>(void) 2013./a>{ 2014./a>        .a href="+code=cancel_delayed_work_sync" class="sref">cancel_delayed_work_sync./a>(&.a href="+code=rehash_flow_wq" class="sref">rehash_flow_wq./a>); 2015./a>        .a href="+code=dp_unregister_genl" class="sref">dp_unregister_genl./a>(.a href="+code=ARRAY_SIZE" class="sref">ARRAY_SIZE./a>(.a href="+code=dp_genl_families" class="sref">dp_genl_families./a>)); 2016./a>        .a href="+code=unregister_netdevice_notifier" class="sref">unregister_netdevice_notifier./a>(&.a href="+code=ovs_dp_device_notifier" class="sref">ovs_dp_device_notifier./a>); 2017./a>        .a href="+code=unregister_pernet_device" class="sref">unregister_pernet_device./a>(&.a href="+code=ovs_net_
	s" class="sref">ovs_net_
	s./a>); 2018./a>        .a href="+code=rcu_barrier" class="sref">rcu_barrier./a>(); 2019./a>        .a href="+code=ovs_vport_exit" class="sref">ovs_vport_exit./a>(); 2020./a>        .a href="+code=ovs_flow_exit" class="sref">ovs_flow_exit./a>(); 2021./a>} 2022./a> 2023./a>.a href="+code=module_init" class="sref">module_init./a>(.a href="+code=dp_init" class="sref">dp_init./a>); 2024./a>.a href="+code=module_exit" class="sref">module_exit./a>(.a href="+code=dp_cleanup" class="sref">dp_cleanup./a>); 2025./a> 2026./a>.a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION./a>(.span class="string">"O	en vSwitch switching datapath"); 2027./a>.a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE./a>(.span class="string">"GPL"); 2028./a>./pre>
lxr.linux.no kindly hosted by Redpill Linpro AS./a>, provider of Linux consulting and erations services since 1995.