1. 27 2月, 2019 5 次提交
  2. 26 2月, 2019 2 次提交
  3. 25 2月, 2019 10 次提交
  4. 24 2月, 2019 3 次提交
  5. 23 2月, 2019 7 次提交
    • C
      net_sched: initialize net pointer inside tcf_exts_init() · 14215108
      Cong Wang 提交于
      For tcindex filter, it is too late to initialize the
      net pointer in tcf_exts_validate(), as tcf_exts_get_net()
      requires a non-NULL net pointer. We can just move its
      initialization into tcf_exts_init(), which just requires
      an additional parameter.
      
      This makes the code in tcindex_alloc_perfect_hash()
      prettier.
      
      Cc: Jamal Hadi Salim <jhs@mojatatu.com>
      Cc: Jiri Pirko <jiri@resnulli.us>
      Signed-off-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      14215108
    • E
      net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation · 97417f61
      Eli Britstein 提交于
      Flow entropy is calculated on the inner packet headers and used for
      flow distribution in processing, routing etc. For GRE-type
      encapsulations the entropy value is placed in the eight LSB of the key
      field in the GRE header as defined in NVGRE RFC 7637. For UDP based
      encapsulations the entropy value is placed in the source port of the
      UDP header.
      The hardware may support entropy calculation specifically for GRE and
      for all tunneling protocols. With commit df2ef3bf ("net/mlx5e: Add
      GRE protocol offloading") GRE is offloaded, but the hardware is
      configured by default to calculate flow entropy so packets transmitted
      on the wire have a wrong key. To support UDP based tunnels (i.e VXLAN),
      GRE (i.e. no flow entropy) and NVGRE (i.e. with flow entropy) the
      hardware behaviour must be controlled by the driver.
      
      Ensure port entropy calculation is enabled for offloaded VXLAN tunnels
      and disable port entropy calculation in the presence of offloaded GRE
      tunnels by monitoring the presence of entropy enabling tunnels (i.e
      VXLAN) and entropy disabing tunnels (i.e GRE).
      
      Fixes: df2ef3bf ("net/mlx5e: Add GRE protocol offloading")
      Signed-off-by: NEli Britstein <elibr@mellanox.com>
      Reviewed-by: NOz Shlomo <ozsh@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      97417f61
    • E
      net/mlx5: Introduce tunnel entropy control in PCMR register · 0dcaafc0
      Eli Britstein 提交于
      When using the device packet encapsulation offload, the device
      calculates an entropy value, representing the inner packet headers. The
      entropy field is placed inside the outer packet headers. For UDP-type
      encapsulations, the entropy is placed in the source port field of the
      UDP header. For GRE-type encapsulations, the entropy is placed in the 8
      LSB of the key field in the GRE header. If the device does not recognize
      the encapsulation type, the entropy is not placed in the packet.
      
      Entropy setting can be controlled using PCMR register. if encapsulation
      offload is not used force_entropy_cap should be set to 0x0. Entropy
      setting is enabled/disabled using entropy_calc, and could be
      additionally enabled/disabled for GRE encapsulation by entropy_gre_calc.
      
      As a pre-step to automatically control the tunnel entropy, introduce
      the entropy fields in the PCMR register with no functional change.
      Signed-off-by: NEli Britstein <elibr@mellanox.com>
      Reviewed-by: NOz Shlomo <ozsh@mellanox.com>
      Reviewed-by: NRoi Dayan <roid@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      0dcaafc0
    • M
      net/ethernet: Add parse_protocol header_ops support · ace53b2e
      Maxim Mikityanskiy 提交于
      The previous commit introduced parse_protocol callback which should
      extract the protocol number from the L2 header. Make all Ethernet
      devices support it.
      Signed-off-by: NMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ace53b2e
    • M
      net: Introduce parse_protocol header_ops callback · e78b2915
      Maxim Mikityanskiy 提交于
      Introduce a new optional header_ops callback called parse_protocol and a
      wrapper function dev_parse_header_protocol, similar to dev_parse_header.
      
      The new callback's purpose is to extract the protocol number from the L2
      header, the format of which is known to the driver, but not to the upper
      layers of the stack.
      Signed-off-by: NMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e78b2915
    • M
      net: Don't set transport offset to invalid value · d2aa125d
      Maxim Mikityanskiy 提交于
      If the socket was created with socket(AF_PACKET, SOCK_RAW, 0),
      skb->protocol will be unset, __skb_flow_dissect() will fail, and
      skb_probe_transport_header() will fall back to the offset_hint, making
      the resulting skb_transport_offset incorrect.
      
      If, however, there is no transport header in the packet,
      transport_header shouldn't be set to an arbitrary value.
      
      Fix it by leaving the transport offset unset if it couldn't be found, to
      be explicit rather than to fill it with some wrong value. It changes the
      behavior, but if some code relied on the old behavior, it would be
      broken anyway, as the old one is incorrect.
      Signed-off-by: NMaxim Mikityanskiy <maximmi@mellanox.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d2aa125d
    • E
      KEYS: user: Align the payload buffer · cc1780fc
      Eric Biggers 提交于
      Align the payload of "user" and "logon" keys so that users of the
      keyrings service can access it as a struct that requires more than
      2-byte alignment.  fscrypt currently does this which results in the read
      of fscrypt_key::size being misaligned as it needs 4-byte alignment.
      
      Align to __alignof__(u64) rather than __alignof__(long) since in the
      future it's conceivable that people would use structs beginning with
      u64, which on some platforms would require more than 'long' alignment.
      Reported-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Fixes: 2aa349f6 ("[PATCH] Keys: Export user-defined keyring operations")
      Fixes: 88bd6ccd ("ext4 crypto: add encryption key management facilities")
      Cc: stable@vger.kernel.org
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Tested-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NJames Morris <james.morris@microsoft.com>
      cc1780fc
  6. 22 2月, 2019 13 次提交