All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC bpf-next 0/7] net: flow_dissector: trigger BPF hook when called from eth_get_headlen
@ 2019-02-05 17:36 Stanislav Fomichev
  2019-02-05 17:36 ` [RFC bpf-next 1/7] net: introduce __init_skb and __init_skb_shinfo helpers Stanislav Fomichev
                   ` (7 more replies)
  0 siblings, 8 replies; 30+ messages in thread
From: Stanislav Fomichev @ 2019-02-05 17:36 UTC (permalink / raw)
  To: netdev; +Cc: davem, ast, daniel, simon.horman, willemb, Stanislav Fomichev

Currently, when eth_get_headlen calls flow dissector, it doesn't pass any
skb. Because we use passed skb to lookup associated networking namespace
to find whether we have a BPF program attached or not, we always use
C-based flow dissector in this case.

The goal of this patch series is to add new networking namespace argument
to the eth_get_headlen and make BPF flow dissector programs be able to
work in the skb-less case.

The series goes like this:
1. introduce __init_skb and __init_skb_shinfo; those will be used to
   initialize temporary skb
2. introduce skb_net which can be used to get networking namespace
   associated with an skb
3. add new optional network namespace argument to __skb_flow_dissect and
   plumb through the callers
4. add new __flow_bpf_dissect which constructs temporary on-stack skb
   (using __init_skb) and calls BPF flow dissector program
5. convert flow dissector BPF_PROG_TEST_RUN to skb-less mode to show that
   it works
6. add selftest that makes sure going over the packet bounds in
   bpf_skb_load_bytes with on-stack skb doesn't cause any problems
7. add new net namespace argument go eth_get_headlen and convert the
   callers

Stanislav Fomichev (7):
  net: introduce __init_skb and __init_skb_shinfo helpers
  net: introduce skb_net helper
  net: plumb network namespace into __skb_flow_dissect
  net: flow_dissector: handle no-skb use case
  bpf: when doing BPF_PROG_TEST_RUN for flow dissector use no-skb mode
  selftests/bpf: add flow dissector bpf_skb_load_bytes helper test
  net: flow_dissector: pass net argument to the eth_get_headlen

 drivers/net/ethernet/broadcom/bnxt/bnxt.c     |   2 +-
 drivers/net/ethernet/hisilicon/hns/hns_enet.c |   3 +-
 .../net/ethernet/hisilicon/hns3/hns3_enet.c   |   3 +-
 drivers/net/ethernet/intel/fm10k/fm10k_main.c |   2 +-
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   3 +-
 drivers/net/ethernet/intel/iavf/iavf_txrx.c   |   2 +-
 drivers/net/ethernet/intel/ice/ice_txrx.c     |   2 +-
 drivers/net/ethernet/intel/igb/igb_main.c     |   2 +-
 drivers/net/ethernet/intel/igc/igc_main.c     |   2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   2 +-
 .../net/ethernet/intel/ixgbevf/ixgbevf_main.c |   3 +-
 .../net/ethernet/mellanox/mlx5/core/en_tx.c   |   3 +-
 drivers/net/tun.c                             |   3 +-
 include/linux/etherdevice.h                   |   2 +-
 include/linux/skbuff.h                        |  23 +++-
 net/bpf/test_run.c                            |  52 +++------
 net/core/flow_dissector.c                     | 105 +++++++++++++-----
 net/core/skbuff.c                             |  78 +++++++------
 net/ethernet/eth.c                            |   8 +-
 tools/testing/selftests/bpf/test_progs.c      |  49 ++++++++
 20 files changed, 227 insertions(+), 122 deletions(-)

-- 
2.20.1.611.gfbb209baf1-goog

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2019-02-25 20:33 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-05 17:36 [RFC bpf-next 0/7] net: flow_dissector: trigger BPF hook when called from eth_get_headlen Stanislav Fomichev
2019-02-05 17:36 ` [RFC bpf-next 1/7] net: introduce __init_skb and __init_skb_shinfo helpers Stanislav Fomichev
2019-02-05 20:18   ` Willem de Bruijn
2019-02-05 17:36 ` [RFC bpf-next 2/7] net: introduce skb_net helper Stanislav Fomichev
2019-02-05 20:19   ` Willem de Bruijn
2019-02-05 20:42     ` Stanislav Fomichev
2019-02-05 17:36 ` [RFC bpf-next 3/7] net: plumb network namespace into __skb_flow_dissect Stanislav Fomichev
2019-02-05 20:19   ` Willem de Bruijn
2019-02-05 20:40     ` Stanislav Fomichev
2019-02-05 17:36 ` [RFC bpf-next 4/7] net: flow_dissector: handle no-skb use case Stanislav Fomichev
2019-02-05 20:19   ` Willem de Bruijn
2019-02-05 20:45     ` Stanislav Fomichev
2019-02-05 17:36 ` [RFC bpf-next 5/7] bpf: when doing BPF_PROG_TEST_RUN for flow dissector use no-skb mode Stanislav Fomichev
2019-02-05 20:19   ` Willem de Bruijn
2019-02-05 17:36 ` [RFC bpf-next 6/7] selftests/bpf: add flow dissector bpf_skb_load_bytes helper test Stanislav Fomichev
2019-02-05 17:36 ` [RFC bpf-next 7/7] net: flow_dissector: pass net argument to the eth_get_headlen Stanislav Fomichev
2019-02-05 20:18 ` [RFC bpf-next 0/7] net: flow_dissector: trigger BPF hook when called from eth_get_headlen Willem de Bruijn
2019-02-05 20:40   ` Stanislav Fomichev
2019-02-06  0:47     ` Alexei Starovoitov
2019-02-06  0:59       ` Stanislav Fomichev
2019-02-06  3:12         ` Alexei Starovoitov
2019-02-06  3:56           ` Stanislav Fomichev
2019-02-06  4:11             ` Alexei Starovoitov
2019-02-06  5:49               ` Stanislav Fomichev
2019-02-12 17:02                 ` Stanislav Fomichev
2019-02-14  4:39                   ` Alexei Starovoitov
2019-02-14  5:57                     ` Stanislav Fomichev
2019-02-14  6:38                       ` Alexei Starovoitov
2019-02-14 17:35                         ` Stanislav Fomichev
2019-02-25 20:33                           ` Stanislav Fomichev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.