[RFC,v2,07/14] bpf: remove log level in internal helper

Message ID 20231208145950.2184940-8-david.marchand@redhat.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Detect superfluous newline in logs |

Commit Message

David Marchand Dec. 8, 2023, 2:59 p.m. UTC
  There is no other log level than debug, simplify this helper.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/bpf/bpf_validate.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
  

Comments

Stephen Hemminger Dec. 8, 2023, 5:04 p.m. UTC | #1
On Fri,  8 Dec 2023 15:59:41 +0100
David Marchand <david.marchand@redhat.com> wrote:

> There is no other log level than debug, simplify this helper.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>

Acked-by: Stephen Hemminger <stephen@networkplumber.org>
  
Tyler Retzlaff Dec. 8, 2023, 9:02 p.m. UTC | #2
On Fri, Dec 08, 2023 at 03:59:41PM +0100, David Marchand wrote:
> There is no other log level than debug, simplify this helper.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  

Patch

diff --git a/lib/bpf/bpf_validate.c b/lib/bpf/bpf_validate.c
index 95b9ef99ef..f246b3c5eb 100644
--- a/lib/bpf/bpf_validate.c
+++ b/lib/bpf/bpf_validate.c
@@ -2178,18 +2178,18 @@  restore_eval_state(struct bpf_verifier *bvf, struct inst_node *node)
 }
 
 static void
-log_eval_state(const struct bpf_verifier *bvf, const struct ebpf_insn *ins,
-	uint32_t pc, int32_t loglvl)
+log_dbg_eval_state(const struct bpf_verifier *bvf, const struct ebpf_insn *ins,
+	uint32_t pc)
 {
 	const struct bpf_eval_state *st;
 	const struct bpf_reg_val *rv;
 
-	rte_log(loglvl, rte_bpf_logtype, "%s(pc=%u):\n", __func__, pc);
+	RTE_BPF_LOG(DEBUG, "%s(pc=%u):\n", __func__, pc);
 
 	st = bvf->evst;
 	rv = st->rv + ins->dst_reg;
 
-	rte_log(loglvl, rte_bpf_logtype,
+	RTE_BPF_LOG(DEBUG,
 		"r%u={\n"
 		"\tv={type=%u, size=%zu},\n"
 		"\tmask=0x%" PRIx64 ",\n"
@@ -2269,7 +2269,7 @@  evaluate(struct bpf_verifier *bvf)
 				}
 			}
 
-			log_eval_state(bvf, ins + idx, idx, RTE_LOG_DEBUG);
+			log_dbg_eval_state(bvf, ins + idx, idx);
 			bvf->evin = NULL;
 		}