]> git.baikalelectronics.ru Git - kernel.git/commitdiff
nfp: bpf: remove the register renumbering leftovers
authorJakub Kicinski <jakub.kicinski@netronome.com>
Fri, 3 Nov 2017 20:56:23 +0000 (13:56 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 5 Nov 2017 13:26:19 +0000 (22:26 +0900)
The register renumbering was removed and will not be coming back
in its old, naive form, given that it would be fundamentally
incompatible with calling functions.  Remove the leftovers.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c
drivers/net/ethernet/netronome/nfp/bpf/main.h
drivers/net/ethernet/netronome/nfp/bpf/offload.c

index e1907a1d269e54ace5f979261b2da0c8600c8ddb..ff150c27f411f7229edad7d15e9731a3cc96f8cf 100644 (file)
@@ -2314,9 +2314,6 @@ nfp_bpf_jit(struct bpf_prog *filter, void *prog_mem,
        if (ret)
                goto out;
 
-       nfp_prog->num_regs = MAX_BPF_REG;
-       nfp_prog->regs_per_thread = 32;
-
        nfp_prog->prog = prog_mem;
        nfp_prog->__prog_alloc_len = prog_sz;
 
@@ -2331,7 +2328,6 @@ nfp_bpf_jit(struct bpf_prog *filter, void *prog_mem,
        ret = nfp_bpf_ustore_calc(nfp_prog, (__force __le64 *)prog_mem);
 
        res->n_instr = nfp_prog->prog_len;
-       res->dense_mode = false;
 out:
        nfp_prog_free(nfp_prog);
 
index c5280de2ab14c0011f3c908a94c3fdcff170d672..85b7d9398cda0ba90f55ef932c1ca7eb5fd25a2f 100644 (file)
@@ -141,8 +141,6 @@ static inline u8 mbpf_mode(const struct nfp_insn_meta *meta)
  * @prog_len: number of valid instructions in @prog array
  * @__prog_alloc_len: alloc size of @prog array
  * @type: BPF program type
- * @num_regs: number of registers used by this program
- * @regs_per_thread: number of basic registers allocated per thread
  * @start_off: address of the first instruction in the memory
  * @tgt_out: jump target for normal exit
  * @tgt_abort: jump target for abort (e.g. access outside of packet buffer)
@@ -159,9 +157,6 @@ struct nfp_prog {
 
        enum bpf_prog_type type;
 
-       unsigned int num_regs;
-       unsigned int regs_per_thread;
-
        unsigned int start_off;
        unsigned int tgt_out;
        unsigned int tgt_abort;
@@ -177,7 +172,6 @@ struct nfp_prog {
 
 struct nfp_bpf_result {
        unsigned int n_instr;
-       bool dense_mode;
 };
 
 int
index b9b5d675c4d380b7069af9e466e5cc835af787c1..268ba1ba82db16bce2ed27141b73708d2504ada8 100644 (file)
@@ -98,19 +98,14 @@ out:
 static void
 nfp_net_bpf_load_and_start(struct nfp_net *nn, u32 tc_flags,
                           void *code, dma_addr_t dma_addr,
-                          unsigned int code_sz, unsigned int n_instr,
-                          bool dense_mode)
+                          unsigned int code_sz, unsigned int n_instr)
 {
-       u64 bpf_addr = dma_addr;
        int err;
 
        nn->dp.bpf_offload_skip_sw = !!(tc_flags & TCA_CLS_FLAGS_SKIP_SW);
 
-       if (dense_mode)
-               bpf_addr |= NFP_NET_CFG_BPF_CFG_8CTX;
-
        nn_writew(nn, NFP_NET_CFG_BPF_SIZE, n_instr);
-       nn_writeq(nn, NFP_NET_CFG_BPF_ADDR, bpf_addr);
+       nn_writeq(nn, NFP_NET_CFG_BPF_ADDR, dma_addr);
 
        /* Load up the JITed code */
        err = nfp_net_reconfig(nn, NFP_NET_CFG_UPDATE_BPF);
@@ -169,7 +164,7 @@ int nfp_net_bpf_offload(struct nfp_net *nn, struct tc_cls_bpf_offload *cls_bpf)
                nfp_net_bpf_stop(nn);
                nfp_net_bpf_load_and_start(nn, cls_bpf->gen_flags, code,
                                           dma_addr, max_instr * sizeof(u64),
-                                          res.n_instr, res.dense_mode);
+                                          res.n_instr);
                return 0;
 
        case TC_CLSBPF_ADD:
@@ -183,7 +178,7 @@ int nfp_net_bpf_offload(struct nfp_net *nn, struct tc_cls_bpf_offload *cls_bpf)
 
                nfp_net_bpf_load_and_start(nn, cls_bpf->gen_flags, code,
                                           dma_addr, max_instr * sizeof(u64),
-                                          res.n_instr, res.dense_mode);
+                                          res.n_instr);
                return 0;
 
        case TC_CLSBPF_DESTROY: