diff mbox series

[05/14] net: dsa: tag_mtk: assign per-port queues

Message ID 20221107185452.90711-5-nbd@nbd.name (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series [01/14] net: ethernet: mtk_eth_soc: account for vlan in rx header length | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter warning Series does not have a cover letter
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 15 of 15 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 9 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Felix Fietkau Nov. 7, 2022, 6:54 p.m. UTC
Keeps traffic sent to the switch within link speed limits

Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
 net/dsa/tag_mtk.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Vladimir Oltean Nov. 7, 2022, 8:40 p.m. UTC | #1
Hi Felix,

On Mon, Nov 07, 2022 at 07:54:43PM +0100, Felix Fietkau wrote:
> Keeps traffic sent to the switch within link speed limits
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---

Do you have a patch 00/14 that explains what you're up to? I'm only
copied on 05/14 and 10/14, hard to get an idea.
Vladimir Oltean Nov. 7, 2022, 9:22 p.m. UTC | #2
On Mon, Nov 07, 2022 at 07:54:43PM +0100, Felix Fietkau wrote:
> Keeps traffic sent to the switch within link speed limits
> 
> Signed-off-by: Felix Fietkau <nbd@nbd.name>
> ---
>  net/dsa/tag_mtk.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
> index 415d8ece242a..445d6113227f 100644
> --- a/net/dsa/tag_mtk.c
> +++ b/net/dsa/tag_mtk.c
> @@ -25,6 +25,9 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
>  	u8 xmit_tpid;
>  	u8 *mtk_tag;
>  
> +	/* Reserve the first three queues for packets not passed through DSA */
> +	skb_set_queue_mapping(skb, 3 + dp->index);
> +

Should DSA have to care about this detail, or could you rework your
mtk_select_queue() procedure to adjust the queue mapping as needed?

>  	/* Build the special tag after the MAC Source Address. If VLAN header
>  	 * is present, it's required that VLAN header and special tag is
>  	 * being combined. Only in this way we can allow the switch can parse
> -- 
> 2.38.1
>
Felix Fietkau Nov. 8, 2022, 6:01 a.m. UTC | #3
On 07.11.22 22:22, Vladimir Oltean wrote:
> On Mon, Nov 07, 2022 at 07:54:43PM +0100, Felix Fietkau wrote:
>> Keeps traffic sent to the switch within link speed limits
>> 
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
>>  net/dsa/tag_mtk.c | 3 +++
>>  1 file changed, 3 insertions(+)
>> 
>> diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
>> index 415d8ece242a..445d6113227f 100644
>> --- a/net/dsa/tag_mtk.c
>> +++ b/net/dsa/tag_mtk.c
>> @@ -25,6 +25,9 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
>>  	u8 xmit_tpid;
>>  	u8 *mtk_tag;
>>  
>> +	/* Reserve the first three queues for packets not passed through DSA */
>> +	skb_set_queue_mapping(skb, 3 + dp->index);
>> +
> 
> Should DSA have to care about this detail, or could you rework your
> mtk_select_queue() procedure to adjust the queue mapping as needed?
I'm setting the queue here so that I don't have to add the extra 
overhead of parsing the payload in the ethernet driver.
For passing the queue, I used a similar approach as tag_brcm.c and
drivers/net/ethernet/broadcom/bcmsysport.c

- Felix
Felix Fietkau Nov. 8, 2022, 6:18 a.m. UTC | #4
On 07.11.22 21:40, Vladimir Oltean wrote:
> Hi Felix,
> 
> On Mon, Nov 07, 2022 at 07:54:43PM +0100, Felix Fietkau wrote:
>> Keeps traffic sent to the switch within link speed limits
>> 
>> Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> ---
> 
> Do you have a patch 00/14 that explains what you're up to? I'm only
> copied on 05/14 and 10/14, hard to get an idea.
I will add it in v2
Vladimir Oltean Nov. 8, 2022, 7:58 a.m. UTC | #5
On Tue, Nov 08, 2022 at 07:01:29AM +0100, Felix Fietkau wrote:
> On 07.11.22 22:22, Vladimir Oltean wrote:
> > On Mon, Nov 07, 2022 at 07:54:43PM +0100, Felix Fietkau wrote:
> > > Keeps traffic sent to the switch within link speed limits
> > > 
> > > Signed-off-by: Felix Fietkau <nbd@nbd.name>
> > > ---
> > >  net/dsa/tag_mtk.c | 3 +++
> > >  1 file changed, 3 insertions(+)
> > > 
> > > diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
> > > index 415d8ece242a..445d6113227f 100644
> > > --- a/net/dsa/tag_mtk.c
> > > +++ b/net/dsa/tag_mtk.c
> > > @@ -25,6 +25,9 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
> > >  	u8 xmit_tpid;
> > >  	u8 *mtk_tag;
> > > +	/* Reserve the first three queues for packets not passed through DSA */
> > > +	skb_set_queue_mapping(skb, 3 + dp->index);
> > > +
> > 
> > Should DSA have to care about this detail, or could you rework your
> > mtk_select_queue() procedure to adjust the queue mapping as needed?
> I'm setting the queue here so that I don't have to add the extra overhead of
> parsing the payload in the ethernet driver.
> For passing the queue, I used a similar approach as tag_brcm.c and
> drivers/net/ethernet/broadcom/bcmsysport.c

I was just asking if you can't add the 3 elsewhere, since the DSA
tagging protocol shouldn't care how many MAC IDs the DSA master has.
Felix Fietkau Nov. 8, 2022, 9:20 a.m. UTC | #6
On 08.11.22 08:58, Vladimir Oltean wrote:
> On Tue, Nov 08, 2022 at 07:01:29AM +0100, Felix Fietkau wrote:
>> On 07.11.22 22:22, Vladimir Oltean wrote:
>> > On Mon, Nov 07, 2022 at 07:54:43PM +0100, Felix Fietkau wrote:
>> > > Keeps traffic sent to the switch within link speed limits
>> > > 
>> > > Signed-off-by: Felix Fietkau <nbd@nbd.name>
>> > > ---
>> > >  net/dsa/tag_mtk.c | 3 +++
>> > >  1 file changed, 3 insertions(+)
>> > > 
>> > > diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
>> > > index 415d8ece242a..445d6113227f 100644
>> > > --- a/net/dsa/tag_mtk.c
>> > > +++ b/net/dsa/tag_mtk.c
>> > > @@ -25,6 +25,9 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
>> > >  	u8 xmit_tpid;
>> > >  	u8 *mtk_tag;
>> > > +	/* Reserve the first three queues for packets not passed through DSA */
>> > > +	skb_set_queue_mapping(skb, 3 + dp->index);
>> > > +
>> > 
>> > Should DSA have to care about this detail, or could you rework your
>> > mtk_select_queue() procedure to adjust the queue mapping as needed?
>> I'm setting the queue here so that I don't have to add the extra overhead of
>> parsing the payload in the ethernet driver.
>> For passing the queue, I used a similar approach as tag_brcm.c and
>> drivers/net/ethernet/broadcom/bcmsysport.c
> 
> I was just asking if you can't add the 3 elsewhere, since the DSA
> tagging protocol shouldn't care how many MAC IDs the DSA master has.
Sure, that would work. I'll change it in v2.

- Felix
diff mbox series

Patch

diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
index 415d8ece242a..445d6113227f 100644
--- a/net/dsa/tag_mtk.c
+++ b/net/dsa/tag_mtk.c
@@ -25,6 +25,9 @@  static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
 	u8 xmit_tpid;
 	u8 *mtk_tag;
 
+	/* Reserve the first three queues for packets not passed through DSA */
+	skb_set_queue_mapping(skb, 3 + dp->index);
+
 	/* Build the special tag after the MAC Source Address. If VLAN header
 	 * is present, it's required that VLAN header and special tag is
 	 * being combined. Only in this way we can allow the switch can parse