/** * struct vport_portids - array of netlink portids of a vport. * must be protected by rcu. * @rn_ids: The reciprocal value of @n_ids. * @rcu: RCU callback head for deferred destruction. * @n_ids: Size of @ids array. * @ids: Array storing the Netlink socket pids to be used for packets received * on this port that miss the flow table.
*/ struct vport_portids { struct reciprocal_value rn_ids; struct rcu_head rcu;
u32 n_ids;
u32 ids[];
};
/** * struct vport - one port within a datapath * @dev: Pointer to net_device. * @dev_tracker: refcount tracker for @dev reference * @dp: Datapath to which this port belongs. * @upcall_portids: RCU protected 'struct vport_portids'. * @port_no: Index into @dp's @ports array. * @hash_node: Element in @dev_table hash table in vport.c. * @dp_hash_node: Element in @datapath->ports hash table in datapath.c. * @ops: Class structure. * @upcall_stats: Upcall stats of every ports. * @detach_list: list used for detaching vport in net-exit call. * @rcu: RCU callback head for deferred destruction.
*/ struct vport { struct net_device *dev;
netdevice_tracker dev_tracker; struct datapath *dp; struct vport_portids __rcu *upcall_portids;
u16 port_no;
/** * struct vport_parms - parameters for creating a new vport * * @name: New vport's name. * @type: New vport's type. * @options: %OVS_VPORT_ATTR_OPTIONS attribute from Netlink message, %NULL if * none was supplied. * @desired_ifindex: New vport's ifindex. * @dp: New vport's datapath. * @port_no: New vport's port number. * @upcall_portids: %OVS_VPORT_ATTR_UPCALL_PID attribute from Netlink message, * %NULL if none was supplied.
*/ struct vport_parms { constchar *name; enum ovs_vport_type type; int desired_ifindex; struct nlattr *options;
/** * struct vport_ops - definition of a type of virtual port * * @type: %OVS_VPORT_TYPE_* value for this type of virtual port. * @create: Create a new vport configured as specified. On success returns * a new vport allocated with ovs_vport_alloc(), otherwise an ERR_PTR() value. * @destroy: Destroys a vport. Must call vport_free() on the vport but not * before an RCU grace period has elapsed. * @set_options: Modify the configuration of an existing vport. May be %NULL * if modification is not supported. * @get_options: Appends vport-specific attributes for the configuration of an * existing vport to a &struct sk_buff. May be %NULL for a vport that does not * have any configuration. * @send: Send a packet on the device. * zero for dropped packets or negative for error. * @owner: Module that implements this vport type. * @list: List entry in the global list of vport types.
*/ struct vport_ops { enum ovs_vport_type type;
/* Called with ovs_mutex. */ struct vport *(*create)(conststruct vport_parms *); void (*destroy)(struct vport *);
int (*set_options)(struct vport *, struct nlattr *); int (*get_options)(conststruct vport *, struct sk_buff *);
/** * struct vport_upcall_stats_percpu - per-cpu packet upcall statistics for * a given vport. * @syncp: Synchronization point for 64bit counters. * @n_success: Number of packets that upcall to userspace succeed. * @n_fail: Number of packets that upcall to userspace failed.
*/ struct vport_upcall_stats_percpu { struct u64_stats_sync syncp;
u64_stats_t n_success;
u64_stats_t n_fail;
};
/** * vport_priv - access private data area of vport * * @vport: vport to access * * Returns: A void pointer to a private data allocated in the @vport. * * If a nonzero size was passed in priv_size of vport_alloc() a private data * area was allocated on creation. This allows that area to be accessed and * used for any purpose needed by the vport implementer.
*/ staticinlinevoid *vport_priv(conststruct vport *vport)
{ return (u8 *)(uintptr_t)vport + ALIGN(sizeof(struct vport), VPORT_ALIGN);
}
/** * vport_from_priv - lookup vport from private data pointer * * @priv: Start of private data area. * * Returns: A reference to a vport structure that contains @priv. * * It is sometimes useful to translate from a pointer to the private data * area to the vport, such as in the case where the private data pointer is * the result of a hash table lookup. @priv must point to the start of the * private data area.
*/ staticinlinestruct vport *vport_from_priv(void *priv)
{ return (struct vport *)((u8 *)priv - ALIGN(sizeof(struct vport), VPORT_ALIGN));
}
int ovs_vport_receive(struct vport *, struct sk_buff *, conststruct ip_tunnel_info *);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.