lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180125220053.30040-1-jakub.kicinski@netronome.com>
Date:   Thu, 25 Jan 2018 14:00:42 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     davem@...emloft.net
Cc:     jiri@...nulli.us, dsahern@...il.com, netdev@...r.kernel.org,
        oss-drivers@...ronome.com,
        Jakub Kicinski <jakub.kicinski@...ronome.com>
Subject: [PATCH net-next v2 00/11] use tc_cls_can_offload_and_chain0() throughout the drivers

Hi!

This set makes all drivers use a new tc_cls_can_offload_and_chain0()
helper which will set extack in case TC hw offload flag is disabled.

I chose to keep the new helper which also looks at the chain but
renamed it more appropriately.  The rationale being that most drivers
don't accept chains other than 0 and since we have to pass extack
to the helper we can as well pass the entire struct tc_cls_common_offload
and perform the most common checks.

This code makes the assumption that type_data in the callback can
be interpreted as struct tc_cls_common_offload, i.e. the real offload
structure has common part as the first member.  This allows us to
make the check once for all classifier types if driver supports
more than one.

v1:
 - drop the type validation in nfp and netdevsim.
v2:
 - reorder checks in patch 1;
 - split other changes from patch 1;
 - add the i40e patch in;
 - add one more test case - for chain 0 extack.

Jakub Kicinski (11):
  pkt_cls: add new tc cls helper to check offload flag and chain index
  netdevsim: use tc_cls_can_offload_and_chain0()
  nfp: use tc_cls_can_offload_and_chain0()
  cxgb4: use tc_cls_can_offload_and_chain0()
  mlx5: use tc_cls_can_offload_and_chain0()
  bnxt: use tc_cls_can_offload_and_chain0()
  ixgbe: use tc_cls_can_offload_and_chain0()
  i40e: use tc_cls_can_offload_and_chain0()
  mlxsw: use tc_cls_can_offload_and_chain0()
  selftests/bpf: check for spurious extacks from the driver
  selftests/bpf: check for chain-non-0 extack message

 drivers/net/ethernet/broadcom/bnxt/bnxt.c          |  3 +-
 drivers/net/ethernet/broadcom/bnxt/bnxt_tc.c       |  3 --
 drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c      |  3 +-
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c    |  8 +---
 drivers/net/ethernet/intel/i40e/i40e_main.c        |  8 ++--
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c      |  5 +--
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |  5 +--
 drivers/net/ethernet/mellanox/mlx5/core/en_rep.c   |  5 +--
 drivers/net/ethernet/mellanox/mlxsw/spectrum.c     |  6 +--
 drivers/net/ethernet/netronome/nfp/bpf/main.c      |  4 +-
 .../net/ethernet/netronome/nfp/flower/offload.c    |  7 ++--
 drivers/net/netdevsim/bpf.c                        |  5 +--
 include/net/pkt_cls.h                              | 14 +++++++
 tools/testing/selftests/bpf/test_offload.py        | 43 ++++++++++++++++++++--
 14 files changed, 72 insertions(+), 47 deletions(-)

-- 
2.15.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