projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gitignore: Add manpage-check.
[openvswitch]
/
datapath
/
vport.c
diff --git
a/datapath/vport.c
b/datapath/vport.c
index 517e871ee3d25af55092087124fdceca10860e4e..487d75241fe69e5b261ea052b9e35d9b72189e6e 100644
(file)
--- 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
* @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)
{
*/
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.
*/
*
* Retrieves the type of the given device.
*/
-enum o
dp
_vport_type vport_get_type(const struct vport *vport)
+enum o
vs
_vport_type vport_get_type(const struct vport *vport)
{
return vport->ops->type;
}
{
return vport->ops->type;
}
@@
-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);
}
@@
-621,11
+623,12
@@
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
* @skb: sk_buff where options should be appended.
*
* Retrieves the configuration of the given device, appending an
- * %O
DP
_VPORT_ATTR_OPTIONS attribute that in turn contains nested
+ * %O
VS
_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
* 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.
*/
@@
-633,14
+636,16
@@
int vport_get_options(const struct vport *vport, struct sk_buff *skb)
{
struct nlattr *nla;
{
struct nlattr *nla;
- nla = nla_nest_start(skb, O
DP
_VPORT_ATTR_OPTIONS);
+ nla = nla_nest_start(skb, O
VS
_VPORT_ATTR_OPTIONS);
if (!nla)
return -EMSGSIZE;
if (vport->ops->get_options) {
int err = vport->ops->get_options(vport, skb);
if (!nla)
return -EMSGSIZE;
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);