Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-16 Thread Bruce Evans

On Sat, 16 Sep 2017, Alexander Leidinger wrote:

Quoting Bruce Evans  (from Sat, 16 Sep 2017 13:46:37 
+1000 (EST)):



It gives lesser breakage here:
- with an old PCI em, an error that occur every few makeworlds over nfs now
  hang the hardware.  It used to be recovered from afger about 10 seconds.
  This only happened once.  I then applied my old fix which ignores the
  error better so as to recover from it immediately.  This seems to work as
  before.


As I also have an em device which switches into non-working state: what's the 
patch you have for this? I would like to see if your change also helps my 
device to get back into working shape again.


X Index: em_txrx.c
X ===
X --- em_txrx.c (revision 323636)
X +++ em_txrx.c (working copy)
X @@ -640,9 +640,20 @@
X 
X  		/* Make sure bad packets are discarded */

X   if (errors & E1000_RXD_ERR_FRAME_ERR_MASK) {
X +#if 0
X   adapter->dropped_pkts++;
X - /* XXX fixup if common */
X   return (EBADMSG);
X +#else
X + /*
X +  * XXX the above error handling is worse than none.
X +  * First it it drops 'i' packets before the current
X +  * one and doesn't count them.  Then it returns an
X +  * error.  iflib can't really handle this error.
X +  * It just resets, and this usually drops many more
X +  * packets (without counting them) and much time.
X +  */
X + printf("lem: frame error: ignored\n");
X +#endif
X   }
X 
X  		ri->iri_frags[i].irf_flid = 0;


This is for old em.  nfs doesn't seem to notice the dropped packet(s) after
this.

I think the comment "fixup if common" means "this error should actually
be handled if it occurs enough to matter".

I removed the increment of the dropped packet count because with the change
none are dropped directly here.  I think the error is just for this packet
but more than 1 packet might be dropped by returning in the old code, but
debugging code seem to show no more than 1 packet at a time having an error.
I think returning drops good packets after the bad one together with leaving
the state inconsistent, and it takes almost a reset to recover.

X @@ -703,8 +714,12 @@
X 
X  		/* Make sure bad packets are discarded */

X   if (staterr & E1000_RXDEXT_ERR_FRAME_ERR_MASK) {
X +#if 0
X   adapter->dropped_pkts++;
X   return EBADMSG;
X +#else
X + printf("em: frame error: ignored\n");
X +#endif
X   }
X 
X  		ri->iri_frags[i].irf_flid = 0;


This is for newer em.  I haven't noticed any problems with that (except it
has 27 usec higher latency).

Bruce
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-16 Thread Alexander Leidinger
Quoting Bruce Evans  (from Sat, 16 Sep 2017  
13:46:37 +1000 (EST)):



It gives lesser breakage here:
- with an old PCI em, an error that occur every few makeworlds over nfs now
  hang the hardware.  It used to be recovered from afger about 10 seconds.
  This only happened once.  I then applied my old fix which ignores the
  error better so as to recover from it immediately.  This seems to work as
  before.


As I also have an em device which switches into non-working state:  
what's the patch you have for this? I would like to see if your change  
also helps my device to get back into working shape again.


Bye,
Alexander.


--
http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF


pgpmPAwC0gZTI.pgp
Description: Digitale PGP-Signatur


Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-15 Thread Bruce Evans

On Fri, 15 Sep 2017, Scott Long wrote:


On Sep 13, 2017, at 9:12 AM, Sean Bruno  wrote:


#blamebruno


A large burden.


Reviewed by:sbruno
Approved by:sbruno (mentor)
Sponsored by:Limelight Networks
Differential Revision:https://reviews.freebsd.org/D12235


*gasps at the LoC count and number of changed drivers*

Could someone please better break this up in the future..?


This ridiculous loc was due to the amount of restructuring needed to get
us back to being in sync with our development.  The future will not have
this big of a commit/change and should be more bite/fun sized.

The #blamebruno tag in the commit log was to indicate that this was not
something Stephen was doing on his own, but was something that I had
induced over the last few months during testing.


This breaks my system.  I prior to this commit, I had igb0 and igb1.  Now I
only have igb0, and it\xe2]x80\x99s like igb1 isn\xe2\x80\x99tt even trying to 
attach.  Unfortunately,
this breaks my nfsroot setup, so I need to roll back my tree.  Please let me
know if there\xe2\x80\x99ss anything I can provide to help debugging.


