Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1653307
| From | David Miller <davem@davemloft.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH net-next 2/7] net: dsa: remove useless rcv copy in DSA tree |
| Date | 2017-05-30 17:20 +0200 |
| Message-ID | <tMR69-A4-9@gated-at.bofh.it> (permalink) |
| References | <tMQjL-8vK-3@gated-at.bofh.it> <tMQjN-8vK-35@gated-at.bofh.it> <tMQWt-wG-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Andrew Lunn <andrew@lunn.ch>
Date: Tue, 30 May 2017 17:05:31 +0200
> On Tue, May 30, 2017 at 10:21:26AM -0400, Vivien Didelot wrote:
>> The dsa_switch_tree holds a copy of the rcv member of the dsa_device_ops
>> structure. dst->rcv is always assigned to dst->tag_ops->rcv. Remove this
>> useless copy.
>>
>> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
>> ---
>> include/net/dsa.h | 4 ----
>> net/dsa/dsa.c | 4 ++--
>> net/dsa/dsa2.c | 2 --
>> net/dsa/legacy.c | 2 --
>> 4 files changed, 2 insertions(+), 10 deletions(-)
>>
>> diff --git a/include/net/dsa.h b/include/net/dsa.h
>> index cb5d668b265d..4b82766715e9 100644
>> --- a/include/net/dsa.h
>> +++ b/include/net/dsa.h
>> @@ -126,10 +126,6 @@ struct dsa_switch_tree {
>> * protocol to use.
>> */
>> struct net_device *master_netdev;
>> - struct sk_buff * (*rcv)(struct sk_buff *skb,
>> - struct net_device *dev,
>> - struct packet_type *pt,
>> - struct net_device *orig_dev);
>>
>> /*
>> * Original copy of the master netdev ethtool_ops
>> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
>> index 7a8a0358299b..861dc0e5020d 100644
>> --- a/net/dsa/dsa.c
>> +++ b/net/dsa/dsa.c
>> @@ -29,7 +29,7 @@
>>
>> bool dsa_uses_tagged_protocol(struct dsa_switch_tree *dst)
>> {
>> - return !!dst->rcv;
>> + return dst->tag_ops && dst->tag_ops->rcv;
>
> This makes the hot path more expensive. The copy is probably worth it
> in terms of performance.
Agreed.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH net-next 0/7] net: dsa: tagger simplification Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 16:30 +0200
[PATCH net-next 3/7] net: dsa: remove unused arguments of tagger rcv Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 16:30 +0200
Re: [PATCH net-next 3/7] net: dsa: remove unused arguments of tagger rcv Andrew Lunn <andrew@lunn.ch> - 2017-05-30 17:20 +0200
[PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 16:30 +0200
Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code Andrew Lunn <andrew@lunn.ch> - 2017-05-30 17:10 +0200
Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code David Miller <davem@davemloft.net> - 2017-05-30 17:20 +0200
Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 18:00 +0200
Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 18:20 +0200
Re: [PATCH net-next 1/7] net: dsa: hide dsa_uses_tagged_protocol code Andrew Lunn <andrew@lunn.ch> - 2017-05-30 18:20 +0200
[PATCH net-next 7/7] net: dsa: factor skb freeing on xmit Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 16:30 +0200
Re: [PATCH net-next 7/7] net: dsa: factor skb freeing on xmit Andrew Lunn <andrew@lunn.ch> - 2017-05-30 17:40 +0200
[PATCH net-next 5/7] net: dsa: remove useless goto label in tagger rcv Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 16:30 +0200
[PATCH net-next 2/7] net: dsa: remove useless rcv copy in DSA tree Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-05-30 16:30 +0200
Re: [PATCH net-next 2/7] net: dsa: remove useless rcv copy in DSA tree Andrew Lunn <andrew@lunn.ch> - 2017-05-30 17:10 +0200
Re: [PATCH net-next 2/7] net: dsa: remove useless rcv copy in DSA tree David Miller <davem@davemloft.net> - 2017-05-30 17:20 +0200
Re: [PATCH net-next 0/7] net: dsa: tagger simplification Andrew Lunn <andrew@lunn.ch> - 2017-05-30 17:20 +0200
csiph-web