diff mbox series

net: dsa: Implement flow_dissect callback for tag_qca

Message ID 1553659146-44406-1-git-send-email-xiaofeis@codeaurora.org
State Accepted
Delegated to: David Miller
Headers show
Series net: dsa: Implement flow_dissect callback for tag_qca | expand

Commit Message

xiaofeis March 27, 2019, 3:59 a.m. UTC
Add flow_dissect for qca tagged packet to get the right hash.

Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org>
---
 net/dsa/tag_qca.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Andrew Lunn March 27, 2019, 8:57 a.m. UTC | #1
On Wed, Mar 27, 2019 at 11:59:06AM +0800, xiaofeis wrote:
> Add flow_dissect for qca tagged packet to get the right hash.
> 
> Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Vinod Koul March 27, 2019, 10:15 a.m. UTC | #2
On 27-03-19, 11:59, xiaofeis wrote:
> Add flow_dissect for qca tagged packet to get the right hash.

Ideally this patch should have been tagged as V2. Anyhow the change
looks fine so:

Reviewed-by: Vinod Koul <vkoul@kernel.org>

> Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org>
> ---
>  net/dsa/tag_qca.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
> index e886a3c..f4b4de3 100644
> --- a/net/dsa/tag_qca.c
> +++ b/net/dsa/tag_qca.c
> @@ -113,8 +113,18 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
>  	return skb;
>  }
>  
> +static int qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
> +                                int *offset)
> +{
> +	*offset = QCA_HDR_LEN;
> +	*proto = ((__be16 *)skb->data)[0];
> +
> +	return 0;
> +}
> +
>  const struct dsa_device_ops qca_netdev_ops = {
>  	.xmit	= qca_tag_xmit,
>  	.rcv	= qca_tag_rcv,
> +	.flow_dissect = qca_tag_flow_dissect,
>  	.overhead = QCA_HDR_LEN,
>  };
> -- 
> 1.9.1
Florian Fainelli March 27, 2019, 4:27 p.m. UTC | #3
On 3/26/19 8:59 PM, xiaofeis wrote:
> Add flow_dissect for qca tagged packet to get the right hash.
> 
> Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
xiaofeis March 28, 2019, 4:37 a.m. UTC | #4
On 2019-03-27 18:15, Vinod Koul wrote:
> On 27-03-19, 11:59, xiaofeis wrote:
>> Add flow_dissect for qca tagged packet to get the right hash.
> 
> Ideally this patch should have been tagged as V2. Anyhow the change
> looks fine so:
> 
> Reviewed-by: Vinod Koul <vkoul@kernel.org>
> 
>> Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org>
>> ---
>>  net/dsa/tag_qca.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
>> index e886a3c..f4b4de3 100644
>> --- a/net/dsa/tag_qca.c
>> +++ b/net/dsa/tag_qca.c
>> @@ -113,8 +113,18 @@ static struct sk_buff *qca_tag_rcv(struct sk_buff 
>> *skb, struct net_device *dev,
>>  	return skb;
>>  }
>> 
>> +static int qca_tag_flow_dissect(const struct sk_buff *skb, __be16 
>> *proto,
>> +                                int *offset)
>> +{
>> +	*offset = QCA_HDR_LEN;
>> +	*proto = ((__be16 *)skb->data)[0];
>> +
>> +	return 0;
>> +}
>> +
>>  const struct dsa_device_ops qca_netdev_ops = {
>>  	.xmit	= qca_tag_xmit,
>>  	.rcv	= qca_tag_rcv,
>> +	.flow_dissect = qca_tag_flow_dissect,
>>  	.overhead = QCA_HDR_LEN,
>>  };
>> --
>> 1.9.1
Thanks Vinod, will take care next time.
David Miller March 28, 2019, 11:57 p.m. UTC | #5
From: xiaofeis <xiaofeis@codeaurora.org>
Date: Wed, 27 Mar 2019 11:59:06 +0800

> Add flow_dissect for qca tagged packet to get the right hash.
> 
> Signed-off-by: Xiaofei Shen <xiaofeis@codeaurora.org>

Applied.
diff mbox series

Patch

diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
index e886a3c..f4b4de3 100644
--- a/net/dsa/tag_qca.c
+++ b/net/dsa/tag_qca.c
@@ -113,8 +113,18 @@  static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
 	return skb;
 }
 
+static int qca_tag_flow_dissect(const struct sk_buff *skb, __be16 *proto,
+                                int *offset)
+{
+	*offset = QCA_HDR_LEN;
+	*proto = ((__be16 *)skb->data)[0];
+
+	return 0;
+}
+
 const struct dsa_device_ops qca_netdev_ops = {
 	.xmit	= qca_tag_xmit,
 	.rcv	= qca_tag_rcv,
+	.flow_dissect = qca_tag_flow_dissect,
 	.overhead = QCA_HDR_LEN,
 };