Skip to contentSkip to conversation

ipvs: adjust the debug info in function set_tcp_state

PATCH Superseded longguang.yue 4 participants 9 messages Sep 27, 2020 – Oct 20, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 ipvs: adjust the debug info in function set_tcp_state

outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

---
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -4
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 	if (new_state != cp->state) {
 		struct ip_vs_dest *dest = cp->dest;
 
-		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-			      "%s:%d state: %s->%s conn->refcnt:%d\n",
+		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+			      "d:%s:%d state: %s->%s conn->refcnt:%d\n",
 			      pd->pp->name,
 			      ((state_off == TCP_DIR_OUTPUT) ?
 			       "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 			      th->fin ? 'F' : '.',
 			      th->ack ? 'A' : '.',
 			      th->rst ? 'R' : '.',
-			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-			      ntohs(cp->dport),
 			      IP_VS_DBG_ADDR(cp->af, &cp->caddr),
 			      ntohs(cp->cport),
+			      IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+			      ntohs(cp->vport),
+			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+			      ntohs(cp->dport),
 			      tcp_state_name(cp->state),
 			      tcp_state_name(new_state),
 			      refcount_read(&cp->refcnt));
Signature · 1 line
2.20.1 (Apple Git-117)
maintainer Acked-by on v4 1/1
#1 lore raw

Hello,

Quoted 4 lines · longguang.yue

outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

Looks good to me, thanks!

Simon, Pablo, may be commit description should not
be indented...

Quoted 36 lines
---
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -4
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 	if (new_state != cp->state) {
 		struct ip_vs_dest *dest = cp->dest;
 
-		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-			      "%s:%d state: %s->%s conn->refcnt:%d\n",
+		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+			      "d:%s:%d state: %s->%s conn->refcnt:%d\n",
 			      pd->pp->name,
 			      ((state_off == TCP_DIR_OUTPUT) ?
 			       "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 			      th->fin ? 'F' : '.',
 			      th->ack ? 'A' : '.',
 			      th->rst ? 'R' : '.',
-			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-			      ntohs(cp->dport),
 			      IP_VS_DBG_ADDR(cp->af, &cp->caddr),
 			      ntohs(cp->cport),
+			      IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+			      ntohs(cp->vport),
+			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+			      ntohs(cp->dport),
 			      tcp_state_name(cp->state),
 			      tcp_state_name(new_state),
 			      refcount_read(&cp->refcnt));
Signature · 1 line
2.20.1 (Apple Git-117)

Regards

--
Julian Anastasov <[email protected]>

#2 lore raw

PATCH v5 1/1 ipvs: adjust the debug info in function set_tcp_state

Outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

---
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -4
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 	if (new_state != cp->state) {
 		struct ip_vs_dest *dest = cp->dest;
 
-		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-			      "%s:%d state: %s->%s conn->refcnt:%d\n",
+		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+			      "d:%s:%d state: %s->%s conn->refcnt:%d\n",
 			      pd->pp->name,
 			      ((state_off == TCP_DIR_OUTPUT) ?
 			       "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 			      th->fin ? 'F' : '.',
 			      th->ack ? 'A' : '.',
 			      th->rst ? 'R' : '.',
-			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-			      ntohs(cp->dport),
 			      IP_VS_DBG_ADDR(cp->af, &cp->caddr),
 			      ntohs(cp->cport),
+			      IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+			      ntohs(cp->vport),
+			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+			      ntohs(cp->dport),
 			      tcp_state_name(cp->state),
 			      tcp_state_name(new_state),
 			      refcount_read(&cp->refcnt));
Signature · 1 line
2.20.1 (Apple Git-117)
#3 lore raw

I sincerely apologize for the trouble which takes up much of your time. If the last patch does not work , would you please fix it? thanks

Quoted 42 lines · longguang.yue

Outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

---
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -5
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
        if (new_state != cp->state) {
                struct ip_vs_dest *dest = cp->dest;
 
-               IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-                             "%s:%d state: %s->%s conn->refcnt:%d\n",
+               IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+                             "d:%s:%d state: %s->%s conn->refcnt:%d\n",
                              pd->pp->name,
                              ((state_off == TCP_DIR_OUTPUT) ?
                               "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
                              th->fin ? 'F' : '.',
                              th->ack ? 'A' : '.',
                              th->rst ? 'R' : '.',
-                             IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-                             ntohs(cp->dport),
                              IP_VS_DBG_ADDR(cp->af, &cp->caddr),
                              ntohs(cp->cport),
+                             IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+                             ntohs(cp->vport),
+                             IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+                             ntohs(cp->dport),
                              tcp_state_name(cp->state),
                              tcp_state_name(new_state),
                              refcount_read(&cp->refcnt));
--

2.20.1 (Apple Git-117)

#4 lore raw

Julian, Pablo, Simon, Hi, ping

Quoted 48 lines · yue longguang

I sincerely apologize for the trouble which takes up much of your time. If the last patch does not work , would you please fix it? thanks

Quoted 42 lines · longguang.yue

Outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

---
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -5
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
        if (new_state != cp->state) {
                struct ip_vs_dest *dest = cp->dest;
 
-               IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-                             "%s:%d state: %s->%s conn->refcnt:%d\n",
+               IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+                             "d:%s:%d state: %s->%s conn->refcnt:%d\n",
                              pd->pp->name,
                              ((state_off == TCP_DIR_OUTPUT) ?
                               "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
                              th->fin ? 'F' : '.',
                              th->ack ? 'A' : '.',
                              th->rst ? 'R' : '.',
-                             IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-                             ntohs(cp->dport),
                              IP_VS_DBG_ADDR(cp->af, &cp->caddr),
                              ntohs(cp->cport),
+                             IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+                             ntohs(cp->vport),
+                             IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+                             ntohs(cp->dport),
                              tcp_state_name(cp->state),
                              tcp_state_name(new_state),
                              refcount_read(&cp->refcnt));
--

2.20.1 (Apple Git-117)

maintainer Acked-by on v5 1/1
#5 lore raw
In reply to longguang.yue

Hello,

Quoted 4 lines · longguang.yue

Outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

OK, v5 can be used instead of fixing v4.

Quoted 1 line

---

longguang.yue, at this place after --- you can add info
for changes between versions, eg:
v5: fix indentation

Use this for other patches, so that we know what is
changed between versions.

Quoted 35 lines
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -4
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 	if (new_state != cp->state) {
 		struct ip_vs_dest *dest = cp->dest;
 
-		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-			      "%s:%d state: %s->%s conn->refcnt:%d\n",
+		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+			      "d:%s:%d state: %s->%s conn->refcnt:%d\n",
 			      pd->pp->name,
 			      ((state_off == TCP_DIR_OUTPUT) ?
 			       "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 			      th->fin ? 'F' : '.',
 			      th->ack ? 'A' : '.',
 			      th->rst ? 'R' : '.',
-			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-			      ntohs(cp->dport),
 			      IP_VS_DBG_ADDR(cp->af, &cp->caddr),
 			      ntohs(cp->cport),
+			      IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+			      ntohs(cp->vport),
+			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+			      ntohs(cp->dport),
 			      tcp_state_name(cp->state),
 			      tcp_state_name(new_state),
 			      refcount_read(&cp->refcnt));
Signature · 1 line
2.20.1 (Apple Git-117)

Regards

--
Julian Anastasov <[email protected]>

#6 lore raw

It's done.

Quoted 71 lines · Julian Anastasov

Hello,

Quoted 4 lines · longguang.yue

Outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

OK, v5 can be used instead of fixing v4.

Quoted 1 line

---

Changelogs:
v5: fix indentation
v4: fix checkpatch
v3: fix checkpatch
v2: IP_VS_DBG_BUF outputs src,virtual,dst of ip_vs_conn
v1: fix the inverse of src and dst address

longguang.yue, at this place after --- you can add info
for changes between versions, eg:
v5: fix indentation

Use this for other patches, so that we know what is
changed between versions.

Quoted 34 lines
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -5
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
      if (new_state != cp->state) {
              struct ip_vs_dest *dest = cp->dest;
 
-             IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-                           "%s:%d state: %s->%s conn->refcnt:%d\n",
+             IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+                           "d:%s:%d state: %s->%s conn->refcnt:%d\n",
                            pd->pp->name,
                            ((state_off == TCP_DIR_OUTPUT) ?
                             "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
                            th->fin ? 'F' : '.',
                            th->ack ? 'A' : '.',
                            th->rst ? 'R' : '.',
-                           IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-                           ntohs(cp->dport),
                            IP_VS_DBG_ADDR(cp->af, &cp->caddr),
                            ntohs(cp->cport),
+                           IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+                           ntohs(cp->vport),
+                           IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+                           ntohs(cp->dport),
                            tcp_state_name(cp->state),
                            tcp_state_name(new_state),
                            refcount_read(&cp->refcnt));
--
Quoted 1 line

2.20.1 (Apple Git-117)

Regards

--
Julian Anastasov <[email protected]>

#7 lore raw

PATCH v6 1/1 ipvs: adjust the debug info in function set_tcp_state

In reply to Julian Anastasov

Outputting client,virtual,dst addresses info when tcp state changes, which makes the connection debug more clear

---
v5,v6: fix indentation and add changelogs v3,v4: fix checkpatch
v2: IP_VS_DBG_BUF outputs src,virtual,dst of ip_vs_conn
v1: fix the inverse of src and dst address

---
 net/netfilter/ipvs/ip_vs_proto_tcp.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
net/netfilter/ipvs/ip_vs_proto_tcp.c +6 -4
index dc2e7da2742a..7da51390cea6 100644
@@ -539,8 +539,8 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 	if (new_state != cp->state) {
 		struct ip_vs_dest *dest = cp->dest;
 
-		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] %s:%d->"
-			      "%s:%d state: %s->%s conn->refcnt:%d\n",
+		IP_VS_DBG_BUF(8, "%s %s [%c%c%c%c] c:%s:%d v:%s:%d "
+			      "d:%s:%d state: %s->%s conn->refcnt:%d\n",
 			      pd->pp->name,
 			      ((state_off == TCP_DIR_OUTPUT) ?
 			       "output " : "input "),
@@ -548,10 +548,12 @@ set_tcp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
 			      th->fin ? 'F' : '.',
 			      th->ack ? 'A' : '.',
 			      th->rst ? 'R' : '.',
-			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
-			      ntohs(cp->dport),
 			      IP_VS_DBG_ADDR(cp->af, &cp->caddr),
 			      ntohs(cp->cport),
+			      IP_VS_DBG_ADDR(cp->af, &cp->vaddr),
+			      ntohs(cp->vport),
+			      IP_VS_DBG_ADDR(cp->daf, &cp->daddr),
+			      ntohs(cp->dport),
 			      tcp_state_name(cp->state),
 			      tcp_state_name(new_state),
 			      refcount_read(&cp->refcnt));
Signature · 1 line
2.20.1 (Apple Git-117)