1. 17 Sep, 2021 1 commit
  2. 09 Aug, 2021 1 commit
  3. 24 Jan, 2019 1 commit
    • Eric Joyner's avatar
      intel iflib drivers: correct initialization of tx_cidx_processed · 088a0b27
      Eric Joyner authored
      From Jake:
      In r341156 ("Fix first-packet completion", 2018-11-28) a hack to work
      around a delta calculation determining how many descriptors were used
      was added to ixl_isc_tx_credits_update_dwb.
      The same fix was also applied to the em and igb drivers in r340310, and
      to ix in r341156.
      The hack checked the case where prev and cur were equal, and then added
      one. This works, because by the time we do the delta check, we already
      know there is at least one packet available, so the delta should be at
      least one.
      However, it's not a complete fix, and as indicated by the comment is
      really a hack to work around the real bug.
      The real problem is that the first time that we transmit a packet,
      tx_cidx_processed will be set to point to the start of the ring.
      Ultimately, the credits_update function expects it to point to the
      *last* descriptor that was processed. Since we haven't yet processed any
      descriptors, pointing it to 0 results in this incorrect calculation.
      Fix the initialization code to have it point to the end of the ring
      instead. One way to think about this, is that we are setting the value
      to be one prior to the first available descriptor.
      Doing so, corrects the delta calculation in all cases. The original fix
      only works if the first packet has exactly one descriptor. Otherwise, we
      will report 1 less than the correct value.
      As part of this fix, also update the MPASS assertions to match the real
      expectations. First, ensure that prev is not equal to cur, since this
      should never happen. Second, remove the assertion about prev==0 || delta
      != 0. It looks like that originated from when the em driver was
      converted to iflib. It seems like it was supposed to ensure that delta
      was non-zero. However, because we originally returned 0 delta for the
      first calculation, the "prev == 0" was tacked on.
      Instead, replace this with a check that delta is greater than zero,
      after the correction necessary when the ring pointers wrap around.
      This new solution should fix the same bug as r341156 did, but in a more
      robust way.
      Submitted by:	Jacob Keller <jacob.e.keller@intel.com>
      Reviewed by:	shurd@
      Sponsored by:	Intel Corporation
      Differential Revision:	https://reviews.freebsd.org/D18545
  4. 09 Nov, 2018 1 commit
    • Stephen Hurd's avatar
      Fix first-packet completion · cf49cdd5
      Stephen Hurd authored
      The first packet after the ring is initialized was never
      completed as isc_txd_credits_update() would not include it in the
      count of completed packets. This caused netmap to never complete
      a batch. See PR 233022 for more details.
      PR:		233022
      Reported by:	lev
      Reviewed by:	lev
      MFC after:	3 days
      Sponsored by:	Limelight Networks
      Differential Revision:	https://reviews.freebsd.org/D17931
  5. 14 Oct, 2018 1 commit
    • Eric Joyner's avatar
      em/igb/ix(4): Port two Tx/Rx fixes made to ixl in r339338 · adf93b56
      Eric Joyner authored
      - Fix assert/panic on receive when Jumbo Frames are enabled.
      From the commit I made to ixl:
      "It turns out that *_isc_rxd_available is supposed to return how many
      packets are available to be cleaned on the rx ring. This patch removes
      a section of code where if the budget argument is 1, the function would return
      one if there was a descriptor available, not necessarily a packet.
      This is okay in regular mtu 1500 traffic since the max frame size is less
      than the configured receive buffer size (2048), but this doesn't work when
      received packets can span more than one  descriptor, as is the case when the
      mtu is 9000 and the receive buffer size is 4096."
      - Fix possible Tx hang because *_isc_txd_credits_update returns incorrect result
      From the commit by Krzysztof Galazka to ixl: "Function isc_txd_update_credits
      called with clear set to false should return 1 if there are TX descriptors
      already handled by HW. It was always returning 0 causing troubles with UDP TX
      PR:             231659
      Reported by:    lev@
      Approved by:	re (gjb@)
      Sponsored by:   Intel Corporation
  6. 04 May, 2018 1 commit
  7. 11 Apr, 2018 1 commit
  8. 21 Mar, 2018 1 commit
    • Stephen Hurd's avatar
      Update copyright per Matthew Macy · 7021bf05
      Stephen Hurd authored
      "Under my tutelage Nicole did 85% of the work. At the time it seemed
      simplest for a number of reasons to put my copyright on it. I now consider
      that to have been a mistake."
      Submitted by:	Matthew Macy <mmacy@mattmacy.io>
      Reviewed by:	shurd
      Approved by:	shurd
      Differential Revision:	https://reviews.freebsd.org/D14766
  9. 19 Dec, 2017 1 commit
  10. 16 Sep, 2017 1 commit
    • Stephen Hurd's avatar
      Revert r323516 (iflib rollup) · ab2e3f79
      Stephen Hurd authored
      This was really too big of a commit even if everything worked, but there
      are multiple new issues introduced in the one huge commit, so it's not
      worth keeping this until it's fixed.
      I'll work on splitting this up into logical chunks and introduce them one
      at a time over the next week or two.
      Approved by:	sbruno (mentor)
      Sponsored by:	Limelight Networks
  11. 13 Sep, 2017 1 commit
    • Stephen Hurd's avatar
      Roll up iflib commits from github. This pulls in most of the work done · d300df01
      Stephen Hurd authored
      by Matt Macy as well as other changes which he has accepted via pull
      request to his github repo at https://github.com/mattmacy/networking/
      This should bring -CURRENT and the github repo into close enough sync to
      allow small feature branches rather than a large chain of interdependant
      patches being developed out of tree.  The reset of the synchronization
      should be able to be completed on github by splitting the remaining
      changes that are not yet ready into short feature branches for later
      review as smaller commits.
      Here is a summary of changes included in this patch:
      1)  More checks when INVARIANTS are enabled for eariler problem
      2)  Group Task Queue cleanups
          - Fix use of duplicate shortdesc for gtaskqueue malloc type.
            Some interfaces such as memguard(9) use the short description to
            identify malloc types, so duplicates should be avoided.
      3)  Allow gtaskqueues to use ithreads in addition to taskqueues
          - In some cases, this can improve performance
      4)  Better logging when taskqgroup_attach*() fails to set interrupt
      5)  Do not start gtaskqueues until they're needed
      6)  Have mp_ring enqueue function enter the ABDICATED rather than BUSY
          state.  This moves the TX to the gtaskq and allows processing to
          continue faster as well as make TX batching more likely.
      7)  Add an ift_txd_errata function to struct if_txrx.  This allows
          drivers to inspect/modify mbufs before transmission.
      8)  Add a new IFLIB_NEED_ZERO_CSUM for drivers to indicate they need
          checksums zeroed for checksum offload to work.  This avoids modifying
          packet data in the TX path when possible.
      9)  Use ithreads for iflib I/O instead of taskqueues
      10) Clean up ioctl and support async ioctl functions
      11) Prefetch two cachlines from each mbuf instead of one up to 128B.  We
          often need to parse packet header info beyond 64B.
      12) Fix potential memory corruption due to fence post error in
          bit_nclear() usage.
      13) Improved hang detection and handling
      14) If the packet is smaller than MTU, disable the TSO flags.
          This avoids extra packet parsing when not needed.
      15) Move TCP header parsing inside the IS_TSO?() test.
          This avoids extra packet parsing when not needed.
      16) Pass chains of mbufs that are not consumed by lro to if_input()
          rather call if_input() for each mbuf.
      17) Re-arrange packet header loads to get as much work as possible done
          before a cache stall.
      18) Lock the context when calling IFDI_ATTACH_PRE()/IFDI_ATTACH_POST()/
      19) Attempt to distribute RX/TX tasks across cores more sensibly,
          especially when RX and TX share an interrupt.  RX will attempt to
          take the first threads on a core, and TX will attempt to take
          successive threads.
      20) Allow iflib_softirq_alloc_generic() to request affinity to the same
          cpus an interrupt has affinity with.  This allows TX queues to
          ensure they are serviced by the socket the device is on.
      21) Add new iflib sysctls to net.iflib:
          - timer_int - interval at which to run per-queue timers in ticks
          - force_busdma
      22) Add new per-device iflib sysctls to dev.X.Y.iflib
          - rx_budget allows tuning the batch size on the RX path
          - watchdog_events Count of watchdog events seen since load
      23) Fix error where netmap_rxq_init() could get called before
      24) e1000: Fixed version of r323008: post-cold sleep instead of DELAY
          when waiting for firmware
          - After interrupts are enabled, convert all waits to sleeps
          - Eliminates e1000 software/firmware synchronization busy waits after
      25) e1000: Remove special case for budget=1 in em_txrx.c
          - Premature optimization which may actually be incorrect with
            multi-segment packets
      26) e1000: Split out TX interrupt rather than share an interrupt for
          RX and TX.
          - Allows better performance by keeping RX and TX paths separate
      27) e1000: Separate igb from em code where suitable
          Much easier to understand separate functions and "if (is_igb)" than
          previous tests like "if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC))"
      Reviewed by:	sbruno
      Approved by:	sbruno (mentor)
      Sponsored by:	Limelight Networks
      Differential Revision:	https://reviews.freebsd.org/D12235
  12. 13 Mar, 2017 1 commit
    • Sean Bruno's avatar
      IFLIB updates · 95246abb
      Sean Bruno authored
      - unconditionally enable BUS_DMA on non-x86 architectures
      - speed up rxd zeroing via customized function
      - support out of order updates to rxd's
      - add prefetching to hardware descriptor rings
      - only prefetch on 10G or faster hardware
      - add seperate tx queue intr function
      - preliminary rework of NETMAP interfaces, WIP
      Submitted by:	Matt Macy <mmacy@nextbsd.org>
      Sponsored by:	Limelight Networks
  13. 25 Jan, 2017 1 commit
  14. 24 Jan, 2017 3 commits
    • Sean Bruno's avatar
      iflib: · bd84f700
      Sean Bruno authored
           Add internal tracking of smp startup status to reliably figure out
           what methods are to be used to get gtaskqueue up and running.
           Calculating this pointer gives undefined behaviour when (last == -1)
           (it is before the buffer).  The pointer is always followed.  Panics
           occurred when it points to an unmapped page.  Otherwise, the pointed-to
           garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
           broken case the loop was usually null and the function just returned, and
           this was acidentally correct.
      Submitted by:	bde
      Reported by:	Matt Macy <mmacy@nextbsd.org>
    • Sean Bruno's avatar
      Revert 312696 due to build tests. · 36fa5d5b
      Sean Bruno authored
    • Sean Bruno's avatar
      iflib: · 562a3182
      Sean Bruno authored
         Add internal tracking of smp startup status to reliably figure out
         what methods are to be used to get gtaskqueue up and running.
         Calculating this pointer gives undefined behaviour when (last == -1)
         (it is before the buffer).  The pointer is always followed.  Panics
         occurred when it points to an unmapped page.  Otherwise, the pointed-to
         garbage tends to not have the E1000_TXD_STAT_DD bit set in it, so in the
         broken case the loop was usually null and the function just returned, and
         this was acidentally correct.
      Submitted by:	bde
      Reviewed by:	Matt Macy <mmacy@nextbsd.org>
  15. 11 Jan, 2017 1 commit
  16. 10 Jan, 2017 2 commits
    • Sean Bruno's avatar
      Add copywrite notices, 2-clause BSD. · d37cece2
      Sean Bruno authored
      Reported by:	jmallett
    • Sean Bruno's avatar
      Migrate e1000 to the IFLIB framework: · f2d6ace4
      Sean Bruno authored
      - em(4) igb(4) and lem(4)
      - deprecate the igb device from kernel configurations
      - create a symbolic link in /boot/kernel from if_em.ko to if_igb.ko
      Devices tested:
      - 82574L
      - I218-LM
      - 82546GB
      - 82579LM
      - I350
      - I217
      Please report problems to freebsd-net@freebsd.org
      Partial review from jhb and suggestions on how to *not* brick folks who
      originally would have lost their igbX device.
      Submitted by:	mmacy@nextbsd.org
      MFC after:	2 weeks
      Relnotes:	yes
      Sponsored by:	Limelight Networks and Dell EMC Isilon
      Differential Revision:	https://reviews.freebsd.org/D8299