1. 05 Jul, 2022 9 commits
  2. 04 Jul, 2022 19 commits
    • Dmitry Chagin's avatar
      linux(4): Use saved cpu feature bits · 03473e8e
      Dmitry Chagin authored
      MFC after:		3 days
    • Dmitry Chagin's avatar
      linux(4): Implement __vdso_time · 42317e64
      Dmitry Chagin authored
      PR:		240769
      MFC after:	3 days
    • Gleb Smirnoff's avatar
      sockets: use only soref()/sorele() as socket reference count · d8596171
      Gleb Smirnoff authored
      o Retire SS_FDREF as it is basically a debug flag on top of already
        existing soref()/sorele().
      o Convert SS_PROTOREF into soref()/sorele().
      o Change reference model for the listen queues, see below.
      o Make sofree() private.  The correct KPI to use is only sorele().
      o Make soabort() respect the model and sorele() instead of sofree().
      Note on listening queues.  Until now the sockets on a queue had zero
      reference count.  And the reference were given only upon accept(2).  The
      assumption was that there is no way to see the queued socket from anywhere
      except its head.  This is not true, since queued sockets already have pcbs,
      which are linked at least into the global pcb lists.  With this change we
      put the reference right in the sonewconn() and on accept(2) path we just
      hand the existing reference to the file descriptor.
      Differential revision:	https://reviews.freebsd.org/D35679
    • Gleb Smirnoff's avatar
      sockets: use positive flag for file descriptor socket reference · bc760564
      Gleb Smirnoff authored
      Rename SS_NOFDREF to SS_FDREF and flip all bitwise operations.
      Mark sockets created by socreate() with SS_FDREF.
      This change is mostly illustrative. With it we see that SS_FDREF
      is a debugging flag, since:
      * socreate() takes a reference with soref().
      * on accept path solisten_dequeue() takes a reference
        with soref() and then soaccept() sets SS_FDREF.
      * soclose() checks SS_FDREF, removes it and does sorele().
      Reviewed by:		tuexen
      Differential revision:	https://reviews.freebsd.org/D35678
    • Gleb Smirnoff's avatar
      tcp: use a TCP flag to check if connection has been close(2)d · 74703901
      Gleb Smirnoff authored
      The flag SS_NOFDREF is a private flag of the socket layer.  It also
      is supposed to be read with SOCK_LOCK(), which we don't own here.
      Reviewed by:		rrs, tuexen
      Differential revision:	https://reviews.freebsd.org/D35663
    • Bjoern A. Zeeb's avatar
      pca954x: harmonize pca9547 and pca954x and add pca9540 support · 97dbd377
      Bjoern A. Zeeb authored
      The two implementations for the pca9548 switch and the pca9547 mux
      seemed close enough so we can put them together and with a bit more
      abstraction add pca9540 support.
      While here apply a bit of consistency in variable and driver naming and
      use device_has_property instead of the FDT-only OF_ variant.
      This disconnects pca9547 from the build but does not yet delete it.
      MFC after:	2 weeks
      Reviewed by:	mmel (earlier version), avg
      Differential Revision: https://reviews.freebsd.org/D35701
    • Doug Moore's avatar
      rb_tree: fine-tune rebalancing code · 2120d7f5
      Doug Moore authored
      Change parts of RB_INSERT_COLOR and RB_REMOVE_COLOR to reduce the
      number of operations, by, in some cases, flipping two color bits at a
      time instead of flipping each individually, in separate operations,
      and by using a switch statement to replace a sequence of if-elses.
      Rewrite RB_SET_PARENT to generate fewer instructions.  These changes
      reduce the code size by over 100 bytes on some architectures.
      Also, allow RB users to define a preprocessor symbol to generate
      RB_REMOVE_COLOR code that matches the implementation described in the
      original weak-AVL paper in one particular case, instead of the still
      correct, but slightly more efficient implementation of that case
      currently implemented.
      Reviewed by:	alc
      MFC after:	3 weeks
      Differential Revision:	https://reviews.freebsd.org/D35524
    • Andrew Gallatin's avatar
      pmcstat: fix log analysis · 0aa15077
      Andrew Gallatin authored
      pmcstat has been broken for analyzing logs since D35342 / b6e28991.
      This is because the pmc for the first CPU is not added when reading logs
      because unlike its clones, its event id is not invalid. That causes us
      to fail the assertion at lib/libpmcstat/libpmcstat_logging.c:293
      when encountering samples from cpu0.
      Fix this by removing the check that the PMC is invalid
      Reviewed by: tsoome
      Sponsored by: Netflix
      Differential Revision: https://reviews.freebsd.org/D35709
    • Andrew Turner's avatar
      Add Rockchip PCIe cleanup on attach faulure · ee2324aa
      Andrew Turner authored
      We should clean up on failure as it may panic the kernel later, e.g.
      if we crate the rman, but fail to destroy it on attach faulure.
      Reviewed by:	imp
      Sponsored by:	The FreeBSD Foundation
      Differential Revision: https://reviews.freebsd.org/D35682
    • Andrew Turner's avatar
      Fix ofw pcib when it rman_init fails · b1e93132
      Andrew Turner authored
      rman_fini assumes rman_init has been called successfully. Clean up
      init faulure by only calling rman_fini when rman_init has succeeded.
      While here add ofw_pcib_fini that can be used by a sub-class to clean
      Reviewed by:	bz, imp
      Sponsored by:	The FreeBSD Foundation
      Differential Revision: https://reviews.freebsd.org/D35681
    • Andrew Turner's avatar
      Support decoding mem32 memory in the rk pcie driver · 1c799a6f
      Andrew Turner authored
      This is needed with some dtb files.
      While here use a switch statement as the two options are mutually
      exclusive in any iteration of the loop.
      Reviewed by:	imp
      Sponsored by:	The FreeBSD Foundation
      Differential Revision: https://reviews.freebsd.org/D35680
    • Kornel Dulęba's avatar
      e6000sw: Fix direct register write logic · 66548259
      Kornel Dulęba authored
      When accessing a register directly from etherswitchcfg one must specify
      a register group(e.g. registers of portN) and the register offset within
      the group. The latter is passed as the 5 least significant bits.
      Extract the former by dividing the register address by 32, not by 5.
      Approved by:	mw(mentor)
      Obtained from:	Semihalf
      Sponsored by:	Stormshield
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D35672
    • Kornel Dulęba's avatar
      lockstat: Fix construction of comparision predicates · 9dbacce2
      Kornel Dulęba authored
      Passing "0x%p" to sprintf results in double "0x" being printed.
      This causes a dtrace script compilation failure when "-d" flag
      is specified.
      Fix that by removing the extraneous "0x".
      Reviewed by:	markj
      Approved by:	mw(mentor)
      Obtained from:	Semihalf
      Sponsored by:	Alstom
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D35690
    • Mike Karels's avatar
      mountd startup: enable NFSv4 if needed on restart · 1cf8e633
      Mike Karels authored
      The mountd script in rc.d sets vfs.nfsd.server_max_nfsvers correctly
      when it is run at system startup, relying on the kernel default.
      However, if NFSv4 was enabled in /etc/rc.conf later, and the script
      was re-run to restart mountd, the sysctl was still set to 3.
      Set the sysctl to the right value in all cases.
      Reviewed by:	rmacklem
      MFC after:	1 week
    • Mateusz Guzik's avatar
      routing: hide notify_add and notify_del behind ROUTE_MPATH · db4b4021
      Mateusz Guzik authored
      Fixes a warn about unused routines without the option.
      Sponsored by:	Rubicon Communications, LLC ("Netgate")
    • Yuri's avatar
      ipmi: do not omit lun in BMC addresses · 177f8b32
      Yuri authored
      Some systems put sensors on non-0 lun, so we should not omit it.  This
      was the only difference with the Linux driver, where DIMM sensors could
      be queried, but not on FreeBSD.
      See this report[1] on the FreeBSD forums:
      Reviewed by:	philip
      Tested by:	Andrey Lanin[1]
      MFC after:	1 week
      Differential Revision: https://reviews.freebsd.org/D35612
    • Yuri's avatar
      ipmi: correctly handle ipmb requests · 18db96db
      Yuri authored
      Handle IPMB requests using SEND_MSG (sent as driver request as we do not
      need to return anything back to userland for this) and GET_MSG (sent as
      usual request so we can return the data for RECEIVE_MSG ioctl) pair.
      This fixes fetching complete sensor data from boards (e.g. HP ProLiant
      DL380 Gen10).
      Reviewed by:	philip
      MFC after:	1 week
      Differential Revision: https://reviews.freebsd.org/D35605
    • Xin LI's avatar
      file: upgrade to 5.42. · a4d6d3b8
      Xin LI authored
      MFC after:	2 weeks
    • Xin LI's avatar
      Vendor import of file 5.42. · ba49e637
      Xin LI authored
  3. 03 Jul, 2022 12 commits
    • Bjoern A. Zeeb's avatar
      dwc3: improve debugging · 11a7d5e5
      Bjoern A. Zeeb authored
      Rather than hiding behind #if 0, hide the debugging behind DWC3_DEBUG
      so it can be turned on with a single define.  Require bootverbose
      to print anything so we can still avoid spamming the console if DWC3_DEBUG
      is on.
      Harmonize the format string in snsp_dwc3_dump_regs() to always print the
      full register and also print the XHCI quirks.
      Call snsp_dwc3_dump_regs() twice, before and after generic XHCI attachment
      and initialisation as this may have an effect on the confirgumation state.
      Obtained from:	an old debug patch
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35700
    • Bjoern A. Zeeb's avatar
      dwc3: add more quirks and checks · 09cdf487
      Bjoern A. Zeeb authored
      Rather than just printing the Global SNPS ID Register store it as well
      so we can do a version check later.
      In addition, for debugging purposes, read the Global Hardware Parameters
      Registers and print them.
      Based on the snpsid disable an XHCI feature using a quirk prepared
      in 447c418d.
      Add the "snps,dis_u3_susphy_quirk" quirk and handle Suspend USB3.0 SS PHY
      after power-on-reset/during core initialization (suggested to be cleared)
      based on the DWC3_GHWPARAMS0 register.
      MFC after:	2 weeks
      Obtained from:	an old debugging patch
      Reviewed by:	mw (earlier version), mmel
      Differential Revision: https://reviews.freebsd.org/D35699
    • Bjoern A. Zeeb's avatar
      dwc3: uncondinationally enable Host IN Auto Retry · cec0a5ec
      Bjoern A. Zeeb authored
      Enable dwc3's auto retry feature. For IN transfers with crc errors
      or internal overruns this will make the host reply with a
      non-terminating retry ACK.  I believe the hope was to improve
      reliability after seeing occasional hiccups.
      Obtained from:	an old debugging patch
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35698
    • Bjoern A. Zeeb's avatar
      dwc3: fix snps,dis-del-phy-power-chg-quirk · 0084212b
      Bjoern A. Zeeb authored
      If snps,dis-del-phy-power-chg-quirk is set, the register bit should be
      cleared not ored on (it's the "dis" version).
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35697
    • Bjoern A. Zeeb's avatar
      tca6416: add support for tca9539 · c4b98101
      Bjoern A. Zeeb authored
      Programming-wise tca6416 and tca9539 seem identical so all we have to
      do is add the extra ofw_compat_data line.
      MFC after:	2 weeks
      Reviewed by:	mw
      Differential Revision: https://reviews.freebsd.org/D35702
    • J.R. Oldroyd's avatar
      wpa_supplicant: Resolve secondary VAP association issue · 775611ea
      J.R. Oldroyd authored
      Association will fail on a secondary open unprotected VAP when the
      primary VAP is configured for WPA. Examples of secondary VAPs are,
      hotels, universities, and commodity routers' guest networks.
      A broadly similar bug was discussed on Red Hat's bugzilla affecting
      association to a D-Link DIR-842.
      This suggests that as IEs were added to the 802.11 protocol the old code
      was increasingly inadaquate to handle the additional IEs, not only a
      secondary VAP.
      PR:		264238
      Reported by:	Jaskie <jiangjun12321@gmail.com>
      		"J.R. Oldroyd" <fbsd@opal.com>
      Submitted by:	"J.R. Oldroyd" <fbsd@opal.com>
      MFC after:	3 days
    • Cy Schubert's avatar
      wpa: Enable WEP by default · 7999a7f2
      Cy Schubert authored
      As of hostap 2.10, WEP is disabled by default. This of course is not a
      bad thing but requires some planning and an announcment to remove WEP
      support by default. A possible src.conf knob or letting users know they
      should use the port instead might different options.
      MFC after:	3 days
    • Rick Macklem's avatar
      mount_nfs.8: Update BUGS section for NFSv4.1/4.2 · aba7a81a
      Rick Macklem authored
      If the "intr" and/or "soft" mount options are used for
      NFSv4 mounts, the protocol can be broken when the
      operation returns without waiting for the RPC reply.
      The likelyhood of failure increases for NFSv4.1/4.2
      mounts, since the session slot will be broken when
      an RPC reply is not processed.
      This is mentioned in the BUGS section of "man mount_nfs",
      but there was no specific mention of the session slot
      problem.  This patch adds a sentence for this case.
      PR: 260011
      Reviewed by:	gbe
      MFC after:	2 weeks
      Differential Revision:	https://reviews.freebsd.org/D35693
    • Dimitry Andric's avatar
      Apply clang fix for assertion building llvm with libc++ 15 · 3b7f365e
      Dimitry Andric authored
      Merge commit f1b0a4fc540f from llvm git (by Richard Smith):
        An expression should only contain an unexpanded parameter pack if it
        lexically contains a mention of the pack.
        Systematically distinguish between syntactic and semantic references to
        packs, especially when propagating dependence from a type into an
        expression. We should consult the type-as-written when computing
        syntactic dependence and should consult the semantic type when computing
        semantic dependence.
        Fixes #54402.
      MFC after:	3 days
    • Gordon Bergling's avatar
      sockatmark(3): Add references to 4.4BSD IPC tutorials · 6cea3be9
      Gordon Bergling authored
      Obtained from:	NetBSD
      MFC after:	3 days
    • Gordon Bergling's avatar
      if_clone: Fix a typo in a source code comment · e8b7972c
      Gordon Bergling authored
      - s/fucntions/functions/
      MFC ater:	3 days
    • Gordon Bergling's avatar
      jme(4): Fix a typo in a source code comment · 015d570c
      Gordon Bergling authored
      - s/fuctions/functions/
      MFC after:	3 days