* 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>
*
* 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;
}
* @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
{
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;
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
*
*/
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;
}
return sent;
-
-error:
- kfree_skb(skb);
- vport_record_error(vport, VPORT_E_TX_DROPPED);
- return 0;
}
/**