xdp: don't make drivers report attachment mode

prog_attached of struct netdev_bpf should have been superseded
by simply setting prog_id long time ago, but we kept it around
to allow offloading drivers to communicate attachment mode (drv
vs hw).  Subsequently drivers were also allowed to report back
attachment flags (prog_flags), and since nowadays only programs
attached will XDP_FLAGS_HW_MODE can get offloaded, we can tell
the attachment mode from the flags driver reports.  Remove
prog_attached member.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Jakub Kicinski
2018-07-11 20:36:39 -07:00
committed by Daniel Borkmann
parent 4f91da26c8
commit 6b86758973
15 changed files with 9 additions and 25 deletions

View File

@@ -819,10 +819,6 @@ enum bpf_netdev_command {
*/
XDP_SETUP_PROG,
XDP_SETUP_PROG_HW,
/* Check if a bpf program is set on the device. The callee should
* set @prog_attached to one of XDP_ATTACHED_* values, note that "true"
* is equivalent to XDP_ATTACHED_DRV.
*/
XDP_QUERY_PROG,
/* BPF program for offload callbacks, invoked at program load time. */
BPF_OFFLOAD_VERIFIER_PREP,
@@ -849,7 +845,6 @@ struct netdev_bpf {
};
/* XDP_QUERY_PROG */
struct {
u8 prog_attached;
u32 prog_id;
/* flags with which program was installed */
u32 prog_flags;