It gives lesser breakage here:
- with an old PCI em, an error that occur every few makeworlds over nfs now
  hang the hardware.  It used to be recovered from afger about 10 seconds.
  This only happened once.  I then applied my old fix which ignores the
  error better so as to recover from it immediately.  This seems to work as
  before.
- with a newer PCI-e em, throughput as measured by netblast is down by
  more that a factor of 2 since last month.

Bruce
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-15 Thread Scott Long

> On Sep 13, 2017, at 9:12 AM, Sean Bruno  wrote:
> 
 #blamebruno
 
 Reviewed by:sbruno
 Approved by:sbruno (mentor)
 Sponsored by:Limelight Networks
 Differential Revision:https://reviews.freebsd.org/D12235
>>> 
>>> *gasps at the LoC count and number of changed drivers*
>>> 
>>> Could someone please better break this up in the future..?
>> 
>> Agreed. Down the road parsing out individual commits in this jumbo commit 
>> will be difficult to parse. IMO this may as well have simply been, import 
>> from https://github.com/mattmacy/networking/, just like Mr. Torvalds does 
>> at kernel.org. I expect to see a commit like this there but not here. Can 
>> we break this down to its functional commits?
>> 
>> 
> 
> 
> This ridiculous loc was due to the amount of restructuring needed to get
> us back to being in sync with our development.  The future will not have
> this big of a commit/change and should be more bite/fun sized.
> 
> The #blamebruno tag in the commit log was to indicate that this was not
> something Stephen was doing on his own, but was something that I had
> induced over the last few months during testing.
> 

This breaks my system.  I prior to this commit, I had igb0 and igb1.  Now I
only have igb0, and it’s like igb1 isn’t even trying to attach.  Unfortunately,
this breaks my nfsroot setup, so I need to roll back my tree.  Please let me
know if there’s anything I can provide to help debugging.

Scott


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-13 Thread Warner Losh
On Wed, Sep 13, 2017 at 7:45 AM, Cy Schubert 
wrote:

> In message  KcmTA@mail.gmail.c
> om>
> , Warner Losh writes:
> > --001a1141f15ac444250559123c56
> > Content-Type: text/plain; charset="UTF-8"
> >
> > On Wed, Sep 13, 2017 at 1:11 AM, Cy Schubert 
> > wrote:
> >
> > > In message <4d5ae475-5a38-4429-8b71-dbecdfb0a...@gmail.com>, Ngie
> Cooper
> > > writes
> > > :
> > > >
> > > > > On Sep 12, 2017, at 18:18, Stephen Hurd  wrote:
> > > > >
> > > > > Author: shurd
> > > > > Date: Wed Sep 13 01:18:42 2017
> > > > > New Revision: 323516
> > > > > URL: https://svnweb.freebsd.org/changeset/base/323516
> > > > >
> > > > > Log:
> > > > >  Roll up iflib commits from github.  This pulls in most of the work
> > > done
> > > > >  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
> > > > >  detection
> > > > >  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
> > > > >  affinity.
> > > > >  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()/
> > > > >  IFDI_DETACH();
> > > > >  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
> > > > >  IFDI_INIT()
> > > > >  24) e1000: Fixed version of r323008: post-cold sleep instead of
> DELAY
> > > > >  when waiting for firmware
> > > > >  - After interrupts are enabled, convert all 

Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-13 Thread Cy Schubert
In message <48654d1f-4cc7-da05-7a73-ef538b431...@freebsd.org>, Sean Bruno 
write
s:
> This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
> --K3RXSO7fXoxBXqJUE1dpQ1sEQkuJPg1DQ
> Content-Type: multipart/mixed; boundary="lalB5jI6dIhQxjTp1UFWH9Jx4OpW69Pfe";
>  protected-headers="v1"
> From: Sean Bruno 
> To: Cy Schubert ,
>  Ngie Cooper 
> Cc: Stephen Hurd , src-committ...@freebsd.org,
>  svn-src-...@freebsd.org, svn-src-head@freebsd.org
> Message-ID: <48654d1f-4cc7-da05-7a73-ef538b431...@freebsd.org>
> Subject: Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net
>  sys
> References: <201709130711.v8d7blts003...@slippy.cwsent.com>
> In-Reply-To: <201709130711.v8d7blts003...@slippy.cwsent.com>
> 
> --lalB5jI6dIhQxjTp1UFWH9Jx4OpW69Pfe
> Content-Type: text/plain; charset=utf-8
> Content-Language: en-US
> Content-Transfer-Encoding: quoted-printable
> 
> >>>  #blamebruno
> >>>
> >>>  Reviewed by:sbruno
> >>>  Approved by:sbruno (mentor)
> >>>  Sponsored by:Limelight Networks
> >>>  Differential Revision:https://reviews.freebsd.org/D12235
> >>
> >> *gasps at the LoC count and number of changed drivers*
> >>
> >> Could someone please better break this up in the future..?
> >=20
> > Agreed. Down the road parsing out individual commits in this jumbo comm=
> it=20
> > will be difficult to parse. IMO this may as well have simply been, impo=
> rt=20
> > from https://github.com/mattmacy/networking/, just like Mr. Torvalds do=
> es=20
> > at kernel.org. I expect to see a commit like this there but not here. C=
> an=20
> > we break this down to its functional commits?
> >=20
> >=20
> 
> 
> This ridiculous loc was due to the amount of restructuring needed to get
> us back to being in sync with our development.  The future will not have
> this big of a commit/change and should be more bite/fun sized.
> 
> The #blamebruno tag in the commit log was to indicate that this was not
> something Stephen was doing on his own, but was something that I had
> induced over the last few months during testing.

