X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fvport.c;h=487d75241fe69e5b261ea052b9e35d9b72189e6e;hb=57d6a4c71bd0b4ed477ec273d4d4f84c5e4ed465;hp=852a3c69f5f00dbb15cfcdfecdec3e81333503f9;hpb=f0fef76062d67bff94a3243a469f182dd6f503a1;p=openvswitch diff --git a/datapath/vport.c b/datapath/vport.c index 852a3c69..487d7524 100644 --- a/datapath/vport.c +++ b/datapath/vport.c @@ -221,7 +221,7 @@ void vport_free(struct vport *vport) * @parms: Information about new vport. * * Creates a new vport with the specified configuration (which is dependent on - * device type) and attaches it to a datapath. RTNL lock must be held. + * device type). RTNL lock must be held. */ struct vport *vport_add(const struct vport_parms *parms) { @@ -386,7 +386,7 @@ const char *vport_get_name(const struct vport *vport) * * Retrieves the type of the given device. */ -enum odp_vport_type vport_get_type(const struct vport *vport) +enum ovs_vport_type vport_get_type(const struct vport *vport) { return vport->ops->type; } @@ -605,12 +605,14 @@ int vport_get_iflink(const struct vport *vport) * * @vport: vport from which to retrieve MTU * - * Retrieves the MTU of the given device. - * - * Must be called with RTNL lock or rcu_read_lock. + * Retrieves the MTU of the given device. Returns 0 if @vport does not have an + * MTU (as e.g. some tunnels do not). Either RTNL lock or rcu_read_lock must + * be held. */ int vport_get_mtu(const struct vport *vport) { + if (!vport->ops->get_mtu) + return 0; return vport->ops->get_mtu(vport); } @@ -621,7 +623,7 @@ int vport_get_mtu(const struct vport *vport) * @skb: sk_buff where options should be appended. * * Retrieves the configuration of the given device, appending an - * %ODP_VPORT_ATTR_OPTIONS attribute that in turn contains nested + * %OVS_VPORT_ATTR_OPTIONS attribute that in turn contains nested * vport-specific attributes to @skb. * * Returns 0 if successful, -EMSGSIZE if @skb has insufficient room, or another @@ -634,7 +636,7 @@ int vport_get_options(const struct vport *vport, struct sk_buff *skb) { struct nlattr *nla; - nla = nla_nest_start(skb, ODP_VPORT_ATTR_OPTIONS); + nla = nla_nest_start(skb, OVS_VPORT_ATTR_OPTIONS); if (!nla) return -EMSGSIZE; @@ -710,7 +712,7 @@ int vport_send(struct vport *vport, struct sk_buff *skb) int sent; mtu = vport_get_mtu(vport); - if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) { + if (mtu && unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) { if (net_ratelimit()) pr_warn("%s: dropped over-mtu packet: %d > %d\n", dp_name(vport->dp), packet_length(skb), mtu);