[ovs-dev] [PATCH 7/8] tnl-ports: Handle STT ports.
Jesse Gross
jesse at kernel.org
Fri Jan 22 19:51:23 UTC 2016
On Sun, Jan 10, 2016 at 11:18 PM, Pravin B Shelar <pshelar at nicira.com> wrote:
> diff --git a/lib/tnl-ports.c b/lib/tnl-ports.c
> index e7f2066..13d114d 100644
> --- a/lib/tnl-ports.c
> +++ b/lib/tnl-ports.c
> @@ -95,24 +96,28 @@ tnl_port_init_flow(struct flow *flow, struct eth_addr mac,
> - if (udp_port) {
> - flow->nw_proto = IPPROTO_UDP;
> + if (tp_port) {
> + if (!strcmp(type, "stt")) {
> + flow->nw_proto = IPPROTO_TCP;
> + } else {
> + flow->nw_proto = IPPROTO_UDP;
> + }
> } else {
> flow->nw_proto = IPPROTO_GRE;
> }
Now that we have the type, it might be better to just use it in all
cases instead of heuristics like no port numbers.
> @@ -129,9 +134,9 @@ map_insert(odp_port_t port, struct eth_addr mac, struct in6_addr *addr,
> /* XXX: No fragments support. */
> match.wc.masks.nw_frag = FLOW_NW_FRAG_MASK;
>
> - /* 'udp_port' is zero for non-UDP tunnels (e.g. GRE). In this case it
> + /* 'tp_port' is zero for non-UDP tunnels (e.g. GRE). In this case it
Not just UDP tunnels any more.
> void
> tnl_port_map_insert(odp_port_t port,
> - ovs_be16 udp_port, const char dev_name[])
> + ovs_be16 tp_port, const char dev_name[], const char type[])
> {
> struct tnl_port *p;
> struct ip_device *ip_dev;
>
> ovs_mutex_lock(&mutex);
> LIST_FOR_EACH(p, node, &port_list) {
> - if (udp_port == p->udp_port) {
> + if (tp_port == p->tp_port) {
> goto out;
> }
> }
Doesn't this need to check the type? Also the same when we delete the tunnel.
More information about the dev
mailing list