1. 30 5月, 2019 15 次提交
    • I
      net: phylink: Add PHYLINK_DEV operation type · 43de6195
      Ioana Ciornei 提交于
      In the PHYLINK_DEV operation type, the PHYLINK infrastructure can work
      without an attached net_device. For printing usecases, instead, a struct
      device * should be passed to PHYLINK using the phylink_config structure.
      
      Also, netif_carrier_* calls ar guarded by the presence of a valid
      net_device. When using the PHYLINK_DEV operation type, we cannot check
      link status using the netif_carrier_ok() API so instead, keep an
      internal state of the MAC and call mac_link_{down,up} only when the link
      changed.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      43de6195
    • I
      net: phylink: Add struct phylink_config to PHYLINK API · 44cc27e4
      Ioana Ciornei 提交于
      The phylink_config structure will encapsulate a pointer to a struct
      device and the operation type requested for this instance of PHYLINK.
      This patch does not make any functional changes, it just transitions the
      PHYLINK internals and all its users to the new API.
      
      A pointer to a phylink_config structure will be passed to
      phylink_create() instead of the net_device directly. Also, the same
      phylink_config pointer will be passed back to all phylink_mac_ops
      callbacks instead of the net_device. Using this mechanism, a PHYLINK
      user can get the original net_device using a structure such as
      'to_net_dev(config->dev)' or directly the structure containing the
      phylink_config using a container_of call.
      
      At the moment, only the PHYLINK_NETDEV is defined as a valid operation
      type for PHYLINK. In this mode, a valid reference to a struct device
      linked to the original net_device should be passed to PHYLINK through
      the phylink_config structure.
      
      This API changes is mainly driven by the necessity of adding a new
      operation type in PHYLINK that disconnects the phy_device from the
      net_device and also works when the net_device is lacking.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Tested-by: NMaxime Chevallier <maxime.chevallier@bootlin.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      44cc27e4
    • I
      net: phylink: Add phylink_mac_link_{up, down} wrapper functions · 27755ff8
      Ioana Ciornei 提交于
      This is a cosmetic patch that reduces the clutter in phylink_resolve
      around calling the .mac_link_up/.mac_link_down driver callbacks.  In a
      further patch this logic will be extended to emit notifications in case
      a net device does not exist.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      27755ff8
    • I
      net: phy: Add phy_standalone sysfs entry · c920f745
      Ioana Ciornei 提交于
      Export a phy_standalone device attribute that is meant to give the
      indication that this PHY lacks an attached_dev and its corresponding
      sysfs link. The attribute will be created only when the
      phy_attach_direct() function will be called with a NULL net_device.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c920f745
    • I
      net: phy: Check against net_device being NULL · 82c76aca
      Ioana Ciornei 提交于
      In general, we don't want MAC drivers calling phy_attach_direct with the
      net_device being NULL. Add checks against this in all the functions
      calling it: phy_attach() and phy_connect_direct().
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Suggested-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      82c76aca
    • I
      net: phy: Guard against the presence of a netdev · 2db2d9d1
      Ioana Ciornei 提交于
      A prerequisite for PHYLIB to work in the absence of a struct net_device
      is to not access pointers to it.
      
      Changes are needed in the following areas:
      
       - Printing: In some places netdev_err was replaced with phydev_err.
      
       - Incrementing reference count to the parent MDIO bus driver: If there
         is no net device, then the reference count should definitely be
         incremented since there is no chance that it was an Ethernet driver
         who registered the MDIO bus.
      
       - Sysfs links are not created in case there is no attached_dev.
      
       - No netif_carrier_off is done if there is no attached_dev.
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2db2d9d1
    • V
      net: phy: Add phy_sysfs_create_links helper function · 53cfca2d
      Vladimir Oltean 提交于
      This is a cosmetic patch that wraps the operation of creating sysfs
      links between the netdev->phydev and the phydev->attached_dev.
      
      This is needed to keep the indentation level in check in a follow-up
      patch where this function will be guarded against the existence of a
      phydev->attached_dev.
      Signed-off-by: NVladimir Oltean <olteanv@gmail.com>
      Signed-off-by: NIoana Ciornei <ioana.ciornei@nxp.com>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      53cfca2d
    • K
      net: sched: Introduce act_ctinfo action · 24ec483c
      Kevin 'ldir' Darbyshire-Bryant 提交于
      ctinfo is a new tc filter action module.  It is designed to restore
      information contained in firewall conntrack marks to other packet fields
      and is typically used on packet ingress paths.  At present it has two
      independent sub-functions or operating modes, DSCP restoration mode &
      skb mark restoration mode.
      
      The DSCP restore mode:
      
      This mode copies DSCP values that have been placed in the firewall
      conntrack mark back into the IPv4/v6 diffserv fields of relevant
      packets.
      
      The DSCP restoration is intended for use and has been found useful for
      restoring ingress classifications based on egress classifications across
      links that bleach or otherwise change DSCP, typically home ISP Internet
      links.  Restoring DSCP on ingress on the WAN link allows qdiscs such as
      but by no means limited to CAKE to shape inbound packets according to
      policies that are easier to set & mark on egress.
      
      Ingress classification is traditionally a challenging task since
      iptables rules haven't yet run and tc filter/eBPF programs are pre-NAT
      lookups, hence are unable to see internal IPv4 addresses as used on the
      typical home masquerading gateway.  Thus marking the connection in some
      manner on egress for later restoration of classification on ingress is
      easier to implement.
      
      Parameters related to DSCP restore mode:
      
      dscpmask - a 32 bit mask of 6 contiguous bits and indicate bits of the
      conntrack mark field contain the DSCP value to be restored.
      
      statemask - a 32 bit mask of (usually) 1 bit length, outside the area
      specified by dscpmask.  This represents a conditional operation flag
      whereby the DSCP is only restored if the flag is set.  This is useful to
      implement a 'one shot' iptables based classification where the
      'complicated' iptables rules are only run once to classify the
      connection on initial (egress) packet and subsequent packets are all
      marked/restored with the same DSCP.  A mask of zero disables the
      conditional behaviour ie. the conntrack mark DSCP bits are always
      restored to the ip diffserv field (assuming the conntrack entry is found
      & the skb is an ipv4/ipv6 type)
      
      e.g. dscpmask 0xfc000000 statemask 0x01000000
      
      |----0xFC----conntrack mark----000000---|
      | Bits 31-26 | bit 25 | bit24 |~~~ Bit 0|
      | DSCP       | unused | flag  |unused   |
      |-----------------------0x01---000000---|
            |                   |
            |                   |
            ---|             Conditional flag
               v             only restore if set
      |-ip diffserv-|
      | 6 bits      |
      |-------------|
      
      The skb mark restore mode (cpmark):
      
      This mode copies the firewall conntrack mark to the skb's mark field.
      It is completely the functional equivalent of the existing act_connmark
      action with the additional feature of being able to apply a mask to the
      restored value.
      
      Parameters related to skb mark restore mode:
      
      mask - a 32 bit mask applied to the firewall conntrack mark to mask out
      bits unwanted for restoration.  This can be useful where the conntrack
      mark is being used for different purposes by different applications.  If
      not specified and by default the whole mark field is copied (i.e.
      default mask of 0xffffffff)
      
      e.g. mask 0x00ffffff to mask out the top 8 bits being used by the
      aforementioned DSCP restore mode.
      
      |----0x00----conntrack mark----ffffff---|
      | Bits 31-24 |                          |
      | DSCP & flag|      some value here     |
      |---------------------------------------|
      			|
      			|
      			v
      |------------skb mark-------------------|
      |            |                          |
      |  zeroed    |                          |
      |---------------------------------------|
      
      Overall parameters:
      
      zone - conntrack zone
      
      control - action related control (reclassify | pipe | drop | continue |
      ok | goto chain <CHAIN_INDEX>)
      Signed-off-by: NKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
      Reviewed-by: NToke Høiland-Jørgensen <toke@redhat.com>
      Acked-by: NCong Wang <xiyou.wangcong@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24ec483c
    • H
      r8169: remove 1000/Half from supported modes · a6851c61
      Heiner Kallweit 提交于
      MAC on the GBit versions supports 1000/Full only, however the PHY
      partially claims to support 1000/Half. So let's explicitly remove
      this mode.
      Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6851c61
    • J
      net: mscc: ocelot: Implement port policers via tc command · 2c1d029a
      Joergen Andreasen 提交于
      Hardware offload of matchall classifier and police action are now
      supported via the tc command.
      Supported police parameters are: rate and burst.
      
      Example:
      
      Add:
      tc qdisc add dev eth3 handle ffff: ingress
      tc filter add dev eth3 parent ffff: prio 1 handle 2	\
      	matchall skip_sw				\
      	action police rate 100Mbit burst 10000
      
      Show:
      tc -s -d qdisc show dev eth3
      tc -s -d filter show dev eth3 ingress
      
      Delete:
      tc filter del dev eth3 parent ffff: prio 1
      tc qdisc del dev eth3 handle ffff: ingress
      Signed-off-by: NJoergen Andreasen <joergen.andreasen@microchip.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2c1d029a
    • D
      Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue · 7da33a8f
      David S. Miller 提交于
      Jeff Kirsher says:
      
      ====================
      100GbE Intel Wired LAN Driver Updates 2019-05-29
      
      This series contains updates to ice driver only.
      
      Bruce cleans up white space issues and fixes complaints about using
      bitop assignments using operands of different sizes.
      
      Anirudh cleans up code that is no longer needed now that the firmware
      supports the functionality.  Adds support for ethtool selftestto the ice
      driver, which includes testing link, interrupts, eeprom, registers and
      packet loopback.  Also, cleaned up duplicate code.
      
      Tony implements support for toggling receive VLAN filter via ethtool.
      
      Brett bumps up the minimum receive descriptor count per queue to resolve
      dropped packets.  Refactored the interrupt tracking for the ice driver
      to resolve issues seen with the co-existence of features and SR-IOV, so
      instead of having a hardware IRQ tracker and a software IRQ tracker,
      simply use one tracker.  Also adds a helper function to trigger software
      interrupts.
      
      Mitch changes how Malicious Driver Detection (MDD) events are handled,
      to ensure all VFs checked for MDD events and just log the event instead
      of disabling the VF, which was preventing proper release of resources if
      the VF is rebooted or the VF driver reloaded.
      
      Dave cleans up a redundant call to register LLDP MIB change events.
      
      Dan adds support to retrieve the current setting of firmware logging
      from the hardware to properly initialize the hardware structure.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      7da33a8f
    • Y
      net: stmmac: Fix build error without CONFIG_INET · a3e2f6ad
      YueHaibing 提交于
      Fix gcc build error while CONFIG_INET is not set
      
      drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.o: In function `__stmmac_test_loopback':
      stmmac_selftests.c:(.text+0x8ec): undefined reference to `ip_send_check'
      stmmac_selftests.c:(.text+0xacc): undefined reference to `udp4_hwcsum'
      
      Add CONFIG_INET dependency to fix this.
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: 091810db ("net: stmmac: Introduce selftests support")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a3e2f6ad
    • H
      rhashtable: Add rht_ptr_rcu and improve rht_ptr · 279758f8
      Herbert Xu 提交于
      This patch moves common code between rht_ptr and rht_ptr_exclusive
      into __rht_ptr.  It also adds a new helper rht_ptr_rcu exclusively
      for the RCU case.  This way rht_ptr becomes a lock-only construct
      so we can use the lighter rcu_dereference_protected primitive.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      279758f8
    • J
      net: stmmac: use dev_info() before netdev is registered · af649352
      Jisheng Zhang 提交于
      Before the netdev is registered, calling netdev_info() will emit
      something as "(unnamed net device) (uninitialized)", looks confusing.
      
      Before this patch:
      [    3.155028] stmmaceth f7b60000.ethernet (unnamed net_device) (uninitialized): device MAC address 52:1a:55:18:9e:9d
      
      After this patch:
      [    3.155028] stmmaceth f7b60000.ethernet: device MAC address 52:1a:55:18:9e:9d
      Signed-off-by: NJisheng Zhang <Jisheng.Zhang@synaptics.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      af649352
    • C
      qed: fix spelling mistake "inculde" -> "include" · 1b3855ab
      Colin Ian King 提交于
      There is a spelling mistake in a DP_INFO message. Fix it.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Acked-by: Michal Kalderon <michal.kalderon@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1b3855ab
  2. 29 5月, 2019 25 次提交