linux/net/openvswitch/vport.h
<<
"v4/spae=l "v4/form=l "v4a "v href="../linux+v3ion1/netn venvswitch/vport.h"> "v4img src="../.static/gfx/right.png" alt=">>"> 4/spae=l 4spae class="lxr_search"> "v4input typ hidden" nam navtarget" > "> "v4input typ text" nam search" id search"> "v4butt6" typ submit">Search "vPrefsl "v4/a> 4/spae=l "v v4/div=l "v v4form acalue="ajax+*" method="post" onsubmit="return false;"> 4input typ hidden" nam ajax_lookup" id ajax_lookup" > "> "v v4/form=l "v v4div class="headingbott6m">l 4div id file_contents"=
v v14/a>4spae class="comment">/*4/spae=lv v24/a>4spae class="comment"> * Copyright (c) 2007-2012 Nicira, Inc.4/spae=lv v34/a>4spae class="comment"> *4/spae=lv v44/a>4spae class="comment"> * This program is free software; you cae redistribute it and/or4/spae=lv v54/a>4spae class="comment"> * modify it under the terms of vers16"
2 of the GNU General Public4/spae=lv v64/a>4spae class="comment"> * License as published by the Free Software Foundaalue.4/spae=lv v74/a>4spae class="comment"> *4/spae=lv v84/a>4spae class="comment"> * This program is distributed in the h ve that it will be useful, but4/spae=lv v94/a>4spae class="comment"> * WITHOUT ANY WARRANTY; without even the implied warranty of4/spae=lv >
  a>4spae class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU4/spae=lv 114/a>4spae class="comment"> * General Public License for more details.4/spae=lv 124/a>4spae class="comment"> *4/spae=lv 134/a>4spae class="comment"> * You should have received a copy of the GNU General Public License4/spae=lv 144/a>4spae class="comment"> * along with this program; if not, write to the Free Software4/spae=lv 154/a>4spae class="comment"> * Foundaalue, Inc., 51 Franklin Street, Fifth Floor, Bostue, MA4/spae=lv 164/a>4spae class="comment"> * 02110-1301, USA4/spae=lv 174/a>4spae class="comment"> */4/spae=lv 184/a>lv 194/a>#ifndefv4a href="+code=VPORT_H" class="sref">VPORT_H4/a>lv 2
  a>#definev4a href="+code=VPORT_H" class="sref">VPORT_H4/a> 1lv 214/a>lv 224/a>#include <linux/list.h4/a>>lv 234/a>#include <linux/ venvswitch.h4/a>>lv 244/a>#include <linux/skbuff.h4/a>>lv 254/a>#include <linux/spinlock.h4/a>>lv 264/a>#include <linux/u64_stats_sync.h4/a>>lv 274/a>lv 284/a>#include "daaapath.h4/a>"lv 294/a>lv 3
  a>structv4a href="+code=vport" class="sref">vport  a>;lv 31  a>structv4a href="+code=vport_parms" class="sref">vport_parms  a>;lv 324/a>lv 334/a>4spae class="comment">/* The following definialues are for users of the vport subsytem: */4/spae=lv 344/a>lv 354/a>intv4a href="+code=ovs_vport_inia" class="sref">ovs_vport_inia4/a>(void);lv 364/a>voidv4a href="+code=ovs_vport_exia" class="sref">ovs_vport_exia4/a>(void);lv 374/a>lv 38  a>structv4a href="+code=vport" class="sref">vport  a> *4a href="+code=ovs_vport_add" class="sref">ovs_vport_add4/a>(cuest structv4a href="+code=vport_parms" class="sref">vport_parms  a> *);lv 394/a>voidv4a href="+code=ovs_vport_del" class="sref">ovs_vport_del4/a>(structv4a href="+code=vport" class="sref">vport  a> *);lv 404/a>lv 41  a>structv4a href="+code=vport" class="sref">vport  a> *4a href="+code=ovs_vport_locate" class="sref">ovs_vport_locate4/a>(cuest char *4a href="+code=nam
" class="sref">nam
4/a>);lv 424/a>lv 434/a>voidv4a href="+code=ovs_vport_get_stats" class="sref">ovs_vport_get_stats4/a>(structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=ovs_vport_stats" class="sref">ovs_vport_stats4/a> *);lv 444/a>lv 454/a>intv4a href="+code=ovs_vport_set_ values" class="sref">ovs_vport_set_ values4/a>(structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=nlattr" class="sref">nlattr  a> *4a href="+code=ovalues" class="sref">ovalues4/a>);lv 464/a>intv4a href="+code=ovs_vport_get_ values" class="sref">ovs_vport_get_ values4/a>(cuest structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=sk_buff" class="sref">sk_buff4/a> *);lv 474/a>lv 484/a>intv4a href="+code=ovs_vport_send" class="sref">ovs_vport_send4/a>(structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=sk_buff" class="sref">sk_buff4/a> *);lv 494/a>lv 5
  a>4spae class="comment">/* The following definialues are for implementers of vport devices: */4/spae=lv 514/a>lv 52  a>structv4a href="+code=vport_percpu_stats" class="sref">vport_percpu_stats4/a> {lv 534/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=rx_bytes" class="sref">rx_bytes  a>;lv 544/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=rx_packets" class="sref">rx_packets  a>;lv 554/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=tx_bytes" class="sref">tx_bytes  a>;lv 564/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=tx_packets" class="sref">tx_packets  a>;lv 574/a>        structv4a href="+code=u64_stats_sync" class="sref">u64_stats_sync4/a> 4a href="+code=sync" class="sref">sync4/a>;lv 584/a>};lv 594/a>lv 6
  a>structv4a href="+code=vport_err_stats" class="sref">vport_err_stats4/a> {lv 614/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=rx_dropped" class="sref">rx_dropped4/a>;lv 624/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=rx_errors" class="sref">rx_errors4/a>;lv 634/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=tx_dropped" class="sref">tx_dropped4/a>;lv 644/a>        4a href="+code=u64" class="sref">u644/a> 4a href="+code=tx_errors" class="sref">tx_errors4/a>;lv 654/a>};lv 664/a>lv 674/a>4spae class="comment">/**4/spae=lv 684/a>4spae class="comment"> * structvvport - one port within a daaapath4/spae=lv 694/a>4spae class="comment"> * @rcu: RCU callback head for deferred destructlue.4/spae=lv 7
  a>4spae class="comment"> * @port_no: Index into @dp's @ports array.4/spae=lv 714/a>4spae class="comment"> * @dp: Daaapath to which this port belongs.4/spae=lv 724/a>4spae class="comment"> * @node: Element in @dp's @port_list.4/spae=lv 734/a>4spae class="comment"> * @upcall_pid: The Netlink port to use for packets received 6"
this port that4/spae=lv 744/a>4spae class="comment"> * miss the flow table.4/spae=lv 754/a>4spae class="comment"> * @hash_node: Element in @dev_table hash table in vport.c.4/spae=lv 764/a>4spae class="comment"> * @ops: Class structure.4/spae=lv 774/a>4spae class="comment"> * @percpu_stats: Points to per-CPU statistics used and maintained by vport  spae=lv 784/a>4spae class="comment"> * @stats_lock: Protects @err_stats;  spae=lv 794/a>4spae class="comment"> * @err_stats: Points to error statistics used and maintained by vport  spae=lv 8
  a>4spae class="comment"> */4/spae=lv 81  a>structv4a href="+code=vport" class="sref">vport  a> {lv 824/a>        structv4a href="+code=rcu_head" class="sref">rcu_head4/a> 4a href="+code=rcu" class="sref">rcu4/a>;lv 834/a>        4a href="+code=u16" class="sref">u164/a> 4a href="+code=port_no" class="sref">port_no4/a>;lv 844/a>        structv4a href="+code=daaapath" class="sref">daaapath4/a> *4a href="+code=dp" class="sref">dp4/a>;lv 854/a>        structv4a href="+code=list_head" class="sref">list_head4/a> 4a href="+code=node" class="sref">node4/a>;lv 864/a>        4a href="+code=u32" class="sref">u324/a> 4a href="+code=upcall_pid" class="sref">upcall_pid4/a>;lv 874/a>lv 884/a>        structv4a href="+code=hlist_node" class="sref">hlist_node4/a> 4a href="+code=hash_node" class="sref">hash_node4/a>;lv 894/a>        cuest structv4a href="+code=vport_ops" class="sref">vport_ops  a> *4a href="+code=ovs" class="sref">ovs4/a>;lv 904/a>lv 914/a>        structv4a href="+code=vport_percpu_stats" class="sref">vport_percpu_stats4/a> 4a href="+code=__percpu" class="sref">__percpu  a> *4a href="+code=percpu_stats" class="sref">percpu_stats4/a>;lv 924/a>lv 934/a>        4a href="+code=spinlock_t" class="sref">spinlock_t4/a> 4a href="+code=stats_lock" class="sref">stats_lock4/a>;lv 944/a>        structv4a href="+code=vport_err_stats" class="sref">vport_err_stats4/a> 4a href="+code=err_stats" class="sref">err_stats4/a>;lv 954/a>};lv 964/a>lv 974/a>4spae class="comment">/**4/spae=lv 984/a>4spae class="comment"> * structvvport_parms - param
ters for creating a new vport  spae=lv 994/a>4spae class="comment"> *4/spae=lv1004/a>4spae class="comment"> * @nam
: New vport's nam
.4/spae=lv1014/a>4spae class="comment"> * @typ
: New vport's typ
.4/spae=lv1024/a>4spae class="comment"> * @ values: %OVS_VPORT_ATTR_OPTIONS attribute from Netlink message, %NULL if4/spae=lv1034/a>4spae class="comment"> * none was supplied.4/spae=lv1044/a>4spae class="comment"> * @dp: New vport's daaapath.4/spae=lv1054/a>4spae class="comment"> * @port_no: New vport's port number.4/spae=lv1064/a>4spae class="comment"> */4/spae=lv107  a>structv4a href="+code=vport_parms" class="sref">vport_parms  a> {lv1084/a>        cuest char *4a href="+code=nam
" class="sref">nam
4/a>;lv1094/a>        enumv4a href="+code=ovs_vport_typ
" class="sref">ovs_vport_typ
4/a> 4a href="+code=typ
" class="sref">typ
4/a>;lv1>
  a>        structv4a href="+code=nlattr" class="sref">nlattr  a> *4a href="+code=ovalues" class="sref">ovalues4/a>;lv1114/a>lv1124/a>        4spae class="comment">/* For ovs_vport_alloc(). */4/spae=lv113  a>        structv4a href="+code=daaapath" class="sref">daaapath4/a> *4a href="+code=dp" class="sref">dp4/a>;lv1144/a>        4a href="+code=u16" class="sref">u164/a> 4a href="+code=port_no" class="sref">port_no4/a>;lv1154/a>        4a href="+code=u32" class="sref">u324/a> 4a href="+code=upcall_pid" class="sref">upcall_pid4/a>;lv1164/a>};lv1174/a>lv1184/a>4spae class="comment">/**4/spae=lv1194/a>4spae class="comment"> * structvvport_ops - definialue of a typ
 of virtual port  spae=lv1204/a>4spae class="comment"> *  spae=lv1214/a>4spae class="comment"> * @typ
: %OVS_VPORT_TYPE_* 	  >
 for this typ
 of virtual port.4/spae=lv1224/a>4spae class="comment"> * @creat
: Creat
 a new vport cuefigured as specified.  On success returns4/spae=lv1234/a>4spae class="comment"> * a new vport allocated with ovs_vport_alloc(), otherwise an ERR_PTR() 	  >
.4/spae=lv1244/a>4spae class="comment"> * @destroy: Destroys a vport.  Must callvvport_free() on the vport but not4/spae=lv1254/a>4spae class="comment"> * before ae RCU grace period has elapsed.4/spae=lv1264/a>4spae class="comment"> * @set_ values: Modify the cuefiguraalue of an existing vport.  May be %NULL4/spae=lv1274/a>4spae class="comment"> * if modificaalue is not supported.4/spae=lv1284/a>4spae class="comment"> * @get_ values: Apvends vport-specific attributes for the cuefiguraalue of an4/spae=lv1294/a>4spae class="comment"> * existing vport to a &structvsk_buff.  May be %NULL for a vport that does not4/spae=lv1304/a>4spae class="comment"> * have any cuefiguraalue.4/spae=lv1314/a>4spae class="comment"> * @get_nam
: Get the device's nam
.4/spae=lv1324/a>4spae class="comment"> * @get_cuefig: Get the device's cuefiguraalue.4/spae=lv1334/a>4spae class="comment"> * @get_ifindex: Get the system interface index associated with the device.4/spae=lv1344/a>4spae class="comment"> * May be nullvif the device does not have an ifindex.4/spae=lv1354/a>4spae class="comment"> * @send: Send a packet on the device.  Returns the length of the packet sent.4/spae=lv1364/a>4spae class="comment"> */4/spae=lv137  a>structv4a href="+code=vport_ops" class="sref">vport_ops  a> {lv1384/a>        enumv4a href="+code=ovs_vport_typ
" class="sref">ovs_vport_typ
4/a> 4a href="+code=typ
" class="sref">typ
4/a>;lv1394/a>lv14
  a>        4spae class="comment">/* Called with RTNL lock. */4/spae=lv1414/a>        structv4a href="+code=vport" class="sref">vport  a> *(*4a href="+code=creat
" class="sref">creat
  a>)(cuest structv4a href="+code=vport_parms" class="sref">vport_parms  a> *);lv1424/a>        voidv(*4a href="+code=destroy" class="sref">destroy  a>)(structv4a href="+code=vport" class="sref">vport  a> *);lv1434/a>lv1444/a>        intv(*4a href="+code=set_ values" class="sref">set_ values4/a>)(structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=nlattr" class="sref">nlattr  a> *);lv1454/a>        intv(*4a href="+code=get_ values" class="sref">get_ values4/a>)(cuest structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=sk_buff" class="sref">sk_buff4/a> *);lv1464/a>lv147  a>        4spae class="comment">/* Called with rcu_read_lock or RTNL lock. */4/spae=lv1484/a>        cuest char *(*4a href="+code=get_nam
" class="sref">get_nam
4/a>)(cuest structv4a href="+code=vport" class="sref">vport  a> *);lv1494/a>        voidv(*4a href="+code=get_cuefig" class="sref">get_cuefig4/a>)(cuest structv4a href="+code=vport" class="sref">vport  a> *, voidv*);lv1504/a>        intv(*4a href="+code=get_ifindex" class="sref">get_ifindex4/a>)(cuest structv4a href="+code=vport" class="sref">vport  a> *);lv1514/a>lv1524/a>        intv(*4a href="+code=send" class="sref">send4/a>)(structv4a href="+code=vport" class="sref">vport  a> *, structv4a href="+code=sk_buff" class="sref">sk_buff4/a> *);lv1534/a>};lv1544/a>lv1554/a>enumv4a href="+code=vport_err_typ
" class="sref">vport_err_typ
  a> {lv1564/a>        4a href="+code=VPORT_E_RX_DROPPED" class="sref">VPORT_E_RX_DROPPED4/a>,lv1574/a>        4a href="+code=VPORT_E_RX_ERROR" class="sref">VPORT_E_RX_ERROR4/a>,lv1584/a>        4a href="+code=VPORT_E_TX_DROPPED" class="sref">VPORT_E_TX_DROPPED4/a>,lv1594/a>        4a href="+code=VPORT_E_TX_ERROR" class="sref">VPORT_E_TX_ERROR4/a>,lv16
  a>};lv1614/a>lv162  a>structv4a href="+code=vport" class="sref">vport  a> *4a href="+code=ovs_vport_alloc" class="sref">ovs_vport_alloc  a>(intv4a href="+code=priv_siz
" class="sref">priv_siz
4/a>, cuest structv4a href="+code=vport_ops" class="sref">vport_ops  a> *,lv1634/a>                              cuest structv4a href="+code=vport_parms" class="sref">vport_parms  a> *);lv1644/a>voidv4a href="+code=ovs_vport_free" class="sref">ovs_vport_free  a>(structv4a href="+code=vport" class="sref">vport  a> *);lv1654/a>lv1664/a>#definev4a href="+code=VPORT_ALIGN" class="sref">VPORT_ALIGN  a> 8lv1674/a>lv1684/a>4spae class="comment">/**4/spae=lv1694/a>4spae class="comment"> *      vport_priv - access privat
 daaa area of vport4/spae=lv17
  a>4spae class="comment"> *4/spae=lv1714/a>4spae class="comment"> * @vport: vport to access4/spae=lv1724/a>4spae class="comment"> *4/spae=lv1eassvport  a> *4a href="+code=ovs_vport_alloc" class="sref">44/a> 4a href="+nzero vpornvswip="s but4/code=vportch/vport.4/spae=lengef="netn ve.h#L173" id  L1call_pid: The Netlink po173">v1644/a>vpae class="comment"> * m1iss t1e flow table.4/spae=lv1654/a>lpae class="comment"> * @1hash_1ode: Element in @dev_table hash hrefef="nny purpose needpae=l4s1pae class="comment"> * @1ops: 1lass structure.4/spae=l4s1pae class="comment"> * @1percp17class=">
	4ef">VPORT_ALIGN incommen="netn venvswincommh#L16t.h#L1f">vport_parms  a> *);ef=href="netn venvswitch/ef=s="srss="sref">vport  a> *);l4pae class="comment"> * @1stats1lock: 6" id  L156" class="line" nam
  L156" 794/a>4s1pae class="comment"> * @1err_s17_ERROR" classnam
  a(">upcall_pid4/a>8netn venvswitchu8t.h#L16rt  a> *);lvport  a> *);lVPORT_ALIGN  a> 8l4s1pae class="comment"> */41/spae1l4ructv4a href="+code=vpor1t" cl18#L162" id  L162" class="line" nam
  L162" 824/a>  1      structv4a href="+c1ode=r18a href="netn venvswitch/vpoort.h#L169" id  L169" class="line" nam
  L169" 834/a>  1      4a href="+code=u161" cla18_alloc" class="sref">44/a> 4a area of vpoae=lort4/spav4div renvswiae=lv      structv4a href="+c1ode=d18 flow table.4/spae=ll      structv4a href="+c1ode=l18: New vport's port number.4/ef=: Staswich/ref="netn venvswit.h#L136" id  L136" class="line" nam
  L136" 864/a>  1      4a href="+code=u321" cla18ass structure.4/spae=l4s1a href="netn venvswitch/1vport18icaalue is not supported.4/spaItn vesometimesswitch/netn ransla/spae=l  1      structv4a href="+c1ode=h18lues: Apvends vport-specific avswittcha hrenvsw,venvhae=lt4/spaecase wheren vengef="netn venpovice.nit.h#L172" id  L172" class="line" nam
  L172" 894/a>  1      cuest structv4a hr1ef="+18rt_priv - access privat
 daaa  venntent"ref="n"netn venvsv4div . v4/ef= m notpovicttcha hrstaswich/a h.h#L172" id  L172" class="line" nam
  L172" 904/a>l<1a href="netn venvswitch/1vport19 cuefiguraalue.4/spae=l  1      structv4a href="+c1ode=v19vport to access4/spae=ll<1a href="netn venvswitch/1vport192lass=">
	4ef">VPORT_ALIGN incommen="netn venvswincommh#L16ef">vport  a> *);lvport_parms rt4/href="netn venvrt4/s="s)" id  L148" class="line" nam
  L148" 934/a>  1      4a href="+code=spi1nlock1t" cla6" id  L156" class="line" nam
  L156" 944/a>  1      structv4a href="+c1ode=v1ort_err_stats"nam
  a(ef">vport  a> *);lupcall_pid4/art4/href="netn venvrt4/s="sspart  a> *);lvport  a> *);lVPORT_ALIGN  a> 8l};1l  1a href="netn venvswitch/1vport1h#L97" id  L97" class="line" nam
  L97">v1 974/a>4s1pae class="comment">/**41/spae1lovs_vport_free  a>(ref="nectv4a href="+code=vport" ref="nes="sref">vport  a> *);lsk_buff4/a> *);l4s1pae class="comment"> * s1truct1vport_ass="sref">ovs_vport_free  a>(refordvport.ctv4a href="+code=vport" refordvport.s="sref">vport  a> *);lvport_err_typ
  a> {lvport_err a> {l#ifnndefv4a href="+code=VPORTf="+19#L140" id  L140" class="line" nam
  L1402>v1004/a>2spae class="comment"> * 2nam
:2New vport's nam
.4/spae=/twarswich/=">
	4allvenvmpi/4/senvswie=lv v24>v1014/a>2spae class="comment"> * 2typ
:2New vport's typ
.4/spae=lv1024/a>2spae class="comment"> * 2 valu2s: exce.n" class="sref">vport_ops  a> *,lovs_vport_fre" c=lv1034/a>2spae class="comment"> * 2one w2s suppexce.n" class="sref">vport_ops  a> *,lovs_vport_frevice.nala*,l244/a>#inspae class="comment"> * 2dp: N20#L155" id  L155" class="line" nam
  L1552>v1054/a>2spae class="comment"> * 2port_2o: New#endifrcu_read_lock or RTNL lockam
  L1ort.h#L148" id  L148" class="line" nam
  L1482>264/a>#inspae class="comment"> */2/spae2lile_cont
ile_contents" class=fooce.">
ceivoriginal LXR/or4/spaee=lLXR/or Runityt_ops"ref="extn v hre lspae=llx.@l"net.not_op.
ile_conents" class=subfooce.">
lx..l"net.no kindlvehostpae=l< id  L148http://www.redpi/l-l"npro.no">Redpi/lwarnpro ASt_ops"proviGenech/L"net" clant"envswnd assh/vporvesertch/v since+19#5.
ile_conte/bodyone/htmlont