1. 18 Sep, 2021 11 commits
    • Florian Westphal's avatar
      mptcp: add MPTCP_SUBFLOW_ADDRS getsockopt support · c11c5906
      Florian Westphal authored
      This retrieves the address pairs of all subflows currently
      active for a given mptcp connection.
      
      It re-uses the same meta-header as for MPTCP_TCPINFO.
      
      A new structure is provided to hold the subflow
      address data:
      
      struct mptcp_subflow_addrs {
      	union {
      		__kernel_sa_family_t sa_family;
      		struct sockaddr sa_local;
      		struct sockaddr_in sin_local;
      		struct sockaddr_in6 sin6_local;
      		struct sockaddr_storage ss_local;
      	};
      	union {
      		struct sockaddr sa_remote;
      		struct sockaddr_in sin_remote;
      		struct sockaddr_in6 sin6_remote;
      		struct sockaddr_storage ss_remote;
      	};
      };
      
      Usage of the new getsockopt is very similar to
      MPTCP_TCPINFO one.
      
      Userspace allocates a
      'struct mptcp_subflow_data', followed by one or
      more 'struct mptcp_subflow_addrs', then inits the
      mptcp_subflow_data structure as follows:
      
      struct mptcp_subflow_addrs *sf_addr;
      struct mptcp_subflow_data *addr;
      socklen_t olen = sizeof(*addr) + (8 * sizeof(*sf_addr));
      
      addr = malloc(olen);
      addr->size_subflow_data = sizeof(*addr);
      addr->num_subflows = 0;
      addr->size_kernel = 0;
      addr->size_user = sizeof(struct mptcp_subflow_addrs);
      
      sf_addr = (struct mptcp_subflow_addrs *)(addr + 1);
      
      and then retrieves the endpoint addresses via:
      ret = getsockopt(fd, SOL_MPTCP, MPTCP_SUBFLOW_ADDRS,
      		 addr, &olen);
      
      If the call succeeds, kernel will have added up to 8
      endpoint addresses after the 'mptcp_subflow_data' header.
      
      Userspace needs to re-check 'olen' value to detect how
      many bytes have been filled in by the kernel.
      
      Userspace can check addr->num_subflows to discover when
      there were more subflows that available data space.
      Co-developed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c11c5906
    • Florian Westphal's avatar
      mptcp: add MPTCP_TCPINFO getsockopt support · 06f15cee
      Florian Westphal authored
      Allow users to retrieve TCP_INFO data of all subflows.
      
      Users need to pre-initialize a meta header that has to be
      prepended to the data buffer that will be filled with the tcp info data.
      
      The meta header looks like this:
      
      struct mptcp_subflow_data {
       __u32 size_subflow_data;/* size of this structure in userspace */
       __u32 num_subflows;	/* must be 0, set by kernel */
       __u32 size_kernel;	/* must be 0, set by kernel */
       __u32 size_user;	/* size of one element in data[] */
      } __attribute__((aligned(8)));
      
      size_subflow_data has to be set to 'sizeof(struct mptcp_subflow_data)'.
      This allows to extend mptcp_subflow_data structure later on without
      breaking backwards compatibility.
      
      If the structure is extended later on, kernel knows where the
      userspace-provided meta header ends, even if userspace uses an older
      (smaller) version of the structure.
      
      num_subflows must be set to 0. If the getsockopt request succeeds (return
      value is 0), it will be updated to contain the number of active subflows
      for the given logical connection.
      
      size_kernel must be set to 0. If the getsockopt request is successful,
      it will contain the size of the 'struct tcp_info' as known by the kernel.
      This is informational only.
      
      size_user must be set to 'sizeof(struct tcp_info)'.
      
      This allows the kernel to only fill in the space reserved/expected by
      userspace.
      
      Example:
      
      struct my_tcp_info {
        struct mptcp_subflow_data d;
        struct tcp_info ti[2];
      };
      struct my_tcp_info ti;
      socklen_t olen;
      
      memset(&ti, 0, sizeof(ti));
      
      ti.d.size_subflow_data = sizeof(struct mptcp_subflow_data);
      ti.d.size_user = sizeof(struct tcp_info);
      olen = sizeof(ti);
      
      ret = getsockopt(fd, SOL_MPTCP, MPTCP_TCPINFO, &ti, &olen);
      if (ret < 0)
      	die_perror("getsockopt MPTCP_TCPINFO");
      
      mptcp_subflow_data.num_subflows is populated with the number of
      subflows that exist on the kernel side for the logical mptcp connection.
      
      This allows userspace to re-try with a larger tcp_info array if the number
      of subflows was larger than the available space in the ti[] array.
      
      olen has to be set to the number of bytes that userspace has allocated to
      receive the kernel data.  It will be updated to contain the real number
      bytes that have been copied to by the kernel.
      
      In the above example, if the number if subflows was 1, olen is equal to
      'sizeof(struct mptcp_subflow_data) + sizeof(struct tcp_info).
      For 2 or more subflows olen is equal to 'sizeof(struct my_tcp_info)'.
      
      If there was more data that could not be copied due to lack of space
      in the option buffer, userspace can detect this by checking
      mptcp_subflow_data->num_subflows.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      06f15cee
    • Florian Westphal's avatar
      mptcp: add MPTCP_INFO getsockopt · 55c42fa7
      Florian Westphal authored
      Its not compatible with multipath-tcp.org kernel one.
      
      1. The out-of-tree implementation defines a different 'struct mptcp_info',
         with embedded __user addresses for additional data such as
         endpoint addresses.
      
      2. Mat Martineau points out that embedded __user addresses doesn't work
      with BPF_CGROUP_RUN_PROG_GETSOCKOPT() which assumes that copying in
      optsize bytes from optval provides all data that got copied to userspace.
      
      This provides mptcp_info data for the given mptcp socket.
      
      Userspace sets optlen to the size of the structure it expects.
      The kernel updates it to contain the number of bytes that it copied.
      
      This allows to append more information to the structure later.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      55c42fa7
    • Florian Westphal's avatar
      mptcp: add new mptcp_fill_diag helper · 61bc6e82
      Florian Westphal authored
      Will be re-used from getsockopt path.
      Since diag can be a module, we can't export the helper from diag, it
      needs to be moved to core.
      Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
      Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      61bc6e82
    • David S. Miller's avatar
      Merge branch 'macb-MII-on-RGMII' · 95dca2d5
      David S. Miller authored
      Claudiu Beznea says:
      
      ====================
      net: macb: add support for MII on RGMII interface
      
      This series adds support for MII mode on RGMII interface (patches 3/4,
      4/4). Along with this the series also contains minor cleanups (patches 1/3,
      2/3) on macb.h.
      
      Changes in v2:
      - added patch 4/4 to enable MII on RGMII support for SAMA7G5 MAC IPs
      ====================
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      95dca2d5
    • Claudiu Beznea's avatar
      net: macb: enable mii on rgmii for sama7g5 · 0f4f6d73
      Claudiu Beznea authored
      Both MAC IPs available on SAMA7G5 support MII on RGMII feature.
      Enable these by adding proper capability to proper macb_config
      objects.
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0f4f6d73
    • Claudiu Beznea's avatar
      net: macb: add support for mii on rgmii · 1a9b5a26
      Claudiu Beznea authored
      Cadence IP has option to enable MII support on RGMII interface. This
      could be selected though bit 28 of network control register. This option
      is not enabled on all the IP versions thus add a software capability to
      be selected by the proper implementation of this IP.
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1a9b5a26
    • Claudiu Beznea's avatar
      net: macb: align for OSSMODE offset · d7b3485f
      Claudiu Beznea authored
      Align for OSSMODE offset.
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d7b3485f
    • Claudiu Beznea's avatar
      net: macb: add description for SRTSM · 1dac0084
      Claudiu Beznea authored
      Add description for SRTSM bit.
      Signed-off-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
      Acked-by: default avatarNicolas Ferre <nicolas.ferre@microchip.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1dac0084
    • Florian Fainelli's avatar
      net: bcmgenet: Patch PHY interface for dedicated PHY driver · b972b54a
      Florian Fainelli authored
      When we are using a dedicated PHY driver (not the Generic PHY driver)
      chances are that it is going to configure RGMII delays and do that in a
      way that is incompatible with our incorrect interpretation of the
      phy_interface value.
      
      Add a quirk in order to reverse the PHY_INTERFACE_MODE_RGMII to the
      value of PHY_INTERFACE_MODE_RGMII_ID such that the MAC continues to be
      configured the way it used to be, but the PHY driver can account for
      adding delays. Conversely when PHY_INTERFACE_MODE_RGMII_TXID is
      specified, return PHY_INTERFACE_MODE_RGMII_RXID to the PHY since we will
      have enabled a TXC MAC delay (id_mode_dis=0, meaning there is a delay
      inserted).
      
      This is not considered a bug fix at this point since it only affects
      Broadcom STB platforms shipping with a Device Tree blob that is not
      updatable in the field (quite a few devices out there) and which was
      generated using the scripted Device Tree environment shipped with those
      platforms' SDK.
      Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b972b54a
    • Heiner Kallweit's avatar
      sky2: Stop printing VPD info to debugfs · 0efcc3f2
      Heiner Kallweit authored
      Sky2 is parsing the VPD and adds the parsed information to its debugfs
      file. This isn't needed in kernel, userspace tools like lspci can be
      used to display such information nicely. Therefore remove this from
      the driver.
      
      lspci -vv:
      
      Capabilities: [50] Vital Product Data
      	Product Name: Marvell Yukon 88E8070 Gigabit Ethernet Controller
      	Read-only fields:
      		[PN] Part number: Yukon 88E8070
      		[EC] Engineering changes: Rev. 1.0
      		[MN] Manufacture ID: Marvell
      		[SN] Serial number: AbCdEfG970FD4
      		[CP] Extended capability: 01 10 cc 03
      		[RV] Reserved: checksum good, 9 byte(s) reserved
      	Read/write fields:
      		[RW] Read-write area: 1 byte(s) free
      	End
      
      Relevant part in debugfs file:
      
      0000:01:00.0 Product Data
      Marvell Yukon 88E8070 Gigabit Ethernet Controller
       Part Number: Yukon 88E8070
       Engineering Level: Rev. 1.0
       Manufacturer: Marvell
       Serial Number: AbCdEfG970FD4
      Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
      Acked-by: default avatarStephen Hemminger <stephen@networkplumber.org>
      Link: https://lore.kernel.org/r/bbaee8ab-9b2e-de04-ee7b-571e094cc5fe@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      0efcc3f2
  2. 17 Sep, 2021 25 commits
  3. 16 Sep, 2021 4 commits
    • Jakub Kicinski's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 561bed68
      Jakub Kicinski authored
      No conflicts!
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      561bed68
    • Linus Torvalds's avatar
      Merge tag 'net-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · fc0c0548
      Linus Torvalds authored
      Pull networking fixes from Jakub Kicinski:
       "Including fixes from bpf.
      
        Current release - regressions:
      
         - vhost_net: fix OoB on sendmsg() failure
      
         - mlx5: bridge, fix uninitialized variable usage
      
         - bnxt_en: fix error recovery regression
      
        Current release - new code bugs:
      
         - bpf, mm: fix lockdep warning triggered by stack_map_get_build_id_offset()
      
        Previous releases - regressions:
      
         - r6040: restore MDIO clock frequency after MAC reset
      
         - tcp: fix tp->undo_retrans accounting in tcp_sacktag_one()
      
         - dsa: flush switchdev workqueue before tearing down CPU/DSA ports
      
        Previous releases - always broken:
      
         - ptp: dp83640: don't define PAGE0, avoid compiler warning
      
         - igc: fix tunnel segmentation offloads
      
         - phylink: update SFP selected interface on advertising changes
      
         - stmmac: fix system hang caused by eee_ctrl_timer during suspend/resume
      
         - mlx5e: fix mutual exclusion between CQE compression and HW TS
      
        Misc:
      
         - bpf, cgroups: fix cgroup v2 fallback on v1/v2 mixed mode
      
         - sfc: fallback for lack of xdp tx queues
      
         - hns3: add option to turn off page pool feature"
      
      * tag 'net-5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (67 commits)
        mlxbf_gige: clear valid_polarity upon open
        igc: fix tunnel offloading
        net/{mlx5|nfp|bnxt}: Remove unnecessary RTNL lock assert
        net: wan: wanxl: define CROSS_COMPILE_M68K
        selftests: nci: replace unsigned int with int
        net: dsa: flush switchdev workqueue before tearing down CPU/DSA ports
        Revert "net: phy: Uniform PHY driver access"
        net: dsa: destroy the phylink instance on any error in dsa_slave_phy_setup
        ptp: dp83640: don't define PAGE0
        bnx2x: Fix enabling network interfaces without VFs
        Revert "Revert "ipv4: fix memory leaks in ip_cmsg_send() callers""
        tcp: fix tp->undo_retrans accounting in tcp_sacktag_one()
        net-caif: avoid user-triggerable WARN_ON(1)
        bpf, selftests: Add test case for mixed cgroup v1/v2
        bpf, selftests: Add cgroup v1 net_cls classid helpers
        bpf, cgroups: Fix cgroup v2 fallback on v1/v2 mixed mode
        bpf: Add oversize check before call kvcalloc()
        net: hns3: fix the timing issue of VF clearing interrupt sources
        net: hns3: fix the exception when query imp info
        net: hns3: disable mac in flr process
        ...
      fc0c0548
    • Guenter Roeck's avatar
      net: 6pack: Fix tx timeout and slot time · 3c0d2a46
      Guenter Roeck authored
      tx timeout and slot time are currently specified in units of HZ.  On
      Alpha, HZ is defined as 1024.  When building alpha:allmodconfig, this
      results in the following error message.
      
        drivers/net/hamradio/6pack.c: In function 'sixpack_open':
        drivers/net/hamradio/6pack.c:71:41: error:
        	unsigned conversion from 'int' to 'unsigned char'
        	changes value from '256' to '0'
      
      In the 6PACK protocol, tx timeout is specified in units of 10 ms and
      transmitted over the wire:
      
          https://www.linux-ax25.org/wiki/6PACK
      
      Defining a value dependent on HZ doesn't really make sense, and
      presumably comes from the (very historical) situation where HZ was
      originally 100.
      
      Note that the SIXP_SLOTTIME use explicitly is about 10ms granularity:
      
              mod_timer(&sp->tx_t, jiffies + ((when + 1) * HZ) / 100);
      
      and the SIXP_TXDELAY walue is sent as a byte over the wire.
      Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3c0d2a46
    • Arnd Bergmann's avatar
      drm/rockchip: cdn-dp-core: Make cdn_dp_core_resume __maybe_unused · 040b8907
      Arnd Bergmann authored
      With the new static annotation, the compiler warns when the functions
      are actually unused:
      
         drivers/gpu/drm/rockchip/cdn-dp-core.c:1123:12: error: 'cdn_dp_resume' defined but not used [-Werror=unused-function]
          1123 | static int cdn_dp_resume(struct device *dev)
               |            ^~~~~~~~~~~~~
      
      Mark them __maybe_unused to suppress that warning as well.
      
      [ Not so 'new' static annotations any more, and I removed the part of
        the patch that added __maybe_unused to cdn_dp_suspend(), because it's
        used by the shutdown/remove code.
      
        So only the resume function ends up possibly unused if CONFIG_PM isn't
        set     - Linus ]
      
      Fixes: 7c49abb4 ("drm/rockchip: cdn-dp-core: Make cdn_dp_core_suspend/resume static")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Reviewed-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      040b8907