i40e: Fix a vlan bug
PATCH 1/1 i40e: Fix a vlan bug
From: "Chen Jing D(Mark)" <[email protected]>
i40e uses an bitmap array to store those vlan tags that are set by application. In function i40e_set_vlan_filter, it stores vlan tag to wrong place. This change will fix it.
--- lib/librte_pmd_i40e/i40e_ethdev.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)
lib/librte_pmd_i40e/i40e_ethdev.c +4 -7
@@ -4163,8 +4163,8 @@ i40e_find_vlan_filter(struct i40e_vsi *vsi, {uint32_t vid_idx, vid_bit; - vid_idx = (uint32_t ) ((vlan_id >>5 ) &0x7F ); - vid_bit = (uint32_t ) (1 << (vlan_id &0x1F )); + vid_idx = (uint32_t )(vlan_id /I40E_UINT32_BIT_SIZE ); + vid_bit = (uint32_t )(1 << (vlan_id %I40E_UINT32_BIT_SIZE ));if (vsi->vfta[vid_idx] & vid_bit)return 1 ;
@@ -4178,14 +4178,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, {uint32_t vid_idx, vid_bit; -#define UINT32_BIT_MASK 0x1F -#define VALID_VLAN_BIT_MASK 0xFFF/* VFTA is 32-bits size array, each element contains 32 vlan bits, Find the * element first, then find the bits it belongs to */ - vid_idx = (uint32_t ) ((vlan_id &VALID_VLAN_BIT_MASK ) >> -sizeof (uint32_t )); - vid_bit = (uint32_t ) (1 << (vlan_id &UINT32_BIT_MASK )); + vid_idx = (uint32_t )(vlan_id /I40E_UINT32_BIT_SIZE ); + vid_bit = (uint32_t )(1 << (vlan_id %I40E_UINT32_BIT_SIZE ));if (on) vsi->vfta[vid_idx] |= vid_bit;
Signature · 1 line
1.7.7.6
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this issue.
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2] lib/librte_pmd_i40e: set vlan filter fix
please ignore my comments :)
But you both calculation are different.
Thanks,
Michael
Quoted 43 lines · Chen Jing D(Mark)
From: "Chen Jing D(Mark)" <[email protected]>
i40e uses an bitmap array to store those vlan tags that are set by application. In function
i40e_set_vlan_filter, it stores vlan tag to wrong place. This change will fix it.Signed-off-by Chen Jing D(Mark) <[email protected]>--- lib/librte_pmd_i40e/i40e_ethdev.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)lib/librte_pmd_i40e/i40e_ethdev.c +4
-7@@ -4163,8 +4163,8 @@ i40e_find_vlan_filter(struct i40e_vsi *vsi, {uint32_t vid_idx, vid_bit; - vid_idx = (uint32_t ) ((vlan_id >>5 ) &0x7F ); - vid_bit = (uint32_t ) (1 << (vlan_id &0x1F )); + vid_idx = (uint32_t )(vlan_id /I40E_UINT32_BIT_SIZE ); + vid_bit = (uint32_t )(1 << (vlan_id %I40E_UINT32_BIT_SIZE ));if (vsi->vfta[vid_idx] & vid_bit)return 1 ;@@ -4178,14 +4178,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, {uint32_t vid_idx, vid_bit; -#define UINT32_BIT_MASK 0x1F -#define VALID_VLAN_BIT_MASK 0xFFF/* VFTA is 32-bits size array, each element contains 32 vlan bits, Find the * element first, then find the bits it belongs to */ - vid_idx = (uint32_t ) ((vlan_id &VALID_VLAN_BIT_MASK ) >> -sizeof (uint32_t )); - vid_bit = (uint32_t ) (1 << (vlan_id &UINT32_BIT_MASK )); + vid_idx = (uint32_t )(vlan_id /I40E_UINT32_BIT_SIZE ); + vid_bit = (uint32_t )(1 << (vlan_id %I40E_UINT32_BIT_SIZE ));if (on) vsi->vfta[vid_idx] |= vid_bit;
Yes, the same to his. As he is in vacation, I'd like to send out patch for him.
Quoted 67 lines
-----Original Message-----
From: Qiu, Michael
Sent: Thursday, December 04, 2014 6:19 PM
To: Chen, Jing D; [email protected]
Cc: Xie, Huawei
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bugHi Mark,
I think Huawei ([email protected]) has one patch set to fix this issue.
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Thanks,
MichaelQuoted 6 lines · Chen Jing D(Mark)
From: "Chen Jing D(Mark)" <[email protected]>
i40e uses an bitmap array to store those vlan tags that are set by application. In function
i40e_set_vlan_filter, it stores vlan tag to wrong place. This change will fix it.Review
Quoted 6 lines
Signed-off-by Chen Jing D(Mark) <[email protected]>--- lib/librte_pmd_i40e/i40e_ethdev.c | 11 ++++------- 1 files changed, 4 insertions(+), 7 deletions(-)(quoted diff) +0
-0
b/lib/librte_pmd_i40e/i40e_ethdev.cQuoted 15 lines
index 87e750a..cebc21d 100644
lib/librte_pmd_i40e/i40e_ethdev.c +2
-2@@ -4163,8 +4163,8 @@ i40e_find_vlan_filter(struct i40e_vsi *vsi, {uint32_t vid_idx, vid_bit; - vid_idx = (uint32_t ) ((vlan_id >>5 ) &0x7F ); - vid_bit = (uint32_t ) (1 << (vlan_id &0x1F )); + vid_idx = (uint32_t )(vlan_id /I40E_UINT32_BIT_SIZE ); + vid_bit = (uint32_t )(1 << (vlan_id %I40E_UINT32_BIT_SIZE ));if (vsi->vfta[vid_idx] & vid_bit)return 1 ;lib/librte_pmd_i40e/i40e_ethdev.c i40e_set_vlan_filter(struct i40e_vsi *vsi, · line 4181
Quoted 6 lines
lib/librte_pmd_i40e/i40e_ethdev.c +0
-2@@ -4178,14 +4178,11 @@ i40e_set_vlan_filter(struct i40e_vsi *vsi, {uint32_t vid_idx, vid_bit; -#define UINT32_BIT_MASK 0x1F -#define VALID_VLAN_BIT_MASK 0xFFF/* VFTA is 32-bits size array, each element contains 32 vlan bits, Find the
Quoted 10 lines
lib/librte_pmd_i40e/i40e_ethdev.c +2
-3* element first, then find the bits it belongs to */ - vid_idx = (uint32_t ) ((vlan_id &VALID_VLAN_BIT_MASK ) >> -sizeof (uint32_t )); - vid_bit = (uint32_t ) (1 << (vlan_id &UINT32_BIT_MASK )); + vid_idx = (uint32_t )(vlan_id /I40E_UINT32_BIT_SIZE ); + vid_bit = (uint32_t )(1 << (vlan_id %I40E_UINT32_BIT_SIZE ));if (on) vsi->vfta[vid_idx] |= vid_bit;
2014-12-04 10:18, Qiu, Michael:
Quoted 11 lines
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this issue.
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Yes, please Jing (Mark), if you reworked the v4 patch, it would clearer to have a changelog, to name it v5 and to insert it in the previous thread with --in-reply-to.
At the moment, both patches block each other.
Signature · 1 line
Thomas
As I don't know what commit he is based on, I'd like to generate a new patch with latest dpdk repo.
Quoted 27 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 04, 2014 6:26 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug2014-12-04 10:18, Qiu, Michael:
Quoted 11 lines
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this issue.
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Yes, please Jing (Mark), if you reworked the v4 patch, it would clearer to have a changelog, to name it v5 and to insert it in the previous thread with --in-reply-to.
At the moment, both patches block each other.--
Thomas
2014-12-04 10:30, Chen, Jing D:
Quoted 1 line
As I don't know what commit he is based on, I'd like to generate a new patch with latest dpdk repo.
There's something wrong here. You rework a patch and you don't know what was the current status but you expect that the reviewers can understand it better than you?
You are breaking all the elementary rules of patch management. We have currently 2 fixes pending for the same bug.
PS: please don't top post.
Signature · 1 line
Thomas
Quoted 27 lines
Quoted 27 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 04, 2014 6:26 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug2014-12-04 10:18, Qiu, Michael:
Quoted 11 lines
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this issue.
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Yes, please Jing (Mark), if you reworked the v4 patch, it would clearer to have a changelog, to name it v5 and to insert it in the previous thread with --in-reply-to.
At the moment, both patches block each other.--
Thomas
Quoted 9 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 4, 2014 6:39 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug
Quoted 7 lines
2014-12-04 10:30, Chen, Jing D:
Quoted 1 line
As I don't know what commit he is based on, I'd like to generate a new
patch with latest dpdk repo.
There's something wrong here. You rework a patch and you don't know what was the current status but you expect that the reviewers can understand it better than you?
You don't understand me. Please read my above words again.
As I said, he is in vacation, I came to fix problem. I know exactly what's the problem. So, I used simple way.
Quoted 1 line
You are breaking all the elementary rules of patch management.
Please kindly list all the elementary rules of patch management, please. If possible, can you post it somewhere so other new guys can find and follow?
Quoted 3 lines
We have currently 2 fixes pending for the same bug.
PS: please don't top post.
I apologized for top post.
Quoted 32 lines
--
ThomasQuoted 11 lines
Quoted 11 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 04, 2014 6:26 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug2014-12-04 10:18, Qiu, Michael:
Quoted 3 lines
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this
issue.
Quoted 16 lines
Quoted 16 lines
Quoted 8 lines
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Yes, please Jing (Mark), if you reworked the v4 patch, it would clearer to have a changelog, to name it v5 and to insert it in the previous thread with --in-reply-to.
At the moment, both patches block each other.--
Thomas
2014-12-04 14:29, Chen, Jing D:
Quoted 10 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 7 lines
2014-12-04 10:30, Chen, Jing D:
Quoted 1 line
As I don't know what commit he is based on, I'd like to generate a new
patch with latest dpdk repo.
There's something wrong here. You rework a patch and you don't know what was the current status but you expect that the reviewers can understand it better than you?
You don't understand me. Please read my above words again.
Yes there probably is a misunderstanding.
Quoted 1 line
As I said, he is in vacation, I came to fix problem. I know exactly what's the problem. So, I used simple way.
So Huawei was trying to fix the bug and you suggest another way to fix it. But you didn't explain why your fix is better than the previous one. And we don't know if it's the continuation of his work or not. If you are trying to fix exactly the same problem, incrementing the version number of the patch makes clear that previous version doesn't need to be reviewed, reworked or applied. In patchwork language, it supersedes the previous patch which won't appear anymore.
Quoted 4 lines
Quoted 1 line
You are breaking all the elementary rules of patch management.
Please kindly list all the elementary rules of patch management, please. If possible, can you post it somewhere so other new guys can find and follow?
They are explained in http://dpdk.org/dev#send.
That's the ones I've enumerated in my first email:
- changelog
- increment version number (v5 here)
- use --in-reply-to
Quoted 1 line
Quoted 1 line
We have currently 2 fixes pending for the same bug.
To sum it up, we need:
1) a review
2) an agreement that the Huawei's fix is superseded by this one
Thank you
Signature · 1 line
Thomas
Quoted 37 lines
Quoted 1 line
PS: please don't top post.
I apologized for top post.
Quoted 32 lines
--
ThomasQuoted 11 lines
Quoted 11 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 04, 2014 6:26 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug2014-12-04 10:18, Qiu, Michael:
Quoted 3 lines
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this
issue.
Quoted 16 lines
Quoted 16 lines
Quoted 8 lines
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Yes, please Jing (Mark), if you reworked the v4 patch, it would clearer to have a changelog, to name it v5 and to insert it in the previous thread with --in-reply-to.
At the moment, both patches block each other.--
Thomas
Hi Thomas:
I will continue work on this fix.
Do you have comments to the v4 patch?
For Bruce's comment, I add some descriptive commit message for the commit. For the constant number, I define a macro as the wrapper for the VFA array index and value.
One question is it isn't based on latest commit, but I tried applying the patch, there is no problem. +/*
+ * vlan_id is a 12 bit number.
+ * The VFTA array is actually a 4096 bit array, 128 of 32bit elements.
+ * 2^5 = 32. The val of lower 5 bits specifies the bit in the 32bit element.
+ * The higher 7 bit val specifies VFTA array index.
+ */
+#define I40E_VFTA_BIT(vlan_id) (1 << ((vlan_id) & 0x1F))
+#define I40E_VFTA_IDX(vlan_id) ((vlan_id) >> 5)
Hi,
Quoted 25 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 4, 2014 11:33 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bug2014-12-04 14:29, Chen, Jing D:
Quoted 11 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 8 lines
2014-12-04 10:30, Chen, Jing D:
Quoted 2 lines
As I don't know what commit he is based on, I'd like to generate a new
patch with latest dpdk repo.
There's something wrong here. You rework a patch and you don't know what was the current status but you expect that the reviewers can understand it better than you?
You don't understand me. Please read my above words again.
Yes there probably is a misunderstanding.
Quoted 1 line
As I said, he is in vacation, I came to fix problem. I know exactly what's the
problem. So, I used simple way.
Quoted 8 lines
So Huawei was trying to fix the bug and you suggest another way to fix it. But you didn't explain why your fix is better than the previous one. And we don't know if it's the continuation of his work or not. If you are trying to fix exactly the same problem, incrementing the version number of the patch makes clear that previous version doesn't need to be reviewed, reworked or applied. In patchwork language, it supersedes the previous patch which won't appear anymore.
OK, I prefer to follow Huawei's patch set and drop my commit.
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
You are breaking all the elementary rules of patch management.
Please kindly list all the elementary rules of patch management, please. If possible, can you post it somewhere so other new guys can find and
Quoted 8 lines
follow?
They are explained in http://dpdk.org/dev#send.
That's the ones I've enumerated in my first email:
- changelog
- increment version number (v5 here)
- use --in-reply-to
Thanks for explanation.
Quoted 49 lines
Quoted 1 line
Quoted 1 line
We have currently 2 fixes pending for the same bug.
To sum it up, we need:
1) a review
2) an agreement that the Huawei's fix is superseded by this oneThank you
--
ThomasQuoted 39 lines
Quoted 1 line
PS: please don't top post.
I apologized for top post.
Quoted 34 lines
--
ThomasQuoted 7 lines
Quoted 7 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, December 04, 2014 6:26 PM
To: Chen, Jing D
Cc: [email protected]; Qiu, Michael
Subject: Re: [dpdk-dev] [PATCH] i40e: Fix a vlan bugQuoted 5 lines
Quoted 5 lines
2014-12-04 10:18, Qiu, Michael:
Quoted 4 lines
Hi Mark,
I think Huawei ([email protected]) has one patch set to fix this
issue.
Quoted 17 lines
Quoted 17 lines
Quoted 9 lines
If your patch is totally different with him:
[dpdk-dev] [PATCH v4 0/2]
lib/librte_pmd_i40e: set vlan filter fixplease ignore my comments :)
But you both calculation are different.
Yes, please Jing (Mark), if you reworked the v4 patch, it would clearer to have a changelog, to name it v5 and to insert it in the previous thread with --in-reply-to.
At the moment, both patches block each other.--
Thomas
Hi Huawei,
2014-12-05 04:56, Xie, Huawei:
Quoted 7 lines
Hi Thomas:
I will continue work on this fix.
Do you have comments to the v4 patch?
For Bruce's comment, I add some descriptive commit message for the commit. For the constant number, I define a macro as the wrapper for the VFA array index and value.One question is it isn't based on latest commit, but I tried applying the patch, there is no problem.
Review
Quoted 8 lines
(quoted diff) +8
-0+/* + * vlan_id is a 12 bit number. + * The VFTA array is actually a 4096 bit array, 128 of 32bit elements. + * 2^5 = 32. The val of lower 5 bits specifies the bit in the 32bit element. + * The higher 7 bit val specifies VFTA array index. + */ +#define I40E_VFTA_BIT(vlan_id) (1 << ((vlan_id) & 0x1F)) +#define I40E_VFTA_IDX(vlan_id) ((vlan_id) >> 5)
If you replace the values by constants, it's ok for me. Note that I won't check the i40e datasheet so you need a reviewer who will do :)
Signature · 1 line
Thomas