1. 05 10月, 2020 6 次提交
  2. 04 10月, 2020 6 次提交
  3. 03 10月, 2020 10 次提交
  4. 01 10月, 2020 11 次提交
  5. 30 9月, 2020 7 次提交
    • J
      netfilter: nf_tables: add userdata attributes to nft_chain · 002f2176
      Jose M. Guisado Gomez 提交于
      Enables storing userdata for nft_chain. Field udata points to user data
      and udlen stores its length.
      
      Adds new attribute flag NFTA_CHAIN_USERDATA.
      Signed-off-by: NJose M. Guisado Gomez <guigom@riseup.net>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      002f2176
    • V
      net: mscc: ocelot: automatically detect VCAP constants · 20968054
      Vladimir Oltean 提交于
      The numbers in struct vcap_props are not intuitive to derive, because
      they are not a straightforward copy-and-paste from the reference manual
      but instead rely on a fairly detailed level of understanding of the
      layout of an entry in the TCAM and in the action RAM. For this reason,
      bugs are very easy to introduce here.
      
      Ease the work of hardware porters and read from hardware the constants
      that were exported for this particular purpose. Note that this implies
      that struct vcap_props can no longer be const.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      20968054
    • V
      net: mscc: ocelot: add definitions for VCAP ES0 keys, actions and target · e3aea296
      Vladimir Oltean 提交于
      As a preparation step for the offloading to ES0, let's create the
      infrastructure for talking with this hardware block.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e3aea296
    • V
      net: mscc: ocelot: add definitions for VCAP IS1 keys, actions and target · a61e365d
      Vladimir Oltean 提交于
      As a preparation step for the offloading to IS1, let's create the
      infrastructure for talking with this hardware block.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a61e365d
    • V
      net: mscc: ocelot: generalize existing code for VCAP · c1c3993e
      Vladimir Oltean 提交于
      In the Ocelot switches there are 3 TCAMs: VCAP ES0, IS1 and IS2, which
      have the same configuration interface, but different sets of keys and
      actions. The driver currently only supports VCAP IS2.
      
      In preparation of VCAP IS1 and ES0 support, the existing code must be
      generalized to work with any VCAP.
      
      In that direction, we should move the structures that depend upon VCAP
      instantiation, like vcap_is2_keys and vcap_is2_actions, out of struct
      ocelot and into struct vcap_props .keys and .actions, a structure that
      is replicated 3 times, once per VCAP. We'll pass that structure as an
      argument to each function that does the key and action packing - only
      the control logic needs to distinguish between ocelot->vcap[VCAP_IS2]
      or IS1 or ES0.
      
      Another change is to make use of the newly introduced ocelot_target_read
      and ocelot_target_write API, since the 3 VCAPs have the same registers
      but put at different addresses.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c1c3993e
    • V
      net: mscc: ocelot: introduce a new ocelot_target_{read,write} API · 3c0e37a9
      Vladimir Oltean 提交于
      There are some targets (register blocks) in the Ocelot switch that are
      instantiated more than once. For example, the VCAP IS1, IS2 and ES0
      blocks all share the same register layout for interacting with the cache
      for the TCAM and the action RAM.
      
      For the VCAPs, the procedure for servicing them is actually common. We
      just need an API specifying which VCAP we are talking to, and we do that
      via these raw ocelot_target_read and ocelot_target_write accessors.
      
      In plain ocelot_read, the target is encoded into the register enum
      itself:
      
      	u16 target = reg >> TARGET_OFFSET;
      
      For the VCAPs, the registers are currently defined like this:
      
      	enum ocelot_reg {
      	[...]
      		S2_CORE_UPDATE_CTRL = S2 << TARGET_OFFSET,
      		S2_CORE_MV_CFG,
      		S2_CACHE_ENTRY_DAT,
      		S2_CACHE_MASK_DAT,
      		S2_CACHE_ACTION_DAT,
      		S2_CACHE_CNT_DAT,
      		S2_CACHE_TG_DAT,
      	[...]
      	};
      
      which is precisely what we want to avoid, because we'd have to duplicate
      the same register map for S1 and for S0, and then figure out how to pass
      VCAP instance-specific registers to the ocelot_read calls (basically
      another lookup table that undoes the effect of shifting with
      TARGET_OFFSET).
      
      So for some targets, propose a more raw API, similar to what is
      currently done with ocelot_port_readl and ocelot_port_writel. Those
      targets can only be accessed with ocelot_target_{read,write} and not
      with ocelot_{read,write} after the conversion, which is fine.
      
      The VCAP registers are not actually modified to use this new API as of
      this patch. They will be modified in the next one.
      Signed-off-by: NVladimir Oltean <vladimir.oltean@nxp.com>
      Acked-by: NAlexandre Belloni <alexandre.belloni@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3c0e37a9
    • S
      net: Add netif_rx_any_context() · c11171a4
      Sebastian Andrzej Siewior 提交于
      Quite some drivers make conditional decisions based on in_interrupt() to
      invoke either netif_rx() or netif_rx_ni().
      
      Conditionals based on in_interrupt() or other variants of preempt count
      checks in drivers should not exist for various reasons and Linus clearly
      requested to either split the code pathes or pass an argument to the
      common functions which provides the context.
      
      This is obviously the correct solution, but for some of the affected
      drivers this needs a major rewrite due to their convoluted structure.
      
      As in_interrupt() usage in drivers needs to be phased out, provide
      netif_rx_any_context() as a stop gap for these drivers.
      
      This confines the in_interrupt() conditional to core code which in turn
      allows to remove the access to this check for driver code and provides one
      central place to do further modifications once the driver maze is cleaned
      up.
      Suggested-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c11171a4