diff mbox

[net-next,2/6] openvswitch: Pass net into ovs_fragment

Message ID 1443648336-31741-2-git-send-email-ebiederm@xmission.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Eric W. Biederman Sept. 30, 2015, 9:25 p.m. UTC
In preparation for the ipv4 and ipv6 fragmentation code taking a net
parameter pass a struct net into ovs_fragment where the v4 and v6
fragmentation code is called.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
---
 net/openvswitch/actions.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Nicolas Dichtel Oct. 1, 2015, 8:31 a.m. UTC | #1
Le 30/09/2015 23:25, Eric W. Biederman a écrit :
> In preparation for the ipv4 and ipv6 fragmentation code taking a net
> parameter pass a struct net into ovs_fragment where the v4 and v6
> fragmentation code is called.
>
> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
> ---
[snip]
> @@ -748,6 +748,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
>   		if (likely(!mru || (skb->len <= mru + ETH_HLEN))) {
>   			ovs_vport_send(vport, skb);
>   		} else if (mru <= vport->dev->mtu) {
> +			struct net *net = read_pnet(&dp->net);
nit: add an empty line after variables declaration.

>   			__be16 ethertype = key->eth.type;
>
>   			if (!is_flow_key_valid(key)) {
[snip]
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Eric W. Biederman Oct. 1, 2015, 4:03 p.m. UTC | #2
Nicolas Dichtel <nicolas.dichtel@6wind.com> writes:

> Le 30/09/2015 23:25, Eric W. Biederman a écrit :
>> In preparation for the ipv4 and ipv6 fragmentation code taking a net
>> parameter pass a struct net into ovs_fragment where the v4 and v6
>> fragmentation code is called.
>>
>> Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
>> ---
> [snip]
>> @@ -748,6 +748,7 @@ static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
>>   		if (likely(!mru || (skb->len <= mru + ETH_HLEN))) {
>>   			ovs_vport_send(vport, skb);
>>   		} else if (mru <= vport->dev->mtu) {
>> +			struct net *net = read_pnet(&dp->net);
> nit: add an empty line after variables declaration.
>
>>   			__be16 ethertype = key->eth.type;
>>
^^^^^^^^^^^  The empty line is right here, after the second variable
             declaration.

>>   			if (!is_flow_key_valid(key)) {
> [snip]
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nicolas Dichtel Oct. 1, 2015, 10:14 p.m. UTC | #3
Le 01/10/2015 18:03, Eric W. Biederman a écrit :
> Nicolas Dichtel <nicolas.dichtel@6wind.com> writes:
>
>> Le 30/09/2015 23:25, Eric W. Biederman a écrit :
[snip]
>>> +			struct net *net = read_pnet(&dp->net);
>> nit: add an empty line after variables declaration.
>>
>>>    			__be16 ethertype = key->eth.type;
>>>
> ^^^^^^^^^^^  The empty line is right here, after the second variable
>               declaration.
Rooh ... I need glasses ;-)

Sorry for the noise.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c
index f00c641ecd93..ba38662f9f5e 100644
--- a/net/openvswitch/actions.c
+++ b/net/openvswitch/actions.c
@@ -684,8 +684,8 @@  static void prepare_frag(struct vport *vport, struct sk_buff *skb)
 	skb_pull(skb, hlen);
 }
 
-static void ovs_fragment(struct vport *vport, struct sk_buff *skb, u16 mru,
-			 __be16 ethertype)
+static void ovs_fragment(struct net *net, struct vport *vport,
+			 struct sk_buff *skb, u16 mru, __be16 ethertype)
 {
 	if (skb_network_offset(skb) > MAX_L2_LEN) {
 		OVS_NLERR(1, "L2 header too long to fragment");
@@ -748,6 +748,7 @@  static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
 		if (likely(!mru || (skb->len <= mru + ETH_HLEN))) {
 			ovs_vport_send(vport, skb);
 		} else if (mru <= vport->dev->mtu) {
+			struct net *net = read_pnet(&dp->net);
 			__be16 ethertype = key->eth.type;
 
 			if (!is_flow_key_valid(key)) {
@@ -757,7 +758,7 @@  static void do_output(struct datapath *dp, struct sk_buff *skb, int out_port,
 					ethertype = vlan_get_protocol(skb);
 			}
 
-			ovs_fragment(vport, skb, mru, ethertype);
+			ovs_fragment(net, vport, skb, mru, ethertype);
 		} else {
 			kfree_skb(skb);
 		}