MCPcopy Create free account
hub / github.com/F-Stack/f-stack / eval_jeq_jne

Function eval_jeq_jne

dpdk/lib/bpf/bpf_validate.c:1032–1058  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1030}
1031
1032static void
1033eval_jeq_jne(struct bpf_reg_val *trd, struct bpf_reg_val *trs)
1034{
1035 /* sreg is constant */
1036 if (trs->u.min == trs->u.max) {
1037 trd->u = trs->u;
1038 /* dreg is constant */
1039 } else if (trd->u.min == trd->u.max) {
1040 trs->u = trd->u;
1041 } else {
1042 trd->u.max = RTE_MIN(trd->u.max, trs->u.max);
1043 trd->u.min = RTE_MAX(trd->u.min, trs->u.min);
1044 trs->u = trd->u;
1045 }
1046
1047 /* sreg is constant */
1048 if (trs->s.min == trs->s.max) {
1049 trd->s = trs->s;
1050 /* dreg is constant */
1051 } else if (trd->s.min == trd->s.max) {
1052 trs->s = trd->s;
1053 } else {
1054 trd->s.max = RTE_MIN(trd->s.max, trs->s.max);
1055 trd->s.min = RTE_MAX(trd->s.min, trs->s.min);
1056 trs->s = trd->s;
1057 }
1058}
1059
1060static void
1061eval_jgt_jle(struct bpf_reg_val *trd, struct bpf_reg_val *trs,

Callers 1

eval_jccFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected