Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'fix-BPF-offload-related-bugs'

Jakub Kicinski says:

====================
fix BPF offload related bugs

test_offload.py catches some recently added bugs.

First of a bug in test_offload.py itself after recent changes
to netdevsim is fixed.

Second patch fixes a bug in cls_bpf, and last one addresses
a problem with the recently added XDP installation optimization.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+13 -3
+2 -1
net/core/dev.c
··· 8421 8421 return -EINVAL; 8422 8422 } 8423 8423 8424 - if (prog->aux->id == prog_id) { 8424 + /* prog->aux->id may be 0 for orphaned device-bound progs */ 8425 + if (prog->aux->id && prog->aux->id == prog_id) { 8425 8426 bpf_prog_put(prog); 8426 8427 return 0; 8427 8428 }
+6 -2
net/sched/cls_bpf.c
··· 162 162 cls_bpf.name = obj->bpf_name; 163 163 cls_bpf.exts_integrated = obj->exts_integrated; 164 164 165 - if (oldprog) 165 + if (oldprog && prog) 166 166 err = tc_setup_cb_replace(block, tp, TC_SETUP_CLSBPF, &cls_bpf, 167 167 skip_sw, &oldprog->gen_flags, 168 168 &oldprog->in_hw_count, 169 169 &prog->gen_flags, &prog->in_hw_count, 170 170 true); 171 - else 171 + else if (prog) 172 172 err = tc_setup_cb_add(block, tp, TC_SETUP_CLSBPF, &cls_bpf, 173 173 skip_sw, &prog->gen_flags, 174 174 &prog->in_hw_count, true); 175 + else 176 + err = tc_setup_cb_destroy(block, tp, TC_SETUP_CLSBPF, &cls_bpf, 177 + skip_sw, &oldprog->gen_flags, 178 + &oldprog->in_hw_count, true); 175 179 176 180 if (prog && err) { 177 181 cls_bpf_offload_cmd(tp, oldprog, prog, extack);
+5
tools/testing/selftests/bpf/test_offload.py
··· 22 22 import pprint 23 23 import random 24 24 import re 25 + import stat 25 26 import string 26 27 import struct 27 28 import subprocess ··· 312 311 for f in out.split(): 313 312 if f == "ports": 314 313 continue 314 + 315 315 p = os.path.join(path, f) 316 + if not os.stat(p).st_mode & stat.S_IRUSR: 317 + continue 318 + 316 319 if os.path.isfile(p): 317 320 _, out = cmd('cat %s/%s' % (path, f)) 318 321 dfs[f] = out.strip()