1. 23 2月, 2019 10 次提交
    • E
      net/mlx5e: Re-add support for TX timeout when TX reporter is not valid · 2c493ae0
      Eran Ben Elisha 提交于
      When TX reporter was introduced, it took ownership over TX timeout error
      handling. this introduced a regression in case TX reporter is not valid
      (NET_DEVLINK is not set, or devlink_health_reporter_create failure).
      
      Fix mlx5e_tx_reporter_timeout function so it can be called at all times.
      
      In addition, remove a warning print that indicates that a TX timeout won't
      be handled in case of no valid TX reporter.
      
      Fixes: 7d91126b ("net/mlx5e: Add tx timeout support for mlx5e tx reporter")
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      2c493ae0
    • E
      net/mlx5e: Fix warn print in case of TX reporter creation failure · 772ac5e2
      Eran Ben Elisha 提交于
      Print warning message in case of TX reporter creation failure, only if the
      return value is ERR_PTR type. NULL pointer return indicates that
      NET_DEVLINK is not set, and the warning print can be skipped.
      
      Fixes: de8650a8 ("net/mlx5e: Add tx reporter support")
      Signed-off-by: NEran Ben Elisha <eranbe@mellanox.com>
      Signed-off-by: NSaeed Mahameed <saeedm@mellanox.com>
      772ac5e2
    • 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
    • E
      net/mlx5: Use read-modify-write when changing PCMR register values · bfedc645
      Eli Britstein 提交于
      Currently changing a PCMR field is done by setting the field in a
      zeroed buffer, zeroing other unrelated fields.
      Fix this behaviour by modifying only the required field after first
      reading the current register values, as a pre-step towards using more
      fields in PCMR register.
      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>
      bfedc645
    • D
      Merge branch 'dsa-vlan' · 2fce40a5
      David S. Miller 提交于
      Florian Fainelli says:
      
      ====================
      net: dsa: VLAN devices w/ filtering
      
      This patch series supports having VLAN devices on top of DSA/switch
      ports while the switch has VLAN filtering globally turned on (as is the
      case with Broadcom switches). Whether the switch does global or per-port
      VLAN filtering, having VLAN entries for these VLAN devices is
      beneficial.
      
      We take care of a few possibly problematic cases:
      
      - adding a VLAN device while there is an existing VLAN entry created by
        a VLAN aware bridge. The entire bridge's VLAN database and not just
        the specific bridge port is being checked to be safe and conserative
      
      - adding a bridge VLAN entry when there is an existing VLAN device
        created is also not possible because that would lead to the bridge
        being able to manipulate the VLAN device's VID/attributes under its feet
      
      - enslaving a VLAN device into a VLAN aware bridge since that duplicates
        functionality already offered by the VLAN aware bridge
      
      Here are the different test cases that were run to exercise this:
      
      ip addr flush dev gphy
      ip link add dev br0 type bridge
      echo 1 > /sys/class/net/br0/bridge/vlan_filtering
      ip link set dev gphy master br0
      udhcpc -i br0
      
      vconfig add rgmii_1 100
      ifconfig rgmii_1.100 192.168.100.10
      ping -c 2 192.168.100.1
      
      vconfig add br0 42
      bridge vlan add vid 42 dev gphy
      bridge vlan add vid 42 dev br0 self
      ifconfig br0.42 192.168.42.2
      ping -c 2 192.168.42.1
      
      ip link del rgmii_1.100
      vconfig add rgmii_1 100
      ifconfig rgmii_1.100 192.168.100.10
      ping -c 2 192.168.100.1
      echo 0 > /sys/class/net/br0/bridge/vlan_filtering
      ping -c 2 192.168.100.1
      
      ip link del rgmii_1.100
      echo 1 > /sys/class/net/br0/bridge/vlan_filtering
      
      vconfig add rgmii_1 100
      brctl addif br0 rgmii_1
      bridge vlan add vid 100 dev rgmii_1
      
      vconfig rem rgmii_1.100
      bridge vlan add vid 100 dev rgmii_1
      vconfig add rgmii_1 100
      
      bridge vlan del vid 100 dev rgmii_1
      vconfig add rgmii_1 100
      brctl addif br0 rgmii_1.100
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2fce40a5
    • F
      net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation · 061f6a50
      Florian Fainelli 提交于
      In order to properly support VLAN filtering being enabled/disabled on a
      bridge, while having other ports being non bridge port members, we need
      to support the ndo_vlan_rx_{add,kill}_vid callbacks in order to make
      sure the non-bridge ports can continue receiving VLAN tags, even when
      the switch is globally configured to do ingress/egress VID checking.
      
      Since we can call dsa_port_vlan_{add,del} with a bridge_dev pointer
      NULL, we now need to check that in these two functions.
      
      We specifically deal with two possibly problematic cases:
      
      - creating a bridge VLAN entry while there is an existing VLAN device
        claiming that same VID
      
      - creating a VLAN device while there is an existing bridge VLAN entry
        with that VID
      
      Those are both resolved with returning -EBUSY back to user-space.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      061f6a50
    • F
      net: dsa: Deny enslaving VLAN devices into VLAN aware bridge · cc1d5bda
      Florian Fainelli 提交于
      VLAN devices on top of a DSA network device which is already part of a
      bridge and with said bridge being VLAN aware should not be allowed to be
      enslaved into that bridge. For one, this duplicates functionality
      offered by the VLAN aware bridge which supports tagged and untagged VLAN
      frames processing and it would make things needlessly complex to e.g.:
      propagate FDB/MDB accordingly.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cc1d5bda
    • G
      isdn_common: Mark expected switch fall-throughs · 6d20faec
      Gustavo A. R. Silva 提交于
      In preparation to enabling -Wimplicit-fallthrough, mark switch
      cases where we are expecting to fall through.
      
      This patch fixes the following warnings:
      
      drivers/isdn/i4l/isdn_common.c: In function ‘isdn_wildmat’:
      drivers/isdn/i4l/isdn_common.c:173:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
          p++;
          ~^~
      drivers/isdn/i4l/isdn_common.c:174:3: note: here
         default:
         ^~~~~~~
        CC [M]  drivers/leds/leds-lp8788.o
        CC [M]  drivers/gpu/drm/amd/amdgpu/../powerplay/smumgr/smu10_smumgr.o
      drivers/isdn/i4l/isdn_common.c: In function ‘isdn_status_callback’:
      drivers/isdn/i4l/isdn_common.c:729:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
         if (divert_if)
            ^
      drivers/isdn/i4l/isdn_common.c:732:2: note: here
        default:
        ^~~~~~~
      
      Warning level 3 was used: -Wimplicit-fallthrough=3
      
      Notice that, in this particular case, the code comment is modified
      in accordance with what GCC is expecting to find.
      
      This patch is part of the ongoing efforts to enable
      -Wimplicit-fallthrough.
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6d20faec
    • A
      net: phy: aquantia: Use get_features for the PHYs abilities · 023fb4b5
      Andrew Lunn 提交于
      Use the new PHY driver call to get the PHYs supported features.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      [hkallweit1@gmail.com: removed new config_init callback from patch]
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      023fb4b5
  2. 22 2月, 2019 30 次提交