I suppose it is sometimes unavoidable.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  http://www.FreeBSD.org

The need of the many outweighs the greed of the few.


___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-13 Thread Sean Bruno
>>>  #blamebruno
>>>
>>>  Reviewed by:sbruno
>>>  Approved by:sbruno (mentor)
>>>  Sponsored by:Limelight Networks
>>>  Differential Revision:https://reviews.freebsd.org/D12235
>>
>> *gasps at the LoC count and number of changed drivers*
>>
>> Could someone please better break this up in the future..?
> 
> Agreed. Down the road parsing out individual commits in this jumbo commit 
> will be difficult to parse. IMO this may as well have simply been, import 
> from https://github.com/mattmacy/networking/, just like Mr. Torvalds does 
> at kernel.org. I expect to see a commit like this there but not here. Can 
> we break this down to its functional commits?
> 
> 


This ridiculous loc was due to the amount of restructuring needed to get
us back to being in sync with our development.  The future will not have
this big of a commit/change and should be more bite/fun sized.

The #blamebruno tag in the commit log was to indicate that this was not
something Stephen was doing on his own, but was something that I had
induced over the last few months during testing.

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-13 Thread Cy Schubert
In message 
, Warner Losh writes:
> --001a1141f15ac444250559123c56
> Content-Type: text/plain; charset="UTF-8"
> 
> On Wed, Sep 13, 2017 at 1:11 AM, Cy Schubert 
> wrote:
> 
> > In message <4d5ae475-5a38-4429-8b71-dbecdfb0a...@gmail.com>, Ngie Cooper
> > writes
> > :
> > >
> > > > On Sep 12, 2017, at 18:18, Stephen Hurd  wrote:
> > > >
> > > > Author: shurd
> > > > Date: Wed Sep 13 01:18:42 2017
> > > > New Revision: 323516
> > > > URL: https://svnweb.freebsd.org/changeset/base/323516
> > > >
> > > > Log:
> > > >  Roll up iflib commits from github.  This pulls in most of the work
> > done
> > > >  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
> > > >  detection
> > > >  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
> > > >  affinity.
> > > >  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()/
> > > >  IFDI_DETACH();
> > > >  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
> > > >  IFDI_INIT()
> > > >  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
> > > >startup
> > > >  25) e1000: Remove special case for budget=1 in em_txrx.c
> > > >  - Premature optimization which may actually be incorrect with
> > > >multi-segment packet

Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-13 Thread Warner Losh
On Wed, Sep 13, 2017 at 1:11 AM, Cy Schubert 
wrote:

