diff mbox

[net-next] bridge: Add ability to always enable TSO/UFO

Message ID 1418179394-4470-2-git-send-email-makita.toshiaki@lab.ntt.co.jp
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Toshiaki Makita Dec. 10, 2014, 2:43 a.m. UTC
Currently a bridge device turns off TSO/UFO features if no bridge ports
support it. We can always enable them, since packets can be segmented
on ports by software as well as on the bridge device.
This will reduce the number of packets processed in the bridge.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
---
 net/bridge/br_if.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Dec. 10, 2014, 7:50 p.m. UTC | #1
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Wed, 10 Dec 2014 11:43:14 +0900

> -	features &= ~NETIF_F_ONE_FOR_ALL;
> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;

I don't think this is the expression you intend to use.

I think you meant:

	features &= ~(NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE);

Or:

	features = ~NETIF_F_ONE_FOR_ALL;
	features |= NETIF_F_GSO_SOFTWARE;
--
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
Toshiaki Makita Dec. 11, 2014, 2:04 a.m. UTC | #2
On 2014/12/11 4:50, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Wed, 10 Dec 2014 11:43:14 +0900
> 
>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
> 
> I don't think this is the expression you intend to use.

Thank you, but this is really my intended expression.

"features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
including GSO_SOFTWARE.
But I want to leave GSO_SOFTWARE bits here.

> 
> I think you meant:
> 
> 	features &= ~(NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE);

ONE_FOR_ALL already includes GSO_SOFTWARE.

> 
> Or:
> 
> 	features = ~NETIF_F_ONE_FOR_ALL;
> 	features |= NETIF_F_GSO_SOFTWARE;

This way, users cannot drop TSO/UFO by ethtool.

Thanks,
Toshiaki Makita

--
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
David Miller Dec. 11, 2014, 2:13 a.m. UTC | #3
From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Date: Thu, 11 Dec 2014 11:04:44 +0900

> On 2014/12/11 4:50, David Miller wrote:
>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>> 
>>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>> 
>> I don't think this is the expression you intend to use.
> 
> Thank you, but this is really my intended expression.
> 
> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
> including GSO_SOFTWARE.
> But I want to leave GSO_SOFTWARE bits here.

It is clearer to say this as:

	~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)

Or create a new NETIF_F_* macro to express this idea succinctly.
--
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
Toshiaki Makita Dec. 11, 2014, 2:20 a.m. UTC | #4
On 2014/12/11 11:13, David Miller wrote:
> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
> Date: Thu, 11 Dec 2014 11:04:44 +0900
> 
>> On 2014/12/11 4:50, David Miller wrote:
>>> From: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
>>> Date: Wed, 10 Dec 2014 11:43:14 +0900
>>>
>>>> -	features &= ~NETIF_F_ONE_FOR_ALL;
>>>> +	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
>>>
>>> I don't think this is the expression you intend to use.
>>
>> Thank you, but this is really my intended expression.
>>
>> "features &= ~NETIF_F_ONE_FOR_ALL" drops all of ONE_FOR_ALL bits
>> including GSO_SOFTWARE.
>> But I want to leave GSO_SOFTWARE bits here.
> 
> It is clearer to say this as:
> 
> 	~(NETIF_F_ONE_FOR_ALL & ~NETIF_F_GSO_SOFTWARE)
> 
> Or create a new NETIF_F_* macro to express this idea succinctly.

OK, I will. (once net-next is reopened)

Thanks,
Toshiaki Makita

--
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/bridge/br_if.c b/net/bridge/br_if.c
index ed307db..e93bf17 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -418,7 +418,7 @@  netdev_features_t br_features_recompute(struct net_bridge *br,
 		return features;
 
 	mask = features;
-	features &= ~NETIF_F_ONE_FOR_ALL;
+	features &= ~NETIF_F_ONE_FOR_ALL | NETIF_F_GSO_SOFTWARE;
 
 	list_for_each_entry(p, &br->port_list, list) {
 		features = netdev_increment_features(features,