datapath: Disable LRO from userspace instead of the kernel.
[sliver-openvswitch.git] / datapath / vport.c
index 8ef96f7..2b5a0b4 100644 (file)
@@ -6,8 +6,6 @@
  * kernel, by Linus Torvalds and others.
  */
 
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
 #include <linux/dcache.h>
 #include <linux/etherdevice.h>
 #include <linux/if.h>
@@ -221,7 +219,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 +384,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;
 }
@@ -623,7 +621,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
@@ -636,7 +634,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;
 
@@ -687,16 +685,6 @@ void vport_receive(struct vport *vport, struct sk_buff *skb)
        dp_process_received_packet(vport, skb);
 }
 
-static inline unsigned packet_length(const struct sk_buff *skb)
-{
-       unsigned length = skb->len - ETH_HLEN;
-
-       if (skb->protocol == htons(ETH_P_8021Q))
-               length -= VLAN_HLEN;
-
-       return length;
-}
-
 /**
  *     vport_send - send a packet on a device
  *
@@ -708,18 +696,7 @@ static inline unsigned packet_length(const struct sk_buff *skb)
  */
 int vport_send(struct vport *vport, struct sk_buff *skb)
 {
-       int mtu;
-       int sent;
-
-       mtu = vport_get_mtu(vport);
-       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);
-               goto error;
-       }
-
-       sent = vport->ops->send(vport, skb);
+       int sent = vport->ops->send(vport, skb);
 
        if (vport->ops->flags & VPORT_F_GEN_STATS && sent > 0) {
                struct vport_percpu_stats *stats;
@@ -736,11 +713,6 @@ int vport_send(struct vport *vport, struct sk_buff *skb)
        }
 
        return sent;
-
-error:
-       kfree_skb(skb);
-       vport_record_error(vport, VPORT_E_TX_DROPPED);
-       return 0;
 }
 
 /**