> In message <4d5ae475-5a38-4429-8b71-dbecdfb0a...@gmail.com>, Ngie Cooper
> writes
> :
> >
> > > On Sep 12, 2017, at 18:18, Stephen Hurd  wrote:
> > >
> > > Author: shurd
> > > Date: Wed Sep 13 01:18:42 2017
> > > New Revision: 323516
> > > URL: https://svnweb.freebsd.org/changeset/base/323516
> > >
> > > Log:
> > >  Roll up iflib commits from github.  This pulls in most of the work
> done
> > >  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
> > >  detection
> > >  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
> > >  affinity.
> > >  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()/
> > >  IFDI_DETACH();
> > >  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
> > >  IFDI_INIT()
> > >  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
> > >startup
> > >  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)

Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-13 Thread Cy Schubert
In message <4d5ae475-5a38-4429-8b71-dbecdfb0a...@gmail.com>, Ngie Cooper 
writes
:
> 
> > On Sep 12, 2017, at 18:18, Stephen Hurd  wrote:
> > 
> > Author: shurd
> > Date: Wed Sep 13 01:18:42 2017
> > New Revision: 323516
> > URL: https://svnweb.freebsd.org/changeset/base/323516
> > 
> > Log:
> >  Roll up iflib commits from github.  This pulls in most of the work done
> >  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
> >  detection
> >  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
> >  affinity.
> >  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()/
> >  IFDI_DETACH();
> >  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
> >  IFDI_INIT()
> >  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
> >startup
> >  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))"
> > 
> >  #blamebruno
> > 
> >  Reviewed by:sbruno
> >  Approved by:sbruno (mentor)
> >  Sponsored by:Limelight Networks
> >  Differential Revis

Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-12 Thread Ngie Cooper

> On Sep 12, 2017, at 18:18, Stephen Hurd  wrote:
> 
> Author: shurd
> Date: Wed Sep 13 01:18:42 2017
> New Revision: 323516
> URL: https://svnweb.freebsd.org/changeset/base/323516
> 
> Log:
>  Roll up iflib commits from github.  This pulls in most of the work done
>  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
>  detection
>  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
>  affinity.
>  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()/
>  IFDI_DETACH();
>  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
>  IFDI_INIT()
>  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
>startup
>  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))"
> 
>  #blamebruno
> 
>  Reviewed by:sbruno
>  Approved by:sbruno (mentor)
>  Sponsored by:Limelight Networks
>  Differential Revision:https://reviews.freebsd.org/D12235

*gasps at the LoC count and number of changed drivers*

Could someone please better break this up in the future..?

Thank you,
-Ngie
___
svn-src-head@freebsd.org mailing list
https://

Re: svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-12 Thread Ryan Libby
On Tue, Sep 12, 2017 at 6:18 PM, Stephen Hurd  wrote:
> Author: shurd
> Date: Wed Sep 13 01:18:42 2017
> New Revision: 323516
> URL: https://svnweb.freebsd.org/changeset/base/323516
>
> Log:
>   Roll up iflib commits from github.  This pulls in most of the work done
>   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
>   detection
>   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
>   affinity.
>   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()/
>   IFDI_DETACH();
>   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
>   IFDI_INIT()
>   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
> startup
>   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))"
>
>   #blamebruno
>
>   Reviewed by:  sbruno
>   Approved by:  sbruno (mentor)
>   Sponsored by: Limelight Networks
>   Differential Revision:https://reviews.freebsd.org/D12235
>
> Modified:
>   head/sys/dev/bnxt/if_bnxt.c
>   head/sys/dev/e1000/e1000_80003es2lan.c
>   head/sys/dev/e1000/e1000_82571.c
>   head/sys/dev/e1000/e1000_82

svn commit: r323516 - in head/sys: dev/bnxt dev/e1000 kern net sys

2017-09-12 Thread Stephen Hurd
Author: shurd
Date: Wed Sep 13 01:18:42 2017
New Revision: 323516
URL: https://svnweb.freebsd.org/changeset/base/323516

Log:
  Roll up iflib commits from github.  This pulls in most of the work done
  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
  detection
  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
  affinity.
  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()/
  IFDI_DETACH();
  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
  IFDI_INIT()
  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
startup
  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))"
  
  #blamebruno
  
  Reviewed by:  sbruno
  Approved by:  sbruno (mentor)
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D12235

Modified:
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/dev/e1000/e1000_80003es2lan.c
  head/sys/dev/e1000/e1000_82571.c
  head/sys/dev/e1000/e1000_82575.c
  head/sys/dev/e1000/e1000_hw.h
  head/sys/dev/e1000/e1000_i210.c
  head/sys/dev/e1000/e1000_i210.h
  head/sys/dev/e1000/e1000_ich8lan.c
  head/sys/dev/e1000/e1000_mac.c
  head/sys/dev/e1000/e1000_mac.h
  head/sys/dev/e1000/e