projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
datapath: Further mirror checksum offloading state on old kernels.
[openvswitch]
/
datapath
/
vport.c
diff --git
a/datapath/vport.c
b/datapath/vport.c
index 517e871ee3d25af55092087124fdceca10860e4e..8ef96f73e1fc6ea7e77cb1881d5617e0be93ab85 100644
(file)
--- a/
datapath/vport.c
+++ b/
datapath/vport.c
@@
-605,12
+605,14
@@
int vport_get_iflink(const struct vport *vport)
*
* @vport: vport from which to retrieve MTU
*
*
* @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)
{
*/
int vport_get_mtu(const struct vport *vport)
{
+ if (!vport->ops->get_mtu)
+ return 0;
return vport->ops->get_mtu(vport);
}
return vport->ops->get_mtu(vport);
}
@@
-625,7
+627,8
@@
int vport_get_mtu(const struct vport *vport)
* vport-specific attributes to @skb.
*
* Returns 0 if successful, -EMSGSIZE if @skb has insufficient room, or another
* vport-specific attributes to @skb.
*
* Returns 0 if successful, -EMSGSIZE if @skb has insufficient room, or another
- * negative error code if a real error occurred.
+ * negative error code if a real error occurred. If an error occurs, @skb is
+ * left unmodified.
*
* Must be called with RTNL lock or rcu_read_lock.
*/
*
* Must be called with RTNL lock or rcu_read_lock.
*/
@@
-639,8
+642,10
@@
int vport_get_options(const struct vport *vport, struct sk_buff *skb)
if (vport->ops->get_options) {
int err = vport->ops->get_options(vport, skb);
if (vport->ops->get_options) {
int err = vport->ops->get_options(vport, skb);
- if (err)
+ if (err) {
+ nla_nest_cancel(skb, nla);
return err;
return err;
+ }
}
nla_nest_end(skb, nla);
}
nla_nest_end(skb, nla);
@@
-707,7
+712,7
@@
int vport_send(struct vport *vport, struct sk_buff *skb)
int sent;
mtu = vport_get_mtu(vport);
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);
if (net_ratelimit())
pr_warn("%s: dropped over-mtu packet: %d > %d\n",
dp_name(vport->dp), packet_length(skb), mtu);