Skip to contentSkip to conversation

mbuf: remove unused next member

PATCH In review Xiaolong Ye 4 participants 7 messages Jun 9, 2020 – Jun 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mbuf: remove unused next member

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

---

I found this issue when reading the mbuf dynfiled/dynflag feature code, mbuf_autotest is passed with this change, though I may miss something or this filed has some special design purpose, please correct me if I am wrong.

 lib/librte_mbuf/rte_mbuf_dyn.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_mbuf/rte_mbuf_dyn.c +0 -2
index d6931f847..953e3ec31 100644
@@ -19,7 +19,6 @@
 #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"
 
 struct mbuf_dynfield_elt {
-	TAILQ_ENTRY(mbuf_dynfield_elt) next;
 	struct rte_mbuf_dynfield params;
 	size_t offset;
 };
@@ -31,7 +30,6 @@ static struct rte_tailq_elem mbuf_dynfield_tailq = {
 EAL_REGISTER_TAILQ(mbuf_dynfield_tailq);
 
 struct mbuf_dynflag_elt {
-	TAILQ_ENTRY(mbuf_dynflag_elt) next;
 	struct rte_mbuf_dynflag params;
 	unsigned int bitnum;
 };
Signature · 1 line
2.17.1
Acked-by on v1 1/1
#1 lore raw

Hi Xialong,

Quoted 9 lines · Xiaolong Ye

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

Good catch, I forgot to remove this field which was used in former implementations. Thanks!

I suggest to update the title to highlight it's about dynamic mbuf:
mbuf: remove unused next member in dyn flag/field

Apart from this:

Quoted 33 lines

---

I found this issue when reading the mbuf dynfiled/dynflag feature code, mbuf_autotest is passed with this change, though I may miss something or this filed has some special design purpose, please correct me if I am wrong.

 lib/librte_mbuf/rte_mbuf_dyn.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_mbuf/rte_mbuf_dyn.c +0 -2
index d6931f847..953e3ec31 100644
@@ -19,7 +19,6 @@
 #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"
 
 struct mbuf_dynfield_elt {
-	TAILQ_ENTRY(mbuf_dynfield_elt) next;
 	struct rte_mbuf_dynfield params;
 	size_t offset;
 };
@@ -31,7 +30,6 @@ static struct rte_tailq_elem mbuf_dynfield_tailq = {
 EAL_REGISTER_TAILQ(mbuf_dynfield_tailq);
 
 struct mbuf_dynflag_elt {
-	TAILQ_ENTRY(mbuf_dynflag_elt) next;
 	struct rte_mbuf_dynflag params;
 	unsigned int bitnum;
 };
Signature · 1 line
2.17.1
#2 lore raw
Quoted 13 lines · Olivier Matz

Hi Xialong,

Quoted 9 lines · Xiaolong Ye

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")
Quoted 8 lines

Good catch, I forgot to remove this field which was used in former implementations. Thanks!

I suggest to update the title to highlight it's about dynamic mbuf:
mbuf: remove unused next member in dyn flag/field

Apart from this:

Thanks for the ack, I'll submit V2 with suggested subject.

Thanks,
Xiaolong

Quoted 34 lines
Quoted 34 lines

---

I found this issue when reading the mbuf dynfiled/dynflag feature code, mbuf_autotest is passed with this change, though I may miss something or this filed has some special design purpose, please correct me if I am wrong.

 lib/librte_mbuf/rte_mbuf_dyn.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_mbuf/rte_mbuf_dyn.c +0 -2
index d6931f847..953e3ec31 100644
@@ -19,7 +19,6 @@
 #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"
 
 struct mbuf_dynfield_elt {
-	TAILQ_ENTRY(mbuf_dynfield_elt) next;
 	struct rte_mbuf_dynfield params;
 	size_t offset;
 };
@@ -31,7 +30,6 @@ static struct rte_tailq_elem mbuf_dynfield_tailq = {
 EAL_REGISTER_TAILQ(mbuf_dynfield_tailq);
 
 struct mbuf_dynflag_elt {
-	TAILQ_ENTRY(mbuf_dynflag_elt) next;
 	struct rte_mbuf_dynflag params;
 	unsigned int bitnum;
 };
Signature · 1 line
2.17.1
#3 lore raw
Quoted 20 lines · On Tue, 9 Jun 2020 15:15:33 +0800 Ye Xiaolong <[email protected]> wrote:
Quoted 19 lines · Olivier Matz

Hi Xialong,

Quoted 9 lines · Xiaolong Ye

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

Good catch, I forgot to remove this field which was used in former implementations. Thanks!

I suggest to update the title to highlight it's about dynamic mbuf:
mbuf: remove unused next member in dyn flag/field

Quoted 7 lines
Quoted 2 lines

Apart from this:

Thanks for the ack, I'll submit V2 with suggested subject.

Thanks,
Xiaolong

Is the field visible in ABI?

#4 lore raw
Quoted 26 lines · Stephen Hemminger
Quoted 23 lines · On Tue, 9 Jun 2020 15:15:33 +0800 Ye Xiaolong <[email protected]> wrote:
Quoted 21 lines · Olivier Matz

Hi Xialong,

Quoted 9 lines · Xiaolong Ye

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

Good catch, I forgot to remove this field which was used in former implementations. Thanks!

I suggest to update the title to highlight it's about dynamic mbuf:
mbuf: remove unused next member in dyn flag/field

Apart from this:

Quoted 6 lines
Quoted 4 lines

Thanks for the ack, I'll submit V2 with suggested subject.

Thanks,
Xiaolong

Is the field visible in ABI?

I don't think so, the touched structs in this patch mbuf_dynfield_elt and mbuf_dynflag_elt are internal structures used in rte_mbuf_dyn.c, and structures exposed to user are struct rte_mbuf_dynfield and rte_mbuf_dynflag in rte_mbuf_dyn.h, and they still keep the same as before, so there should be no ABI break in this patch.

Thanks,
Xiaolong

#5 lore raw

PATCH v2 1/1 mbuf: remove unused next member in dyn flag/field

In reply to Xiaolong Ye

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

---

V2: update subject as Olivier suggested.

 lib/librte_mbuf/rte_mbuf_dyn.c | 2 --
 1 file changed, 2 deletions(-)
lib/librte_mbuf/rte_mbuf_dyn.c +0 -2
index d6931f847..953e3ec31 100644
@@ -19,7 +19,6 @@
 #define RTE_MBUF_DYN_MZNAME "rte_mbuf_dyn"
 
 struct mbuf_dynfield_elt {
-	TAILQ_ENTRY(mbuf_dynfield_elt) next;
 	struct rte_mbuf_dynfield params;
 	size_t offset;
 };
@@ -31,7 +30,6 @@ static struct rte_tailq_elem mbuf_dynfield_tailq = {
 EAL_REGISTER_TAILQ(mbuf_dynfield_tailq);
 
 struct mbuf_dynflag_elt {
-	TAILQ_ENTRY(mbuf_dynflag_elt) next;
 	struct rte_mbuf_dynflag params;
 	unsigned int bitnum;
 };
Signature · 1 line
2.17.1
#6 lore raw

Re: [dpdk-dev] [PATCH v2] mbuf: remove unused next member in dyn flag/field

09/06/2020 09:12, Xiaolong Ye:

Quoted 10 lines

TAILQ_ENTRY next is not needed in struct mbuf_dynfield_elt and mbuf_dynflag_elt, since they are actually chained by rte_tailq_entry's next field when calling TAILQ_INSERT_TAIL(mbuf_dynfield/dynflag_list, te, next).

Fixes 4958ca3a443a ("mbuf: support dynamic fields and flags")

Applied, thanks