svn commit: r323512 - head/sys/conf

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Tue Sep 12 23:58:38 2017
New Revision: 323512
URL: https://svnweb.freebsd.org/changeset/base/323512

Log:
  Leave the Cavium Liquid IO driver exist in files, not files.amd64
  
  Submitted by: imp

Modified:
  head/sys/conf/files
  head/sys/conf/files.amd64

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Sep 12 23:46:33 2017(r323511)
+++ head/sys/conf/files Tue Sep 12 23:58:38 2017(r323512)
@@ -2216,6 +2216,62 @@ dev/le/if_le_pci.c   optional le pci
 dev/le/lance.c optional le
 dev/led/led.c  standard
 dev/lge/if_lge.c   optional lge
+dev/liquidio/base/cn23xx_pf_device.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_console.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_ctrl.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_device.c optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_droq.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_mem_ops.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_request_manager.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/base/lio_response_manager.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_core.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_ioctl.c   optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_main.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_rss.c optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_rxtx.coptional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+dev/liquidio/lio_sysctl.c  optional lio\
+   compile-with "${NORMAL_C}   \
+   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
+lio.c  optional lio\
+   compile-with"${AWK} -f $S/tools/fw_stub.awk 
lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \
+   no-implicit-rule before-depend local\
+   clean   "lio.c"
+lio_23xx_nic.bin.fw.fwo optional lio   \
+   dependency  "lio_23xx_nic.bin.fw"   \
+   compile-with"${NORMAL_FWO}" \
+   no-implicit-rule\
+   clean   "lio_23xx_nic.bin.fw.fwo"
+lio_23xx_nic.bin.fwoptional lio\
+   dependency  "$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu"   \
+   compile-with"${NORMAL_FW}"  \
+   no-obj no-implicit-rule \
+   clean   "lio_23xx_nic.bin.fw"
 dev/lmc/if_lmc.c   optional lmc
 dev/malo/if_malo.c optional malo
 dev/malo/if_malohal.c  optional malo

Modified: head/sys/conf/files.amd64
==
--- head/sys/conf/files.amd64   Tue Sep 12 23:46:33 2017(r323511)
+++ head/sys/conf/files.amd64   Tue Sep 12 23:58:38 2017(r323512)
@@ -328,62 +328,6 @@ dev/hyperv/vmbus/vmbus_res.c   
optionalhyperv
 dev/hyperv/vmbus/vmbus_xact.c  optionalhyperv
 dev/hyperv/vmbus/amd64/hyperv_machdep.c   

svn commit: r323510 - head/sys/conf

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Tue Sep 12 23:42:52 2017
New Revision: 323510
URL: https://svnweb.freebsd.org/changeset/base/323510

Log:
  Do not try to build the Cavium Liquidio driver on all architechtures.
  
  For now, limit to amd64 only.

Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Tue Sep 12 23:36:58 2017(r323509)
+++ head/sys/conf/files Tue Sep 12 23:42:52 2017(r323510)
@@ -2216,62 +2216,6 @@ dev/le/if_le_pci.c   optional le pci
 dev/le/lance.c optional le
 dev/led/led.c  standard
 dev/lge/if_lge.c   optional lge
-dev/liquidio/base/cn23xx_pf_device.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_console.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_ctrl.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_device.c optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_droq.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_mem_ops.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_request_manager.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/base/lio_response_manager.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_core.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_ioctl.c   optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_main.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_rss.c optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_rxtx.coptional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-dev/liquidio/lio_sysctl.c  optional lio\
-   compile-with "${NORMAL_C}   \
-   -I$S/dev/liquidio -I$S/dev/liquidio/base -DSMP"
-lio.c  optional lio\
-   compile-with"${AWK} -f $S/tools/fw_stub.awk 
lio_23xx_nic.bin.fw:lio_23xx_nic.bin -mlio_23xx_nic.bin -c${.TARGET}" \
-   no-implicit-rule before-depend local\
-   clean   "lio.c"
-lio_23xx_nic.bin.fw.fwo optional lio   \
-   dependency  "lio_23xx_nic.bin.fw"   \
-   compile-with"${NORMAL_FWO}" \
-   no-implicit-rule\
-   clean   "lio_23xx_nic.bin.fw.fwo"
-lio_23xx_nic.bin.fwoptional lio\
-   dependency  "$S/contrib/dev/liquidio/lio_23xx_nic.bin.uu"   \
-   compile-with"${NORMAL_FW}"  \
-   no-obj no-implicit-rule \
-   clean   "lio_23xx_nic.bin.fw"
 dev/lmc/if_lmc.c   optional lmc
 dev/malo/if_malo.c optional malo
 dev/malo/if_malohal.c  optional malo
___
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"


svn commit: r323509 - in head: share/man/man4 sys/conf sys/contrib/dev/liquidio sys/dev/liquidio sys/dev/liquidio/base sys/modules sys/modules/lio

2017-09-12 Thread Sean Bruno
Author: sbruno
Date: Tue Sep 12 23:36:58 2017
New Revision: 323509
URL: https://svnweb.freebsd.org/changeset/base/323509

Log:
  The diff is the initial submission of Cavium Liquidio 2350/2360 10/25G
  Intelligent NIC driver.
  
  The submission conconsists of firmware binary file and driver sources.
  
  Submitted by: pkannega...@cavium.com (Prasad V Kanneganti)
  Relnotes: Yes
  Sponsored by: Cavium Networks
  Differential Revision:https://reviews.freebsd.org/D11927

Added:
  head/share/man/man4/liquidio.4   (contents, props changed)
  head/sys/contrib/dev/liquidio/
  head/sys/contrib/dev/liquidio/lio_23xx_nic.bin.uu
  head/sys/dev/liquidio/
  head/sys/dev/liquidio/base/
  head/sys/dev/liquidio/base/cn23xx_pf_device.c   (contents, props changed)
  head/sys/dev/liquidio/base/cn23xx_pf_device.h   (contents, props changed)
  head/sys/dev/liquidio/base/cn23xx_pf_regs.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_common.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_config.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_console.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_ctrl.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_ctrl.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_device.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_device.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_droq.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_droq.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_image.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_iq.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_mem_ops.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_mem_ops.h   (contents, props changed)
  head/sys/dev/liquidio/base/lio_request_manager.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_response_manager.c   (contents, props changed)
  head/sys/dev/liquidio/base/lio_response_manager.h   (contents, props changed)
  head/sys/dev/liquidio/lio_bsd.h   (contents, props changed)
  head/sys/dev/liquidio/lio_core.c   (contents, props changed)
  head/sys/dev/liquidio/lio_ioctl.c   (contents, props changed)
  head/sys/dev/liquidio/lio_ioctl.h   (contents, props changed)
  head/sys/dev/liquidio/lio_main.c   (contents, props changed)
  head/sys/dev/liquidio/lio_main.h   (contents, props changed)
  head/sys/dev/liquidio/lio_network.h   (contents, props changed)
  head/sys/dev/liquidio/lio_rss.c   (contents, props changed)
  head/sys/dev/liquidio/lio_rss.h   (contents, props changed)
  head/sys/dev/liquidio/lio_rxtx.c   (contents, props changed)
  head/sys/dev/liquidio/lio_rxtx.h   (contents, props changed)
  head/sys/dev/liquidio/lio_sysctl.c   (contents, props changed)
  head/sys/modules/lio/
  head/sys/modules/lio/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/share/man/man4/altq.4
  head/share/man/man4/vlan.4
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/conf/files.amd64
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileTue Sep 12 22:19:21 2017
(r323508)
+++ head/share/man/man4/MakefileTue Sep 12 23:36:58 2017
(r323509)
@@ -253,6 +253,7 @@ MAN=aac.4 \
led.4 \
lge.4 \
${_linux.4} \
+   liquidio.4 \
lm75.4 \
lmc.4 \
lo.4 \

Modified: head/share/man/man4/altq.4
==
--- head/share/man/man4/altq.4  Tue Sep 12 22:19:21 2017(r323508)
+++ head/share/man/man4/altq.4  Tue Sep 12 23:36:58 2017(r323509)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 12, 2017
+.Dd August 28, 2017
 .Dt ALTQ 4
 .Os
 .Sh NAME
@@ -152,6 +152,7 @@ They have been applied to the following hardware drive
 .Xr ixgbe 4 ,
 .Xr jme 4 ,
 .Xr le 4 ,
+.Xr liquidio 4 ,
 .Xr msk 4 ,
 .Xr mxge 4 ,
 .Xr my 4 ,

Added: head/share/man/man4/liquidio.4
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man4/liquidio.4  Tue Sep 12 23:36:58 2017
(r323509)
@@ -0,0 +1,133 @@
+.\"  BSD LICENSE
+.\"
+.\"  Copyright(c) 2017 Cavium, Inc.. All rights reserved.
+.\"  All rights reserved.
+.\"
+.\"  Redistribution and use in source and binary forms, with or without
+.\"  modification, are permitted provided that the following conditions
+.\"  are met:
+.\"
+.\"* Redistributions of source code must retain the above copyright
+.\"  notice, this list of conditions and the following disclaimer.
+.\"* Redistributions in binary form must reproduce the above copyright
+.\"  notice, this list of conditions and the following disclaimer in
+.\"  the documentation and/or 

svn commit: r323373 - head/sys/conf

2017-09-09 Thread Sean Bruno
Author: sbruno
Date: Sat Sep  9 20:07:04 2017
New Revision: 323373
URL: https://svnweb.freebsd.org/changeset/base/323373

Log:
  revert r323371 in prepartion for a proper fix
  
  Submitted by: imp

Modified:
  head/sys/conf/files
  head/sys/conf/files.arm64

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Sep  9 19:49:50 2017(r323372)
+++ head/sys/conf/files Sat Sep  9 20:07:04 2017(r323373)
@@ -3053,6 +3053,7 @@ dev/uart/uart_bus_puc.c   optional uart puc
 dev/uart/uart_bus_scc.coptional uart scc
 dev/uart/uart_core.c   optional uart
 dev/uart/uart_dbg.coptional uart gdb
+dev/uart/uart_dev_mvebu.c  optional uart uart_mvebu
 dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps
 dev/uart/uart_dev_pl011.c  optional uart pl011
 dev/uart/uart_dev_quicc.c  optional uart quicc

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Sat Sep  9 19:49:50 2017(r323372)
+++ head/sys/conf/files.arm64   Sat Sep  9 20:07:04 2017(r323373)
@@ -176,7 +176,6 @@ dev/pci/pci_host_generic_fdt.c  optionalpci fdt
 dev/psci/psci.coptionalpsci
 dev/psci/psci_arm64.S  optionalpsci
 dev/uart/uart_cpu_arm64.c  optionaluart
-dev/uart/uart_dev_mvebu.c  optionaluart uart_mvebu
 dev/uart/uart_dev_pl011.c  optionaluart pl011
 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220
 dev/usb/controller/ehci_mv.c   optionalehci_mv fdt
___
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: r323371 - head/sys/conf

2017-09-09 Thread Sean Bruno


On 09/09/17 13:38, Cy Schubert wrote:
> In message <201709091919.v89jje8z075...@repo.freebsd.org>, Sean Bruno 
> writes:
>> Author: sbruno
>> Date: Sat Sep  9 19:19:13 2017
>> New Revision: 323371
>> URL: https://svnweb.freebsd.org/changeset/base/323371
>>
>> Log:
>>   r323359 instroduced an ARMv8 only uart(4) device to the tree but placed
>>   the driver in a place where it will be built for all targets.  x86 doesn't
>>   have all the required build bits for this device.
>>   
>>   Move the uart(4) device mvebu to arm64 only.
>>
>> Modified:
>>   head/sys/conf/files
>>   head/sys/conf/files.arm64
>>
>> Modified: head/sys/conf/files
>> =
>> =
>> --- head/sys/conf/files  Sat Sep  9 18:39:55 2017(r323370)
>> +++ head/sys/conf/files  Sat Sep  9 19:19:13 2017(r323371)
>> @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.coptional uart 
>> puc
>>  dev/uart/uart_bus_scc.c optional uart scc
>>  dev/uart/uart_core.coptional uart
>>  dev/uart/uart_dbg.c optional uart gdb
>> -dev/uart/uart_dev_mvebu.c   optional uart uart_mvebu
>>  dev/uart/uart_dev_ns8250.c  optional uart uart_ns8250 | uart uart_snps
>>  dev/uart/uart_dev_pl011.c   optional uart pl011
>>  dev/uart/uart_dev_quicc.c   optional uart quicc
>>
>> Modified: head/sys/conf/files.arm64
>> =
>> =
>> --- head/sys/conf/files.arm64Sat Sep  9 18:39:55 2017
>> (r323370)
>> +++ head/sys/conf/files.arm64Sat Sep  9 19:19:13 2017
>> (r323371)
>> @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c   optionalpci fdt
>>  dev/psci/psci.c optionalpsci
>>  dev/psci/psci_arm64.S   optionalpsci
>>  dev/uart/uart_cpu_arm64.c   optionaluart
>> +dev/uart/uart_dev_mvebu.c   optionaluart uart_mvebu
>>  dev/uart/uart_dev_pl011.c   optionaluart pl011
>>  dev/usb/controller/dwc_otg_hisi.c optional  dwcotg fdt soc_hisi_hi6220
>>  dev/usb/controller/ehci_mv.coptionalehci_mv fdt
>>
> 
> Hi Sean,
> 
> Don't forget sys/modules/uart/Makefile.
> 
> 


In what way should it be changed?

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r323371 - head/sys/conf

2017-09-09 Thread Sean Bruno


On 09/09/17 13:51, Warner Losh wrote:
> 
> 
> On Sat, Sep 9, 2017 at 1:19 PM, Sean Bruno <sbr...@freebsd.org
> <mailto:sbr...@freebsd.org>> wrote:
> 
> Author: sbruno
> Date: Sat Sep  9 19:19:13 2017
> New Revision: 323371
> URL: https://svnweb.freebsd.org/changeset/base/323371
> <https://svnweb.freebsd.org/changeset/base/323371>
> 
> Log:
>   r323359 instroduced an ARMv8 only uart(4) device to the tree but
> placed
>   the driver in a place where it will be built for all targets.  x86
> doesn't
>   have all the required build bits for this device.
> 
>   Move the uart(4) device mvebu to arm64 only.
> 
> Modified:
>   head/sys/conf/files
>   head/sys/conf/files.arm64
> 
> Modified: head/sys/conf/files
> 
> ==
> --- head/sys/conf/files Sat Sep  9 18:39:55 2017(r323370)
> +++ head/sys/conf/files Sat Sep  9 19:19:13 2017(r323371)
> @@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c   optional
> uart puc
>  dev/uart/uart_bus_scc.coptional uart scc
>  dev/uart/uart_core.c   optional uart
>  dev/uart/uart_dbg.coptional uart gdb
> -dev/uart/uart_dev_mvebu.c  optional uart uart_mvebu
>  dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart
> uart_snps
>  dev/uart/uart_dev_pl011.c  optional uart pl011
>  dev/uart/uart_dev_quicc.c  optional uart quicc
> 
> Modified: head/sys/conf/files.arm64
> 
> ==
> --- head/sys/conf/files.arm64   Sat Sep  9 18:39:55 2017   
> (r323370)
> +++ head/sys/conf/files.arm64   Sat Sep  9 19:19:13 2017   
> (r323371)
> @@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c  optional   
> pci fdt
>  dev/psci/psci.coptionalpsci
>  dev/psci/psci_arm64.S  optionalpsci
>  dev/uart/uart_cpu_arm64.c  optionaluart
> +dev/uart/uart_dev_mvebu.c  optionaluart uart_mvebu
>  dev/uart/uart_dev_pl011.c  optionaluart pl011
>  dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt
> soc_hisi_hi6220
>  dev/usb/controller/ehci_mv.c   optionalehci_mv fdt
> 
> 
> This is a bad change since we may support running the mvebu in 32-bit
> mode, in which case we'd need it duplicated.
> 
> There's no harm in it being in the global files file, as it won't show
> up automatically.
> 
> Warner
> 


I moved it around like this to unbreak the x86 build.

I see explicit restrictions on the header inclusion in sys/modules/uart
that would keep this from compiling on x86 and caused the breakage.

I don't see an obvious way to get this device to build on 32bit and
64bit arm (unless files.arm is included automagically).

Does this make sense?

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r323371 - head/sys/conf

2017-09-09 Thread Sean Bruno
Author: sbruno
Date: Sat Sep  9 19:19:13 2017
New Revision: 323371
URL: https://svnweb.freebsd.org/changeset/base/323371

Log:
  r323359 instroduced an ARMv8 only uart(4) device to the tree but placed
  the driver in a place where it will be built for all targets.  x86 doesn't
  have all the required build bits for this device.
  
  Move the uart(4) device mvebu to arm64 only.

Modified:
  head/sys/conf/files
  head/sys/conf/files.arm64

Modified: head/sys/conf/files
==
--- head/sys/conf/files Sat Sep  9 18:39:55 2017(r323370)
+++ head/sys/conf/files Sat Sep  9 19:19:13 2017(r323371)
@@ -3053,7 +3053,6 @@ dev/uart/uart_bus_puc.c   optional uart puc
 dev/uart/uart_bus_scc.coptional uart scc
 dev/uart/uart_core.c   optional uart
 dev/uart/uart_dbg.coptional uart gdb
-dev/uart/uart_dev_mvebu.c  optional uart uart_mvebu
 dev/uart/uart_dev_ns8250.c optional uart uart_ns8250 | uart uart_snps
 dev/uart/uart_dev_pl011.c  optional uart pl011
 dev/uart/uart_dev_quicc.c  optional uart quicc

Modified: head/sys/conf/files.arm64
==
--- head/sys/conf/files.arm64   Sat Sep  9 18:39:55 2017(r323370)
+++ head/sys/conf/files.arm64   Sat Sep  9 19:19:13 2017(r323371)
@@ -176,6 +176,7 @@ dev/pci/pci_host_generic_fdt.c  optionalpci fdt
 dev/psci/psci.coptionalpsci
 dev/psci/psci_arm64.S  optionalpsci
 dev/uart/uart_cpu_arm64.c  optionaluart
+dev/uart/uart_dev_mvebu.c  optionaluart uart_mvebu
 dev/uart/uart_dev_pl011.c  optionaluart pl011
 dev/usb/controller/dwc_otg_hisi.c optional dwcotg fdt soc_hisi_hi6220
 dev/usb/controller/ehci_mv.c   optionalehci_mv fdt
___
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: r323359 - in head/sys: conf dev/uart modules/uart

2017-09-09 Thread Sean Bruno


On 09/09/17 12:20, Ian Lepore wrote:
> On Sat, 2017-09-09 at 12:09 -0600, Sean Bruno wrote:
>>
>> On 09/09/17 05:42, Marcin Wojtas wrote:
>>>
>>> Author: mw
>>> Date: Sat Sep  9 11:42:32 2017
>>> New Revision: 323359
>>> URL: https://svnweb.freebsd.org/changeset/base/323359
>>>
>>> Log:
>>>   Introduce UART driver module for Armada 3700
>>>   
>>>   This patch adds support for UART in Armada 3700 family.
>>>   It exposes both low-level UART interface, as well as
>>>   standard driver methods.
>>>   
>>>   Submitted by: Patryk Duda <p...@semihalf.com>
>>>   Obtained from: Semihalf
>>>   Sponsored by: Semihalf
>>>   Differential Revision: https://reviews.freebsd.org/D12250
>>>
>>> Added:
>>>   head/sys/dev/uart/uart_dev_mvebu.c   (contents, props changed)
>>> Modified:
>>>   head/sys/conf/files
>>>   head/sys/modules/uart/Makefile
>>
>> Hrm ... I seem to be getting a compile failure after this:
>>
>> cc -target x86_64-unknown-freebsd12.0 --sysroot=/var/tmp/usr/src/tmp
>> -B/var/tmp/usr/src/tmp/usr/bin  -O2 -pipe  -fno-strict-aliasing
>> -Werror
>> -D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS
>> -include
>> /var/tmp/usr/src/sys/GENERIC-NODEBUG/opt_global.h -I. -I/usr/src/sys
>> -fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
>> -I/var/tmp/usr/src/sys/GENERIC-NODEBUG   -MD
>> -MF.depend.uart_dev_mvebu.o -MTuart_dev_mvebu.o -mcmodel=kernel
>> -mno-red-zone -mno-mmx -mno-sse -msoft-float
>> -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-
>> protector
>> -gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-
>> prototypes
>> -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
>> -Wno-pointer-sign -D__printf__=__freebsd_kprintf__
>> -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas
>> -Wno-error-tautological-compare -Wno-error-empty-body
>> -Wno-error-parentheses-equality -Wno-error-unused-function
>> -Wno-error-pointer-sign -Wno-error-shift-negative-value
>> -Wno-error-address-of-packed-member  -mno-aes -mno-avx
>> -std=iso9899:1999 -c /usr/src/sys/dev/uart/uart_dev_mvebu.c -o
>> uart_dev_mvebu.o
>> In file included from /usr/src/sys/dev/uart/uart_dev_mvebu.c:39:
>> /usr/src/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error:
>> 'ofw_bus_if.h'
>> file not found
>> #include "ofw_bus_if.h"
>>  ^~
>> 1 error generated.
>> *** Error code 1
>>
>> Is there supposed to be processing of ofw_bus_if.m somewhere that is
>> currently missed?
>>
>> sean
>>
> 
> ofw_bus_if.h needs to be added to SRCS= in the module makefile.  Over
> the years I learned to grep the c files for _if.h to figure out what
> generated files to add to a module makefile, but ofw_bus_if.h is
> insidious -- it gets included from ofw_bus_subr.h so nobody includes it
> directly and it always gets missed in new module makefiles.
> 
> -- Ian
> 
> 
> 


Oh, the SRCS entry *is* in sys/modules/uart/Makefile but not for x86
archs.  Should this even be built for x86?

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r323359 - in head/sys: conf dev/uart modules/uart

2017-09-09 Thread Sean Bruno


On 09/09/17 05:42, Marcin Wojtas wrote:
> Author: mw
> Date: Sat Sep  9 11:42:32 2017
> New Revision: 323359
> URL: https://svnweb.freebsd.org/changeset/base/323359
> 
> Log:
>   Introduce UART driver module for Armada 3700
>   
>   This patch adds support for UART in Armada 3700 family.
>   It exposes both low-level UART interface, as well as
>   standard driver methods.
>   
>   Submitted by: Patryk Duda 
>   Obtained from: Semihalf
>   Sponsored by: Semihalf
>   Differential Revision: https://reviews.freebsd.org/D12250
> 
> Added:
>   head/sys/dev/uart/uart_dev_mvebu.c   (contents, props changed)
> Modified:
>   head/sys/conf/files
>   head/sys/modules/uart/Makefile


Hrm ... I seem to be getting a compile failure after this:

cc -target x86_64-unknown-freebsd12.0 --sysroot=/var/tmp/usr/src/tmp
-B/var/tmp/usr/src/tmp/usr/bin  -O2 -pipe  -fno-strict-aliasing -Werror
-D_KERNEL -DKLD_MODULE -nostdinc   -DHAVE_KERNEL_OPTION_HEADERS -include
/var/tmp/usr/src/sys/GENERIC-NODEBUG/opt_global.h -I. -I/usr/src/sys
-fno-common -g -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer
-I/var/tmp/usr/src/sys/GENERIC-NODEBUG   -MD
-MF.depend.uart_dev_mvebu.o -MTuart_dev_mvebu.o -mcmodel=kernel
-mno-red-zone -mno-mmx -mno-sse -msoft-float
-fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector
-gdwarf-2 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef
-Wno-pointer-sign -D__printf__=__freebsd_kprintf__
-Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas
-Wno-error-tautological-compare -Wno-error-empty-body
-Wno-error-parentheses-equality -Wno-error-unused-function
-Wno-error-pointer-sign -Wno-error-shift-negative-value
-Wno-error-address-of-packed-member  -mno-aes -mno-avx
-std=iso9899:1999 -c /usr/src/sys/dev/uart/uart_dev_mvebu.c -o
uart_dev_mvebu.o
In file included from /usr/src/sys/dev/uart/uart_dev_mvebu.c:39:
/usr/src/sys/dev/ofw/ofw_bus_subr.h:40:10: fatal error: 'ofw_bus_if.h'
file not found
#include "ofw_bus_if.h"
 ^~
1 error generated.
*** Error code 1

Is there supposed to be processing of ofw_bus_if.m somewhere that is
currently missed?

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r323027 - in head/sys: dev/e1000 net

2017-08-30 Thread Sean Bruno
Author: sbruno
Date: Wed Aug 30 18:56:24 2017
New Revision: 323027
URL: https://svnweb.freebsd.org/changeset/base/323027

Log:
  Revert r323008 and its conversion of e1000/iflib to using SX locks.
  
  This seems to be missing something on the 82574L causing NFS root mounts
  to hang.
  
  Reported by:  kib

Modified:
  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/e1000_osdep.h
  head/sys/dev/e1000/if_em.c
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/e1000/e1000_80003es2lan.c
==
--- head/sys/dev/e1000/e1000_80003es2lan.c  Wed Aug 30 18:46:38 2017
(r323026)
+++ head/sys/dev/e1000/e1000_80003es2lan.c  Wed Aug 30 18:56:24 2017
(r323027)
@@ -59,6 +59,7 @@ static s32  e1000_reset_hw_80003es2lan(struct e1000_hw
 static s32  e1000_init_hw_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
 static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
+static s32  e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 static s32  e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
 static s32  e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
@@ -67,6 +68,7 @@ static s32  e1000_read_kmrn_reg_80003es2lan(struct e10
 static s32  e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
 u16 data);
 static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
+static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 static s32  e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw);
 static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
 
@@ -297,7 +299,7 @@ static s32 e1000_acquire_phy_80003es2lan(struct e1000_
DEBUGFUNC("e1000_acquire_phy_80003es2lan");
 
mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
-   return e1000_acquire_swfw_sync(hw, mask);
+   return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -313,7 +315,7 @@ static void e1000_release_phy_80003es2lan(struct e1000
DEBUGFUNC("e1000_release_phy_80003es2lan");
 
mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
-   e1000_release_swfw_sync(hw, mask);
+   e1000_release_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -331,7 +333,7 @@ static s32 e1000_acquire_mac_csr_80003es2lan(struct e1
 
mask = E1000_SWFW_CSR_SM;
 
-   return e1000_acquire_swfw_sync(hw, mask);
+   return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -348,7 +350,7 @@ static void e1000_release_mac_csr_80003es2lan(struct e
 
mask = E1000_SWFW_CSR_SM;
 
-   e1000_release_swfw_sync(hw, mask);
+   e1000_release_swfw_sync_80003es2lan(hw, mask);
 }
 
 /**
@@ -363,14 +365,14 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_
 
DEBUGFUNC("e1000_acquire_nvm_80003es2lan");
 
-   ret_val = e1000_acquire_swfw_sync(hw, E1000_SWFW_EEP_SM);
+   ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
if (ret_val)
return ret_val;
 
ret_val = e1000_acquire_nvm_generic(hw);
 
if (ret_val)
-   e1000_release_swfw_sync(hw, E1000_SWFW_EEP_SM);
+   e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
 
return ret_val;
 }
@@ -386,7 +388,78 @@ static void e1000_release_nvm_80003es2lan(struct e1000
DEBUGFUNC("e1000_release_nvm_80003es2lan");
 
e1000_release_nvm_generic(hw);
-   e1000_release_swfw_sync(hw, E1000_SWFW_EEP_SM);
+   e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+}
+
+/**
+ *  e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
+ *  @hw: pointer to the HW structure
+ *  @mask: specifies which semaphore to acquire
+ *
+ *  Acquire the SW/FW semaphore to access the PHY or NVM.  The mask
+ *  will also specify which port we're acquiring the lock for.
+ **/
+static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
+{
+   u32 swfw_sync;
+   u32 swmask = mask;
+   u32 fwmask = mask << 16;
+   s32 i = 0;
+   s32 timeout = 50;
+
+   DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan");
+
+   while (i < timeout) {
+   if (e1000_get_hw_semaphore_generic(hw))
+   return -E1000_ERR_SWFW_SYNC;
+
+   swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC);
+   if (!(swfw_sync & (fwmask | swmask)))
+   break;
+
+   /* Firmware currently using 

svn commit: r323008 - in head/sys: dev/e1000 net

2017-08-29 Thread Sean Bruno
Author: sbruno
Date: Wed Aug 30 00:20:43 2017
New Revision: 323008
URL: https://svnweb.freebsd.org/changeset/base/323008

Log:
  Continuation of lock cleanup in e1000.
  
  Post-cold sleep instead of DELAY when waiting for firmware.
  
  Convert softc mutex to an SX lock.  Change all waits to sleeps
  once interrupts are enabled (and it is safe to sleep).
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D12101

Modified:
  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/e1000_osdep.h
  head/sys/dev/e1000/if_em.c
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/e1000/e1000_80003es2lan.c
==
--- head/sys/dev/e1000/e1000_80003es2lan.c  Wed Aug 30 00:14:36 2017
(r323007)
+++ head/sys/dev/e1000/e1000_80003es2lan.c  Wed Aug 30 00:20:43 2017
(r323008)
@@ -59,7 +59,6 @@ static s32  e1000_reset_hw_80003es2lan(struct e1000_hw
 static s32  e1000_init_hw_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw);
 static void e1000_clear_hw_cntrs_80003es2lan(struct e1000_hw *hw);
-static s32  e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 static s32  e1000_cfg_kmrn_10_100_80003es2lan(struct e1000_hw *hw, u16 duplex);
 static s32  e1000_cfg_kmrn_1000_80003es2lan(struct e1000_hw *hw);
 static s32  e1000_cfg_on_link_up_80003es2lan(struct e1000_hw *hw);
@@ -68,7 +67,6 @@ static s32  e1000_read_kmrn_reg_80003es2lan(struct e10
 static s32  e1000_write_kmrn_reg_80003es2lan(struct e1000_hw *hw, u32 offset,
 u16 data);
 static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw);
-static void e1000_release_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask);
 static s32  e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw);
 static void e1000_power_down_phy_copper_80003es2lan(struct e1000_hw *hw);
 
@@ -299,7 +297,7 @@ static s32 e1000_acquire_phy_80003es2lan(struct e1000_
DEBUGFUNC("e1000_acquire_phy_80003es2lan");
 
mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
-   return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
+   return e1000_acquire_swfw_sync(hw, mask);
 }
 
 /**
@@ -315,7 +313,7 @@ static void e1000_release_phy_80003es2lan(struct e1000
DEBUGFUNC("e1000_release_phy_80003es2lan");
 
mask = hw->bus.func ? E1000_SWFW_PHY1_SM : E1000_SWFW_PHY0_SM;
-   e1000_release_swfw_sync_80003es2lan(hw, mask);
+   e1000_release_swfw_sync(hw, mask);
 }
 
 /**
@@ -333,7 +331,7 @@ static s32 e1000_acquire_mac_csr_80003es2lan(struct e1
 
mask = E1000_SWFW_CSR_SM;
 
-   return e1000_acquire_swfw_sync_80003es2lan(hw, mask);
+   return e1000_acquire_swfw_sync(hw, mask);
 }
 
 /**
@@ -350,7 +348,7 @@ static void e1000_release_mac_csr_80003es2lan(struct e
 
mask = E1000_SWFW_CSR_SM;
 
-   e1000_release_swfw_sync_80003es2lan(hw, mask);
+   e1000_release_swfw_sync(hw, mask);
 }
 
 /**
@@ -365,14 +363,14 @@ static s32 e1000_acquire_nvm_80003es2lan(struct e1000_
 
DEBUGFUNC("e1000_acquire_nvm_80003es2lan");
 
-   ret_val = e1000_acquire_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+   ret_val = e1000_acquire_swfw_sync(hw, E1000_SWFW_EEP_SM);
if (ret_val)
return ret_val;
 
ret_val = e1000_acquire_nvm_generic(hw);
 
if (ret_val)
-   e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
+   e1000_release_swfw_sync(hw, E1000_SWFW_EEP_SM);
 
return ret_val;
 }
@@ -388,78 +386,7 @@ static void e1000_release_nvm_80003es2lan(struct e1000
DEBUGFUNC("e1000_release_nvm_80003es2lan");
 
e1000_release_nvm_generic(hw);
-   e1000_release_swfw_sync_80003es2lan(hw, E1000_SWFW_EEP_SM);
-}
-
-/**
- *  e1000_acquire_swfw_sync_80003es2lan - Acquire SW/FW semaphore
- *  @hw: pointer to the HW structure
- *  @mask: specifies which semaphore to acquire
- *
- *  Acquire the SW/FW semaphore to access the PHY or NVM.  The mask
- *  will also specify which port we're acquiring the lock for.
- **/
-static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
-{
-   u32 swfw_sync;
-   u32 swmask = mask;
-   u32 fwmask = mask << 16;
-   s32 i = 0;
-   s32 timeout = 50;
-
-   DEBUGFUNC("e1000_acquire_swfw_sync_80003es2lan");
-
-   while (i < timeout) {
-   if (e1000_get_hw_semaphore_generic(hw))
-   return -E1000_ERR_SWFW_SYNC;
-
-   swfw_sync = E1000_READ_REG(hw, 

svn commit: r322906 - head/sys/dev/e1000

2017-08-25 Thread Sean Bruno
Author: sbruno
Date: Fri Aug 25 22:38:55 2017
New Revision: 322906
URL: https://svnweb.freebsd.org/changeset/base/322906

Log:
  Add a different #define for the maximum number of transmit and
  recieve descriptors for the igb(4) class of devices.  This will
  allow a better definition for maximum going forward.  Some igb(4)
  devices support more than the default 4K.
  
  Reported by:  Jason (j...@nitrology.com)
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Fri Aug 25 21:53:51 2017(r322905)
+++ head/sys/dev/e1000/if_em.c  Fri Aug 25 22:38:55 2017(r322906)
@@ -515,8 +515,8 @@ static struct if_shared_ctx igb_sctx_init = {
 
.isc_nrxd_min = {EM_MIN_RXD},
.isc_ntxd_min = {EM_MIN_TXD},
-   .isc_nrxd_max = {EM_MAX_RXD},
-   .isc_ntxd_max = {EM_MAX_TXD},
+   .isc_nrxd_max = {IGB_MAX_RXD},
+   .isc_ntxd_max = {IGB_MAX_TXD},
.isc_nrxd_default = {EM_DEFAULT_RXD},
.isc_ntxd_default = {EM_DEFAULT_TXD},
 };

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Fri Aug 25 21:53:51 2017(r322905)
+++ head/sys/dev/e1000/if_em.h  Fri Aug 25 22:38:55 2017(r322906)
@@ -96,10 +96,10 @@
 /* Tunables */
 
 /*
- * EM_TXD: Maximum number of Transmit Descriptors
+ * EM_MAX_TXD: Maximum number of Transmit Descriptors
  * Valid Range: 80-256 for 82542 and 82543-based adapters
  *  80-4096 for others
- * Default Value: 256
+ * Default Value: 1024
  *   This value is the number of transmit descriptors allocated by the driver.
  *   Increasing this value allows the driver to queue more transmits. Each
  *   descriptor is 16 bytes.
@@ -111,12 +111,13 @@
 #define EM_MAX_TXD 4096
 #define EM_DEFAULT_TXD  1024
 #define EM_DEFAULT_MULTI_TXD   4096
+#define IGB_MAX_TXD4096
 
 /*
- * EM_RXD - Maximum number of receive Descriptors
+ * EM_MAX_RXD - Maximum number of receive Descriptors
  * Valid Range: 80-256 for 82542 and 82543-based adapters
  *  80-4096 for others
- * Default Value: 256
+ * Default Value: 1024
  *   This value is the number of receive descriptors allocated by the driver.
  *   Increasing this value allows the driver to buffer more incoming packets.
  *   Each descriptor is 16 bytes.  A receive buffer is also allocated for each
@@ -129,6 +130,7 @@
 #define EM_MAX_RXD 4096
 #define EM_DEFAULT_RXD  1024
 #define EM_DEFAULT_MULTI_RXD   4096
+#define IGB_MAX_RXD4096
 
 /*
  * EM_TIDV - Transmit Interrupt Delay Value
___
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"


svn commit: r322900 - in head: . sys/netinet sys/sys usr.bin/netstat

2017-08-25 Thread Sean Bruno
Author: sbruno
Date: Fri Aug 25 19:41:38 2017
New Revision: 322900
URL: https://svnweb.freebsd.org/changeset/base/322900

Log:
  Use counter(9) for PLPMTUD counters.
  
  Remove unused PLPMTUD sysctl counters.
  
  Bump UPDATING and FreeBSD Version to indicate a rebuild is required.
  
  Submitted by: kevin.bowl...@kev009.com
  Reviewed by:  jtl
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D12003

Modified:
  head/UPDATING
  head/sys/netinet/tcp_timer.c
  head/sys/netinet/tcp_var.h
  head/sys/sys/param.h
  head/usr.bin/netstat/inet.c

Modified: head/UPDATING
==
--- head/UPDATING   Fri Aug 25 19:06:36 2017(r322899)
+++ head/UPDATING   Fri Aug 25 19:41:38 2017(r322900)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ** SPECIAL WARNING: **
 
+20170825:
+   Move PMTUD blackhole counters to TCPSTATS and remove them from bare
+   sysctl values.  Minor nit, but requires a rebuild of both world/kernel
+   to complete.
+
 20170814:
"make check" behavior (made in ^/head@r295380) has been changed to
execute from a limited sandbox, as opposed to executing from

Modified: head/sys/netinet/tcp_timer.c
==
--- head/sys/netinet/tcp_timer.cFri Aug 25 19:06:36 2017
(r322899)
+++ head/sys/netinet/tcp_timer.cFri Aug 25 19:41:38 2017
(r322900)
@@ -148,29 +148,6 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_de
 _NAME(tcp_pmtud_blackhole_detect), 0,
 "Path MTU Discovery Black Hole Detection Enabled");
 
-static VNET_DEFINE(int, tcp_pmtud_blackhole_activated);
-#defineV_tcp_pmtud_blackhole_activated \
-VNET(tcp_pmtud_blackhole_activated)
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated,
-CTLFLAG_RD|CTLFLAG_VNET,
-_NAME(tcp_pmtud_blackhole_activated), 0,
-"Path MTU Discovery Black Hole Detection, Activation Count");
-
-static VNET_DEFINE(int, tcp_pmtud_blackhole_activated_min_mss);
-#defineV_tcp_pmtud_blackhole_activated_min_mss \
-VNET(tcp_pmtud_blackhole_activated_min_mss)
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_activated_min_mss,
-CTLFLAG_RD|CTLFLAG_VNET,
-_NAME(tcp_pmtud_blackhole_activated_min_mss), 0,
-"Path MTU Discovery Black Hole Detection, Activation Count at min MSS");
-
-static VNET_DEFINE(int, tcp_pmtud_blackhole_failed);
-#defineV_tcp_pmtud_blackhole_failedVNET(tcp_pmtud_blackhole_failed)
-SYSCTL_INT(_net_inet_tcp, OID_AUTO, pmtud_blackhole_failed,
-CTLFLAG_RD|CTLFLAG_VNET,
-_NAME(tcp_pmtud_blackhole_failed), 0,
-"Path MTU Discovery Black Hole Detection, Failure Count");
-
 #ifdef INET
 static VNET_DEFINE(int, tcp_pmtud_blackhole_mss) = 1200;
 #defineV_tcp_pmtud_blackhole_mss   VNET(tcp_pmtud_blackhole_mss)
@@ -772,7 +749,7 @@ tcp_timer_rexmt(void * xtp)
tp->t_maxseg > V_tcp_v6pmtud_blackhole_mss) {
/* Use the sysctl tuneable blackhole MSS. */
tp->t_maxseg = V_tcp_v6pmtud_blackhole_mss;
-   V_tcp_pmtud_blackhole_activated++;
+   TCPSTAT_INC(tcps_pmtud_blackhole_activated);
} else if (isipv6) {
/* Use the default MSS. */
tp->t_maxseg = V_tcp_v6mssdflt;
@@ -781,7 +758,7 @@ tcp_timer_rexmt(void * xtp)
 * minmss.
 */
tp->t_flags2 &= ~TF2_PLPMTU_PMTUD;
-   V_tcp_pmtud_blackhole_activated_min_mss++;
+   
TCPSTAT_INC(tcps_pmtud_blackhole_activated_min_mss);
}
 #endif
 #if defined(INET6) && defined(INET)
@@ -791,7 +768,7 @@ tcp_timer_rexmt(void * xtp)
if (tp->t_maxseg > V_tcp_pmtud_blackhole_mss) {
/* Use the sysctl tuneable blackhole MSS. */
tp->t_maxseg = V_tcp_pmtud_blackhole_mss;
-   V_tcp_pmtud_blackhole_activated++;
+   TCPSTAT_INC(tcps_pmtud_blackhole_activated);
} else {
/* Use the default MSS. */
tp->t_maxseg = V_tcp_mssdflt;
@@ -800,7 +777,7 @@ tcp_timer_rexmt(void * xtp)
 * minmss.
 */
tp->t_flags2 &= ~TF2_PLPMTU_PMTUD;
-   V_tcp_pmtud_blackhole_activated_min_mss++;
+   
TCPSTAT_INC(tcps_pmtud_blackhole_activated_min_mss);

svn commit: r322823 - head/sys/net

2017-08-23 Thread Sean Bruno
Author: sbruno
Date: Wed Aug 23 21:49:56 2017
New Revision: 322823
URL: https://svnweb.freebsd.org/changeset/base/322823

Log:
  iflib:  call device's if_init function during vlan initialization.
  
  Submitted by: bhargava.marre...@broadcom.com
  Reviewed by:  shurd
  Sponsored by: Broadcom
  Differential Revision:https://reviews.freebsd.org/D12098

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Aug 23 20:28:25 2017(r322822)
+++ head/sys/net/iflib.cWed Aug 23 21:49:56 2017(r322823)
@@ -3927,7 +3927,7 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag
IFDI_VLAN_REGISTER(ctx, vtag);
/* Re-init to load the changes */
if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER)
-   iflib_init_locked(ctx);
+   iflib_if_init_locked(ctx);
CTX_UNLOCK(ctx);
 }
 
@@ -3946,7 +3946,7 @@ iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vt
IFDI_VLAN_UNREGISTER(ctx, vtag);
/* Re-init to load the changes */
if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER)
-   iflib_init_locked(ctx);
+   iflib_if_init_locked(ctx);
CTX_UNLOCK(ctx);
 }
 
___
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"


svn commit: r322363 - head/sys/dev/e1000

2017-08-10 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 14:54:36 2017
New Revision: 322363
URL: https://svnweb.freebsd.org/changeset/base/322363

Log:
  Purge deprecated locking macros.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Thu Aug 10 14:18:58 2017(r322362)
+++ head/sys/dev/e1000/if_em.h  Thu Aug 10 14:54:36 2017(r322363)
@@ -555,26 +555,6 @@ typedef struct _em_vendor_info_t {
 
 void em_dump_rs(struct adapter *);
 
-#defineEM_CORE_LOCK_INIT(_sc, _name) \
-   mtx_init(&(_sc)->core_mtx, _name, "EM Core Lock", MTX_DEF)
-#defineEM_TX_LOCK_INIT(_sc, _name) \
-   mtx_init(&(_sc)->tx_mtx, _name, "EM TX Lock", MTX_DEF)
-#defineEM_RX_LOCK_INIT(_sc, _name) \
-   mtx_init(&(_sc)->rx_mtx, _name, "EM RX Lock", MTX_DEF)
-#defineEM_CORE_LOCK_DESTROY(_sc)   mtx_destroy(&(_sc)->core_mtx)
-#defineEM_TX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->tx_mtx)
-#defineEM_RX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->rx_mtx)
-#defineEM_CORE_LOCK(_sc)   mtx_lock(&(_sc)->core_mtx)
-#defineEM_TX_LOCK(_sc) mtx_lock(&(_sc)->tx_mtx)
-#defineEM_TX_TRYLOCK(_sc)  mtx_trylock(&(_sc)->tx_mtx)
-#defineEM_RX_LOCK(_sc) mtx_lock(&(_sc)->rx_mtx)
-#defineEM_CORE_UNLOCK(_sc) mtx_unlock(&(_sc)->core_mtx)
-#defineEM_TX_UNLOCK(_sc)   mtx_unlock(&(_sc)->tx_mtx)
-#defineEM_RX_UNLOCK(_sc)   mtx_unlock(&(_sc)->rx_mtx)
-#defineEM_CORE_LOCK_ASSERT(_sc)mtx_assert(&(_sc)->core_mtx, 
MA_OWNED)
-#defineEM_TX_LOCK_ASSERT(_sc)  mtx_assert(&(_sc)->tx_mtx, 
MA_OWNED)
-#defineEM_RX_LOCK_ASSERT(_sc)  mtx_assert(&(_sc)->rx_mtx, 
MA_OWNED)
-
 #define EM_RSSRK_SIZE  4
 #define EM_RSSRK_VAL(key, i)   (key[(i) * EM_RSSRK_SIZE] | \
 key[(i) * EM_RSSRK_SIZE + 1] << 8 | \
___
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"


svn commit: r322338 - head/sys/net

2017-08-09 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 03:43:23 2017
New Revision: 322338
URL: https://svnweb.freebsd.org/changeset/base/322338

Log:
  Don't leak mbufs if clusers exceeds the number of segments.  This would
  leak mbufs over time causing crashes.
  
  PR:   221202
  Submitted by: Matt Macy 
  Reported by:  gergely.czu...@harmless.hu
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug 10 03:11:05 2017(r322337)
+++ head/sys/net/iflib.cThu Aug 10 03:43:23 2017(r322338)
@@ -267,6 +267,8 @@ iflib_get_sctx(if_ctx_t ctx)
 #define RX_SW_DESC_INUSE(1 << 3)
 #define TX_SW_DESC_MAPPED   (1 << 4)
 
+#defineM_TOOBIGM_UNUSED_8
+
 typedef struct iflib_sw_rx_desc_array {
bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
struct mbuf **ifsd_m;   /* pkthdr mbufs */
@@ -2930,8 +2932,11 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
m = m->m_next;
count++;
} while (m != NULL);
-   if (count > *nsegs)
+   if (count > *nsegs) {
+   ifsd_m[pidx] = *m0;
+   ifsd_m[pidx]->m_flags |= M_TOOBIG;
return (0);
+   }
m = *m0;
count = 0;
do {
@@ -3241,8 +3246,15 @@ iflib_tx_desc_free(iflib_txq_t txq, int n)
if ((m = ifsd_m[cidx]) != NULL) {
/* XXX we don't support any drivers that batch 
packets yet */
MPASS(m->m_nextpkt == NULL);
-
-   m_free(m);
+   /* if the number of clusters exceeds the number 
of segments
+* there won't be space on the ring to save a 
pointer to each
+* cluster so we simply free the list here
+*/
+   if (m->m_flags & M_TOOBIG) {
+   m_freem(m);
+   } else {
+   m_free(m);
+   }
ifsd_m[cidx] = NULL;
 #if MEMORY_LOGGING
txq->ift_dequeued++;
___
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"


svn commit: r322337 - head/sys/net

2017-08-09 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 03:11:05 2017
New Revision: 322337
URL: https://svnweb.freebsd.org/changeset/base/322337

Log:
  Export IFCAP_HWSTATS so that we don't experience double stats counting
  on iflib enabled devices.
  
  PR:   220198
  Submitted by: Matt Macy 
  Reported by:  Ben Woods 
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Aug 10 02:55:22 2017(r322336)
+++ head/sys/net/iflib.cThu Aug 10 03:11:05 2017(r322337)
@@ -3723,7 +3723,7 @@ iflib_if_qflush(if_t ifp)
 
 
 #define IFCAP_FLAGS (IFCAP_TXCSUM_IPV6 | IFCAP_RXCSUM_IPV6 | IFCAP_HWCSUM | 
IFCAP_LRO | \
-IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING |   \
+IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTAGGING | 
IFCAP_HWSTATS | \
 IFCAP_VLAN_MTU | IFCAP_VLAN_HWFILTER | IFCAP_VLAN_HWTSO)
 
 static int
@@ -4096,8 +4096,8 @@ iflib_device_register(device_t dev, void *sc, if_share
MPASS(scctx->isc_tx_csum_flags);
 #endif
 
-   if_setcapabilities(ifp, scctx->isc_capenable);
-   if_setcapenable(ifp, scctx->isc_capenable);
+   if_setcapabilities(ifp, scctx->isc_capenable | IFCAP_HWSTATS);
+   if_setcapenable(ifp, scctx->isc_capenable | IFCAP_HWSTATS);
 
if (scctx->isc_ntxqsets == 0 || (scctx->isc_ntxqsets_max && 
scctx->isc_ntxqsets_max < scctx->isc_ntxqsets))
scctx->isc_ntxqsets = scctx->isc_ntxqsets_max;
___
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"


svn commit: r322336 - head/usr.bin/calendar/calendars

2017-08-09 Thread Sean Bruno
Author: sbruno
Date: Thu Aug 10 02:55:22 2017
New Revision: 322336
URL: https://svnweb.freebsd.org/changeset/base/322336

Log:
  Add sbruno@ birthday information.
  
  Reported by:  mckusick

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==
--- head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 02:15:40 
2017(r322335)
+++ head/usr.bin/calendar/calendars/calendar.freebsdThu Aug 10 02:55:22 
2017(r322336)
@@ -427,6 +427,7 @@
 12/18  Semen Ustimenko <sem...@freebsd.org> born in Novosibirsk, Russian 
Federation, 1979
 12/19  Stephen Hurd <sh...@freebsd.org> born in Estevan, Saskatchewan, Canada, 
1975
 12/19  Emmanuel Vadot <m...@freebsd.org> born in Decines-Charpieu, France, 1983
+12/20  Sean Bruno <sbr...@freebsd.org> born in Monterey, California, USA, 1974
 12/21  Rong-En Fan <ra...@freebsd.org> born in Taipei, Taiwan, Republic of 
China, 1982
 12/22  Alan L. Cox <a...@freebsd.org> born in Warren, Ohio, United States, 1964
 12/22  Maxim Sobolev <sobo...@freebsd.org> born in Dnepropetrovsk, Ukraine, 
1976
___
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"


svn commit: r321658 - head/usr.sbin/binmiscctl

2017-07-28 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 28 18:11:53 2017
New Revision: 321658
URL: https://svnweb.freebsd.org/changeset/base/321658

Log:
  binmiscctl should use modfind instead of kldfind
  
  kldfind() only matches kernel modules, so if you link imgact_binmisc directly
  into the kernel, binmiscctl can't find it, tries to load it, and errors
  out with:
Can't load imgact_binmisc kernel module: File exists
  
  A quick search of other base commands shows that the correct procedure is to
  call modfind(), and then try kldload() if that fails.
  
  PR:   218593
  Submitted by: Dan Nelson 
  MFC after:1 week

Modified:
  head/usr.sbin/binmiscctl/binmiscctl.c

Modified: head/usr.sbin/binmiscctl/binmiscctl.c
==
--- head/usr.sbin/binmiscctl/binmiscctl.c   Fri Jul 28 18:09:41 2017
(r321657)
+++ head/usr.sbin/binmiscctl/binmiscctl.c   Fri Jul 28 18:11:53 2017
(r321658)
@@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 enum cmd {
@@ -401,7 +402,7 @@ main(int argc, char **argv)
size_t xbe_out_sz = 0, *xbe_out_szp = NULL;
uint32_t i;
 
-   if (kldfind(KMOD_NAME) == -1) {
+   if (modfind(KMOD_NAME) == -1) {
if (kldload(KMOD_NAME) == -1)
fatal("Can't load %s kernel module: %s",
KMOD_NAME, strerror(errno));
___
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"


svn commit: r321631 - head/sys/dev/ixl

2017-07-27 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 27 23:01:07 2017
New Revision: 321631
URL: https://svnweb.freebsd.org/changeset/base/321631

Log:
  Drop IXL RX lock during TCP_LRO, fixes LOR mahem while holding the RX
  queue lock when the uppoer stack is called inside TCP_LRO
  
  Submitted by: Kevin Bowling 
  Reviewed by:  erj
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D11724

Modified:
  head/sys/dev/ixl/ixl_txrx.c

Modified: head/sys/dev/ixl/ixl_txrx.c
==
--- head/sys/dev/ixl/ixl_txrx.c Thu Jul 27 22:53:47 2017(r321630)
+++ head/sys/dev/ixl/ixl_txrx.c Thu Jul 27 23:01:07 2017(r321631)
@@ -1400,9 +1400,7 @@ ixl_rx_input(struct rx_ring *rxr, struct ifnet *ifp, s
 return;
 }
 #endif
-   IXL_RX_UNLOCK(rxr);
 (*ifp->if_input)(ifp, m);
-   IXL_RX_LOCK(rxr);
 }
 
 
@@ -1730,7 +1728,9 @@ next_desc:
/* Now send to the stack or do LRO */
if (sendmp != NULL) {
rxr->next_check = i;
+   IXL_RX_UNLOCK(rxr);
ixl_rx_input(rxr, ifp, sendmp, ptype);
+   IXL_RX_LOCK(rxr);
i = rxr->next_check;
}
 
@@ -1747,6 +1747,8 @@ next_desc:
 
rxr->next_check = i;
 
+   IXL_RX_UNLOCK(rxr);
+
 #if defined(INET6) || defined(INET)
/*
 * Flush any outstanding LRO work
@@ -1762,7 +1764,6 @@ next_desc:
 #endif
 #endif /* defined(INET6) || defined(INET) */
 
-   IXL_RX_UNLOCK(rxr);
return (FALSE);
 }
 
___
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"


svn commit: r321630 - head/sys/net

2017-07-27 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 27 22:53:47 2017
New Revision: 321630
URL: https://svnweb.freebsd.org/changeset/base/321630

Log:
  Slight restructure of iflib_busdma_load_mbuf_sg() to fix accounting
  when m_collapse() fails.
  
  Submitted by: krzystof.gala...@intel.com
  Reviewed by:  Jeb Cramer 
  Sponsored by: Intel Corporation
  Differential Revision:https://reviews.freebsd.org/D11476

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Jul 27 21:21:43 2017(r321629)
+++ head/sys/net/iflib.cThu Jul 27 22:53:47 2017(r321630)
@@ -2975,6 +2975,8 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
 #endif
ifsd_m[next] = m;
while (buflen > 0) {
+   if (i >= max_segs)
+   goto err;
max_sgsize = MIN(buflen, maxsegsz);
curaddr = pmap_kextract(vaddr);
sgsize = PAGE_SIZE - (curaddr & PAGE_MASK);
@@ -2984,8 +2986,6 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
vaddr += sgsize;
buflen -= sgsize;
i++;
-   if (i >= max_segs)
-   goto err;
}
count++;
tmp = m;
___
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"


svn commit: r321629 - in head/sys: dev/bnxt net

2017-07-27 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 27 21:21:43 2017
New Revision: 321629
URL: https://svnweb.freebsd.org/changeset/base/321629

Log:
  Deprecate unused int isc_max_txqsets and int isc_max_rxqsets as they
  were redundant and not being used to set anything up.
  
  Submitted by: Matt Macy 
  Reported by:  Jeb Cramer 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/net/iflib.h

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Thu Jul 27 20:55:31 2017(r321628)
+++ head/sys/dev/bnxt/if_bnxt.c Thu Jul 27 21:21:43 2017(r321629)
@@ -761,12 +761,12 @@ bnxt_attach_pre(if_ctx_t ctx)
scctx->isc_nrxd[1];
scctx->isc_rxqsizes[2] = sizeof(struct rx_prod_pkt_bd) *
scctx->isc_nrxd[2];
-   scctx->isc_max_rxqsets = min(pci_msix_count(softc->dev)-1,
+   scctx->isc_nrxqsets_max = min(pci_msix_count(softc->dev)-1,
softc->func.max_cp_rings - 1);
-   scctx->isc_max_rxqsets = min(scctx->isc_max_rxqsets,
+   scctx->isc_nrxqsets_max = min(scctx->isc_nrxqsets_max,
softc->func.max_rx_rings);
-   scctx->isc_max_txqsets = min(softc->func.max_rx_rings,
-   softc->func.max_cp_rings - scctx->isc_max_rxqsets - 1);
+   scctx->isc_ntxqsets_max = min(softc->func.max_rx_rings,
+   softc->func.max_cp_rings - scctx->isc_nrxqsets_max - 1);
scctx->isc_rss_table_size = HW_HASH_INDEX_SIZE;
scctx->isc_rss_table_mask = scctx->isc_rss_table_size - 1;
 

Modified: head/sys/net/iflib.h
==
--- head/sys/net/iflib.hThu Jul 27 20:55:31 2017(r321628)
+++ head/sys/net/iflib.hThu Jul 27 21:21:43 2017(r321629)
@@ -200,8 +200,6 @@ typedef struct if_softc_ctx {
uint8_t isc_txd_size[8];
uint8_t isc_rxd_size[8];
 
-   int isc_max_txqsets;
-   int isc_max_rxqsets;
int isc_tx_tso_segments_max;
int isc_tx_tso_size_max;
int isc_tx_tso_segsize_max;
___
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"


svn commit: r321481 - head/sys/dev/bnxt

2017-07-25 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 25 15:33:34 2017
New Revision: 321481
URL: https://svnweb.freebsd.org/changeset/base/321481

Log:
  bnxt: Implement interrupt coalescing options using sysctl.
  
  Submitted by:  bhargava.marre...@broadcom.com
  Differential Revision:https://reviews.freebsd.org/D11702

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/bnxt_hwrm.c
  head/sys/dev/bnxt/bnxt_hwrm.h
  head/sys/dev/bnxt/bnxt_sysctl.c
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hTue Jul 25 15:08:52 2017(r321480)
+++ head/sys/dev/bnxt/bnxt.hTue Jul 25 15:33:34 2017(r321481)
@@ -214,6 +214,18 @@ __FBSDID("$FreeBSD$");
 /* Chip info */
 #define BNXT_TSO_SIZE  UINT16_MAX
 
+#define min_t(type, x, y) ({\
+type __min1 = (x);  \
+type __min2 = (y);  \
+__min1 < __min2 ? __min1 : __min2; })
+
+#define max_t(type, x, y) ({\
+type __max1 = (x);  \
+type __max2 = (y);  \
+__max1 > __max2 ? __max1 : __max2; })
+
+#define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max)
+
 /* NVRAM access */
 enum bnxt_nvm_directory_type {
BNX_DIR_TYPE_UNUSED = 0,
@@ -569,6 +581,20 @@ struct bnxt_softc {
struct bnxt_nvram_info  *nvm_info;
bool wol;
uint8_t wol_filter_id;
+   uint16_trx_coal_usecs;
+   uint16_trx_coal_usecs_irq;
+   uint16_trx_coal_frames;
+   uint16_trx_coal_frames_irq;
+   uint16_ttx_coal_usecs;
+   uint16_ttx_coal_usecs_irq;
+   uint16_ttx_coal_frames;
+   uint16_ttx_coal_frames_irq;
+
+#define BNXT_USEC_TO_COAL_TIMER(x)  ((x) * 25 / 2)
+#define BNXT_DEF_STATS_COAL_TICKS100
+#define BNXT_MIN_STATS_COAL_TICKS 25
+#define BNXT_MAX_STATS_COAL_TICKS100
+
 };
 
 struct bnxt_filter_info {

Modified: head/sys/dev/bnxt/bnxt_hwrm.c
==
--- head/sys/dev/bnxt/bnxt_hwrm.c   Tue Jul 25 15:08:52 2017
(r321480)
+++ head/sys/dev/bnxt/bnxt_hwrm.c   Tue Jul 25 15:33:34 2017
(r321481)
@@ -30,6 +30,7 @@
 __FBSDID("$FreeBSD$");
 
 #include 
+#include 
 
 #include "bnxt.h"
 #include "bnxt_hwrm.h"
@@ -1547,3 +1548,131 @@ bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc)
req.wol_filter_id = softc->wol_filter_id;
return hwrm_send_message(softc, , sizeof(req));
 }
+
+static void bnxt_hwrm_set_coal_params(struct bnxt_softc *softc, uint32_t 
max_frames,
+uint32_t buf_tmrs, uint16_t flags,
+struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req)
+{
+req->flags = htole16(flags);
+req->num_cmpl_dma_aggr = htole16((uint16_t)max_frames);
+req->num_cmpl_dma_aggr_during_int = htole16(max_frames >> 16);
+req->cmpl_aggr_dma_tmr = htole16((uint16_t)buf_tmrs);
+req->cmpl_aggr_dma_tmr_during_int = htole16(buf_tmrs >> 16);
+/* Minimum time between 2 interrupts set to buf_tmr x 2 */
+req->int_lat_tmr_min = htole16((uint16_t)buf_tmrs * 2);
+req->int_lat_tmr_max = htole16((uint16_t)buf_tmrs * 4);
+req->num_cmpl_aggr_int = htole16((uint16_t)max_frames * 4);
+}
+
+
+int bnxt_hwrm_set_coal(struct bnxt_softc *softc)
+{
+int i, rc = 0;
+struct hwrm_ring_cmpl_ring_cfg_aggint_params_input req_rx = {0},
+   req_tx = {0}, *req;
+uint16_t max_buf, max_buf_irq;
+uint16_t buf_tmr, buf_tmr_irq;
+uint32_t flags;
+
+bnxt_hwrm_cmd_hdr_init(softc, _rx,
+   HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
+bnxt_hwrm_cmd_hdr_init(softc, _tx,
+   HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
+
+/* Each rx completion (2 records) should be DMAed immediately.
+ * DMA 1/4 of the completion buffers at a time.
+ */
+max_buf = min_t(uint16_t, softc->rx_coal_frames / 4, 2);
+/* max_buf must not be zero */
+max_buf = clamp_t(uint16_t, max_buf, 1, 63);
+max_buf_irq = clamp_t(uint16_t, softc->rx_coal_frames_irq, 1, 63);
+buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs);
+/* buf timer set to 1/4 of interrupt timer */
+buf_tmr = max_t(uint16_t, buf_tmr / 4, 1);
+buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs_irq);
+buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1);
+
+flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET;
+
+/* RING_IDLE generates more IRQs for lower latency.  Enable it only
+ * if coal_usecs is less than 25 

svn commit: r321480 - in head/sys/netinet: . cc tcp_stacks

2017-07-25 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 25 15:08:52 2017
New Revision: 321480
URL: https://svnweb.freebsd.org/changeset/base/321480

Log:
  Revert r307901 - Inform CC modules about loss events.
  
  This was discussed between various transport@ members and it was
  requested to be reverted and discussed.
  
  Submitted by: Kevin Bowling 
  Reported by:  lawrence
  Reviewed by:  hiren
  Sponsored by: Limelight Networks

Modified:
  head/sys/netinet/cc/cc_cdg.c
  head/sys/netinet/cc/cc_chd.c
  head/sys/netinet/cc/cc_cubic.c
  head/sys/netinet/cc/cc_dctcp.c
  head/sys/netinet/cc/cc_htcp.c
  head/sys/netinet/cc/cc_newreno.c
  head/sys/netinet/tcp_input.c
  head/sys/netinet/tcp_stacks/fastpath.c

Modified: head/sys/netinet/cc/cc_cdg.c
==
--- head/sys/netinet/cc/cc_cdg.cTue Jul 25 15:03:05 2017
(r321479)
+++ head/sys/netinet/cc/cc_cdg.cTue Jul 25 15:08:52 2017
(r321480)
@@ -431,12 +431,7 @@ static void
 cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type)
 {
struct cdg *cdg_data = ccv->cc_data;
-   uint32_t cwin;
-   u_int mss;
 
-   cwin = CCV(ccv, snd_cwnd);
-   mss = CCV(ccv, t_maxseg);
-
switch(signal_type) {
case CC_CDG_DELAY:
CCV(ccv, snd_ssthresh) = cdg_window_decrease(ccv,
@@ -453,7 +448,7 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty
 */
if (IN_CONGRECOVERY(CCV(ccv, t_flags)) ||
cdg_data->queue_state < CDG_Q_FULL) {
-   CCV(ccv, snd_ssthresh) = cwin;
+   CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd);
CCV(ccv, snd_recover) = CCV(ccv, snd_max);
} else {
/*
@@ -466,16 +461,12 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty
cdg_data->shadow_w, RENO_BETA);
 
CCV(ccv, snd_ssthresh) = max(cdg_data->shadow_w,
-   cdg_window_decrease(ccv, cwin, V_cdg_beta_loss));
-   CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
+   cdg_window_decrease(ccv, CCV(ccv, snd_cwnd),
+   V_cdg_beta_loss));
 
cdg_data->window_incr = cdg_data->rtt_count = 0;
}
ENTER_RECOVERY(CCV(ccv, t_flags));
-   break;
-   case CC_RTO:
-   CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2);
-   CCV(ccv, snd_cwnd) = mss;
break;
default:
newreno_cc_algo.cong_signal(ccv, signal_type);

Modified: head/sys/netinet/cc/cc_chd.c
==
--- head/sys/netinet/cc/cc_chd.cTue Jul 25 15:03:05 2017
(r321479)
+++ head/sys/netinet/cc/cc_chd.cTue Jul 25 15:08:52 2017
(r321480)
@@ -330,14 +330,10 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty
struct ertt *e_t;
struct chd *chd_data;
int qdly;
-   uint32_t cwin;
-   u_int mss;
 
e_t = khelp_get_osd(CCV(ccv, osd), ertt_id);
chd_data = ccv->cc_data;
qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt;
-   cwin = CCV(ccv, snd_cwnd);
-   mss = CCV(ccv, t_maxseg);
 
switch(signal_type) {
case CC_CHD_DELAY:
@@ -376,10 +372,6 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty
CCV(ccv, t_maxseg) / 2, 2) * CCV(ccv, t_maxseg);
}
ENTER_FASTRECOVERY(CCV(ccv, t_flags));
-   break;
-   case CC_RTO:
-   CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2);
-   CCV(ccv, snd_cwnd) = mss;
break;
 
default:

Modified: head/sys/netinet/cc/cc_cubic.c
==
--- head/sys/netinet/cc/cc_cubic.c  Tue Jul 25 15:03:05 2017
(r321479)
+++ head/sys/netinet/cc/cc_cubic.c  Tue Jul 25 15:08:52 2017
(r321480)
@@ -225,12 +225,8 @@ static void
 cubic_cong_signal(struct cc_var *ccv, uint32_t type)
 {
struct cubic *cubic_data;
-   uint32_t cwin;
-   u_int mss;
 
cubic_data = ccv->cc_data;
-   cwin = CCV(ccv, snd_cwnd);
-   mss = CCV(ccv, t_maxseg);
 
switch (type) {
case CC_NDUPACK:
@@ -239,8 +235,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type)
cubic_ssthresh_update(ccv);
cubic_data->num_cong_events++;
cubic_data->prev_max_cwnd = 
cubic_data->max_cwnd;
-   cubic_data->max_cwnd = cwin;
-   CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
+   cubic_data->max_cwnd = CCV(ccv, snd_cwnd);
 

svn commit: r321479 - in head/sys/netinet: . cc

2017-07-25 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 25 15:03:05 2017
New Revision: 321479
URL: https://svnweb.freebsd.org/changeset/base/321479

Log:
  Revert r308180 - Set slow start threshold more accurrately on loss ...
  
  This was discussed between various transport@ members and it was
  requested to be reverted and discussed.
  
  Submitted by: kevin
  Reported by:  lawerence
  Reviewed by:  hiren

Modified:
  head/sys/netinet/cc/cc_cdg.c
  head/sys/netinet/cc/cc_chd.c
  head/sys/netinet/cc/cc_dctcp.c
  head/sys/netinet/cc/cc_htcp.c
  head/sys/netinet/cc/cc_newreno.c
  head/sys/netinet/tcp_input.c

Modified: head/sys/netinet/cc/cc_cdg.c
==
--- head/sys/netinet/cc/cc_cdg.cTue Jul 25 14:46:13 2017
(r321478)
+++ head/sys/netinet/cc/cc_cdg.cTue Jul 25 15:03:05 2017
(r321479)
@@ -474,9 +474,7 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_ty
ENTER_RECOVERY(CCV(ccv, t_flags));
break;
case CC_RTO:
-   CCV(ccv, snd_ssthresh) =
-   max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
-   * mss;
+   CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2);
CCV(ccv, snd_cwnd) = mss;
break;
default:

Modified: head/sys/netinet/cc/cc_chd.c
==
--- head/sys/netinet/cc/cc_chd.cTue Jul 25 14:46:13 2017
(r321478)
+++ head/sys/netinet/cc/cc_chd.cTue Jul 25 15:03:05 2017
(r321479)
@@ -330,11 +330,13 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty
struct ertt *e_t;
struct chd *chd_data;
int qdly;
+   uint32_t cwin;
u_int mss;
 
e_t = khelp_get_osd(CCV(ccv, osd), ertt_id);
chd_data = ccv->cc_data;
qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt;
+   cwin = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
 
switch(signal_type) {
@@ -376,9 +378,7 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_ty
ENTER_FASTRECOVERY(CCV(ccv, t_flags));
break;
case CC_RTO:
-   CCV(ccv, snd_ssthresh) =
-   max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
-   * mss;
+   CCV(ccv, snd_ssthresh) = max(2*mss, cwin/2);
CCV(ccv, snd_cwnd) = mss;
break;
 

Modified: head/sys/netinet/cc/cc_dctcp.c
==
--- head/sys/netinet/cc/cc_dctcp.c  Tue Jul 25 14:46:13 2017
(r321478)
+++ head/sys/netinet/cc/cc_dctcp.c  Tue Jul 25 15:03:05 2017
(r321479)
@@ -230,21 +230,19 @@ static void
 dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
 {
struct dctcp *dctcp_data;
-   uint32_t cwin, ssthresh_on_loss;
+   uint32_t cwin;
u_int mss;
 
dctcp_data = ccv->cc_data;
cwin = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
-   ssthresh_on_loss =
-   max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
-   * mss;
 
switch (type) {
case CC_NDUPACK:
if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) {
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
-   CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
+   CCV(ccv, snd_ssthresh) = mss *
+   max(cwin / 2 / mss, 2);
dctcp_data->num_cong_events++;
} else {
/* cwnd has already updated as congestion
@@ -252,7 +250,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
 * snd_cwnd_prev and recalculate snd_ssthresh
 */
cwin = CCV(ccv, snd_cwnd_prev);
-   CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
+   CCV(ccv, snd_ssthresh) =
+   max(cwin / 2 / mss, 2) * mss;
}
ENTER_RECOVERY(CCV(ccv, t_flags));
}
@@ -266,7 +265,8 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
if (V_dctcp_slowstart &&
dctcp_data->num_cong_events++ == 0) {
-   CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
+   CCV(ccv, snd_ssthresh) =
+   mss * max(cwin / 2 / mss, 2);
dctcp_data->alpha = MAX_ALPHA_VALUE;
dctcp_data->bytes_ecn = 0;
dctcp_data->bytes_total = 0;
@@ -285,7 +285,7 @@ 

svn commit: r321477 - head/sys/net

2017-07-25 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 25 14:41:50 2017
New Revision: 321477
URL: https://svnweb.freebsd.org/changeset/base/321477

Log:
  Don't hold the RM lock during lagg_proto_addport() to avoid an LOR.
  
  Submitted by: Kevin Bowling 
  Reviewed by:  mav
  MFC after:1 week
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D11711

Modified:
  head/sys/net/if_lagg.c

Modified: head/sys/net/if_lagg.c
==
--- head/sys/net/if_lagg.c  Tue Jul 25 14:38:30 2017(r321476)
+++ head/sys/net/if_lagg.c  Tue Jul 25 14:41:50 2017(r321477)
@@ -738,14 +738,15 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *
 
lagg_setmulti(lp);
 
+   LAGG_WUNLOCK(sc);
+
if ((error = lagg_proto_addport(sc, lp)) != 0) {
/* Remove the port, without calling pr_delport. */
+   LAGG_WLOCK(sc);
lagg_port_destroy(lp, 0);
LAGG_UNLOCK_ASSERT(sc);
return (error);
}
-
-   LAGG_WUNLOCK(sc);
 
/* Update lagg capabilities */
lagg_capabilities(sc);
___
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"


svn commit: r321476 - head/sys/dev/ixgbe

2017-07-25 Thread Sean Bruno
Author: sbruno
Date: Tue Jul 25 14:38:30 2017
New Revision: 321476
URL: https://svnweb.freebsd.org/changeset/base/321476

Log:
  Drop ixgbe RX lock during TCP_LRO processing.  This eliminates a "storm"
  of LOR detection and a bit of lock release/acquire collision when using LRO.
  
  Submitted by:   Kevin Bowling 
  MFC after:  2 days
  Differential Revision:  https://reviews.freebsd.org/D11712

Modified:
  head/sys/dev/ixgbe/ix_txrx.c

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cTue Jul 25 14:35:44 2017
(r321475)
+++ head/sys/dev/ixgbe/ix_txrx.cTue Jul 25 14:38:30 2017
(r321476)
@@ -1593,9 +1593,7 @@ ixgbe_rx_input(struct rx_ring *rxr, struct ifnet *ifp,
if (tcp_lro_rx(>lro, m, 0) == 0)
return;
}
-   IXGBE_RX_UNLOCK(rxr);
(*ifp->if_input)(ifp, m);
-   IXGBE_RX_LOCK(rxr);
 } /* ixgbe_rx_input */
 
 /
@@ -1880,7 +1878,9 @@ next_desc:
/* Now send to the stack or do LRO */
if (sendmp != NULL) {
rxr->next_to_check = i;
+   IXGBE_RX_UNLOCK(rxr);
ixgbe_rx_input(rxr, ifp, sendmp, ptype);
+   IXGBE_RX_LOCK(rxr);
i = rxr->next_to_check;
}
 
@@ -1897,12 +1897,12 @@ next_desc:
 
rxr->next_to_check = i;
 
+   IXGBE_RX_UNLOCK(rxr);
+
/*
 * Flush any outstanding LRO work
 */
tcp_lro_flush_all(lro);
-
-   IXGBE_RX_UNLOCK(rxr);
 
/*
 * Still have cleaning to do?
___
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"


svn commit: r321336 - head/sys/dev/e1000

2017-07-21 Thread Sean Bruno
Author: sbruno
Date: Fri Jul 21 17:42:54 2017
New Revision: 321336
URL: https://svnweb.freebsd.org/changeset/base/321336

Log:
  Do not update stats counter in SWI context.  Defer to the already existing
  admin thread.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Fri Jul 21 17:11:36 2017(r321335)
+++ head/sys/dev/e1000/if_em.c  Fri Jul 21 17:42:54 2017(r321336)
@@ -1663,9 +1663,7 @@ em_if_timer(if_ctx_t ctx, uint16_t qid)
if (qid != 0)
return;
 
-   em_if_update_admin_status(ctx);
-   em_update_stats_counters(adapter);
-
+   iflib_admin_intr_deferred(ctx);
/* Reset LAA into RAR[0] on 82571 */
if ((adapter->hw.mac.type == e1000_82571) &&
e1000_get_laa_state_82571(>hw))
@@ -1781,6 +1779,7 @@ em_if_update_admin_status(if_ctx_t ctx)
iflib_link_state_change(ctx, LINK_STATE_DOWN, ifp->if_baudrate);
printf("link state changed to down\n");
}
+   em_update_stats_counters(adapter);
 
E1000_WRITE_REG(>hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC);
 }
___
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"


svn commit: r321257 - head/sys/dev/e1000

2017-07-19 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 19 22:41:22 2017
New Revision: 321257
URL: https://svnweb.freebsd.org/changeset/base/321257

Log:
  Restore igb(4) code dropped during iflib conversion
   - restore newer code for vf, i350, i210, i211
   - restore dmac init code for i354 and i350
   - restore WUC/WUFC update
   - check for igb mac type before attempting trying to assert
 a media changed event.
   - handle link events for igb(4) and em(4) devices differently
 and appropriately for their respective model types.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Wed Jul 19 22:06:35 2017(r321256)
+++ head/sys/dev/e1000/if_em.c  Wed Jul 19 22:41:22 2017(r321257)
@@ -1025,7 +1025,7 @@ em_if_attach_post(if_ctx_t ctx)
/* Non-AMT based hardware can now take control from firmware */
if (adapter->has_manage && !adapter->has_amt)
em_get_hw_control(adapter);
-   
+
INIT_DEBUGOUT("em_if_attach_post: end");
 
return (error);
@@ -1691,8 +1691,9 @@ em_if_update_admin_status(if_ctx_t ctx)
struct e1000_hw *hw = >hw;
struct ifnet *ifp = iflib_get_ifp(ctx);
device_t dev = iflib_get_dev(ctx);
-   u32 link_check = 0;
+   u32 link_check, thstat, ctrl;
 
+   link_check = thstat = ctrl = 0;
/* Get the cached link value or read phy for real */
switch (hw->phy.media_type) {
case e1000_media_type_copper:
@@ -1717,11 +1718,21 @@ em_if_update_admin_status(if_ctx_t ctx)
e1000_check_for_link(hw);
link_check = adapter->hw.mac.serdes_has_link;
break;
-   default:
+   /* VF device is type_unknown */
case e1000_media_type_unknown:
+e1000_check_for_link(hw);
+   link_check = !hw->mac.get_link_status;
+   /* Fall thru */
+   default:
break;
}
 
+   /* Check for thermal downshift or shutdown */
+   if (hw->mac.type == e1000_i350) {
+   thstat = E1000_READ_REG(hw, E1000_THSTAT);
+   ctrl = E1000_READ_REG(hw, E1000_CTRL_EXT);
+   }
+
/* Now check for a transition */
if (link_check && (adapter->link_active == 0)) {
e1000_get_speed_and_duplex(hw, >link_speed,
@@ -1743,6 +1754,21 @@ em_if_update_admin_status(if_ctx_t ctx)
adapter->link_active = 1;
adapter->smartspeed = 0;
if_setbaudrate(ifp, adapter->link_speed * 100);
+   if ((ctrl & E1000_CTRL_EXT_LINK_MODE_GMII) &&
+   (thstat & E1000_THSTAT_LINK_THROTTLE))
+   device_printf(dev, "Link: thermal downshift\n");
+   /* Delay Link Up for Phy update */
+   if (((hw->mac.type == e1000_i210) ||
+   (hw->mac.type == e1000_i211)) &&
+   (hw->phy.id == I210_I_PHY_ID))
+   msec_delay(I210_LINK_DELAY);
+   /* Reset if the media type changed. */
+   if ((hw->dev_spec._82575.media_changed) &&
+   (adapter->hw.mac.type >= igb_mac_min)) {
+   hw->dev_spec._82575.media_changed = false;
+   adapter->flags |= IGB_MEDIA_RESET;
+   em_reset(ctx);
+   }
iflib_link_state_change(ctx, LINK_STATE_UP, ifp->if_baudrate);
printf("Link state changed to up\n");
} else if (!link_check && (adapter->link_active == 1)) {
@@ -2210,7 +2236,115 @@ lem_smartspeed(struct adapter *adapter)
adapter->smartspeed = 0;
 }
 
+/*
+ *
+ *  Initialize the DMA Coalescing feature
+ *
+ **/
+static void
+igb_init_dmac(struct adapter *adapter, u32 pba)
+{
+   device_tdev = adapter->dev;
+   struct e1000_hw *hw = >hw;
+   u32 dmac, reg = ~E1000_DMACR_DMAC_EN;
+   u16 hwm;
+   u16 max_frame_size;
 
+   if (hw->mac.type == e1000_i211)
+   return;
+
+   max_frame_size = adapter->shared->isc_max_frame_size;
+   if (hw->mac.type > e1000_82580) {
+
+   if (adapter->dmac == 0) { /* Disabling it */
+   E1000_WRITE_REG(hw, E1000_DMACR, reg);
+   return;
+   } else
+   device_printf(dev, "DMA Coalescing enabled\n");
+
+   /* Set starting threshold */
+   E1000_WRITE_REG(hw, E1000_DMCTXTH, 0);
+
+   hwm = 64 * pba - max_frame_size / 16;
+   if (hwm < 64 * (pba - 6))
+   hwm = 64 * 

svn commit: r321253 - head/sys/net

2017-07-19 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 19 21:18:04 2017
New Revision: 321253
URL: https://svnweb.freebsd.org/changeset/base/321253

Log:
  Don't cache mbuf pointers if the number of descriptors is greater than
  the number of buffers.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Jul 19 21:06:31 2017(r321252)
+++ head/sys/net/iflib.cWed Jul 19 21:18:04 2017(r321253)
@@ -2927,6 +2927,14 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
m_free(tmp);
continue;
}
+   m = m->m_next;
+   count++;
+   } while (m != NULL);
+   if (count > *nsegs)
+   return (0);
+   m = *m0;
+   count = 0;
+   do {
next = (pidx + count) & (ntxd-1);
MPASS(ifsd_m[next] == NULL);
ifsd_m[next] = m;
___
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"


svn commit: r320953 - in head/sys/cam: ata scsi

2017-07-13 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 13 16:56:26 2017
New Revision: 320953
URL: https://svnweb.freebsd.org/changeset/base/320953

Log:
  Add 4k and NCQ_TRIM_BROKEN quirks for Samsung 845 SSDs.
  
  Submitted by:  hann...@gmail.com
  Differential Revision:https://reviews.freebsd.org/D7967

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Thu Jul 13 16:27:43 2017(r320952)
+++ head/sys/cam/ata/ata_da.c   Thu Jul 13 16:56:26 2017(r320953)
@@ -661,6 +661,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+* Samsung 845 SSDs
+* 4k optimised, NCQ TRIM Broken (normal TRIM is fine)
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 845*", "*" },
+   /*quirks*/ADA_Q_4K | ADA_Q_NCQ_TRIM_BROKEN
+   },
+   {
+   /*
 * Samsung 850 SSDs
 * 4k optimised, NCQ TRIM broken (normal TRIM fine)
 */

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Thu Jul 13 16:27:43 2017(r320952)
+++ head/sys/cam/scsi/scsi_da.c Thu Jul 13 16:56:26 2017(r320953)
@@ -1284,6 +1284,14 @@ static struct da_quirk_entry da_quirk_table[] =
},
{
/*
+* Samsung 845 SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 845*", "*" },
+   /*quirks*/DA_Q_4K
+   },
+   {
+   /*
 * Samsung 850 SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
___
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"


svn commit: r320948 - in head/sys/cam: ata scsi

2017-07-13 Thread Sean Bruno
Author: sbruno
Date: Thu Jul 13 15:33:08 2017
New Revision: 320948
URL: https://svnweb.freebsd.org/changeset/base/320948

Log:
  Add 4K quirks for Samsung 750 EVO SSD
  
  Submitted by: lev
  Reviewed by:  mav
  Differential Revision:https://reviews.freebsd.org/D9478

Modified:
  head/sys/cam/ata/ata_da.c
  head/sys/cam/scsi/scsi_da.c

Modified: head/sys/cam/ata/ata_da.c
==
--- head/sys/cam/ata/ata_da.c   Thu Jul 13 15:16:45 2017(r320947)
+++ head/sys/cam/ata/ata_da.c   Thu Jul 13 15:33:08 2017(r320948)
@@ -637,6 +637,14 @@ static struct ada_quirk_entry ada_quirk_table[] =
},
{
/*
+* Samsung 750 SSDs
+* 4k optimised, NCQ TRIM seems to work
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "*", "Samsung SSD 750*", "*" },
+   /*quirks*/ADA_Q_4K
+   },
+   {
+   /*
 * Samsung 830 Series SSDs
 * 4k optimised, NCQ TRIM Broken (normal TRIM is fine)
 */

Modified: head/sys/cam/scsi/scsi_da.c
==
--- head/sys/cam/scsi/scsi_da.c Thu Jul 13 15:16:45 2017(r320947)
+++ head/sys/cam/scsi/scsi_da.c Thu Jul 13 15:33:08 2017(r320948)
@@ -1260,6 +1260,14 @@ static struct da_quirk_entry da_quirk_table[] =
},
{
/*
+* Samsung 750 Series SSDs
+* 4k optimised & trim only works in 4k requests + 4k aligned
+*/
+   { T_DIRECT, SIP_MEDIA_FIXED, "ATA", "Samsung SSD 750*", "*" },
+   /*quirks*/DA_Q_4K
+   },
+   {
+   /*
 * Samsung 830 Series SSDs
 * 4k optimised & trim only works in 4k requests + 4k aligned
 */
___
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"


svn commit: r320916 - head/sys/dev/ixgbe

2017-07-12 Thread Sean Bruno
Author: sbruno
Date: Wed Jul 12 17:35:32 2017
New Revision: 320916
URL: https://svnweb.freebsd.org/changeset/base/320916

Log:
  Reset unsupported SFP tuneable back to original entry name.
  
  Reported by:  olivier@

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Wed Jul 12 15:16:01 2017(r320915)
+++ head/sys/dev/ixgbe/if_ix.c  Wed Jul 12 17:35:32 2017(r320916)
@@ -333,7 +333,7 @@ SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, 
  * doing so you are on your own :)
  */
 static int allow_unsupported_sfp = FALSE;
-SYSCTL_INT(_hw_ix, OID_AUTO, allow_unsupported_sfp, CTLFLAG_RDTUN,
+SYSCTL_INT(_hw_ix, OID_AUTO, unsupported_sfp, CTLFLAG_RDTUN,
 _unsupported_sfp, 0,
 "Allow unsupported SFP modules...use at your own risk");
 
___
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"


svn commit: r320616 - head/contrib/libpcap/bpf/net

2017-07-03 Thread Sean Bruno
Author: sbruno
Date: Mon Jul  3 19:49:25 2017
New Revision: 320616
URL: https://svnweb.freebsd.org/changeset/base/320616

Log:
  Clear clang warning:
warning: macro expansion producing 'defined' has undefined behavior
[-Wexpansion-to-defined]
  
  Submitted by: Aaron Prieger 
  Reviewed by:  dim
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D11166

Modified:
  head/contrib/libpcap/bpf/net/bpf_filter.c

Modified: head/contrib/libpcap/bpf/net/bpf_filter.c
==
--- head/contrib/libpcap/bpf/net/bpf_filter.c   Mon Jul  3 19:46:12 2017
(r320615)
+++ head/contrib/libpcap/bpf/net/bpf_filter.c   Mon Jul  3 19:49:25 2017
(r320616)
@@ -61,7 +61,12 @@
 #include 
 #include 
 
-#defineSOLARIS (defined(sun) && (defined(__SVR4) || defined(__svr4__)))
+#if (defined(sun) && (defined(__SVR4) || defined(__svr4__)))
+#defineSOLARIS 1
+#else
+#define SOLARIS 0
+#endif
+
 #if defined(__hpux) || SOLARIS
 # include 
 # include 
___
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"


svn commit: r320614 - head/sys/netinet

2017-07-03 Thread Sean Bruno
Author: sbruno
Date: Mon Jul  3 19:39:58 2017
New Revision: 320614
URL: https://svnweb.freebsd.org/changeset/base/320614

Log:
  Add a sysctl to toggle the use of the sockets LOWAT when calculating auto 
window growth
  
  Submitted by: j...@nitrology.com (Jason Wolfe)
  Reviewed by:  gnn hiren
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D11016

Modified:
  head/sys/netinet/tcp_output.c

Modified: head/sys/netinet/tcp_output.c
==
--- head/sys/netinet/tcp_output.c   Mon Jul  3 19:33:50 2017
(r320613)
+++ head/sys/netinet/tcp_output.c   Mon Jul  3 19:39:58 2017
(r320614)
@@ -130,6 +130,12 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_max, CTLFL
_NAME(tcp_autosndbuf_max), 0,
"Max size of automatic send buffer");
 
+VNET_DEFINE(int, tcp_sendbuf_auto_lowat) = 0;
+#defineV_tcp_sendbuf_auto_lowatVNET(tcp_sendbuf_auto_lowat)
+SYSCTL_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto_lowat, CTLFLAG_VNET | 
CTLFLAG_RW,
+   _NAME(tcp_sendbuf_auto_lowat), 0,
+   "Modify threshold for auto send buffer growth to account for 
SO_SNDLOWAT");
+
 /*
  * Make sure that either retransmit or persist timer is set for SYN, FIN and
  * non-ACK.
@@ -521,8 +527,12 @@ after_sack_rexmit:
 * XXXGL: should there be used sbused() or sbavail()?
 */
if (V_tcp_do_autosndbuf && so->so_snd.sb_flags & SB_AUTOSIZE) {
-   if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat &&
-   sbused(>so_snd) >= (so->so_snd.sb_hiwat / 8 * 7) &&
+   int autosndbuf_mod = 0;
+   if (V_tcp_sendbuf_auto_lowat)
+   autosndbuf_mod = so->so_snd.sb_lowat;
+
+   if ((tp->snd_wnd / 4 * 5) >= so->so_snd.sb_hiwat - 
autosndbuf_mod &&
+   sbused(>so_snd) >= (so->so_snd.sb_hiwat / 8 * 7) - 
autosndbuf_mod &&
sbused(>so_snd) < V_tcp_autosndbuf_max &&
sendwin >= (sbused(>so_snd) -
(tp->snd_nxt - tp->snd_una))) {
___
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"


svn commit: r320613 - in head/sys: amd64/conf conf i386/conf

2017-07-03 Thread Sean Bruno
Author: sbruno
Date: Mon Jul  3 19:33:50 2017
New Revision: 320613
URL: https://svnweb.freebsd.org/changeset/base/320613

Log:
  Garbage collect kernel option TWA_FLASH_FIRMWARE
  
  Submitted by:  kevin.bowling0kev009.com
  Differential Revision:https://reviews.freebsd.org/D11387

Modified:
  head/sys/amd64/conf/NOTES
  head/sys/conf/options
  head/sys/i386/conf/NOTES

Modified: head/sys/amd64/conf/NOTES
==
--- head/sys/amd64/conf/NOTES   Mon Jul  3 19:30:03 2017(r320612)
+++ head/sys/amd64/conf/NOTES   Mon Jul  3 19:33:50 2017(r320613)
@@ -414,7 +414,6 @@ device  arcmsr  # Areca SATA II RAID
 # The driver is implemented as a SIM, and so, needs the CAM infrastructure.
 #
 optionsTWA_DEBUG   # 0-10; 10 prints the most messages.
-optionsTWA_FLASH_FIRMWARE  # firmware image bundled when defined.
 device twa # 3ware 9000 series PATA/SATA RAID
 
 #

Modified: head/sys/conf/options
==
--- head/sys/conf/options   Mon Jul  3 19:30:03 2017(r320612)
+++ head/sys/conf/options   Mon Jul  3 19:33:50 2017(r320613)
@@ -45,7 +45,6 @@ AHD_REG_PRETTY_PRINT  opt_aic79xx.h
 ADW_ALLOW_MEMIOopt_adw.h
 
 TWA_DEBUG  opt_twa.h
-TWA_FLASH_FIRMWARE opt_twa.h
 
 # Debugging options.
 ALT_BREAK_TO_DEBUGGER  opt_kdb.h

Modified: head/sys/i386/conf/NOTES
==
--- head/sys/i386/conf/NOTESMon Jul  3 19:30:03 2017(r320612)
+++ head/sys/i386/conf/NOTESMon Jul  3 19:33:50 2017(r320613)
@@ -673,7 +673,6 @@ device  arcmsr  # Areca SATA II RAID
 # The driver is implemented as a SIM, and so, needs the CAM infrastructure.
 #
 optionsTWA_DEBUG   # 0-10; 10 prints the most messages.
-optionsTWA_FLASH_FIRMWARE  # firmware image bundled when defined.
 device twa # 3ware 9000 series PATA/SATA RAID
 
 #
___
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"


svn commit: r320611 - head/sys/net

2017-07-03 Thread Sean Bruno
Author: sbruno
Date: Mon Jul  3 19:23:45 2017
New Revision: 320611
URL: https://svnweb.freebsd.org/changeset/base/320611

Log:
  iflib - flib_busdma_load_mbuf_sg used isc_tx_maxsize as max semgent size.
  
  Submitted by: krzysztof.gala...@intel.com
  Differential Revision:https://reviews.freebsd.org/D11403

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cMon Jul  3 18:42:26 2017(r320610)
+++ head/sys/net/iflib.cMon Jul  3 19:23:45 2017(r320611)
@@ -2892,7 +2892,7 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
if_ctx_t ctx;
if_shared_ctx_t sctx;
if_softc_ctx_t  scctx;
-   int i, next, pidx, err, maxsegsz, ntxd, count;
+   int i, next, pidx, err, ntxd, count;
struct mbuf *m, *tmp, **ifsd_m;
 
m = *m0;
@@ -2935,13 +2935,17 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
m = m->m_next;
} while (m != NULL);
} else {
-   int buflen, sgsize, max_sgsize;
+   int buflen, sgsize, maxsegsz, max_sgsize;
vm_offset_t vaddr;
vm_paddr_t curaddr;
 
count = i = 0;
-   maxsegsz = sctx->isc_tx_maxsize;
m = *m0;
+   if (m->m_pkthdr.csum_flags & CSUM_TSO)
+   maxsegsz = scctx->isc_tx_tso_segsize_max;
+   else
+   maxsegsz = sctx->isc_tx_maxsegsize;
+
do {
if (__predict_false(m->m_len <= 0)) {
tmp = m;
___
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"


svn commit: r320609 - in head/sys: dev/bnxt net

2017-07-03 Thread Sean Bruno
Author: sbruno
Date: Mon Jul  3 18:23:35 2017
New Revision: 320609
URL: https://svnweb.freebsd.org/changeset/base/320609

Log:
  bnxt(4) Enable LRO support, redux
  
  iflib - reset fl-ifl_fragidx to 0 on iflib_fl_bufs_free().  This caused the
  panic in em/igb when adding it to a bridge device.
  
  iflib - Handle out of order packet delivery from hardware in support of LRO
  
  Out of order updates to rxd's is fixed in r315217. However, it is not
  completely fixed.  While refilling the buffers, iflib is not considering
  the out of order descriptors. Hence, it is refilling sequentially.
  "idx" variable in _iflib_fl_refill routine is incremented sequentially.
  By doing refilling sequentially, it will override the SGEs that
  are *IN USE* by other connections.  Fix is to maintain a bitmap of
  rx descriptors and differentiate the used one with unused one and
  refill only at the unused indices.  This patch also fixes a
  few bugs in bnxt, related to the same feature.
  
  Submitted by: bhargava.marre...@broadcom.com
  Reviewed by:  venkatkumar.duvv...@broadcom.com shurd
  Differential Revision:https://reviews.freebsd.org/D10681

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/bnxt_hwrm.c
  head/sys/dev/bnxt/bnxt_txrx.c
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/net/iflib.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hMon Jul  3 18:20:45 2017(r320608)
+++ head/sys/dev/bnxt/bnxt.hMon Jul  3 18:23:35 2017(r320609)
@@ -438,6 +438,7 @@ struct bnxt_ring {
uint32_tring_size;  /* Must be a power of two */
uint16_tid; /* Logical ID */
uint16_tphys_id;
+   struct bnxt_full_tpa_start *tpa_start;
 };
 
 struct bnxt_cp_ring {
@@ -564,7 +565,6 @@ struct bnxt_softc {
struct sysctl_ctx_list  hw_stats;
struct sysctl_oid   *hw_stats_oid;
 
-   struct bnxt_full_tpa_start *tpa_start;
struct bnxt_ver_info*ver_info;
struct bnxt_nvram_info  *nvm_info;
bool wol;

Modified: head/sys/dev/bnxt/bnxt_hwrm.c
==
--- head/sys/dev/bnxt/bnxt_hwrm.c   Mon Jul  3 18:20:45 2017
(r320608)
+++ head/sys/dev/bnxt/bnxt_hwrm.c   Mon Jul  3 18:23:35 2017
(r320609)
@@ -935,7 +935,7 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struc
/* TODO: Calculate this based on ring size? */
req.max_agg_segs = htole16(3);
/* Base this in the allocated TPA start size... */
-   req.max_aggs = htole16(2);
+   req.max_aggs = htole16(7);
/*
 * TODO: max_agg_timer?
 * req.mag_agg_timer = htole32(XXX);

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Mon Jul  3 18:20:45 2017
(r320608)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Mon Jul  3 18:23:35 2017
(r320609)
@@ -264,6 +264,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
uint8_t flid;
uint64_t *paddrs;
caddr_t *vaddrs;
+   qidx_t  *frag_idxs;
 
rxqid = iru->iru_qsidx;
count = iru->iru_count;
@@ -272,6 +273,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
flid = iru->iru_flidx;
vaddrs = iru->iru_vaddrs;
paddrs = iru->iru_paddrs;
+   frag_idxs = iru->iru_idxs;
 
if (flid == 0) {
rx_ring = >rx_rings[rxqid];
@@ -287,8 +289,8 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
rxbd[pidx].flags_type = htole16(type);
rxbd[pidx].len = htole16(len);
/* No need to byte-swap the opaque value */
-   rxbd[pidx].opaque = ((rxqid & 0xff) << 24) | (flid << 16)
-   | pidx;
+   rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16)
+   | (frag_idxs[i]));
rxbd[pidx].addr = htole64(paddrs[i]);
if (++pidx == rx_ring->ring_size)
pidx = 0;
@@ -329,7 +331,6 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_cp_ring *cpr = >rx_cp_rings[rxqid];
struct rx_pkt_cmpl *rcp;
-   struct rx_tpa_start_cmpl *rtpa;
struct rx_tpa_end_cmpl *rtpae;
struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr;
int avail = 0;
@@ -338,7 +339,6 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
uint8_t ags;
int i;
uint16_t type;
-   uint8_t agg_id;
 
for (;;) {
NEXT_CP_CONS_V(>ring, cons, v_bit);
@@ -388,18 +388,11 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
avail++;
break;

Re: svn commit: r320362 - head/share/zoneinfo

2017-06-26 Thread Sean Bruno
Hmmm ... This seems to break 'poudriere jail -c jailname -m src=/usr/src
-v head"

--- realinstall_subdir_share/zoneinfo ---
install: builddir/Africa/Abidjan: No such file or directory


On 06/26/17 09:40, Edward Tomasz Napierala wrote:
> Author: trasz
> Date: Mon Jun 26 15:40:24 2017
> New Revision: 320362
> URL: https://svnweb.freebsd.org/changeset/base/320362
> 
> Log:
>   Provide visual feedback when timezone files are installed.
>   After r320003 it wasn't being shown in any way.
>   
>   Submitted by:   bdrewery
>   MFC after:  1 month
>   Differential Revision:  https://reviews.freebsd.org/D11154
> 
> Modified:
>   head/share/zoneinfo/Makefile
> 
> Modified: head/share/zoneinfo/Makefile
> ==
> --- head/share/zoneinfo/Makefile  Mon Jun 26 15:23:12 2017
> (r320361)
> +++ head/share/zoneinfo/Makefile  Mon Jun 26 15:40:24 2017
> (r320362)
> @@ -83,14 +83,19 @@ zoneinfo: yearistype ${TDATA}
>   zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
>   ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES}
>  
> +.if make(*install*)
> +TZS!= cd ${TZBUILDDIR} && find -s * -type f
> +.endif
> +
>  beforeinstall: install-zoneinfo
>  install-zoneinfo:
>   mkdir -p ${DESTDIR}/usr/share/zoneinfo
>   cd ${DESTDIR}/usr/share/zoneinfo;  mkdir -p ${TZBUILDSUBDIRS}
> - cd ${TZBUILDDIR} && \
> - find -s * -type f -exec ${INSTALL} ${TAG_ARGS} \
> +.for f in ${TZS}
> + ${INSTALL} ${TAG_ARGS} \
>   -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
> - \{} ${DESTDIR}/usr/share/zoneinfo/\{} \;
> + ${TZBUILDDIR:C,^${.OBJDIR}/,,}/${f} 
> ${DESTDIR}/usr/share/zoneinfo/${f}
> +.endfor
>   ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \
>   ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/
>  
> 
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r320059 - in head/sys: dev/bnxt net

2017-06-17 Thread Sean Bruno
Author: sbruno
Date: Sat Jun 17 17:42:52 2017
New Revision: 320059
URL: https://svnweb.freebsd.org/changeset/base/320059

Log:
  Revert r319989 "bnxt(4) Enable LRO support"
  
  This generates startup LORs and panics when adding elements to bridge
  devices. I will document further in https://reviews.freebsd.org/D10681
  
  PR:   220073
  Submitted by: dchagin
  Reported by:  db

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/bnxt_hwrm.c
  head/sys/dev/bnxt/bnxt_txrx.c
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/net/iflib.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hSat Jun 17 17:32:40 2017(r320058)
+++ head/sys/dev/bnxt/bnxt.hSat Jun 17 17:42:52 2017(r320059)
@@ -438,7 +438,6 @@ struct bnxt_ring {
uint32_tring_size;  /* Must be a power of two */
uint16_tid; /* Logical ID */
uint16_tphys_id;
-   struct bnxt_full_tpa_start *tpa_start;
 };
 
 struct bnxt_cp_ring {
@@ -565,6 +564,7 @@ struct bnxt_softc {
struct sysctl_ctx_list  hw_stats;
struct sysctl_oid   *hw_stats_oid;
 
+   struct bnxt_full_tpa_start *tpa_start;
struct bnxt_ver_info*ver_info;
struct bnxt_nvram_info  *nvm_info;
bool wol;

Modified: head/sys/dev/bnxt/bnxt_hwrm.c
==
--- head/sys/dev/bnxt/bnxt_hwrm.c   Sat Jun 17 17:32:40 2017
(r320058)
+++ head/sys/dev/bnxt/bnxt_hwrm.c   Sat Jun 17 17:42:52 2017
(r320059)
@@ -935,7 +935,7 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struc
/* TODO: Calculate this based on ring size? */
req.max_agg_segs = htole16(3);
/* Base this in the allocated TPA start size... */
-   req.max_aggs = htole16(7);
+   req.max_aggs = htole16(2);
/*
 * TODO: max_agg_timer?
 * req.mag_agg_timer = htole32(XXX);

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Sat Jun 17 17:32:40 2017
(r320058)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Sat Jun 17 17:42:52 2017
(r320059)
@@ -264,7 +264,6 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
uint8_t flid;
uint64_t *paddrs;
caddr_t *vaddrs;
-   qidx_t  *frag_idxs;
 
rxqid = iru->iru_qsidx;
count = iru->iru_count;
@@ -273,7 +272,6 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
flid = iru->iru_flidx;
vaddrs = iru->iru_vaddrs;
paddrs = iru->iru_paddrs;
-   frag_idxs = iru->iru_idxs;
 
if (flid == 0) {
rx_ring = >rx_rings[rxqid];
@@ -289,8 +287,8 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
rxbd[pidx].flags_type = htole16(type);
rxbd[pidx].len = htole16(len);
/* No need to byte-swap the opaque value */
-   rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16)
-   | (frag_idxs[i]));
+   rxbd[pidx].opaque = ((rxqid & 0xff) << 24) | (flid << 16)
+   | pidx;
rxbd[pidx].addr = htole64(paddrs[i]);
if (++pidx == rx_ring->ring_size)
pidx = 0;
@@ -331,6 +329,7 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_cp_ring *cpr = >rx_cp_rings[rxqid];
struct rx_pkt_cmpl *rcp;
+   struct rx_tpa_start_cmpl *rtpa;
struct rx_tpa_end_cmpl *rtpae;
struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr;
int avail = 0;
@@ -339,6 +338,7 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
uint8_t ags;
int i;
uint16_t type;
+   uint8_t agg_id;
 
for (;;) {
NEXT_CP_CONS_V(>ring, cons, v_bit);
@@ -388,11 +388,18 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
avail++;
break;
case CMPL_BASE_TYPE_RX_TPA_START:
+   rtpa = (void *)[cons];
+   agg_id = (rtpa->agg_id &
+   RX_TPA_START_CMPL_AGG_ID_MASK) >>
+   RX_TPA_START_CMPL_AGG_ID_SFT;
+   softc->tpa_start[agg_id].low = *rtpa;
NEXT_CP_CONS_V(>ring, cons, v_bit);
CMPL_PREFETCH_NEXT(cpr, cons);
 
if (!CMP_VALID([cons], v_bit))
goto cmpl_invalid;
+   softc->tpa_start[agg_id].high =
+   ((struct rx_tpa_start_cmpl_hi *)cmp)[cons];
break;
case CMPL_BASE_TYPE_RX_AGG:
break;
@@ 

svn commit: r320033 - head/contrib/tcp_wrappers

2017-06-16 Thread Sean Bruno
Author: sbruno
Date: Fri Jun 16 22:32:23 2017
New Revision: 320033
URL: https://svnweb.freebsd.org/changeset/base/320033

Log:
  TCP Wrappers: tcpdchk (tcp wrapper configuration checker) and tcpdmatch
  (tcp wrapper oracle) warning fixes via edits to the C code files
  
  contrib/tcp_wrappers/fakelog.c
Warnings for each of functions: openlog( ), vsyslog( ), VARARGS( ),
closelog( )
  warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
  warning: control reaches end of non-void function [-Wreturn-type]
Fixes:
Explicitly added specification of function type to void for each
  function, suppressing both warnings for each function listed
  contrib/tcp_wrappers/inetcf.c
Warnings:
warning: incompativle redeclaration of library function 'malloc'
  note: 'malloc' is a builtin with type 'void *(unsigned long)'
warning: implicit declaration of function 'check_path' is invalid in C99
  [-Wimplicit-function-declaration]
Fixes:
Removed redeclaration of malloc on line 21
Included library  in the code which contains the malloc( )
  function in it's library
Included scaffold.h header file in the code that contains check-path( )
  function
  contrib/tcp_wrappers/scaffold.c
Warnings:
warning: implicitly declaring library function 'exit' with type
  'void (int) __attribute__((noreturn))' 
[-Wimplicit-function-declaration]
note: include the header  or explicitly provide a declaration
  for 'exit'
Fixes:
Included  in the code which contains the exit( ) function in
it's library
  contrib/tcp_wrappers/tcpdchk.c
Warnings:
warning: implicit declaration of function 'getopt' is invalid
  in C99 [-Wimplicit-function-declaration]
warning: implicit declaration of function 'atoi' is invalid
  in C99 [-Wimplicit-function-declaration]
Fixes:
Included the specific function  library to the code
Included to the code which contains the atoi( ) function in
  the library
  contrib/tcp_wrappers/tcpdmatch.c
Warnings:
warning: implicit declaration of function 'getopt' is invalid in C99
  [-Wimplicit-function-declaration]
Fixes:
Included to the code which contains the getopt( ) function in
  the library
  
  Submitted by: Aaron Prieger 
  Reviewed by:  vangyzen
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D10995

Modified:
  head/contrib/tcp_wrappers/fakelog.c
  head/contrib/tcp_wrappers/inetcf.c
  head/contrib/tcp_wrappers/scaffold.c
  head/contrib/tcp_wrappers/tcpdchk.c
  head/contrib/tcp_wrappers/tcpdmatch.c

Modified: head/contrib/tcp_wrappers/fakelog.c
==
--- head/contrib/tcp_wrappers/fakelog.c Fri Jun 16 22:07:14 2017
(r320032)
+++ head/contrib/tcp_wrappers/fakelog.c Fri Jun 16 22:32:23 2017
(r320033)
@@ -17,7 +17,7 @@ static char sccsid[] = "@(#) fakelog.c 1.3 94/12/28 17
 
 /* ARGSUSED */
 
-openlog(name, logopt, facility)
+void openlog(name, logopt, facility)
 char   *name;
 int logopt;
 int facility;
@@ -27,7 +27,7 @@ int facility;
 
 /* vsyslog - format one record */
 
-vsyslog(severity, fmt, ap)
+void vsyslog(severity, fmt, ap)
 int severity;
 char   *fmt;
 va_list ap;
@@ -43,7 +43,7 @@ va_list ap;
 
 /* VARARGS */
 
-VARARGS(syslog, int, severity)
+void VARARGS(syslog, int, severity)
 {
 va_list ap;
 char   *fmt;
@@ -56,7 +56,7 @@ VARARGS(syslog, int, severity)
 
 /* closelog - dummy */
 
-closelog()
+void closelog()
 {
 /* void */
 }

Modified: head/contrib/tcp_wrappers/inetcf.c
==
--- head/contrib/tcp_wrappers/inetcf.c  Fri Jun 16 22:07:14 2017
(r320032)
+++ head/contrib/tcp_wrappers/inetcf.c  Fri Jun 16 22:32:23 2017
(r320033)
@@ -15,13 +15,14 @@ static char sccsid[] = "@(#) inetcf.c 1.7 97/02/12 02:
 #include 
 #include 
 #include 
+#include 
 
 extern int errno;
 extern void exit();
-extern char *malloc();
 
 #include "tcpd.h"
 #include "inetcf.h"
+#include "scaffold.h"
 
  /*
   * Network configuration files may live in unusual places. Here are some

Modified: head/contrib/tcp_wrappers/scaffold.c
==
--- head/contrib/tcp_wrappers/scaffold.cFri Jun 16 22:07:14 2017
(r320032)
+++ head/contrib/tcp_wrappers/scaffold.cFri Jun 16 22:32:23 2017
(r320033)
@@ -22,6 +22,7 @@ static char sccs_id[] = "@(#) scaffold.c 1.6 97/03/21 
 #include 
 #include 
 #include 
+#include 
 
 #ifndef INADDR_NONE
 #defineINADDR_NONE (-1)/* XXX should be 0x */

Modified: head/contrib/tcp_wrappers/tcpdchk.c

svn commit: r320009 - head/usr.sbin/lpr/lpc

2017-06-16 Thread Sean Bruno
Author: sbruno
Date: Fri Jun 16 20:00:39 2017
New Revision: 320009
URL: https://svnweb.freebsd.org/changeset/base/320009

Log:
  Quiesce clang warning while building lpc.
  
  usr.sbin/lpr/lpc/lpc.c
Warning
  passing 'char *[20]' to parameter of type 'const char **' discards
  qualifiers in nested pointer types
  [-Wincompatible-pointer-types-discards-qualifiers]
Fix:
   Explicitly cast the variable "margv" to const char ** only for it's
   use as a parameter to suppress the error
  
  Submitted by: Aaron Prieger 
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D11019

Modified:
  head/usr.sbin/lpr/lpc/lpc.c

Modified: head/usr.sbin/lpr/lpc/lpc.c
==
--- head/usr.sbin/lpr/lpc/lpc.c Fri Jun 16 19:26:33 2017(r320008)
+++ head/usr.sbin/lpr/lpc/lpc.c Fri Jun 16 20:00:39 2017(r320009)
@@ -197,7 +197,7 @@ cmdscanner(void)
makeargv();
if (margc == 0)
continue;
-   if (el != NULL && el_parse(el, margc, margv) != -1)
+   if (el != NULL && el_parse(el, margc, (const char **)margv) != 
-1)
continue;
 
c = getcmd(margv[0]);
___
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"


svn commit: r319990 - head/sys/dev/bnxt

2017-06-15 Thread Sean Bruno
Author: sbruno
Date: Thu Jun 15 21:14:48 2017
New Revision: 319990
URL: https://svnweb.freebsd.org/changeset/base/319990

Log:
  bnxt(4):  Implement temporary workaround in driver to report supported media
  types that are currently unavailable from the firmware.  e.g. 10G, 25G, 50G
  & 100G
  
  Submitted by: bhargava.marre...@broadcom.com
  Reviewed by:  venkatkumar.duvv...@broadcom.com
  Differential Revision:https://reviews.freebsd.org/D10816

Modified:
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Thu Jun 15 21:06:03 2017(r319989)
+++ head/sys/dev/bnxt/if_bnxt.c Thu Jun 15 21:14:48 2017(r319990)
@@ -287,7 +287,7 @@ static driver_t bnxt_iflib_driver = {
  * iflib shared context
  */
 
-#define BNXT_DRIVER_VERSION"1.0.0.0"
+#define BNXT_DRIVER_VERSION"1.0.0.1"
 char bnxt_driver_version[] = BNXT_DRIVER_VERSION;
 extern struct if_txrx bnxt_txrx;
 static struct if_shared_ctx bnxt_sctx_init = {
@@ -1158,7 +1158,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
ifmr->ifm_active |= IFM_1000_SGMII;
break;
default:
-   ifmr->ifm_active |= IFM_UNKNOWN;
+/*
+ * Workaround: 
+ *Don't return IFM_UNKNOWN until 
+ *Stratus return proper media_type 
+ */  
+   ifmr->ifm_active |= IFM_1000_KX;
break;
}
break;
@@ -1198,7 +1203,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
ifmr->ifm_active |= IFM_10G_T;
break;
default:
-   ifmr->ifm_active |= IFM_UNKNOWN;
+/*
+ * Workaround: 
+ *Don't return IFM_UNKNOWN until 
+ *Stratus return proper media_type 
+ */  
+   ifmr->ifm_active |= IFM_10G_CR1;
break;
}
break;
@@ -1219,7 +1229,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
ifmr->ifm_active |= IFM_25G_SR;
break;
default:
-   ifmr->ifm_active |= IFM_UNKNOWN;
+/*
+ * Workaround: 
+ *Don't return IFM_UNKNOWN until 
+ *Stratus return proper media_type 
+ */  
+   ifmr->ifm_active |= IFM_25G_CR;
break;
}
break;
@@ -1255,7 +1270,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
ifmr->ifm_active |= IFM_50G_KR2;
break;
default:
-   ifmr->ifm_active |= IFM_UNKNOWN;
+/*
+ * Workaround: 
+ *Don't return IFM_UNKNOWN until 
+ *Stratus return proper media_type 
+ */  
+   ifmr->ifm_active |= IFM_50G_CR2;
break;
}
break;
@@ -1276,7 +1296,12 @@ bnxt_media_status(if_ctx_t ctx, struct ifmediareq * if
ifmr->ifm_active |= IFM_100G_SR4;
break;
default:
-   ifmr->ifm_active |= IFM_UNKNOWN;
+/*
+ * Workaround: 
+ *Don't return IFM_UNKNOWN until 
+ *Stratus return proper media_type 
+ */  
+   ifmr->ifm_active |= IFM_100G_CR4;
break;
}
default:
@@ -2031,9 +2056,6 @@ bnxt_add_media_types(struct bnxt_softc *softc)
ifmedia_add(softc->media, IFM_ETHER | IFM_10G_CR1, 0,
NULL);
break;
-   case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN:
-   /* Auto only */
-   break;
case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR4:
case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR2:
case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_BASEKR:
@@ -2114,6 +2136,32 @@ bnxt_add_media_types(struct bnxt_softc *softc)
if (supported & HWRM_PORT_PHY_QCFG_OUTPUT_SUPPORT_SPEEDS_1GB)
ifmedia_add(softc->media, IFM_ETHER | IFM_1000_SGMII, 0,
NULL);
+   break;
+   case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN:
+default:
+/*
+ * Workaround for Cumulus & 

svn commit: r319989 - in head/sys: dev/bnxt net

2017-06-15 Thread Sean Bruno
Author: sbruno
Date: Thu Jun 15 21:06:03 2017
New Revision: 319989
URL: https://svnweb.freebsd.org/changeset/base/319989

Log:
  bnxt(4) Enable LRO support
  
  iflib - Handle out of order packet delivery from hardware in support of LRO
  
  Out of order updates to rxd's is fixed in r315217. However, it is not
  completely fixed.  While refilling the buffers, iflib is not considering
  the out of order descriptors. Hence, it is refilling sequentially.
  "idx" variable in _iflib_fl_refill routine is incremented sequentially.
  By doing refilling sequentially, it will override the SGEs that
  are *IN USE* by other connections.  Fix is to maintain a bitmap of
  rx descriptors and differentiate the used one with unused one and
  refill only at the unused indices.  This patch also fixes a
  few bugs in bnxt, related to the same feature.
  
  Submitted by: bhargava.marre...@broadcom.com
  Reviewed by:  shurd@
  Differential Revision:https://reviews.freebsd.org/D10681

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/bnxt_hwrm.c
  head/sys/dev/bnxt/bnxt_txrx.c
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/net/iflib.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hThu Jun 15 20:11:29 2017(r319988)
+++ head/sys/dev/bnxt/bnxt.hThu Jun 15 21:06:03 2017(r319989)
@@ -438,6 +438,7 @@ struct bnxt_ring {
uint32_tring_size;  /* Must be a power of two */
uint16_tid; /* Logical ID */
uint16_tphys_id;
+   struct bnxt_full_tpa_start *tpa_start;
 };
 
 struct bnxt_cp_ring {
@@ -564,7 +565,6 @@ struct bnxt_softc {
struct sysctl_ctx_list  hw_stats;
struct sysctl_oid   *hw_stats_oid;
 
-   struct bnxt_full_tpa_start *tpa_start;
struct bnxt_ver_info*ver_info;
struct bnxt_nvram_info  *nvm_info;
bool wol;

Modified: head/sys/dev/bnxt/bnxt_hwrm.c
==
--- head/sys/dev/bnxt/bnxt_hwrm.c   Thu Jun 15 20:11:29 2017
(r319988)
+++ head/sys/dev/bnxt/bnxt_hwrm.c   Thu Jun 15 21:06:03 2017
(r319989)
@@ -935,7 +935,7 @@ bnxt_hwrm_vnic_tpa_cfg(struct bnxt_softc *softc, struc
/* TODO: Calculate this based on ring size? */
req.max_agg_segs = htole16(3);
/* Base this in the allocated TPA start size... */
-   req.max_aggs = htole16(2);
+   req.max_aggs = htole16(7);
/*
 * TODO: max_agg_timer?
 * req.mag_agg_timer = htole32(XXX);

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Thu Jun 15 20:11:29 2017
(r319988)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Thu Jun 15 21:06:03 2017
(r319989)
@@ -264,6 +264,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
uint8_t flid;
uint64_t *paddrs;
caddr_t *vaddrs;
+   qidx_t  *frag_idxs;
 
rxqid = iru->iru_qsidx;
count = iru->iru_count;
@@ -272,6 +273,7 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
flid = iru->iru_flidx;
vaddrs = iru->iru_vaddrs;
paddrs = iru->iru_paddrs;
+   frag_idxs = iru->iru_idxs;
 
if (flid == 0) {
rx_ring = >rx_rings[rxqid];
@@ -287,8 +289,8 @@ bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
rxbd[pidx].flags_type = htole16(type);
rxbd[pidx].len = htole16(len);
/* No need to byte-swap the opaque value */
-   rxbd[pidx].opaque = ((rxqid & 0xff) << 24) | (flid << 16)
-   | pidx;
+   rxbd[pidx].opaque = (((rxqid & 0xff) << 24) | (flid << 16)
+   | (frag_idxs[i]));
rxbd[pidx].addr = htole64(paddrs[i]);
if (++pidx == rx_ring->ring_size)
pidx = 0;
@@ -329,7 +331,6 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_cp_ring *cpr = >rx_cp_rings[rxqid];
struct rx_pkt_cmpl *rcp;
-   struct rx_tpa_start_cmpl *rtpa;
struct rx_tpa_end_cmpl *rtpae;
struct cmpl_base *cmp = (struct cmpl_base *)cpr->ring.vaddr;
int avail = 0;
@@ -338,7 +339,6 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
uint8_t ags;
int i;
uint16_t type;
-   uint8_t agg_id;
 
for (;;) {
NEXT_CP_CONS_V(>ring, cons, v_bit);
@@ -388,18 +388,11 @@ bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_
avail++;
break;
case CMPL_BASE_TYPE_RX_TPA_START:
-   rtpa = (void *)[cons];
-   agg_id = (rtpa->agg_id &
-   

svn commit: r319984 - head/sys/net

2017-06-15 Thread Sean Bruno
Author: sbruno
Date: Thu Jun 15 17:46:20 2017
New Revision: 319984
URL: https://svnweb.freebsd.org/changeset/base/319984

Log:
  Revert r319921 which seems to cause NFS booting assertion panics in
  various configurations.
  
  Reported by:  pho@

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Jun 15 17:44:16 2017(r319983)
+++ head/sys/net/iflib.cThu Jun 15 17:46:20 2017(r319984)
@@ -520,17 +520,6 @@ rxd_info_zero(if_rxd_info_t ri)
 #define MAX_SINGLE_PACKET_FRACTION 12
 #define IF_BAD_DMA (bus_addr_t)-1
 
-static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0,
-   "iflib driver parameters");
-
-static int iflib_timer_int;
-SYSCTL_INT(_net_iflib, OID_AUTO, timer_int, CTLFLAG_RW, _timer_int,
-0, "interval at which to run per-queue timers (in ticks)");
-
-static int force_busdma = 1;
-SYSCTL_INT(_net_iflib, OID_AUTO, force_busdma, CTLFLAG_RDTUN, _busdma,
-1, "force busdma");
-
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
@@ -570,6 +559,9 @@ TASKQGROUP_DEFINE(if_config_tqg, 1, 1);
 #endif /* !INVARIANTS */
 #endif
 
+static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0,
+   "iflib driver parameters");
+
 /*
  * XXX need to ensure that this can't accidentally cause the head to be moved 
backwards 
  */
@@ -1875,6 +1867,7 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun
cb_arg.error = 0;
q = fl->ifl_rxq;
MPASS(sd_map != NULL);
+   MPASS(sd_map[idx] != NULL);
err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[idx],
 cl, fl->ifl_buf_size, _rxq_refill_cb, _arg, 0);
bus_dmamap_sync(fl->ifl_desc_tag, sd_map[idx], 
BUS_DMASYNC_PREREAD);
@@ -2117,8 +2110,7 @@ iflib_timer(void *arg)
 
sctx->isc_pause_frames = 0;
if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) 
-   callout_reset_on(>ift_timer, iflib_timer_int, iflib_timer,
-   txq, txq->ift_timer.c_cpu);
+   callout_reset_on(>ift_timer, hz/2, iflib_timer, txq, 
txq->ift_timer.c_cpu);
return;
 hung:
CTX_LOCK(ctx);
@@ -2193,8 +2185,8 @@ iflib_init_locked(if_ctx_t ctx)
IFDI_INTR_ENABLE(ctx);
txq = ctx->ifc_txqs;
for (i = 0; i < sctx->isc_ntxqsets; i++, txq++)
-   callout_reset_on(>ift_timer, iflib_timer_int, iflib_timer,
-   txq, txq->ift_timer.c_cpu);
+   callout_reset_on(>ift_timer, hz/2, iflib_timer, txq,
+   txq->ift_timer.c_cpu);
 }
 
 static int
@@ -2905,7 +2897,7 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
ifsd_m = txq->ift_sds.ifsd_m;
ntxd = txq->ift_size;
pidx = txq->ift_pidx;
-   if (force_busdma || map != NULL) {
+   if (map != NULL) {
uint8_t *ifsd_flags = txq->ift_sds.ifsd_flags;
 
err = bus_dmamap_load_mbuf_sg(tag, map,
@@ -3045,8 +3037,7 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp)
next = (cidx + CACHE_LINE_SIZE) & (ntxd-1);
prefetch(>ift_sds.ifsd_flags[next]);
}
-   } 
-   if (txq->ift_sds.ifsd_map != NULL)
+   } else if (txq->ift_sds.ifsd_map != NULL)
map = txq->ift_sds.ifsd_map[pidx];
 
if (m_head->m_pkthdr.csum_flags & CSUM_TSO) {
@@ -3542,8 +3533,7 @@ _task_fn_admin(void *context)
}
IFDI_UPDATE_ADMIN_STATUS(ctx);
for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++)
-   callout_reset_on(>ift_timer, iflib_timer_int, iflib_timer,
-   txq, txq->ift_timer.c_cpu);
+   callout_reset_on(>ift_timer, hz/2, iflib_timer, txq, 
txq->ift_timer.c_cpu);
IFDI_LINK_INTR_ENABLE(ctx);
if (ctx->ifc_flags & IFC_DO_RESET) {
ctx->ifc_flags &= ~IFC_DO_RESET;
@@ -4097,8 +4087,6 @@ iflib_device_register(device_t dev, void *sc, if_share
/* set unconditionally for !x86 */
ctx->ifc_flags |= IFC_DMAR;
 #endif
-   if (force_busdma)
-   ctx->ifc_flags |= IFC_DMAR;
 
msix_bar = scctx->isc_msix_bar;
main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0;
@@ -4421,9 +4409,6 @@ iflib_device_iov_add_vf(device_t dev, uint16_t vfnum, 
 static int
 iflib_module_init(void)
 {
-
-   iflib_timer_int = hz / 2;
-   TUNABLE_INT_FETCH("net.iflib.timer_int", _timer_int);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to 

Re: svn commit: r319921 - head/sys/net

2017-06-15 Thread Sean Bruno


On 06/15/17 04:22, Peter Holm wrote:
> On Wed, Jun 14, 2017 at 09:21:30AM -0600, Sean Bruno wrote:
>>
>>
>> On 06/14/17 08:46, Peter Holm wrote:
>>> On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote:
>>>>
>>>>
>>>> On 06/14/17 03:17, Peter Holm wrote:
>>>>> On Tue, Jun 13, 2017 at 11:16:39PM +, Sean Bruno wrote:
>>>>>> Author: sbruno
>>>>>> Date: Tue Jun 13 23:16:38 2017
>>>>>> New Revision: 319921
>>>>>> URL: https://svnweb.freebsd.org/changeset/base/319921
>>>>>>
>>>>>> Log:
>>>>>>   Add new sysctl to allow changing of timing of the txq timers.
>>>>>>   
>>>>>>   Add new sysctl to override use of busdma in the driver.
>>>>>>   
>>>>>>   Submitted by:  Drew Gallitin <galla...@netflix.com>
>>>>>>
>>>>>> Modified:
>>>>>>   head/sys/net/iflib.c
>>>>>>
>>>>>> Modified: head/sys/net/iflib.c
>>>>>> ==
>>>>>> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017(r319920)
> 
> 
> I fried up some test hardware and have some more info for you.
> Here's a test triggered by a NFS test scenario:
> 
> https://people.freebsd.org/~pho/stress/log/sbruno002.txt
> 
> I have uploaded the kernel + core to:
> https://people.freebsd.org/~pho/kernel+vmcore.519-t2.txz
> 
> Regards,
> 
> - Peter
> 
> 

Thank you for these diagnostics.  I've reverted this change from head.

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r319921 - head/sys/net

2017-06-14 Thread Sean Bruno


On 06/14/17 08:46, Peter Holm wrote:
> On Wed, Jun 14, 2017 at 08:38:36AM -0600, Sean Bruno wrote:
>>
>>
>> On 06/14/17 03:17, Peter Holm wrote:
>>> On Tue, Jun 13, 2017 at 11:16:39PM +, Sean Bruno wrote:
>>>> Author: sbruno
>>>> Date: Tue Jun 13 23:16:38 2017
>>>> New Revision: 319921
>>>> URL: https://svnweb.freebsd.org/changeset/base/319921
>>>>
>>>> Log:
>>>>   Add new sysctl to allow changing of timing of the txq timers.
>>>>   
>>>>   Add new sysctl to override use of busdma in the driver.
>>>>   
>>>>   Submitted by:Drew Gallitin <galla...@netflix.com>
>>>>
>>>> Modified:
>>>>   head/sys/net/iflib.c
>>>>
>>>> Modified: head/sys/net/iflib.c
>>>> ==
>>>> --- head/sys/net/iflib.c   Tue Jun 13 22:57:57 2017(r319920)
>>>
>>> Could this be yours?
>>>
>>> panic: Assertion ifsd_m[next] == NULL failed at ../../../net/iflib.c:2927
>>> cpuid = 12
>>> time = 1497431647
>>> KDB: stack backtrace:
>>> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 
>>> 0xfe104fa993d0
>>> vpanic() at vpanic+0x19c/frame 0xfe104fa99450
>>> kassert_panic() at kassert_panic+0x126/frame 0xfe104fa994c0
>>> iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfe104fa99640
>>> drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfe104fa996a0
>>> ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfe104fa99710
>>> iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfe104fa99750
>>> ether_output() at ether_output+0x750/frame 0xfe104fa997f0
>>> ip_output() at ip_output+0x14c3/frame 0xfe104fa99930
>>> tcp_output() at tcp_output+0xf8c/frame 0xfe104fa99ad0
>>> tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfe104fa99b40
>>> sosend_generic() at sosend_generic+0x3ba/frame 0xfe104fa99bf0
>>> clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfe104fa99d40
>>> clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfe104fa99de0
>>> newnfs_request() at newnfs_request+0x1092/frame 0xfe104fa99f60
>>> nfscl_request() at nfscl_request+0x5b/frame 0xfe104fa99fb0
>>> nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfe104fa9a120
>>> nfs_lookup() at nfs_lookup+0x463/frame 0xfe104fa9a460
>>> VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfe104fa9a490
>>> lookup() at lookup+0x6e2/frame 0xfe104fa9a530
>>> namei() at namei+0x534/frame 0xfe104fa9a5f0
>>> kern_statat() at kern_statat+0x9b/frame 0xfe104fa9a800
>>> freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfe104fa9a980
>>> amd64_syscall() at amd64_syscall+0x564/frame 0xfe104fa9aab0
>>> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfe104fa9aab0
>>> --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip = 0x800910c7a, rsp = 
>>> 0x7fffaed8, rbp = 0x7fffaf00 --
>>>
>>> - Peter
>>>
>>>
>>
>>
>> Is this new of this morning (after I committed updates yesterday)?
>>
>> sean
>>
> 
> It's with r319940M. I'm now using r319919 without this issue.
> 
> Here's the full boot log: https://people.freebsd.org/~pho/iflib.txt
> 
> - Peter
> 


Did you have to run any tests or anything to get this to happen?

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r319921 - head/sys/net

2017-06-14 Thread Sean Bruno


On 06/14/17 03:17, Peter Holm wrote:
> On Tue, Jun 13, 2017 at 11:16:39PM +0000, Sean Bruno wrote:
>> Author: sbruno
>> Date: Tue Jun 13 23:16:38 2017
>> New Revision: 319921
>> URL: https://svnweb.freebsd.org/changeset/base/319921
>>
>> Log:
>>   Add new sysctl to allow changing of timing of the txq timers.
>>   
>>   Add new sysctl to override use of busdma in the driver.
>>   
>>   Submitted by:  Drew Gallitin <galla...@netflix.com>
>>
>> Modified:
>>   head/sys/net/iflib.c
>>
>> Modified: head/sys/net/iflib.c
>> ==
>> --- head/sys/net/iflib.c Tue Jun 13 22:57:57 2017(r319920)
> 
> Could this be yours?
> 
> panic: Assertion ifsd_m[next] == NULL failed at ../../../net/iflib.c:2927
> cpuid = 12
> time = 1497431647
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfe104fa993d0
> vpanic() at vpanic+0x19c/frame 0xfe104fa99450
> kassert_panic() at kassert_panic+0x126/frame 0xfe104fa994c0
> iflib_txq_drain() at iflib_txq_drain+0xdf0/frame 0xfe104fa99640
> drain_ring_lockless() at drain_ring_lockless+0xc0/frame 0xfe104fa996a0
> ifmp_ring_enqueue() at ifmp_ring_enqueue+0x32e/frame 0xfe104fa99710
> iflib_if_transmit() at iflib_if_transmit+0xb0/frame 0xfe104fa99750
> ether_output() at ether_output+0x750/frame 0xfe104fa997f0
> ip_output() at ip_output+0x14c3/frame 0xfe104fa99930
> tcp_output() at tcp_output+0xf8c/frame 0xfe104fa99ad0
> tcp_usr_send() at tcp_usr_send+0x3bd/frame 0xfe104fa99b40
> sosend_generic() at sosend_generic+0x3ba/frame 0xfe104fa99bf0
> clnt_vc_call() at clnt_vc_call+0x4b8/frame 0xfe104fa99d40
> clnt_reconnect_call() at clnt_reconnect_call+0xe8/frame 0xfe104fa99de0
> newnfs_request() at newnfs_request+0x1092/frame 0xfe104fa99f60
> nfscl_request() at nfscl_request+0x5b/frame 0xfe104fa99fb0
> nfsrpc_lookup() at nfsrpc_lookup+0x211/frame 0xfe104fa9a120
> nfs_lookup() at nfs_lookup+0x463/frame 0xfe104fa9a460
> VOP_LOOKUP_APV() at VOP_LOOKUP_APV+0xfe/frame 0xfe104fa9a490
> lookup() at lookup+0x6e2/frame 0xfe104fa9a530
> namei() at namei+0x534/frame 0xfe104fa9a5f0
> kern_statat() at kern_statat+0x9b/frame 0xfe104fa9a800
> freebsd11_lstat() at freebsd11_lstat+0x33/frame 0xfe104fa9a980
> amd64_syscall() at amd64_syscall+0x564/frame 0xfe104fa9aab0
> Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfe104fa9aab0
> --- syscall (190, FreeBSD ELF64, freebsd11_lstat), rip = 0x800910c7a, rsp = 
> 0x7fffaed8, rbp = 0x7fffaf00 --
> 
> - Peter
> 
> 


Is this new of this morning (after I committed updates yesterday)?

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r319922 - head/sys/dev/bnxt

2017-06-13 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 13 23:49:49 2017
New Revision: 319922
URL: https://svnweb.freebsd.org/changeset/base/319922

Log:
  bnxt: In case of multi queues, have unique name for different IRQs.
  
  Submitted by: bhargava.marre...@broadcom.com
  Differential Revision:https://reviews.freebsd.org/D11149

Modified:
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Tue Jun 13 23:16:38 2017(r319921)
+++ head/sys/dev/bnxt/if_bnxt.c Tue Jun 13 23:49:49 2017(r319922)
@@ -1500,6 +1500,7 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int msix)
struct bnxt_softc *softc = iflib_get_softc(ctx);
int rc;
int i;
+   char irq_name[16];
 
rc = iflib_irq_alloc_generic(ctx, >def_cp_ring.irq,
softc->def_cp_ring.ring.id + 1, IFLIB_INTR_ADMIN,
@@ -1511,9 +1512,10 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int msix)
}
 
for (i=0; iscctx->isc_nrxqsets; i++) {
+   snprintf(irq_name, sizeof(irq_name), "rxq%d", i);
rc = iflib_irq_alloc_generic(ctx, >rx_cp_rings[i].irq,
softc->rx_cp_rings[i].ring.id + 1, IFLIB_INTR_RX,
-   bnxt_handle_rx_cp, >rx_cp_rings[i], i, "rx_cp");
+   bnxt_handle_rx_cp, >rx_cp_rings[i], i, irq_name);
if (rc) {
device_printf(iflib_get_dev(ctx),
"Failed to register RX completion ring handler\n");
___
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"


svn commit: r319921 - head/sys/net

2017-06-13 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 13 23:16:38 2017
New Revision: 319921
URL: https://svnweb.freebsd.org/changeset/base/319921

Log:
  Add new sysctl to allow changing of timing of the txq timers.
  
  Add new sysctl to override use of busdma in the driver.
  
  Submitted by: Drew Gallitin 

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Jun 13 22:57:57 2017(r319920)
+++ head/sys/net/iflib.cTue Jun 13 23:16:38 2017(r319921)
@@ -520,6 +520,17 @@ rxd_info_zero(if_rxd_info_t ri)
 #define MAX_SINGLE_PACKET_FRACTION 12
 #define IF_BAD_DMA (bus_addr_t)-1
 
+static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0,
+   "iflib driver parameters");
+
+static int iflib_timer_int;
+SYSCTL_INT(_net_iflib, OID_AUTO, timer_int, CTLFLAG_RW, _timer_int,
+0, "interval at which to run per-queue timers (in ticks)");
+
+static int force_busdma = 1;
+SYSCTL_INT(_net_iflib, OID_AUTO, force_busdma, CTLFLAG_RDTUN, _busdma,
+1, "force busdma");
+
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
@@ -559,9 +570,6 @@ TASKQGROUP_DEFINE(if_config_tqg, 1, 1);
 #endif /* !INVARIANTS */
 #endif
 
-static SYSCTL_NODE(_net, OID_AUTO, iflib, CTLFLAG_RD, 0,
-   "iflib driver parameters");
-
 /*
  * XXX need to ensure that this can't accidentally cause the head to be moved 
backwards 
  */
@@ -1867,7 +1875,6 @@ _iflib_fl_refill(if_ctx_t ctx, iflib_fl_t fl, int coun
cb_arg.error = 0;
q = fl->ifl_rxq;
MPASS(sd_map != NULL);
-   MPASS(sd_map[idx] != NULL);
err = bus_dmamap_load(fl->ifl_desc_tag, sd_map[idx],
 cl, fl->ifl_buf_size, _rxq_refill_cb, _arg, 0);
bus_dmamap_sync(fl->ifl_desc_tag, sd_map[idx], 
BUS_DMASYNC_PREREAD);
@@ -2110,7 +2117,8 @@ iflib_timer(void *arg)
 
sctx->isc_pause_frames = 0;
if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) 
-   callout_reset_on(>ift_timer, hz/2, iflib_timer, txq, 
txq->ift_timer.c_cpu);
+   callout_reset_on(>ift_timer, iflib_timer_int, iflib_timer,
+   txq, txq->ift_timer.c_cpu);
return;
 hung:
CTX_LOCK(ctx);
@@ -2185,8 +2193,8 @@ iflib_init_locked(if_ctx_t ctx)
IFDI_INTR_ENABLE(ctx);
txq = ctx->ifc_txqs;
for (i = 0; i < sctx->isc_ntxqsets; i++, txq++)
-   callout_reset_on(>ift_timer, hz/2, iflib_timer, txq,
-   txq->ift_timer.c_cpu);
+   callout_reset_on(>ift_timer, iflib_timer_int, iflib_timer,
+   txq, txq->ift_timer.c_cpu);
 }
 
 static int
@@ -2897,7 +2905,7 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
ifsd_m = txq->ift_sds.ifsd_m;
ntxd = txq->ift_size;
pidx = txq->ift_pidx;
-   if (map != NULL) {
+   if (force_busdma || map != NULL) {
uint8_t *ifsd_flags = txq->ift_sds.ifsd_flags;
 
err = bus_dmamap_load_mbuf_sg(tag, map,
@@ -3037,7 +3045,8 @@ iflib_encap(iflib_txq_t txq, struct mbuf **m_headp)
next = (cidx + CACHE_LINE_SIZE) & (ntxd-1);
prefetch(>ift_sds.ifsd_flags[next]);
}
-   } else if (txq->ift_sds.ifsd_map != NULL)
+   } 
+   if (txq->ift_sds.ifsd_map != NULL)
map = txq->ift_sds.ifsd_map[pidx];
 
if (m_head->m_pkthdr.csum_flags & CSUM_TSO) {
@@ -3533,7 +3542,8 @@ _task_fn_admin(void *context)
}
IFDI_UPDATE_ADMIN_STATUS(ctx);
for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++)
-   callout_reset_on(>ift_timer, hz/2, iflib_timer, txq, 
txq->ift_timer.c_cpu);
+   callout_reset_on(>ift_timer, iflib_timer_int, iflib_timer,
+   txq, txq->ift_timer.c_cpu);
IFDI_LINK_INTR_ENABLE(ctx);
if (ctx->ifc_flags & IFC_DO_RESET) {
ctx->ifc_flags &= ~IFC_DO_RESET;
@@ -4087,6 +4097,8 @@ iflib_device_register(device_t dev, void *sc, if_share
/* set unconditionally for !x86 */
ctx->ifc_flags |= IFC_DMAR;
 #endif
+   if (force_busdma)
+   ctx->ifc_flags |= IFC_DMAR;
 
msix_bar = scctx->isc_msix_bar;
main_txq = (sctx->isc_flags & IFLIB_HAS_TXCQ) ? 1 : 0;
@@ -4409,6 +4421,9 @@ iflib_device_iov_add_vf(device_t dev, uint16_t vfnum, 
 static int
 iflib_module_init(void)
 {
+
+   iflib_timer_int = hz / 2;
+   TUNABLE_INT_FETCH("net.iflib.timer_int", _timer_int);
return (0);
 }
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To 

svn commit: r319917 - head/sys/net

2017-06-13 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 13 19:32:23 2017
New Revision: 319917
URL: https://svnweb.freebsd.org/changeset/base/319917

Log:
  Plug mbuf leak in the busdma path of iflib.
  
  Submitted by: Michael Tuexen 
  Reported by:  Drew Gallitin 

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Jun 13 19:02:12 2017(r319916)
+++ head/sys/net/iflib.cTue Jun 13 19:32:23 2017(r319917)
@@ -2880,8 +2880,8 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
if_ctx_t ctx;
if_shared_ctx_t sctx;
if_softc_ctx_t  scctx;
-   int i, next, pidx, mask, err, maxsegsz, ntxd, count;
-   struct mbuf *m, *tmp, **ifsd_m, **mp;
+   int i, next, pidx, err, maxsegsz, ntxd, count;
+   struct mbuf *m, *tmp, **ifsd_m;
 
m = *m0;
 
@@ -2905,19 +2905,22 @@ iflib_busdma_load_mbuf_sg(iflib_txq_t txq, bus_dma_tag
if (err)
return (err);
ifsd_flags[pidx] |= TX_SW_DESC_MAPPED;
-   i = 0;
-   next = pidx;
-   mask = (txq->ift_size-1);
+   count = 0;
m = *m0;
do {
-   mp = _m[next];
-   *mp = m;
+   if (__predict_false(m->m_len <= 0)) {
+   tmp = m;
+   m = m->m_next;
+   tmp->m_next = NULL;
+   m_free(tmp);
+   continue;
+   }
+   next = (pidx + count) & (ntxd-1);
+   MPASS(ifsd_m[next] == NULL);
+   ifsd_m[next] = m;
+   count++;
+   tmp = m;
m = m->m_next;
-   if (__predict_false((*mp)->m_len == 0)) {
-   m_free(*mp);
-   *mp = NULL;
-   } else
-   next = (pidx + i) & (ntxd-1);
} while (m != NULL);
} else {
int buflen, sgsize, max_sgsize;
___
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"


svn commit: r318359 - head/sys/dev/bnxt

2017-05-16 Thread Sean Bruno
Author: sbruno
Date: Tue May 16 18:05:34 2017
New Revision: 318359
URL: https://svnweb.freebsd.org/changeset/base/318359

Log:
  Add version tag to the driver.
  
  Start at version 1.0.0.0
  
  Submitted by: bhargava.marre...@broadcom.com
  Reviewed by:  venkatkumar.duvv...@broadcom.com
  Differential Revision:https://reviews.freebsd.org/D10616

Modified:
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Tue May 16 17:51:30 2017(r318358)
+++ head/sys/dev/bnxt/if_bnxt.c Tue May 16 18:05:34 2017(r318359)
@@ -287,7 +287,8 @@ static driver_t bnxt_iflib_driver = {
  * iflib shared context
  */
 
-char bnxt_driver_version[] = "FreeBSD base";
+#define BNXT_DRIVER_VERSION"1.0.0.0"
+char bnxt_driver_version[] = BNXT_DRIVER_VERSION;
 extern struct if_txrx bnxt_txrx;
 static struct if_shared_ctx bnxt_sctx_init = {
.isc_magic = IFLIB_MAGIC,
___
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"


svn commit: r317798 - head/sys/dev/bnxt

2017-05-04 Thread Sean Bruno
Author: sbruno
Date: Thu May  4 15:26:28 2017
New Revision: 317798
URL: https://svnweb.freebsd.org/changeset/base/317798

Log:
  bnxt: Add support for new Broadcom 100Gb adapter BCM57454
  
  Submitted by: bhargava.marre...@broadcom.com
  Reviewed by:  venkatkumar.duvv...@broadcom.com
  Differential Revision:https://reviews.freebsd.org/D10595

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hThu May  4 15:00:09 2017(r317797)
+++ head/sys/dev/bnxt/bnxt.hThu May  4 15:26:28 2017(r317798)
@@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$");
 #define BCM57417_NPAR1 0x16c0
 #define BCM57417_NPAR2 0x16cc
 #define BCM57417_SFP   0x16e2
+#define BCM57454   0x1614
 #define BCM58700   0x16cd
 #define NETXTREME_C_VF10x16cb
 #define NETXTREME_C_VF20x16e1

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Thu May  4 15:00:09 2017(r317797)
+++ head/sys/dev/bnxt/if_bnxt.c Thu May  4 15:26:28 2017(r317798)
@@ -127,6 +127,8 @@ static pci_vendor_info_t bnxt_vendor_inf
"Broadcom BCM57417 NetXtreme-E Ethernet Partition"),
 PVID(BROADCOM_VENDOR_ID, BCM57417_SFP,
"Broadcom BCM57417 NetXtreme-E 10Gb/25Gb Ethernet"),
+PVID(BROADCOM_VENDOR_ID, BCM57454,
+   "Broadcom BCM57454 NetXtreme-E 10Gb/25Gb/40Gb/50Gb/100Gb Ethernet"),
 PVID(BROADCOM_VENDOR_ID, BCM58700,
"Broadcom BCM58700 Nitro 1Gb/2.5Gb/10Gb Ethernet"),
 PVID(BROADCOM_VENDOR_ID, NETXTREME_C_VF1,
___
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"


svn commit: r316616 - head/sys/dev/bnxt

2017-04-07 Thread Sean Bruno
Author: sbruno
Date: Fri Apr  7 16:15:50 2017
New Revision: 316616
URL: https://svnweb.freebsd.org/changeset/base/316616

Log:
  bnxt(4): add support for WOL Magic.
  
  Submitted by: venkatkumar.duvv...@broadcom.com
  Differential Revision:https://reviews.freebsd.org/D10124

Modified:
  head/sys/dev/bnxt/bnxt.h
  head/sys/dev/bnxt/bnxt_hwrm.c
  head/sys/dev/bnxt/bnxt_hwrm.h
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/bnxt.h
==
--- head/sys/dev/bnxt/bnxt.hFri Apr  7 16:14:25 2017(r316615)
+++ head/sys/dev/bnxt/bnxt.hFri Apr  7 16:15:50 2017(r316616)
@@ -100,6 +100,9 @@ __FBSDID("$FreeBSD$");
 #define BNXT_RSS_HASH_TYPE_IPV65
 #define BNXT_GET_RSS_PROFILE_ID(rss_hash_type) ((rss_hash_type >> 1) & 0x1F)
 
+#define BNXT_NO_MORE_WOL_FILTERS   0x
+#define bnxt_wol_supported(softc)  ((softc)->flags & BNXT_FLAG_WOL_CAP)
+
 /* Completion related defines */
 #define CMP_VALID(cmp, v_bit) \
((!!(((struct cmpl_base *)(cmp))->info3_v & htole32(CMPL_BASE_V))) == 
!!(v_bit) )
@@ -512,7 +515,8 @@ struct bnxt_softc {
struct bnxt_bar_infohwrm_bar;
struct bnxt_bar_infodoorbell_bar;
struct bnxt_link_info   link_info;
-#define BNXT_FLAG_NPAR 1
+#define BNXT_FLAG_NPAR 0x1
+#define BNXT_FLAG_WOL_CAP  0x2
uint32_tflags;
uint32_ttotal_msix;
 
@@ -562,6 +566,8 @@ struct bnxt_softc {
struct bnxt_full_tpa_start *tpa_start;
struct bnxt_ver_info*ver_info;
struct bnxt_nvram_info  *nvm_info;
+   bool wol;
+   uint8_t wol_filter_id;
 };
 
 struct bnxt_filter_info {

Modified: head/sys/dev/bnxt/bnxt_hwrm.c
==
--- head/sys/dev/bnxt/bnxt_hwrm.c   Fri Apr  7 16:14:25 2017
(r316615)
+++ head/sys/dev/bnxt/bnxt_hwrm.c   Fri Apr  7 16:15:50 2017
(r316616)
@@ -398,6 +398,10 @@ bnxt_hwrm_func_qcaps(struct bnxt_softc *
if (rc)
goto fail;
 
+   if (resp->flags &
+   htole32(HWRM_FUNC_QCAPS_OUTPUT_FLAGS_WOL_MAGICPKT_SUPPORTED))
+   softc->flags |= BNXT_FLAG_WOL_CAP;
+
func->fw_fid = le16toh(resp->fid);
memcpy(func->mac_addr, resp->mac_address, ETHER_ADDR_LEN);
func->max_rsscos_ctxs = le16toh(resp->max_rsscos_ctx);
@@ -1483,3 +1487,63 @@ exit:
BNXT_HWRM_UNLOCK(softc);
return rc;
 }
+
+uint16_t
+bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle)
+{
+   struct hwrm_wol_filter_qcfg_input req = {0};
+   struct hwrm_wol_filter_qcfg_output *resp =
+   (void *)softc->hwrm_cmd_resp.idi_vaddr;
+   uint16_t next_handle = 0;
+   int rc;
+
+   bnxt_hwrm_cmd_hdr_init(softc, , HWRM_WOL_FILTER_QCFG);
+   req.port_id = htole16(softc->pf.port_id);
+   req.handle = htole16(handle);
+   rc = hwrm_send_message(softc, , sizeof(req));
+   if (!rc) {
+   next_handle = le16toh(resp->next_handle);
+   if (next_handle != 0) {
+   if (resp->wol_type ==
+   HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT) {
+   softc->wol = 1;
+   softc->wol_filter_id = resp->wol_filter_id;
+   }
+   }
+   }
+   return next_handle;
+}
+
+int
+bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc)
+{
+   struct hwrm_wol_filter_alloc_input req = {0};
+   struct hwrm_wol_filter_alloc_output *resp =
+   (void *)softc->hwrm_cmd_resp.idi_vaddr;
+   int rc;
+
+   bnxt_hwrm_cmd_hdr_init(softc, , HWRM_WOL_FILTER_ALLOC);
+   req.port_id = htole16(softc->pf.port_id);
+   req.wol_type = HWRM_WOL_FILTER_ALLOC_INPUT_WOL_TYPE_MAGICPKT;
+   req.enables =
+   htole32(HWRM_WOL_FILTER_ALLOC_INPUT_ENABLES_MAC_ADDRESS);
+   memcpy(req.mac_address, softc->func.mac_addr, ETHER_ADDR_LEN);
+   rc = hwrm_send_message(softc, , sizeof(req));
+   if (!rc)
+   softc->wol_filter_id = resp->wol_filter_id;
+
+   return rc;
+}
+
+int
+bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc)
+{
+   struct hwrm_wol_filter_free_input req = {0};
+
+   bnxt_hwrm_cmd_hdr_init(softc, , HWRM_WOL_FILTER_FREE);
+   req.port_id = htole16(softc->pf.port_id);
+   req.enables =
+   htole32(HWRM_WOL_FILTER_FREE_INPUT_ENABLES_WOL_FILTER_ID);
+   req.wol_filter_id = softc->wol_filter_id;
+   return hwrm_send_message(softc, , sizeof(req));
+}

Modified: head/sys/dev/bnxt/bnxt_hwrm.h
==
--- head/sys/dev/bnxt/bnxt_hwrm.h   Fri Apr  7 16:14:25 2017
(r316615)
+++ head/sys/dev/bnxt/bnxt_hwrm.h   Fri Apr  7 16:15:50 2017
(r316616)
@@ -98,5 

svn commit: r316596 - in head/sys: dev/e1000 net

2017-04-06 Thread Sean Bruno
Author: sbruno
Date: Fri Apr  7 00:33:03 2017
New Revision: 316596
URL: https://svnweb.freebsd.org/changeset/base/316596

Log:
  Move pause frame counter out of struct if_ctx and into struct if_softc_ctx_t
  so that we can use it in iflib to detect pause frames.
  
  The igb(4) driver definitely used to use this in its old timer function and
  I see no reason to restrict it to that driver only.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Thu Apr  6 23:40:51 2017(r316595)
+++ head/sys/dev/e1000/if_em.c  Fri Apr  7 00:33:03 2017(r316596)
@@ -3705,6 +3705,11 @@ em_update_stats_counters(struct adapter 
adapter->stats.xonrxc += E1000_READ_REG(>hw, E1000_XONRXC);
adapter->stats.xontxc += E1000_READ_REG(>hw, E1000_XONTXC);
adapter->stats.xoffrxc += E1000_READ_REG(>hw, E1000_XOFFRXC);
+   /*
+** For watchdog management we need to know if we have been
+** paused during the last interval, so capture that here.
+   */
+   adapter->shared->isc_pause_frames = adapter->stats.xoffrxc;
adapter->stats.xofftxc += E1000_READ_REG(>hw, E1000_XOFFTXC);
adapter->stats.fcruc += E1000_READ_REG(>hw, E1000_FCRUC);
adapter->stats.prc64 += E1000_READ_REG(>hw, E1000_PRC64);

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Apr  6 23:40:51 2017(r316595)
+++ head/sys/net/iflib.cFri Apr  7 00:33:03 2017(r316596)
@@ -170,7 +170,6 @@ struct iflib_ctx {
 
int ifc_link_state;
int ifc_link_irq;
-   int ifc_pause_frames;
int ifc_watchdog_events;
struct cdev *ifc_led_dev;
struct resource *ifc_msix_mem;
@@ -2087,6 +2086,7 @@ iflib_timer(void *arg)
 {
iflib_txq_t txq = arg;
if_ctx_t ctx = txq->ift_ctx;
+   if_softc_ctx_t sctx = >ifc_softc_ctx;
 
if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))
return;
@@ -2098,7 +2098,7 @@ iflib_timer(void *arg)
IFDI_TIMER(ctx, txq->ift_id);
if ((txq->ift_qstatus == IFLIB_QUEUE_HUNG) &&
((txq->ift_cleaned_prev == txq->ift_cleaned) ||
-(ctx->ifc_pause_frames == 0)))
+(sctx->isc_pause_frames == 0)))
goto hung;
 
if (ifmp_ring_is_stalled(txq->ift_br))
@@ -2108,7 +2108,7 @@ iflib_timer(void *arg)
if (txq->ift_db_pending)
GROUPTASK_ENQUEUE(>ift_task);
 
-   ctx->ifc_pause_frames = 0;
+   sctx->isc_pause_frames = 0;
if (if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING) 
callout_reset_on(>ift_timer, hz/2, iflib_timer, txq, 
txq->ift_timer.c_cpu);
return;
@@ -2120,7 +2120,6 @@ hung:
 
IFDI_WATCHDOG_RESET(ctx);
ctx->ifc_watchdog_events++;
-   ctx->ifc_pause_frames = 0;
 
ctx->ifc_flags |= IFC_DO_RESET;
iflib_admin_intr_deferred(ctx);

Modified: head/sys/net/iflib.h
==
--- head/sys/net/iflib.hThu Apr  6 23:40:51 2017(r316595)
+++ head/sys/net/iflib.hFri Apr  7 00:33:03 2017(r316596)
@@ -215,6 +215,7 @@ typedef struct if_softc_ctx {
 
iflib_intr_mode_t isc_intr;
uint16_t isc_max_frame_size; /* set at init time by driver */
+   uint32_t isc_pause_frames;   /* set by driver for iflib_timer to detect 
*/
pci_vendor_info_t isc_vendor_info;  /* set by iflib prior to 
attach_pre */
int isc_disable_msix;
if_txrx_t isc_txrx;
___
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"


svn commit: r316581 - head/sys/dev/bnxt

2017-04-06 Thread Sean Bruno
Author: sbruno
Date: Thu Apr  6 16:22:54 2017
New Revision: 316581
URL: https://svnweb.freebsd.org/changeset/base/316581

Log:
  tx and rx interrupts are not combined in bnxt(4) and should be handled
  independantly.
  
  Submitted by: venkatkumar.duvv...@broadcom.com>
  Differential Revision:https://reviews.freebsd.org/D10297

Modified:
  head/sys/dev/bnxt/if_bnxt.c

Modified: head/sys/dev/bnxt/if_bnxt.c
==
--- head/sys/dev/bnxt/if_bnxt.c Thu Apr  6 16:19:19 2017(r316580)
+++ head/sys/dev/bnxt/if_bnxt.c Thu Apr  6 16:22:54 2017(r316581)
@@ -177,7 +177,8 @@ static void bnxt_update_admin_status(if_
 
 /* Interrupt enable / disable */
 static void bnxt_intr_enable(if_ctx_t ctx);
-static int bnxt_queue_intr_enable(if_ctx_t ctx, uint16_t qid);
+static int bnxt_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid);
+static int bnxt_tx_queue_intr_enable(if_ctx_t ctx, uint16_t qid);
 static void bnxt_disable_intr(if_ctx_t ctx);
 static int bnxt_msix_intr_assign(if_ctx_t ctx, int msix);
 
@@ -253,8 +254,8 @@ static device_method_t bnxt_iflib_method
DEVMETHOD(ifdi_update_admin_status, bnxt_update_admin_status),
 
DEVMETHOD(ifdi_intr_enable, bnxt_intr_enable),
-   DEVMETHOD(ifdi_tx_queue_intr_enable, bnxt_queue_intr_enable),
-   DEVMETHOD(ifdi_rx_queue_intr_enable, bnxt_queue_intr_enable),
+   DEVMETHOD(ifdi_tx_queue_intr_enable, bnxt_tx_queue_intr_enable),
+   DEVMETHOD(ifdi_rx_queue_intr_enable, bnxt_rx_queue_intr_enable),
DEVMETHOD(ifdi_intr_disable, bnxt_disable_intr),
DEVMETHOD(ifdi_msix_intr_assign, bnxt_msix_intr_assign),
 
@@ -1437,7 +1438,16 @@ bnxt_intr_enable(if_ctx_t ctx)
 
 /* Enable interrupt for a single queue */
 static int
-bnxt_queue_intr_enable(if_ctx_t ctx, uint16_t qid)
+bnxt_tx_queue_intr_enable(if_ctx_t ctx, uint16_t qid)
+{
+   struct bnxt_softc *softc = iflib_get_softc(ctx);
+
+   bnxt_do_enable_intr(>tx_cp_rings[qid]);
+   return 0;
+}
+
+static int
+bnxt_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid)
 {
struct bnxt_softc *softc = iflib_get_softc(ctx);
 
@@ -1482,7 +1492,7 @@ bnxt_msix_intr_assign(if_ctx_t ctx, int 
 
for (i=0; iscctx->isc_nrxqsets; i++) {
rc = iflib_irq_alloc_generic(ctx, >rx_cp_rings[i].irq,
-   softc->rx_cp_rings[i].ring.id + 1, IFLIB_INTR_RXTX,
+   softc->rx_cp_rings[i].ring.id + 1, IFLIB_INTR_RX,
bnxt_handle_rx_cp, >rx_cp_rings[i], i, "rx_cp");
if (rc) {
device_printf(iflib_get_dev(ctx),
___
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"


svn commit: r316544 - head/sys/dev/ixgbe

2017-04-05 Thread Sean Bruno
Author: sbruno
Date: Wed Apr  5 22:01:49 2017
New Revision: 316544
URL: https://svnweb.freebsd.org/changeset/base/316544

Log:
  Don't overrite vf->flags variable at the end of ixgbe(4) ixgbe_add_vf().
  
  Found by PVS-Studio Static code analyzer.
  
  PR:   217748
  Submitted by: razmys...@viva64.com
  MFC after:1 week

Modified:
  head/sys/dev/ixgbe/if_ix.c

Modified: head/sys/dev/ixgbe/if_ix.c
==
--- head/sys/dev/ixgbe/if_ix.c  Wed Apr  5 21:08:26 2017(r316543)
+++ head/sys/dev/ixgbe/if_ix.c  Wed Apr  5 22:01:49 2017(r316544)
@@ -5991,7 +5991,7 @@ ixgbe_add_vf(device_t dev, u16 vfnum, co
 */
vf->flags |= IXGBE_VF_CAP_MAC;
 
-   vf->flags = IXGBE_VF_ACTIVE;
+   vf->flags |= IXGBE_VF_ACTIVE;
 
ixgbe_init_vf(adapter, vf);
IXGBE_CORE_UNLOCK(adapter);
___
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"


svn commit: r316541 - head/sys/dev/ixgbe

2017-04-05 Thread Sean Bruno
Author: sbruno
Date: Wed Apr  5 19:52:49 2017
New Revision: 316541
URL: https://svnweb.freebsd.org/changeset/base/316541

Log:
  Fix a double free in ixgbe_rxeof()
  
  Submitted by: rstone
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D10255

Modified:
  head/sys/dev/ixgbe/ix_txrx.c

Modified: head/sys/dev/ixgbe/ix_txrx.c
==
--- head/sys/dev/ixgbe/ix_txrx.cWed Apr  5 19:46:24 2017
(r316540)
+++ head/sys/dev/ixgbe/ix_txrx.cWed Apr  5 19:52:49 2017
(r316541)
@@ -1431,20 +1431,10 @@ fail:
 
 static void 
 ixgbe_free_receive_ring(struct rx_ring *rxr)
-{ 
-   struct ixgbe_rx_buf   *rxbuf;
+{
 
for (int i = 0; i < rxr->num_desc; i++) {
-   rxbuf = >rx_buffers[i];
-   if (rxbuf->buf != NULL) {
-   bus_dmamap_sync(rxr->ptag, rxbuf->pmap,
-   BUS_DMASYNC_POSTREAD);
-   bus_dmamap_unload(rxr->ptag, rxbuf->pmap);
-   rxbuf->buf->m_flags |= M_PKTHDR;
-   m_freem(rxbuf->buf);
-   rxbuf->buf = NULL;
-   rxbuf->flags = 0;
-   }
+   ixgbe_rx_discard(rxr, i);
}
 }
 
@@ -1596,7 +1586,9 @@ fail:
 */
for (int i = 0; i < j; ++i) {
rxr = >rx_rings[i];
+   IXGBE_RX_LOCK(rxr);
ixgbe_free_receive_ring(rxr);
+   IXGBE_RX_UNLOCK(rxr);
}
 
return (ENOBUFS);
@@ -1645,14 +1637,7 @@ ixgbe_free_receive_buffers(struct rx_rin
if (rxr->rx_buffers != NULL) {
for (int i = 0; i < adapter->num_rx_desc; i++) {
rxbuf = >rx_buffers[i];
-   if (rxbuf->buf != NULL) {
-   bus_dmamap_sync(rxr->ptag, rxbuf->pmap,
-   BUS_DMASYNC_POSTREAD);
-   bus_dmamap_unload(rxr->ptag, rxbuf->pmap);
-   rxbuf->buf->m_flags |= M_PKTHDR;
-   m_freem(rxbuf->buf);
-   }
-   rxbuf->buf = NULL;
+   ixgbe_rx_discard(rxr, i);
if (rxbuf->pmap != NULL) {
bus_dmamap_destroy(rxr->ptag, rxbuf->pmap);
rxbuf->pmap = NULL;
@@ -1722,11 +1707,12 @@ ixgbe_rx_discard(struct rx_ring *rxr, in
*/
 
if (rbuf->fmp != NULL) {/* Partial chain ? */
-   rbuf->fmp->m_flags |= M_PKTHDR;
+   bus_dmamap_sync(rxr->ptag, rbuf->pmap, BUS_DMASYNC_POSTREAD);
m_freem(rbuf->fmp);
rbuf->fmp = NULL;
rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */
} else if (rbuf->buf) {
+   bus_dmamap_sync(rxr->ptag, rbuf->pmap, BUS_DMASYNC_POSTREAD);
m_free(rbuf->buf);
rbuf->buf = NULL;
}
@@ -1814,6 +1800,8 @@ ixgbe_rxeof(struct ix_queue *que)
goto next_desc;
}
 
+   bus_dmamap_sync(rxr->ptag, rbuf->pmap, BUS_DMASYNC_POSTREAD);
+
/*
** On 82599 which supports a hardware
** LRO (called HW RSC), packets need
___
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"


svn commit: r316502 - head/sys/net

2017-04-04 Thread Sean Bruno
Author: sbruno
Date: Tue Apr  4 21:03:34 2017
New Revision: 316502
URL: https://svnweb.freebsd.org/changeset/base/316502

Log:
  Allow MSIX to be turned off by tuneable per interface, per driver.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Apr  4 20:03:57 2017(r316501)
+++ head/sys/net/iflib.cTue Apr  4 21:03:34 2017(r316502)
@@ -521,8 +521,6 @@ rxd_info_zero(if_rxd_info_t ri)
 #define MAX_SINGLE_PACKET_FRACTION 12
 #define IF_BAD_DMA (bus_addr_t)-1
 
-static int enable_msix = 1;
-
 #define CTX_ACTIVE(ctx) ((if_getdrvflags((ctx)->ifc_ifp) & IFF_DRV_RUNNING))
 
 #define CTX_LOCK_INIT(_sc, _name)  mtx_init(&(_sc)->ifc_mtx, _name, "iflib ctx 
lock", MTX_DEF)
@@ -5187,7 +5185,7 @@ iflib_msix_init(if_ctx_t ctx)
bar = ctx->ifc_softc_ctx.isc_msix_bar;
admincnt = sctx->isc_admin_intrcnt;
/* Override by tuneable */
-   if (enable_msix == 0)
+   if (scctx->isc_disable_msix)
goto msi;
 
/*
@@ -5428,6 +5426,9 @@ iflib_add_device_sysctl_pre(if_ctx_t ctx
SYSCTL_ADD_U16(ctx_list, oid_list, OID_AUTO, "override_qs_enable",
   CTLFLAG_RWTUN, >ifc_sysctl_qs_eq_override, 0,
"permit #txq != #rxq");
+   SYSCTL_ADD_INT(ctx_list, oid_list, OID_AUTO, "disable_msix",
+  CTLFLAG_RWTUN, >ifc_softc_ctx.isc_disable_msix, 0,
+  "disable MSIX (default 0)");
 
/* XXX change for per-queue sizes */
SYSCTL_ADD_PROC(ctx_list, oid_list, OID_AUTO, "override_ntxds",

Modified: head/sys/net/iflib.h
==
--- head/sys/net/iflib.hTue Apr  4 20:03:57 2017(r316501)
+++ head/sys/net/iflib.hTue Apr  4 21:03:34 2017(r316502)
@@ -216,6 +216,7 @@ typedef struct if_softc_ctx {
iflib_intr_mode_t isc_intr;
uint16_t isc_max_frame_size; /* set at init time by driver */
pci_vendor_info_t isc_vendor_info;  /* set by iflib prior to 
attach_pre */
+   int isc_disable_msix;
if_txrx_t isc_txrx;
 } *if_softc_ctx_t;
 
___
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"


svn commit: r316494 - head/sys/dev/e1000

2017-04-04 Thread Sean Bruno
Author: sbruno
Date: Tue Apr  4 16:54:46 2017
New Revision: 316494
URL: https://svnweb.freebsd.org/changeset/base/316494

Log:
  no_desc_avail is tracked in iflib now making this redundant.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Tue Apr  4 16:26:46 2017(r316493)
+++ head/sys/dev/e1000/if_em.c  Tue Apr  4 16:54:46 2017(r316494)
@@ -3883,9 +3883,6 @@ em_add_hw_stats(struct adapter *adapter)
SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tx_irq",
CTLFLAG_RD, >tx_irq,
"Queue MSI-X Transmit Interrupts");
-   SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "no_desc_avail",
-   CTLFLAG_RD, >no_desc_avail,
-   "Queue No Descriptor Available");
}
 
for (int j = 0; j < adapter->rx_num_queues; j++, rx_que++) {

Modified: head/sys/dev/e1000/if_em.h
==
--- head/sys/dev/e1000/if_em.h  Tue Apr  4 16:26:46 2017(r316493)
+++ head/sys/dev/e1000/if_em.h  Tue Apr  4 16:54:46 2017(r316494)
@@ -368,7 +368,6 @@ struct tx_ring {
void*tag;
struct resource *res;
 unsigned long  tx_irq;
-unsigned long  no_desc_avail;
 
/* Saved csum offloading context information */
int csum_flags;
___
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"


svn commit: r316475 - head/sys/dev/e1000

2017-04-03 Thread Sean Bruno
Author: sbruno
Date: Mon Apr  3 21:19:12 2017
New Revision: 316475
URL: https://svnweb.freebsd.org/changeset/base/316475

Log:
  Remove unsafe and non-functional DDB functions that I added long ago
  for debugging.

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Apr  3 21:17:57 2017(r316474)
+++ head/sys/dev/e1000/if_em.c  Mon Apr  3 21:19:12 2017(r316475)
@@ -4378,40 +4378,3 @@ em_enable_vectors_82574(if_ctx_t ctx)
device_printf(dev, "Writing to eeprom: done\n");
}
 }
-
-
-#ifdef DDB
-DB_COMMAND(em_reset_dev, em_ddb_reset_dev)
-{
-   devclass_t dc;
-   int max_em;
-
-   dc = devclass_find("em");
-   max_em = devclass_get_maxunit(dc);
-
-   for (int index = 0; index < (max_em - 1); index++) {
-   device_t dev;
-   dev = devclass_get_device(dc, index);
-   if (device_get_driver(dev) == _driver) {
-   struct adapter *adapter = device_get_softc(dev);
-   em_if_init(adapter->ctx);
-   }
-   }
-}
-DB_COMMAND(em_dump_queue, em_ddb_dump_queue)
-{
-   devclass_t dc;
-   int max_em;
-
-   dc = devclass_find("em");
-   max_em = devclass_get_maxunit(dc);
-
-   for (int index = 0; index < (max_em - 1); index++) {
-   device_t dev;
-   dev = devclass_get_device(dc, index);
-   if (device_get_driver(dev) == _driver)
-   em_print_debug_info(device_get_softc(dev));
-   }
-
-}
-#endif
___
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"


svn commit: r316474 - head/sys/dev/e1000

2017-04-03 Thread Sean Bruno
Author: sbruno
Date: Mon Apr  3 21:17:57 2017
New Revision: 316474
URL: https://svnweb.freebsd.org/changeset/base/316474

Log:
  Remove rx_processing_limit sysctl and now orphaned function 
em_set_sysctl_value
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Apr  3 21:10:02 2017(r316473)
+++ head/sys/dev/e1000/if_em.c  Mon Apr  3 21:17:57 2017(r316474)
@@ -290,8 +290,6 @@ static void em_handle_link(void *context
 
 static voidem_enable_vectors_82574(if_ctx_t);
 
-static voidem_set_sysctl_value(struct adapter *, const char *,
-   const char *, int *, int);
 static int em_set_flowcntl(SYSCTL_HANDLER_ARGS);
 static int em_sysctl_eee(SYSCTL_HANDLER_ARGS);
 static voidem_if_led_func(if_ctx_t ctx, int onoff);
@@ -896,11 +894,6 @@ em_if_attach_pre(if_ctx_t ctx)
E1000_REGISTER(hw, E1000_ITR),
DEFAULT_ITR);
 
-   /* Sysctl for limiting the amount of work done in the taskqueue */
-   em_set_sysctl_value(adapter, "rx_processing_limit",
-   "max number of rx packets to process", >rx_process_limit,
-   em_rx_process_limit);
-
hw->mac.autoneg = DO_AUTO_NEG;
hw->phy.autoneg_wait_to_complete = FALSE;
hw->phy.autoneg_advertised = AUTONEG_ADV_DEFAULT;
@@ -4217,17 +4210,6 @@ em_add_int_delay_sysctl(struct adapter *
info, 0, em_sysctl_int_delay, "I", description);
 }
 
-static void
-em_set_sysctl_value(struct adapter *adapter, const char *name,
-   const char *description, int *limit, int value)
-{
-   *limit = value;
-   SYSCTL_ADD_INT(device_get_sysctl_ctx(adapter->dev),
-   SYSCTL_CHILDREN(device_get_sysctl_tree(adapter->dev)),
-   OID_AUTO, name, CTLFLAG_RW, limit, value, description);
-}
-
-
 /*
  * Set flow control using sysctl:
  * Flow control values:
___
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"


svn commit: r316281 - head/sys/net

2017-03-30 Thread Sean Bruno
Author: sbruno
Date: Thu Mar 30 16:54:01 2017
New Revision: 316281
URL: https://svnweb.freebsd.org/changeset/base/316281

Log:
  Don't call init functions directly from the timer/watchdog function.
  
  Enqueue this in the admin task now that it can process it.
  
  Submitted by: Matt Macy 
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Mar 30 16:31:35 2017(r316280)
+++ head/sys/net/iflib.cThu Mar 30 16:54:01 2017(r316281)
@@ -1441,15 +1441,17 @@ _iflib_irq_alloc(if_ctx_t ctx, if_irq_t 
driver_filter_t filter, driver_intr_t handler, void *arg,
 char *name)
 {
-   int rc;
+   int rc, flags;
struct resource *res;
-   void *tag;
+   void *tag = NULL;
device_t dev = ctx->ifc_dev;
 
+   flags = RF_ACTIVE;
+   if (ctx->ifc_flags & IFC_LEGACY)
+   flags |= RF_SHAREABLE;
MPASS(rid < 512);
irq->ii_rid = rid;
-   res = bus_alloc_resource_any(dev, SYS_RES_IRQ, >ii_rid,
-RF_SHAREABLE | RF_ACTIVE);
+   res = bus_alloc_resource_any(dev, SYS_RES_IRQ, >ii_rid, flags);
if (res == NULL) {
device_printf(dev,
"failed to allocate IRQ for rid %d, name %s.\n", rid, name);
@@ -2122,7 +2124,8 @@ hung:
ctx->ifc_watchdog_events++;
ctx->ifc_pause_frames = 0;
 
-   iflib_init_locked(ctx);
+   ctx->ifc_flags |= IFC_DO_RESET;
+   iflib_admin_intr_deferred(ctx);
CTX_UNLOCK(ctx);
 }
 
@@ -2600,7 +2603,7 @@ txq_max_rs_deferred(iflib_txq_t txq)
return (notify_count >> 1);
if (txq->ift_in_use > minthresh)
return (notify_count >> 2);
-   return (notify_count >> 4);
+   return (2);
 }
 
 #define M_CSUM_FLAGS(m) ((m)->m_pkthdr.csum_flags)
___
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"


svn commit: r316278 - head/sys/net

2017-03-30 Thread Sean Bruno
Author: sbruno
Date: Thu Mar 30 16:03:51 2017
New Revision: 316278
URL: https://svnweb.freebsd.org/changeset/base/316278

Log:
  Assert IFF_DRV_OACTIVE in iflib_timer() when the "hung" case is detected
  so that iflib's admin task can still process the reset directive and restore
  functionality.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Mar 30 15:05:58 2017(r316277)
+++ head/sys/net/iflib.cThu Mar 30 16:03:51 2017(r316278)
@@ -2114,7 +2114,7 @@ iflib_timer(void *arg)
return;
 hung:
CTX_LOCK(ctx);
-   if_setdrvflagbits(ctx->ifc_ifp, 0, IFF_DRV_RUNNING);
+   if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_OACTIVE, IFF_DRV_RUNNING);
device_printf(ctx->ifc_dev,  "TX(%d) desc avail = %d, pidx = %d\n",
  txq->ift_id, TXQ_AVAIL(txq), txq->ift_pidx);
 
@@ -3516,8 +3516,11 @@ _task_fn_admin(void *context)
iflib_txq_t txq;
int i;
 
-   if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING))
-   return;
+   if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_RUNNING)) {
+   if (!(if_getdrvflags(ctx->ifc_ifp) & IFF_DRV_OACTIVE)) {
+   return;
+   }
+   }
 
CTX_LOCK(ctx);
for (txq = ctx->ifc_txqs, i = 0; i < sctx->isc_ntxqsets; i++, txq++) {
___
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"


svn commit: r316027 - head/sys/dev/e1000

2017-03-27 Thread Sean Bruno
Author: sbruno
Date: Mon Mar 27 15:08:02 2017
New Revision: 316027
URL: https://svnweb.freebsd.org/changeset/base/316027

Log:
  Access *correct* ifp data structure when debug sysctl is invoked.
  
  Submitted by: Kevin Bowling 
  Sponsored by: Limelight Networks
  Differential Revision:https://reviews.freebsd.org/D10126

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Mon Mar 27 14:55:23 2017(r316026)
+++ head/sys/dev/e1000/if_em.c  Mon Mar 27 15:08:02 2017(r316027)
@@ -4341,16 +4341,17 @@ em_if_debug(if_ctx_t ctx)
 static void
 em_print_debug_info(struct adapter *adapter)
 {
-   device_t dev = adapter->dev;
+   device_t dev = iflib_get_dev(adapter->ctx);
+   struct ifnet *ifp = iflib_get_ifp(adapter->ctx);
struct tx_ring *txr = >tx_queues->txr;
struct rx_ring *rxr = >rx_queues->rxr;
 
-   if (if_getdrvflags(adapter->ifp) & IFF_DRV_RUNNING)
+   if (if_getdrvflags(ifp) & IFF_DRV_RUNNING)
printf("Interface is RUNNING ");
else
printf("Interface is NOT RUNNING\n");
 
-   if (if_getdrvflags(adapter->ifp) & IFF_DRV_OACTIVE)
+   if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE)
printf("and INACTIVE\n");
else
printf("and ACTIVE\n");
___
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"


svn commit: r316026 - head/sys/dev/bnxt

2017-03-27 Thread Sean Bruno
Author: sbruno
Date: Mon Mar 27 14:55:23 2017
New Revision: 316026
URL: https://svnweb.freebsd.org/changeset/base/316026

Log:
  Change the default rss_type to M_HASHTYPE_OPAQUE_HASH.
  
  Submitted by: Venkat Duvvuru 
  MFC after:1 week
  Differential Revision:https://reviews.freebsd.org/D9905

Modified:
  head/sys/dev/bnxt/bnxt_txrx.c

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Mon Mar 27 14:37:35 2017
(r316025)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Mon Mar 27 14:55:23 2017
(r316026)
@@ -452,7 +452,7 @@ bnxt_set_rsstype(if_rxd_info_t ri, uint8
ri->iri_rsstype = M_HASHTYPE_RSS_IPV6;
break;
default:
-   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   ri->iri_rsstype = M_HASHTYPE_OPAQUE_HASH;
break;
}
 }
___
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"


svn commit: r315961 - head/sys/dev/sound/pci/hda

2017-03-25 Thread Sean Bruno
Author: sbruno
Date: Sat Mar 25 19:12:09 2017
New Revision: 315961
URL: https://svnweb.freebsd.org/changeset/base/315961

Log:
  Add ids for ALC233 found on Intel Skull Mountain NUC.

Modified:
  head/sys/dev/sound/pci/hda/hdac.h
  head/sys/dev/sound/pci/hda/hdacc.c

Modified: head/sys/dev/sound/pci/hda/hdac.h
==
--- head/sys/dev/sound/pci/hda/hdac.h   Sat Mar 25 19:08:51 2017
(r315960)
+++ head/sys/dev/sound/pci/hda/hdac.h   Sat Mar 25 19:12:09 2017
(r315961)
@@ -339,6 +339,7 @@
 /* Realtek */
 #define REALTEK_VENDORID   0x10ec
 #define HDA_CODEC_ALC221   HDA_CODEC_CONSTRUCT(REALTEK, 0x0221)
+#define HDA_CODEC_ALC233   HDA_CODEC_CONSTRUCT(REALTEK, 0x0233)
 #define HDA_CODEC_ALC260   HDA_CODEC_CONSTRUCT(REALTEK, 0x0260)
 #define HDA_CODEC_ALC262   HDA_CODEC_CONSTRUCT(REALTEK, 0x0262)
 #define HDA_CODEC_ALC267   HDA_CODEC_CONSTRUCT(REALTEK, 0x0267)

Modified: head/sys/dev/sound/pci/hda/hdacc.c
==
--- head/sys/dev/sound/pci/hda/hdacc.c  Sat Mar 25 19:08:51 2017
(r315960)
+++ head/sys/dev/sound/pci/hda/hdacc.c  Sat Mar 25 19:12:09 2017
(r315961)
@@ -77,6 +77,7 @@ static const struct {
{ HDA_CODEC_CS4207, 0,  "Cirrus Logic CS4207" },
{ HDA_CODEC_CS4210, 0,  "Cirrus Logic CS4210" },
{ HDA_CODEC_ALC221, 0,  "Realtek ALC221" },
+   { HDA_CODEC_ALC233, 0,  "Realtek ALC233" },
{ HDA_CODEC_ALC260, 0,  "Realtek ALC260" },
{ HDA_CODEC_ALC262, 0,  "Realtek ALC262" },
{ HDA_CODEC_ALC267, 0,  "Realtek ALC267" },
___
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"


svn commit: r315905 - head/sys/dev/e1000

2017-03-24 Thread Sean Bruno
Author: sbruno
Date: Fri Mar 24 14:27:29 2017
New Revision: 315905
URL: https://svnweb.freebsd.org/changeset/base/315905

Log:
  Add missing 'else' to conditional.  This doesn't really affect the code
  flow or configuration in any way.

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Fri Mar 24 14:26:01 2017(r315904)
+++ head/sys/dev/e1000/if_em.c  Fri Mar 24 14:27:29 2017(r315905)
@@ -3231,7 +3231,7 @@ em_if_enable_intr(if_ctx_t ctx)
if (hw->mac.type == e1000_82574) {
E1000_WRITE_REG(hw, EM_EIAC, EM_MSIX_MASK);
ims_mask |= adapter->ims;
-   } if (adapter->intr_type == IFLIB_INTR_MSIX && hw->mac.type >= 
igb_mac_min)  {
+   } else if (adapter->intr_type == IFLIB_INTR_MSIX && hw->mac.type >= 
igb_mac_min)  {
u32 mask = (adapter->que_mask | adapter->link_mask);
 
E1000_WRITE_REG(>hw, E1000_EIAC, mask);
___
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"


svn commit: r315903 - head/sys/dev/e1000

2017-03-24 Thread Sean Bruno
Author: sbruno
Date: Fri Mar 24 14:25:56 2017
New Revision: 315903
URL: https://svnweb.freebsd.org/changeset/base/315903

Log:
  Add missing 'else' to 3-state conditional during setup of interrupts.
  
  We don't want to overwrite the 82574 interrupt setup with a different
  configuration.
  
  PR:   218041
  Submitted by: razmys...@viva64.com

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Fri Mar 24 14:19:52 2017(r315902)
+++ head/sys/dev/e1000/if_em.c  Fri Mar 24 14:25:56 2017(r315903)
@@ -1941,10 +1941,11 @@ em_if_msix_intr_assign(if_ctx_t ctx, int
tx_que->eims = 1 << (22 + i);
adapter->ims |= tx_que->eims;
adapter->ivars |= (8 | tx_que->msix) << (8 + (i * 4));
-   } if (adapter->hw.mac.type == e1000_82575)
+   } else if (adapter->hw.mac.type == e1000_82575) {
tx_que->eims = E1000_EICR_TX_QUEUE0 << (i %  
adapter->tx_num_queues);
-   else
+   } else {
tx_que->eims = 1 << (i %  adapter->tx_num_queues);
+   }
}
 
/* Link interrupt */
___
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"


svn commit: r315306 - head/sys/dev/e1000

2017-03-15 Thread Sean Bruno
Author: sbruno
Date: Wed Mar 15 14:44:59 2017
New Revision: 315306
URL: https://svnweb.freebsd.org/changeset/base/315306

Log:
  Actually set the MTU to the requested value and fixup handling of jumbo
  frames.
  
  Submitted by: Matt Macy 
  Reported by:  pho
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Wed Mar 15 13:36:35 2017(r315305)
+++ head/sys/dev/e1000/if_em.c  Wed Mar 15 14:44:59 2017(r315306)
@@ -1116,7 +1116,6 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu
 {
int max_frame_size;
struct adapter *adapter = iflib_get_softc(ctx);
-   struct ifnet *ifp = iflib_get_ifp(ctx);
if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx);
 
 IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)");
@@ -1154,7 +1153,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu
}
 
scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size =
-   if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
+   mtu + ETHER_HDR_LEN + ETHER_CRC_LEN;
return (0);
 }
 
___
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"


svn commit: r315288 - head/sys/net

2017-03-14 Thread Sean Bruno
Author: sbruno
Date: Tue Mar 14 22:25:07 2017
New Revision: 315288
URL: https://svnweb.freebsd.org/changeset/base/315288

Log:
  Change casting to a uintptr_t to be compatible with non-x86 architectures.
  
  Submitted by: Matt Macy 
  Reported by:  rpokala
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Mar 14 22:02:02 2017(r315287)
+++ head/sys/net/iflib.cTue Mar 14 22:25:07 2017(r315288)
@@ -257,7 +257,7 @@ iflib_get_sctx(if_ctx_t ctx)
 
 #define IP_ALIGNED(m) uintptr_t)(m)->m_data) & 0x3) == 0x2)
 #define CACHE_PTR_INCREMENT (CACHE_LINE_SIZE/sizeof(void*))
-#define CACHE_PTR_NEXT(ptr) ((void *)(((vm_paddr_t)(ptr)+CACHE_LINE_SIZE-1) & 
(CACHE_LINE_SIZE-1)))
+#define CACHE_PTR_NEXT(ptr) ((void *)(((uintptr_t)(ptr)+CACHE_LINE_SIZE-1) & 
(CACHE_LINE_SIZE-1)))
 
 #define LINK_ACTIVE(ctx) ((ctx)->ifc_link_state == LINK_STATE_UP)
 #define CTX_IS_VF(ctx) ((ctx)->ifc_sctx->isc_flags & IFLIB_IS_VF)
___
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: r315245 - head/sys/net

2017-03-14 Thread Sean Bruno


On 03/14/17 10:25, Ravi Pokala wrote:
> Hi Sean,
> 
> A few MIPS (XLPN32, XLRN32), and PowerPC (MPC85XX, MPC85XXSPE) configs are 
> still broken:
> 
> --- iflib.o ---
> cc1: warnings being treated as errors
> /usr/home/rpokala/freebsd/clean/base/head/sys/net/iflib.c: In function 
> 'calc_next_rxd':
> /usr/home/rpokala/freebsd/clean/base/head/sys/net/iflib.c:2280: warning: 
> cast from pointer to integer of different size [-Wpointer-to-int-cast]
> /usr/home/rpokala/freebsd/clean/base/head/sys/net/iflib.c:2280: warning: 
> cast to pointer from integer of different size [-Wint-to-pointer-cast]
> /usr/home/rpokala/freebsd/clean/base/head/sys/net/iflib.c: In function 
> 'calc_next_txd':
> /usr/home/rpokala/freebsd/clean/base/head/sys/net/iflib.c:2990: warning: 
> cast from pointer to integer of different size [-Wpointer-to-int-cast]
> /usr/home/rpokala/freebsd/clean/base/head/sys/net/iflib.c:2990: warning: 
> cast to pointer from integer of different size [-Wint-to-pointer-cast]
> *** [iflib.o] Error code 1
> 
> Thanks,
> 
> Ravi (rpokala@)
> 

Hrm.  Ok.  Will fixup directly.

sean

> -Original Message-
> From: <owner-src-committ...@freebsd.org> on behalf of Sean Bruno 
> <sbr...@freebsd.org>
> Date: 2017-03-14, Tuesday at 08:08
> To: <src-committ...@freebsd.org>, <svn-src-...@freebsd.org>, 
> <svn-src-head@freebsd.org>
> Subject: svn commit: r315245 - head/sys/net
> 
> Author: sbruno
> Date: Tue Mar 14 15:08:56 2017
> New Revision: 315245
> URL: https://svnweb.freebsd.org/changeset/base/315245
> 
> Log:
>   Fixup LINT by using uint64_t type as we do on all other calls to PNMB()
>   
>   Found with Jenkins.
>   
>   Reported by:lwshu
>   Sponsored by:   Limelight Networks
> 
> Modified:
>   head/sys/net/iflib.c
> 
> Modified: head/sys/net/iflib.c
> ==
> --- head/sys/net/iflib.c  Tue Mar 14 14:02:47 2017(r315244)
> +++ head/sys/net/iflib.c  Tue Mar 14 15:08:56 2017(r315245)
> @@ -860,7 +860,7 @@ iflib_netmap_txsync(struct netmap_kring 
>   for (n = 0; nm_i != head; n++) {
>   struct netmap_slot *slot = >slot[nm_i];
>   u_int len = slot->len;
> - vm_paddr_t paddr;
> + uint64_t paddr;
>   void *addr = PNMB(na, slot, );
>   int flags = (slot->flags & NS_REPORT ||
>   nic_i == 0 || nic_i == report_frequency) ?
> 
> 
> 
> 
> 



signature.asc
Description: OpenPGP digital signature


svn commit: r315245 - head/sys/net

2017-03-14 Thread Sean Bruno
Author: sbruno
Date: Tue Mar 14 15:08:56 2017
New Revision: 315245
URL: https://svnweb.freebsd.org/changeset/base/315245

Log:
  Fixup LINT by using uint64_t type as we do on all other calls to PNMB()
  
  Found with Jenkins.
  
  Reported by:  lwshu
  Sponsored by: Limelight Networks

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cTue Mar 14 14:02:47 2017(r315244)
+++ head/sys/net/iflib.cTue Mar 14 15:08:56 2017(r315245)
@@ -860,7 +860,7 @@ iflib_netmap_txsync(struct netmap_kring 
for (n = 0; nm_i != head; n++) {
struct netmap_slot *slot = >slot[nm_i];
u_int len = slot->len;
-   vm_paddr_t paddr;
+   uint64_t paddr;
void *addr = PNMB(na, slot, );
int flags = (slot->flags & NS_REPORT ||
nic_i == 0 || nic_i == report_frequency) ?
___
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"


svn commit: r315243 - head/sys/dev/bnxt

2017-03-14 Thread Sean Bruno
Author: sbruno
Date: Tue Mar 14 13:54:18 2017
New Revision: 315243
URL: https://svnweb.freebsd.org/changeset/base/315243

Log:
  Restore changes for RSS routing improvements made in 314369 that were
  reverted in the IFLIB update I made in 315217.
  
  Submitted by: Venkat Duvvuru 

Modified:
  head/sys/dev/bnxt/bnxt_txrx.c

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Tue Mar 14 12:39:19 2017
(r315242)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Tue Mar 14 13:54:18 2017
(r315243)
@@ -426,6 +426,37 @@ cmpl_invalid:
return avail;
 }
 
+static void
+bnxt_set_rsstype(if_rxd_info_t ri, uint8_t rss_hash_type)
+{
+   uint8_t rss_profile_id;
+
+   rss_profile_id = BNXT_GET_RSS_PROFILE_ID(rss_hash_type);
+   switch (rss_profile_id) {
+   case BNXT_RSS_HASH_TYPE_TCPV4:
+   ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4;
+   break;
+   case BNXT_RSS_HASH_TYPE_UDPV4:
+   ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV4;
+   break;
+   case BNXT_RSS_HASH_TYPE_IPV4:
+   ri->iri_rsstype = M_HASHTYPE_RSS_IPV4;
+   break;
+   case BNXT_RSS_HASH_TYPE_TCPV6:
+   ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV6;
+   break;
+   case BNXT_RSS_HASH_TYPE_UDPV6:
+   ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV6;
+   break;
+   case BNXT_RSS_HASH_TYPE_IPV6:
+   ri->iri_rsstype = M_HASHTYPE_RSS_IPV6;
+   break;
+   default:
+   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   break;
+   }
+}
+
 static int
 bnxt_pkt_get_l2(struct bnxt_softc *softc, if_rxd_info_t ri,
 struct bnxt_cp_ring *cpr, uint16_t flags_type)
@@ -443,13 +474,7 @@ bnxt_pkt_get_l2(struct bnxt_softc *softc
/* Extract from the first 16-byte BD */
if (flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID) {
ri->iri_flowid = le32toh(rcp->rss_hash);
-   /*
-* TODO: Extract something useful from rcp->rss_hash_type
-* (undocumented)
-* May be documented in the "LSI ES"
-* also check the firmware code.
-*/
-   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   bnxt_set_rsstype(ri, rcp->rss_hash_type);
}
else {
ri->iri_rsstype = M_HASHTYPE_NONE;
@@ -529,13 +554,7 @@ bnxt_pkt_get_tpa(struct bnxt_softc *soft
/* Extract from the first 16-byte BD */
if (le16toh(tpas->low.flags_type) & RX_TPA_START_CMPL_FLAGS_RSS_VALID) {
ri->iri_flowid = le32toh(tpas->low.rss_hash);
-   /*
-* TODO: Extract something useful from tpas->low.rss_hash_type
-* (undocumented)
-* May be documented in the "LSI ES"
-* also check the firmware code.
-*/
-   ri->iri_rsstype = M_HASHTYPE_OPAQUE;
+   bnxt_set_rsstype(ri, tpas->low.rss_hash_type);
}
else {
ri->iri_rsstype = M_HASHTYPE_NONE;
___
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"


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

2017-03-13 Thread Sean Bruno
Author: sbruno
Date: Mon Mar 13 22:53:06 2017
New Revision: 315217
URL: https://svnweb.freebsd.org/changeset/base/315217

Log:
  IFLIB updates
  - 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 
  Sponsored by: Limelight Networks

Modified:
  head/sys/dev/bnxt/bnxt_txrx.c
  head/sys/dev/bnxt/if_bnxt.c
  head/sys/dev/e1000/em_txrx.c
  head/sys/dev/e1000/if_em.c
  head/sys/dev/e1000/if_em.h
  head/sys/dev/e1000/igb_txrx.c
  head/sys/net/ifdi_if.m
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/dev/bnxt/bnxt_txrx.c
==
--- head/sys/dev/bnxt/bnxt_txrx.c   Mon Mar 13 22:45:51 2017
(r315216)
+++ head/sys/dev/bnxt/bnxt_txrx.c   Mon Mar 13 22:53:06 2017
(r315217)
@@ -48,17 +48,19 @@ __FBSDID("$FreeBSD$");
  */
 
 static int bnxt_isc_txd_encap(void *sc, if_pkt_info_t pi);
-static void bnxt_isc_txd_flush(void *sc, uint16_t txqid, uint32_t pidx);
-static int bnxt_isc_txd_credits_update(void *sc, uint16_t txqid, uint32_t cidx,
-bool clear);
+static void bnxt_isc_txd_flush(void *sc, uint16_t txqid, qidx_t pidx);
+static int bnxt_isc_txd_credits_update(void *sc, uint16_t txqid, bool clear);
 
-static void bnxt_isc_rxd_refill(void *sc, uint16_t rxqid, uint8_t flid,
+static void bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru);
+
+/* uint16_t rxqid, uint8_t flid,
 uint32_t pidx, uint64_t *paddrs, caddr_t *vaddrs, uint16_t count,
 uint16_t buf_size);
+*/
 static void bnxt_isc_rxd_flush(void *sc, uint16_t rxqid, uint8_t flid,
-uint32_t pidx);
-static int bnxt_isc_rxd_available(void *sc, uint16_t rxqid, uint32_t idx,
-int budget);
+qidx_t pidx);
+static int bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_t idx,
+qidx_t budget);
 static int bnxt_isc_rxd_pkt_get(void *sc, if_rxd_info_t ri);
 
 static int bnxt_intr(void *sc);
@@ -172,7 +174,7 @@ bnxt_isc_txd_encap(void *sc, if_pkt_info
 }
 
 static void
-bnxt_isc_txd_flush(void *sc, uint16_t txqid, uint32_t pidx)
+bnxt_isc_txd_flush(void *sc, uint16_t txqid, qidx_t pidx)
 {
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_ring *tx_ring = >tx_rings[txqid];
@@ -185,7 +187,7 @@ bnxt_isc_txd_flush(void *sc, uint16_t tx
 }
 
 static int
-bnxt_isc_txd_credits_update(void *sc, uint16_t txqid, uint32_t idx, bool clear)
+bnxt_isc_txd_credits_update(void *sc, uint16_t txqid, bool clear)
 {
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_cp_ring *cpr = >tx_cp_rings[txqid];
@@ -249,15 +251,27 @@ done:
 }
 
 static void
-bnxt_isc_rxd_refill(void *sc, uint16_t rxqid, uint8_t flid,
-   uint32_t pidx, uint64_t *paddrs,
-   caddr_t *vaddrs, uint16_t count, uint16_t len)
+bnxt_isc_rxd_refill(void *sc, if_rxd_update_t iru)
 {
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_ring *rx_ring;
struct rx_prod_pkt_bd *rxbd;
uint16_t type;
uint16_t i;
+   uint16_t rxqid;
+   uint16_t count, len;
+   uint32_t pidx;
+   uint8_t flid;
+   uint64_t *paddrs;
+   caddr_t *vaddrs;
+
+   rxqid = iru->iru_qsidx;
+   count = iru->iru_count;
+   len = iru->iru_buf_size;
+   pidx = iru->iru_pidx;
+   flid = iru->iru_flidx;
+   vaddrs = iru->iru_vaddrs;
+   paddrs = iru->iru_paddrs;
 
if (flid == 0) {
rx_ring = >rx_rings[rxqid];
@@ -284,7 +298,7 @@ bnxt_isc_rxd_refill(void *sc, uint16_t r
 
 static void
 bnxt_isc_rxd_flush(void *sc, uint16_t rxqid, uint8_t flid,
-uint32_t pidx)
+qidx_t pidx)
 {
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_ring *rx_ring;
@@ -310,7 +324,7 @@ bnxt_isc_rxd_flush(void *sc, uint16_t rx
 }
 
 static int
-bnxt_isc_rxd_available(void *sc, uint16_t rxqid, uint32_t idx, int budget)
+bnxt_isc_rxd_available(void *sc, uint16_t rxqid, qidx_t idx, qidx_t budget)
 {
struct bnxt_softc *softc = (struct bnxt_softc *)sc;
struct bnxt_cp_ring *cpr = >rx_cp_rings[rxqid];
@@ -412,37 +426,6 @@ cmpl_invalid:
return avail;
 }
 
-static void
-bnxt_set_rsstype(if_rxd_info_t ri, uint8_t rss_hash_type)
-{
-   uint8_t rss_profile_id;
-
-   rss_profile_id = BNXT_GET_RSS_PROFILE_ID(rss_hash_type);
-   switch (rss_profile_id) {
-   case BNXT_RSS_HASH_TYPE_TCPV4:
-   ri->iri_rsstype = M_HASHTYPE_RSS_TCP_IPV4;
-   break;
-   case BNXT_RSS_HASH_TYPE_UDPV4:
-   ri->iri_rsstype = M_HASHTYPE_RSS_UDP_IPV4;
-   break;
-   case 

Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Sean Bruno


On 03/10/17 13:21, John Baldwin wrote:
> On Friday, March 10, 2017 11:12:45 AM Navdeep Parhar wrote:
>> On Fri, Mar 10, 2017 at 10:41 AM, Ryan Stone  wrote:
>>> There's also the issue that running "ifconfig igb0 blah" during startup will
>>> cause if_igb to be automatically loaded by ifconfig.
>>>
>>> I guess we could add a dummy if_igb.ko that just has a dependency on
>>> if_em.ko
>>
>> I do similar stuff in cxgbe (if_cxl.ko and if_cc.ko exist solely to
>> drag in if_cxgbe.ko as a dependency).  In hindsight I wish I'd just
>> added a list of ifnet names -> kld map to ifconfig instead.  It would
>> have been an ugly hack but much simpler.
> 
> For now I think having an if_igb.c that is like if_cc.c and if_cxl.c
> is probably the simplest way to go.
> 

Gotcha. Will do.

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r311849 - in head: . sys/amd64/conf sys/arm64/conf sys/conf sys/dev/e1000 sys/i386/conf sys/mips/conf sys/modules sys/modules/em sys/modules/igb sys/powerpc/conf

2017-03-10 Thread Sean Bruno


On 02/15/17 03:06, Roger Pau Monné wrote:
> On Tue, Jan 10, 2017 at 03:23:22AM +0000, Sean Bruno wrote:
>> Author: sbruno
>> Date: Tue Jan 10 03:23:22 2017
>> New Revision: 311849
>> URL: https://svnweb.freebsd.org/changeset/base/311849
>>
>> Log:
>>   Migrate e1000 to the IFLIB framework:
>>   - 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
> 
> This linking causes mfsBSD to choke when building an image from HEAD. It tries
> to issue the following command:
> 
> ${_v}${CP} -rp ${_BOOTDIR}/kernel ${WRKDIR}/disk/boot
> 
> Which fails when finding the symbol link. I can send a patch to change that to
> -Rp, which would work fine, but wouldn't it be better to either completely
> remove if_igb.ko, or simply copy if_em.ko to if_igb.ko?
> 
> I'm wondering if for example anyone strips down it's /boot/kernel/ manually, 
> by
> removing unused modules, and what would happen if if_em.ko is removed but not
> if_igb.ko.
> 
> Roger.
> 
> 

Well, this was my naive attempt to make upgrades for users to be
non-eventful in the event they have "if_igb_load=YES" in their
loader.conf instead of having it built into their kernel.

If the -Rp works, I'll add that instead.

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r315008 - head/sys/boot/i386/libi386

2017-03-10 Thread Sean Bruno
Author: sbruno
Date: Fri Mar 10 17:14:08 2017
New Revision: 315008
URL: https://svnweb.freebsd.org/changeset/base/315008

Log:
  r314948 seems to be missing a variable or two that will break
  TFTP/MFSRoot booting via PXE.  For the TFTP_LOADER case, go ahead and
  fire off the old bootp() request to ensure that whatever is missing is
  populated.
  
  Sponsored by: Limelight Networks

Modified:
  head/sys/boot/i386/libi386/pxe.c

Modified: head/sys/boot/i386/libi386/pxe.c
==
--- head/sys/boot/i386/libi386/pxe.cFri Mar 10 16:12:16 2017
(r315007)
+++ head/sys/boot/i386/libi386/pxe.cFri Mar 10 17:14:08 2017
(r315008)
@@ -301,6 +301,9 @@ pxe_open(struct open_file *f, ...)
printf("pxe_open: loaded RFC1048 data from PXE 
Cache\n");
}
 
+#ifdef LOADER_TFTP_SUPPORT
+   bootp(pxe_sock, BOOTP_PXE);
+#endif
if (rootip.s_addr == 0)
rootip.s_addr = bootplayer.sip;
if (gateip.s_addr == 0)
___
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"


svn commit: r314915 - head/tools/tools/netmap

2017-03-08 Thread Sean Bruno
Author: sbruno
Date: Wed Mar  8 17:29:40 2017
New Revision: 314915
URL: https://svnweb.freebsd.org/changeset/base/314915

Log:
  Use the buildworld includes and defaults when building pkt-gen.  This will
  mean that you need a world built to reliably build pkg-gen but this keeps
  the build from failing when your source doesn't match your host running
  version, e.g. building 12 on 11.
  
  Submitted by: Matt Macy 
  MFC after:2 weeks
  Sponsored by: Limelight Networks

Modified:
  head/tools/tools/netmap/Makefile

Modified: head/tools/tools/netmap/Makefile
==
--- head/tools/tools/netmap/MakefileWed Mar  8 14:52:03 2017
(r314914)
+++ head/tools/tools/netmap/MakefileWed Mar  8 17:29:40 2017
(r314915)
@@ -8,7 +8,6 @@ PROGS   =   pkt-gen nmreplay bridge vale-ctl
 CLEANFILES = $(PROGS) *.o
 MAN=
 CFLAGS += -Werror -Wall
-CFLAGS += -nostdinc -I ../../../sys -I/usr/include
 CFLAGS += -Wextra
 
 LDFLAGS += -lpthread
___
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"


svn commit: r314502 - in head/sys: kern net sys

2017-03-01 Thread Sean Bruno
Author: sbruno
Date: Wed Mar  1 18:37:35 2017
New Revision: 314502
URL: https://svnweb.freebsd.org/changeset/base/314502

Log:
  Make gtaskqueue compatible with drm-next such that they can be used with the
  linuxkpi tasklets.
  
  Submitted by: mm...@nextbsd.org
  Reported by:  hps

Modified:
  head/sys/kern/subr_gtaskqueue.c
  head/sys/net/iflib.c
  head/sys/sys/gtaskqueue.h

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Wed Mar  1 18:23:30 2017
(r314501)
+++ head/sys/kern/subr_gtaskqueue.c Wed Mar  1 18:37:35 2017
(r314502)
@@ -52,6 +52,8 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "task
 static voidgtaskqueue_thread_enqueue(void *);
 static voidgtaskqueue_thread_loop(void *arg);
 
+TASKQGROUP_DEFINE(softirq, mp_ncpus, 1);
+
 struct gtaskqueue_busy {
struct gtask*tb_running;
TAILQ_ENTRY(gtaskqueue_busy) tb_link;

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Mar  1 18:23:30 2017(r314501)
+++ head/sys/net/iflib.cWed Mar  1 18:37:35 2017(r314502)
@@ -480,7 +480,6 @@ MODULE_VERSION(iflib, 1);
 MODULE_DEPEND(iflib, pci, 1, 1, 1);
 MODULE_DEPEND(iflib, ether, 1, 1, 1);
 
-TASKQGROUP_DEFINE(if_io_tqg, mp_ncpus, 1);
 TASKQGROUP_DEFINE(if_config_tqg, 1, 1);
 
 #ifndef IFLIB_DEBUG_COUNTERS
@@ -3922,7 +3921,7 @@ iflib_device_deregister(if_ctx_t ctx)
if (ctx->ifc_led_dev != NULL)
led_destroy(ctx->ifc_led_dev);
/* XXX drain any dependent tasks */
-   tqg = qgroup_if_io_tqg;
+   tqg = qgroup_softirq;
for (txq = ctx->ifc_txqs, i = 0; i < NTXQSETS(ctx); i++, txq++) {
callout_drain(>ift_timer);
callout_drain(>ift_db_check);
@@ -4552,7 +4551,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
q = >ifc_txqs[qid];
info = >ifc_txqs[qid].ift_filter_info;
gtask = >ifc_txqs[qid].ift_task;
-   tqg = qgroup_if_io_tqg;
+   tqg = qgroup_softirq;
fn = _task_fn_tx;
GROUPTASK_INIT(gtask, 0, fn, q);
break;
@@ -4560,7 +4559,7 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if
q = >ifc_rxqs[qid];
info = >ifc_rxqs[qid].ifr_filter_info;
gtask = >ifc_rxqs[qid].ifr_task;
-   tqg = qgroup_if_io_tqg;
+   tqg = qgroup_softirq;
fn = _task_fn_rx;
GROUPTASK_INIT(gtask, 0, fn, q);
break;
@@ -4611,13 +4610,13 @@ iflib_softirq_alloc_generic(if_ctx_t ctx
case IFLIB_INTR_TX:
q = >ifc_txqs[qid];
gtask = >ifc_txqs[qid].ift_task;
-   tqg = qgroup_if_io_tqg;
+   tqg = qgroup_softirq;
fn = _task_fn_tx;
break;
case IFLIB_INTR_RX:
q = >ifc_rxqs[qid];
gtask = >ifc_rxqs[qid].ifr_task;
-   tqg = qgroup_if_io_tqg;
+   tqg = qgroup_softirq;
fn = _task_fn_rx;
break;
case IFLIB_INTR_IOV:
@@ -4661,7 +4660,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
q = >ifc_rxqs[0];
info = [0].ifr_filter_info;
gtask = [0].ifr_task;
-   tqg = qgroup_if_io_tqg;
+   tqg = qgroup_softirq;
tqrid = irq->ii_rid = *rid;
fn = _task_fn_rx;
 
@@ -4678,7 +4677,7 @@ iflib_legacy_setup(if_ctx_t ctx, driver_
taskqgroup_attach(tqg, gtask, q, tqrid, name);
 
GROUPTASK_INIT(>ift_task, 0, _task_fn_tx, txq);
-   taskqgroup_attach(qgroup_if_io_tqg, >ift_task, txq, tqrid, "tx");
+   taskqgroup_attach(qgroup_softirq, >ift_task, txq, tqrid, "tx");
return (0);
 }
 
@@ -4728,7 +4727,7 @@ void
 iflib_io_tqg_attach(struct grouptask *gt, void *uniq, int cpu, char *name)
 {
 
-   taskqgroup_attach_cpu(qgroup_if_io_tqg, gt, uniq, cpu, -1, name);
+   taskqgroup_attach_cpu(qgroup_softirq, gt, uniq, cpu, -1, name);
 }
 
 void

Modified: head/sys/sys/gtaskqueue.h
==
--- head/sys/sys/gtaskqueue.h   Wed Mar  1 18:23:30 2017(r314501)
+++ head/sys/sys/gtaskqueue.h   Wed Mar  1 18:37:35 2017(r314502)
@@ -119,5 +119,6 @@ SYSINIT(taskqgroup_adj_##name, SI_SUB_SM
 #endif /* EARLY_AP_STARTUP */
 
 TASKQGROUP_DECLARE(net);
+TASKQGROUP_DECLARE(softirq);
 
 #endif /* !_SYS_GTASKQUEUE_H_ */
___
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"


svn commit: r313935 - head/sys/dev/e1000

2017-02-18 Thread Sean Bruno
Author: sbruno
Date: Sun Feb 19 05:06:29 2017
New Revision: 313935
URL: https://svnweb.freebsd.org/changeset/base/313935

Log:
  Restore PBA setup for igb(4) class devices.
  
  Do no write to PBA register on igb(4) devices unless we need
  to make adjustments for the 82575 and jumbo frames.
  
  Remove redundant LPE/~LPE assignments.
  
  Move e1000_lv_jumbo_workaround_ich8lan() invokcation into a block
  so that its not executed in the igb case.
  
  Move em(4) class assignments of RCTL values to its own code block.
  
  Adjust a few direct accesses of ifp->mtu to use accessor functions.
  
  PR:   216734
  Submitted by: Kaho Toshikazu 

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Sun Feb 19 03:57:41 2017(r313934)
+++ head/sys/dev/e1000/if_em.c  Sun Feb 19 05:06:29 2017(r313935)
@@ -2238,13 +2238,62 @@ em_reset(if_ctx_t ctx)
case e1000_pch_spt:
pba = E1000_PBA_26K;
break;
+   case e1000_82575:
+   pba = E1000_PBA_32K;
+   break;
+   case e1000_82576:
+   case e1000_vfadapt:
+   pba = E1000_READ_REG(hw, E1000_RXPBS);
+   pba &= E1000_RXPBS_SIZE_MASK_82576;
+   break;
+   case e1000_82580:
+   case e1000_i350:
+   case e1000_i354:
+   case e1000_vfadapt_i350:
+   pba = E1000_READ_REG(hw, E1000_RXPBS);
+   pba = e1000_rxpbs_adjust_82580(pba);
+   break;
+   case e1000_i210:
+   case e1000_i211:
+   pba = E1000_PBA_34K;
+   break;
default:
if (adapter->hw.mac.max_frame_size > 8192)
pba = E1000_PBA_40K; /* 40K for Rx, 24K for Tx */
else
pba = E1000_PBA_48K; /* 48K for Rx, 16K for Tx */
}
-   E1000_WRITE_REG(>hw, E1000_PBA, pba);
+
+/* Special needs in case of Jumbo frames */
+if ((hw->mac.type == e1000_82575) && (ifp->if_mtu > ETHERMTU)) {
+u32 tx_space, min_tx, min_rx;
+pba = E1000_READ_REG(hw, E1000_PBA);
+tx_space = pba >> 16;
+pba &= 0x;
+min_tx = (adapter->hw.mac.max_frame_size +
+sizeof(struct e1000_tx_desc) - ETHERNET_FCS_SIZE) * 2;
+min_tx = roundup2(min_tx, 1024);
+min_tx >>= 10;
+min_rx = adapter->hw.mac.max_frame_size;
+min_rx = roundup2(min_rx, 1024);
+min_rx >>= 10;
+if (tx_space < min_tx &&
+((min_tx - tx_space) < pba)) {
+pba = pba - (min_tx - tx_space);
+/*
+ * if short on rx space, rx wins
+ * and must trump tx adjustment
+ */
+if (pba < min_rx)
+pba = min_rx;
+}
+E1000_WRITE_REG(hw, E1000_PBA, pba);
+}
+
+   if (hw->mac.type < igb_mac_min)
+   E1000_WRITE_REG(>hw, E1000_PBA, pba);
+   
+   INIT_DEBUGOUT1("em_reset: pba=%dK",pba);
 
/*
 * These parameters control the automatic generation (Tx) and
@@ -2260,7 +2309,7 @@ em_reset(if_ctx_t ctx)
 *   by 1500.
 * - The pause time is fairly large at 1000 x 512ns = 512 usec.
 */
-   rx_buffer_size = ((E1000_READ_REG(hw, E1000_PBA) & 0x) << 10 );
+   rx_buffer_size = (pba & 0x) << 10;
hw->fc.high_water = rx_buffer_size -
roundup2(adapter->hw.mac.max_frame_size, 1024);
hw->fc.low_water = hw->fc.high_water - 1500;
@@ -2305,6 +2354,21 @@ em_reset(if_ctx_t ctx)
else
E1000_WRITE_REG(hw, E1000_PBA, 26);
break;
+   case e1000_82575:
+   case e1000_82576:
+   /* 8-byte granularity */
+   hw->fc.low_water = hw->fc.high_water - 8;
+   break;
+   case e1000_82580:
+   case e1000_i350:
+   case e1000_i354:
+   case e1000_i210:
+   case e1000_i211:
+   case e1000_vfadapt:
+   case e1000_vfadapt_i350:
+   /* 16-byte granularity */
+   hw->fc.low_water = hw->fc.high_water - 16;
+   break; 
 case e1000_ich9lan:
 case e1000_ich10lan:
if (if_getmtu(ifp) > ETHERMTU) {
@@ -2975,9 +3039,7 @@ em_initialize_receive_unit(if_ctx_t ctx)
} else if (adapter->hw.mac.type >= igb_mac_min) {
u32 psize, srrctl = 0;
 
-   if (ifp->if_mtu > ETHERMTU) {
-   rctl |= E1000_RCTL_LPE;
-
+   if (if_getmtu(ifp) > ETHERMTU) {
/* Set maximum packet len */
   

svn commit: r313900 - head/sys/dev/e1000

2017-02-17 Thread Sean Bruno
Author: sbruno
Date: Fri Feb 17 21:30:16 2017
New Revision: 313900
URL: https://svnweb.freebsd.org/changeset/base/313900

Log:
  Push max_frame_len back into iflib so that jumbo frame sizes work.
  
  Reported by:  pho

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Fri Feb 17 21:25:24 2017(r313899)
+++ head/sys/dev/e1000/if_em.c  Fri Feb 17 21:30:16 2017(r313900)
@@ -920,7 +920,7 @@ em_if_attach_pre(if_ctx_t ctx) 
 * Set the frame limits assuming
 * standard ethernet sized frames.
 */
-   adapter->hw.mac.max_frame_size =
+   scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size =
ETHERMTU + ETHER_HDR_LEN + ETHERNET_FCS_SIZE;
 
/*
@@ -1117,6 +1117,7 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu
   int max_frame_size;
   struct adapter *adapter = iflib_get_softc(ctx);
   struct ifnet *ifp = iflib_get_ifp(ctx); 
+  if_softc_ctx_t scctx = iflib_get_softc_ctx(ctx);
   
   IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)");
   
@@ -1147,7 +1148,8 @@ em_if_mtu_set(if_ctx_t ctx, uint32_t mtu
  return (EINVAL);
   }
   
-  adapter->hw.mac.max_frame_size = if_getmtu(ifp) + ETHER_HDR_LEN + 
ETHER_CRC_LEN;
+  scctx->isc_max_frame_size = adapter->hw.mac.max_frame_size =
+  if_getmtu(ifp) + ETHER_HDR_LEN + ETHER_CRC_LEN;
   return (0);
 }
 
___
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"


svn commit: r313892 - head/tools/build/mk

2017-02-17 Thread Sean Bruno
Author: sbruno
Date: Fri Feb 17 20:02:40 2017
New Revision: 313892
URL: https://svnweb.freebsd.org/changeset/base/313892

Log:
  Update OLD_DIRS for various targets so that some of the branches of
  directories are pruned when the appropriate knobs are turned.
  
  Specifically, turning off bsdconfig, locales, examples, i18n, man,
  ntp, syscons.  It may not seem like a lot, but it helps when trying
  to keep an x86 image under 96MB for MFSRoot netbooting.
  
  Reviewed by:  ngie
  Differential Revision:https://reviews.freebsd.org/D9558

Modified:
  head/tools/build/mk/OptionalObsoleteFiles.inc

Modified: head/tools/build/mk/OptionalObsoleteFiles.inc
==
--- head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Feb 17 19:53:20 
2017(r313891)
+++ head/tools/build/mk/OptionalObsoleteFiles.inc   Fri Feb 17 20:02:40 
2017(r313892)
@@ -1592,6 +1592,14 @@ OLD_FILES+=usr/share/man/man1/dpv.1.gz
 OLD_FILES+=usr/share/man/man3/dialog.3.gz
 OLD_FILES+=usr/share/man/man3/dpv.3.gz
 OLD_FILES+=usr/share/man/man8/bsdconfig.8.gz
+OLD_DIRS+=usr/share/bsdconfig
+OLD_DIRS+=usr/share/bsdconfig/media
+OLD_DIRS+=usr/share/bsdconfig/networking
+OLD_DIRS+=usr/share/bsdconfig/packages
+OLD_DIRS+=usr/share/bsdconfig/password
+OLD_DIRS+=usr/share/bsdconfig/startup
+OLD_DIRS+=usr/share/bsdconfig/timezone
+OLD_DIRS+=usr/share/bsdconfig/usermgmt
 .endif
 
 .if ${MK_FMTREE} == no
@@ -2226,9 +2234,62 @@ OLD_FILES+=usr/share/nls/ru_RU.KOI8-R/ee
 OLD_FILES+=usr/share/nls/uk_UA.KOI8-U/ee.cat
 .endif
 
-#.if ${MK_EXAMPLES} == no
-# to be filled in
-#.endif
+.if ${MK_EXAMPLES} == no
+OLD_DIRS+=usr/share/examples
+OLD_DIRS+=usr/share/examples/BSD_daemon
+OLD_DIRS+=usr/share/examples/FreeBSD_version
+OLD_DIRS+=usr/share/examples/IPv6
+OLD_DIRS+=usr/share/examples/bootforth
+OLD_DIRS+=usr/share/examples/bsdconfig
+OLD_DIRS+=usr/share/examples/csh
+OLD_DIRS+=usr/share/examples/diskless
+OLD_DIRS+=usr/share/examples/dma
+OLD_DIRS+=usr/share/examples/drivers
+OLD_DIRS+=usr/share/examples/etc
+OLD_DIRS+=usr/share/examples/etc/defaults
+OLD_DIRS+=usr/share/examples/find_interface
+OLD_DIRS+=usr/share/examples/hast
+OLD_DIRS+=usr/share/examples/ibcs2
+OLD_DIRS+=usr/share/examples/indent
+OLD_DIRS+=usr/share/examples/ipfw
+OLD_DIRS+=usr/share/examples/jails
+OLD_DIRS+=usr/share/examples/kld
+OLD_DIRS+=usr/share/examples/kld/cdev
+OLD_DIRS+=usr/share/examples/kld/cdev/module
+OLD_DIRS+=usr/share/examples/kld/cdev/test
+OLD_DIRS+=usr/share/examples/kld/dyn_sysctl
+OLD_DIRS+=usr/share/examples/kld/firmware
+OLD_DIRS+=usr/share/examples/kld/firmware/fwconsumer
+OLD_DIRS+=usr/share/examples/kld/firmware/fwimage
+OLD_DIRS+=usr/share/examples/kld/khelp
+OLD_DIRS+=usr/share/examples/kld/syscall
+OLD_DIRS+=usr/share/examples/kld/syscall/module
+OLD_DIRS+=usr/share/examples/kld/syscall/test
+OLD_DIRS+=usr/share/examples/libusb20
+OLD_DIRS+=usr/share/examples/libvgl
+OLD_DIRS+=usr/share/examples/mdoc
+OLD_DIRS+=usr/share/examples/netgraph
+OLD_DIRS+=usr/share/examples/perfmon
+OLD_DIRS+=usr/share/examples/ppi
+OLD_DIRS+=usr/share/examples/ppp
+OLD_DIRS+=usr/share/examples/printing
+OLD_DIRS+=usr/share/examples/scsi_target
+OLD_DIRS+=usr/share/examples/ses
+OLD_DIRS+=usr/share/examples/ses/getencstat
+OLD_DIRS+=usr/share/examples/ses/sesd
+OLD_DIRS+=usr/share/examples/ses/setencstat
+OLD_DIRS+=usr/share/examples/ses/setobjstat
+OLD_DIRS+=usr/share/examples/ses/srcs
+OLD_DIRS+=usr/share/examples/smbfs
+OLD_DIRS+=usr/share/examples/smbfs/print
+OLD_DIRS+=usr/share/examples/sunrpc
+OLD_DIRS+=usr/share/examples/sunrpc/dir
+OLD_DIRS+=usr/share/examples/sunrpc/msg
+OLD_DIRS+=usr/share/examples/sunrpc/sort
+OLD_DIRS+=usr/share/examples/tcsh
+OLD_DIRS+=usr/share/examples/uefisign
+OLD_DIRS+=usr/share/examples/ypldap
+.endif
 
 .if ${MK_FINGER} == no
 OLD_FILES+=usr/bin/finger
@@ -3116,6 +3177,7 @@ OLD_FILES+=usr/share/man/man5/hesiod.con
 .if ${MK_HTML} == no
 OLD_FILES+=usr/share/doc/ncurses/hackguide.html
 OLD_FILES+=usr/share/doc/ncurses/ncurses-intro.html
+OLD_DIRS+=usr/share/doc/ncurses
 OLD_FILES+=usr/share/doc/ntp/accopt.html
 OLD_FILES+=usr/share/doc/ntp/assoc.html
 OLD_FILES+=usr/share/doc/ntp/audio.html
@@ -3203,6 +3265,42 @@ OLD_FILES+=usr/share/man/man3/iconv_open
 OLD_FILES+=usr/share/man/man3/iconv_open_into.3.gz
 OLD_FILES+=usr/share/man/man3/iconvctl.3.gz
 OLD_FILES+=usr/share/man/man3/iconvlist.3.gz
+OLD_DIRS+=usr/share/i18n
+OLD_DIRS+=usr/share/i18n/esdb
+OLD_DIRS+=usr/share/i18n/esdb/ISO-2022
+OLD_DIRS+=usr/share/i18n/esdb/BIG5
+OLD_DIRS+=usr/share/i18n/esdb/MISC
+OLD_DIRS+=usr/share/i18n/esdb/TCVN
+OLD_DIRS+=usr/share/i18n/esdb/EBCDIC
+OLD_DIRS+=usr/share/i18n/esdb/ISO-8859
+OLD_DIRS+=usr/share/i18n/esdb/GEORGIAN
+OLD_DIRS+=usr/share/i18n/esdb/AST
+OLD_DIRS+=usr/share/i18n/esdb/KAZAKH
+OLD_DIRS+=usr/share/i18n/esdb/APPLE
+OLD_DIRS+=usr/share/i18n/esdb/EUC
+OLD_DIRS+=usr/share/i18n/esdb/CP
+OLD_DIRS+=usr/share/i18n/esdb/DEC

svn commit: r313691 - head/sys/dev/e1000

2017-02-12 Thread Sean Bruno
Author: sbruno
Date: Sun Feb 12 23:06:41 2017
New Revision: 313691
URL: https://svnweb.freebsd.org/changeset/base/313691

Log:
  Only trigger em_local_timer on queue index 0.  This was causing continuous
  em_local_timer() executions during normal operation and was very likely
  to cause a lock up on igb(4) devices.
  
  Submitted by: Matt Macy (mm...@nextbsd.org)
  Reported by:  jtl
  Reviewed by:  gallatin
  Sponsored by: Limelight Networks & Netflix

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==
--- head/sys/dev/e1000/if_em.c  Sun Feb 12 21:05:44 2017(r313690)
+++ head/sys/dev/e1000/if_em.c  Sun Feb 12 23:06:41 2017(r313691)
@@ -1625,6 +1625,11 @@ em_if_timer(if_ctx_t ctx, uint16_t qid)
int i;
int trigger = 0; 
 
+   if (qid != 0) {
+   /* XXX all this stuff is per-adapter */
+   return;
+   }
+
em_if_update_admin_status(ctx); 
em_update_stats_counters(adapter);
 
___
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"


svn commit: r313338 - head/sys/dev/gxemul/disk

2017-02-06 Thread Sean Bruno
Author: sbruno
Date: Mon Feb  6 11:37:20 2017
New Revision: 313338
URL: https://svnweb.freebsd.org/changeset/base/313338

Log:
  gxemul:
  
  Add a format string to call to g_new_providerf() found when compiling
  mips64 target with clang.
  
  Reviewed by:  brooks

Modified:
  head/sys/dev/gxemul/disk/gxemul_disk.c

Modified: head/sys/dev/gxemul/disk/gxemul_disk.c
==
--- head/sys/dev/gxemul/disk/gxemul_disk.c  Mon Feb  6 10:57:54 2017
(r313337)
+++ head/sys/dev/gxemul/disk/gxemul_disk.c  Mon Feb  6 11:37:20 2017
(r313338)
@@ -171,7 +171,7 @@ gxemul_disk_attach_geom(void *arg, int f
sc->sc_geom = g_new_geomf(_gxemul_disk_class, "%s", 
device_get_nameunit(sc->sc_dev));
sc->sc_geom->softc = sc;
 
-   sc->sc_provider = g_new_providerf(sc->sc_geom, sc->sc_geom->name);
+   sc->sc_provider = g_new_providerf(sc->sc_geom, "%s", sc->sc_geom->name);
sc->sc_provider->sectorsize = GXEMUL_DISK_DEV_BLOCKSIZE;
sc->sc_provider->mediasize = sc->sc_size;
g_error_provider(sc->sc_provider, 0);
___
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"


svn commit: r313248 - head/sys/net

2017-02-04 Thread Sean Bruno
Author: sbruno
Date: Sat Feb  4 18:25:09 2017
New Revision: 313248
URL: https://svnweb.freebsd.org/changeset/base/313248

Log:
  Delete duplicate break.

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cSat Feb  4 18:20:07 2017(r313247)
+++ head/sys/net/iflib.cSat Feb  4 18:25:09 2017(r313248)
@@ -3422,8 +3422,6 @@ iflib_if_ioctl(if_t ifp, u_long command,
ctx->ifc_if_flags = if_getflags(ifp);
CTX_UNLOCK(ctx);
break;
-
-   break;
case SIOCADDMULTI:
case SIOCDELMULTI:
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
___
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: r312755 - head/sys/net

2017-01-30 Thread Sean Bruno


On 01/27/17 12:28, John Baldwin wrote:
> On Wednesday, January 25, 2017 02:37:05 PM Sean Bruno wrote:
>> Author: sbruno
>> Date: Wed Jan 25 14:37:05 2017
>> New Revision: 312755
>> URL: https://svnweb.freebsd.org/changeset/base/312755
>>
>> Log:
>>   Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns
>>   success and a good value.  Only then try to use it and set the MSIX_ENABLE
>>   bit.
>>   
>>   With the current em(4) driver we have observed failures in this case in a
>>   specific environment when pci_find_cap() would not return the assumed
>>   value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID)
>>   which is read-only.
> 
> Why is this writing directly to the MSIX registers at all?  pci_alloc_msix()
> etc. handle those registers for all other drivers and proper suspend/resume
> depends on drivers using the existing PCI API for managing MSI and MSI-X.
> 

The comment above this code block explains what's up.  Basically,
virtualized environments are sometimes "lazy" about correct register setup.

If MSIX caps aren't set, try to enable them.  If that fails, assume MSI.

Later on the code does the proper pci_alloc_msix() calls in the proper
sequence, IMO.

sean



signature.asc
Description: OpenPGP digital signature


Re: svn commit: r312905 - head/sys/net

2017-01-28 Thread Sean Bruno
>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
>> --- sys/net/iflib.c (revision 312909)
>> +++ sys/net/iflib.c (working copy)
>> @@ -1536,8 +1536,8 @@
>> goto fail;
>> }
>> }
>> +#endif
>> }
>> -#endif
>> return (0);
>>
>>  fail:
> 
> Yes, that fixes it.
> 
> I'm sorry for expressing it so badly at first.
> 
> 

No worries, sorry for the breakage.

sean



signature.asc
Description: OpenPGP digital signature


svn commit: r312924 - head/sys/net

2017-01-28 Thread Sean Bruno
Author: sbruno
Date: Sat Jan 28 15:44:14 2017
New Revision: 312924
URL: https://svnweb.freebsd.org/changeset/base/312924

Log:
  Fix i386 compile failure by moving needed closing parenthesis out of
  conditional block.
  
  Submitted by:   hiren
  Reported by:cy

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cSat Jan 28 15:43:19 2017(r312923)
+++ head/sys/net/iflib.cSat Jan 28 15:44:14 2017(r312924)
@@ -1536,8 +1536,8 @@ iflib_rxsd_alloc(iflib_rxq_t rxq)
goto fail;
}
}
-   }
 #endif
+   }
return (0);
 
 fail:
___
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: r312905 - head/sys/net

2017-01-28 Thread Sean Bruno
>> /export/home/cy/freebsd/svn/ip6-cksum/sys/net/iflib.c:2363:1: error: 
>> function definition is not allowed here
>> {
>> ^
>> fatal error: too many errors emitted, stopping now [-ferror-limit=]
> 
> My initial email about this was correct. It does fail when building i386 
> only. (It builds for amd64.)
> 
> 

Hmmm ... ok.  Does Hiren's suggestion fix your build error?

Index: sys/net/iflib.c
===
--- sys/net/iflib.c (revision 312909)
+++ sys/net/iflib.c (working copy)
@@ -1536,8 +1536,8 @@
goto fail;
}
}
+#endif
}
-#endif
return (0);

 fail:



signature.asc
Description: OpenPGP digital signature


svn commit: r312909 - head/share/man/man9

2017-01-27 Thread Sean Bruno
Author: sbruno
Date: Sat Jan 28 00:40:36 2017
New Revision: 312909
URL: https://svnweb.freebsd.org/changeset/base/312909

Log:
  Add iflib man pages for developers.
  
  Doc review is probably waranted here for editing.
  
  Submitted by: Nicole Graziano

Added:
  head/share/man/man9/iflibdd.9   (contents, props changed)
  head/share/man/man9/iflibdi.9   (contents, props changed)
  head/share/man/man9/iflibtxrx.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile

Modified: head/share/man/man9/Makefile
==
--- head/share/man/man9/MakefileSat Jan 28 00:00:10 2017
(r312908)
+++ head/share/man/man9/MakefileSat Jan 28 00:40:36 2017
(r312909)
@@ -158,6 +158,9 @@ MAN=accept_filter.9 \
ieee80211_regdomain.9 \
ieee80211_scan.9 \
ieee80211_vap.9 \
+   iflibdd.9 \
+   iflibdi.9 \
+   iflibtxrx.9 \
ifnet.9 \
inittodr.9 \
insmntque.9 \

Added: head/share/man/man9/iflibdd.9
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/man/man9/iflibdd.9   Sat Jan 28 00:40:36 2017
(r312909)
@@ -0,0 +1,181 @@
+.\" $FreeBSD$
+.Dd January 27, 2017
+.Dt IFlIBDD(9)
+.Os
+.Sh NAME
+.Nm iflibdd
+.Nd Device Dependent Configuration Functions
+.Sh SYNOPSIS
+.In "ifdi_if.h"
+.Ss "Soft Queue Setup and Teardown Functions"
+.Ss "Mandatory Functions"
+.Ft int
+.Fn ifdi_queues_alloc "if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int 
nqs"
+.Ft int
+.Fn ifdi_queues_free "if_ctx_t ctx"
+.Ss "Optional Functions"
+.Ft int
+.Fn ifdi_txq_setup "if_ctx_t ctx, uint16_t qid"
+.Ft int
+.Fn ifdi_rxq_setup "if_ctx_t ctx, uint16_t qid"
+.Ss "Device Setup and Teardown Functions"
+.Ss "Mandatory Functions"
+.Ft int
+.Fn ifdi_attach_pre "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_attach_post "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_detach "if_ctx_t ctx"
+.Ss "Optional Functions"
+.Ft void
+.Fn ifdi_vlan_register "if_ctx_t ctx, uint16_t vtag"
+.Ft void
+.Fn ifdi_vlan_unregister "if_ctx_t ctx, uint16_t vtag"
+.Ft int
+.Fn ifdi_suspend "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_resume "if_ctx_t ctx"
+.Ss "Device Configuration Functions"
+.Ss "Mandatory Functions"
+.Ft void
+.Fn ifdi_init "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_stop "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_multi_set "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_mtu_set "if_ctx_t ctx, uint32_t mtu"
+.Ft void
+.Fn ifdi_media_status "if_ctx_t ctx, struct ifmediareq *ifr"
+.Ft int
+.Fn ifdi_media_change "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_promisc_set "if_ctx_t ctx, int flags"
+.Ft uint64_t
+.Fn ifdi_get_counter "if_ctx_t ctx, ift_counter cnt"
+.Ft void
+.Fn ifdi_update_admin_status "if_ctx_t ctx"
+.Ss "Optional Functions"
+.Ft void
+.Fn ifdi_media_set "if_ctx_t ctx"
+.Ss "Interrupt enable/disable"
+.Ss "Mandatory Functions"
+.Ft void
+.Fn ifdi_intr_enable "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_queue_intr_enable "if_ctx_t ctx, uint16_t qid"
+.Ft void
+.Fn ifdi_intr_disable "if_ctx_t ctx"
+.Ss IOV Support
+.Ft init
+.Fn iov_init "if_ctx_t, uint16_t num_vfs, const nvlist_t *params"
+.Ft void
+.Fn iov_uinit "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_vflr_handle "if_ctx_t ctx"
+.Ft int
+.Fn ifdi_vf_add "if_ctx_t ctx, uint16_t vfnum, const nvlist_t *params"
+.Ss "Optional Functions"
+.Ft void
+.Fn ifdi_link_intr_enable "if_ctx_t ctx"
+.Ss "Optional Service Routines"
+.Ft void
+.Fn ifdi_timer "if_ctx_t ctx"
+.Ft void
+.Fn ifdi_watchdog_reset "if_ctx_t ctx"
+.Ss "Additional Functions" 
+.Ft void
+.Fn ifdi_led_func "if_ctx_t ctx, int onoff"
+.Ft int
+.Fn ifdi_sysctl_int_delay "if_ctx_t ctx, if_int_delay_info_t iidi"
+.Ft int
+.Fn ifdi_i2c_req "if_ctx_t ctx, struct ifi2creq *req"
+.Sh FUNCTIONS
+The above named functions are device dependent configuration functions. These 
routines are registerd with iflib by the driver and are called from the 
corresponding iflib function to configure device specific functions and 
registers. 
+.Ss Device Dependent Functions
+.Ss Soft Queue Setup and Teardown
+.Bl -ohang -offset indent
+.It Fn ifdi_queues_alloc
+Manditory queues allocation function that is called during iflib_attach. 
vaddrs and paddrs are arrays of virtual and physical addresses respectively of 
the hardware transmit and receive queues, and if relevany, any command 
completion queues. nqs is the number of queues per qset. For example, a driver 
with a single receive and transmit queue would have a nqs equal to 2.
+.It Fn ifdi_queues_free
+Mandatory function that frees the allocated queues and associated transmit 
buffers. 
+.It Fn ifdi_txq_setup
+Optional function for each transmit queue that handles device specific 
initialization.
+.It Fn ifdi_rxq_setup
+Optional function for each receive queue that handles device specific 
initialization.
+.El
+.Ss Device Setup and Teardown
+.Bl -ohang -offset indent
+.It Fn ifdi_attach_pre
+Mandatory function 

svn commit: r312905 - head/sys/net

2017-01-27 Thread Sean Bruno
Author: sbruno
Date: Fri Jan 27 23:08:06 2017
New Revision: 312905
URL: https://svnweb.freebsd.org/changeset/base/312905

Log:
  IFLIB updates:
  We found routing performance dropped significantly when configuring
  FreeBSD as a router, we are applying the following changes in order to
  resolve those issues and hopefully perform better.
   - don't prefetch the flags array, we usually don't need it
   - prefetch the next cache line of each of the software descriptor arrays as
 well as the first cache line of each of the next four packets' mbufs and
 clusters
   - reduce max copy size to 63 bytes
   - convert rx soft descriptors from array of structures to a structure of 
arrays
   - update copyrights
  
  Submitted by: Matt Macy 

Modified:
  head/sys/net/iflib.c
  head/sys/net/iflib.h

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Jan 27 23:03:28 2017(r312904)
+++ head/sys/net/iflib.cFri Jan 27 23:08:06 2017(r312905)
@@ -1,5 +1,5 @@
 /*-
- * Copyright (c) 2014-2016, Matthew Macy 
+ * Copyright (c) 2014-2017, Matthew Macy 
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -264,18 +264,12 @@ iflib_get_sctx(if_ctx_t ctx)
 #define RX_SW_DESC_INUSE(1 << 3)
 #define TX_SW_DESC_MAPPED   (1 << 4)
 
-typedef struct iflib_sw_rx_desc {
-   bus_dmamap_tifsd_map; /* bus_dma map for packet */
-   struct mbuf*ifsd_m;   /* rx: uninitialized mbuf */
-   caddr_t ifsd_cl;  /* direct cluster pointer for rx */
-   uint16_tifsd_flags;
-} *iflib_rxsd_t;
-
-typedef struct iflib_sw_tx_desc_val {
-   bus_dmamap_tifsd_map; /* bus_dma map for packet */
-   struct mbuf*ifsd_m;   /* pkthdr mbuf */
-   uint8_t ifsd_flags;
-} *iflib_txsd_val_t;
+typedef struct iflib_sw_rx_desc_array {
+   bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
+   struct mbuf **ifsd_m;   /* pkthdr mbufs */
+   caddr_t *ifsd_cl;  /* direct cluster pointer for rx */
+   uint8_t *ifsd_flags;
+} iflib_rxsd_array_t;
 
 typedef struct iflib_sw_tx_desc_array {
bus_dmamap_t*ifsd_map; /* bus_dma maps for packet */
@@ -287,7 +281,7 @@ typedef struct iflib_sw_tx_desc_array {
 /* magic number that should be high enough for any hardware */
 #define IFLIB_MAX_TX_SEGS  128
 #define IFLIB_MAX_RX_SEGS  32
-#define IFLIB_RX_COPY_THRESH   128
+#define IFLIB_RX_COPY_THRESH   63
 #define IFLIB_MAX_RX_REFRESH   32
 #define IFLIB_QUEUE_IDLE   0
 #define IFLIB_QUEUE_HUNG   1
@@ -383,7 +377,7 @@ struct iflib_fl {
uint16_tifl_buf_size;
uint16_tifl_cltype;
uma_zone_t  ifl_zone;
-   iflib_rxsd_tifl_sds;
+   iflib_rxsd_array_t  ifl_sds;
iflib_rxq_t ifl_rxq;
uint8_t ifl_id;
bus_dma_tag_t   ifl_desc_tag;
@@ -909,7 +903,7 @@ iflib_netmap_rxsync(struct netmap_kring 
ring->slot[nm_i].len = ri.iri_len - 
crclen;
ring->slot[nm_i].flags = slot_flags;
bus_dmamap_sync(fl->ifl_ifdi->idi_tag,
-   
fl->ifl_sds[nic_i].ifsd_map, BUS_DMASYNC_POSTREAD);
+   
fl->ifl_sds.ifsd_map[nic_i], BUS_DMASYNC_POSTREAD);
nm_i = nm_next(nm_i, lim);
nic_i = nm_next(nic_i, lim);
}
@@ -949,14 +943,14 @@ iflib_netmap_rxsync(struct netmap_kring 
vaddr = addr;
if (slot->flags & NS_BUF_CHANGED) {
/* buffer has changed, reload map */
-   netmap_reload_map(na, fl->ifl_ifdi->idi_tag, 
fl->ifl_sds[nic_i].ifsd_map, addr);
+   netmap_reload_map(na, fl->ifl_ifdi->idi_tag, 
fl->ifl_sds.ifsd_map[nic_i], addr);
slot->flags &= ~NS_BUF_CHANGED;
}
/*
 * XXX we should be batching this operation - TODO
 */
ctx->isc_rxd_refill(ctx->ifc_softc, rxq->ifr_id, 
fl->ifl_id, nic_i, , , 1, fl->ifl_buf_size);
-   bus_dmamap_sync(fl->ifl_ifdi->idi_tag, 
fl->ifl_sds[nic_i].ifsd_map,
+   bus_dmamap_sync(fl->ifl_ifdi->idi_tag, 
fl->ifl_sds.ifsd_map[nic_i],
BUS_DMASYNC_PREREAD);
nm_i = nm_next(nm_i, lim);
nic_i = nm_next(nic_i, lim);
@@ 

svn commit: r312903 - head/sys/net

2017-01-27 Thread Sean Bruno
Author: sbruno
Date: Fri Jan 27 22:30:27 2017
New Revision: 312903
URL: https://svnweb.freebsd.org/changeset/base/312903

Log:
  Replace customized busmaster code with standardized setup call.
  
  Reported by:  jhb

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cFri Jan 27 22:14:42 2017(r312902)
+++ head/sys/net/iflib.cFri Jan 27 22:30:27 2017(r312903)
@@ -4781,12 +4781,9 @@ iflib_msix_init(if_ctx_t ctx)
** successfully initialize us.
*/
{
-   uint16_t pci_cmd_word;
int msix_ctrl, rid;
 
-   pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2);
-   pci_cmd_word |= PCIM_CMD_BUSMASTEREN;
-   pci_write_config(dev, PCIR_COMMAND, pci_cmd_word, 2);
+   pci_enable_busmaster(dev);
rid = 0;
if (pci_find_cap(dev, PCIY_MSIX, ) == 0 && rid != 0) {
rid += PCIR_MSIX_CTRL;
___
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"


svn commit: r312816 - head/sys/net

2017-01-26 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 26 13:50:09 2017
New Revision: 312816
URL: https://svnweb.freebsd.org/changeset/base/312816

Log:
  Minor style annoyance.
  
  Submitted by: bde

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cThu Jan 26 13:48:45 2017(r312815)
+++ head/sys/net/iflib.cThu Jan 26 13:50:09 2017(r312816)
@@ -3755,6 +3755,7 @@ iflib_device_register(device_t dev, void
device_printf(dev, "qset structure setup failed %d\n", err);
goto fail_queues;
}
+
/*
 * Group taskqueues aren't properly set up until SMP is started,
 * so we disable interrupts until we can handle them post
___
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"


svn commit: r312815 - head/sys/kern

2017-01-26 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 26 13:48:45 2017
New Revision: 312815
URL: https://svnweb.freebsd.org/changeset/base/312815

Log:
  A few more style bugs lying around in here.
  
  Submitted by: bde

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Thu Jan 26 13:46:47 2017
(r312814)
+++ head/sys/kern/subr_gtaskqueue.c Thu Jan 26 13:48:45 2017
(r312815)
@@ -630,6 +630,7 @@ taskqgroup_find(struct taskqgroup *qgrou
 
return (idx);
 }
+
 /*
  * smp_started is unusable since it is not set for UP kernels or even for
  * SMP kernels when there is 1 CPU.  This is usually handled by adding a
@@ -643,6 +644,7 @@ taskqgroup_find(struct taskqgroup *qgrou
  * SI_ORDER_ANY and unclearly after the CPUs are started.  It would be
  * simpler for adjustment to pass a flag indicating if it is delayed.
  */ 
+
 static int tqg_smp_started;
 
 static void
@@ -670,7 +672,7 @@ taskqgroup_attach(struct taskqgroup *qgr
qgroup->tqg_queue[qid].tgc_cnt++;
LIST_INSERT_HEAD(>tqg_queue[qid].tgc_tasks, gtask, gt_list);
gtask->gt_taskqueue = qgroup->tqg_queue[qid].tgc_taskq;
-   if (irq != -1 && tqg_smp_started ) {
+   if (irq != -1 && tqg_smp_started) {
gtask->gt_cpu = qgroup->tqg_queue[qid].tgc_cpu;
CPU_ZERO();
CPU_SET(qgroup->tqg_queue[qid].tgc_cpu, );
___
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"


svn commit: r312814 - head/sys/sys

2017-01-26 Thread Sean Bruno
Author: sbruno
Date: Thu Jan 26 13:46:47 2017
New Revision: 312814
URL: https://svnweb.freebsd.org/changeset/base/312814

Log:
  Shoot a couple of style bugs down in the macro declarations.
  
  Submitted by: bde

Modified:
  head/sys/sys/gtaskqueue.h

Modified: head/sys/sys/gtaskqueue.h
==
--- head/sys/sys/gtaskqueue.h   Thu Jan 26 13:04:14 2017(r312813)
+++ head/sys/sys/gtaskqueue.h   Thu Jan 26 13:46:47 2017(r312814)
@@ -80,7 +80,6 @@ int   taskqgroup_adjust(struct taskqgroup 
 #define TASKQGROUP_DECLARE(name)   \
 extern struct taskqgroup *qgroup_##name
 
-
 #ifdef EARLY_AP_STARTUP
 #define TASKQGROUP_DEFINE(name, cnt, stride)   \
\
@@ -94,8 +93,7 @@ taskqgroup_define_##name(void *arg)   

 }  \
\
 SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
-   taskqgroup_define_##name, NULL) \
-
+   taskqgroup_define_##name, NULL)
 #else /* !EARLY_AP_STARTUP */
 #define TASKQGROUP_DEFINE(name, cnt, stride)   \
\
@@ -117,8 +115,7 @@ taskqgroup_adjust_##name(void *arg) 

 }  \
\
 SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY,   \
-   taskqgroup_adjust_##name, NULL) \
-
+   taskqgroup_adjust_##name, NULL)
 #endif /* EARLY_AP_STARTUP */
 
 TASKQGROUP_DECLARE(net);
___
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"


svn commit: r312786 - head/sys/dev/e1000

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 23:12:03 2017
New Revision: 312786
URL: https://svnweb.freebsd.org/changeset/base/312786

Log:
  Implement RSS queue tagging for em(4) class devices from a copy and massage
  of functions from igb(4).  This enables 2 queue routing on 82574L class
  devices again.

Modified:
  head/sys/dev/e1000/em_txrx.c

Modified: head/sys/dev/e1000/em_txrx.c
==
--- head/sys/dev/e1000/em_txrx.cWed Jan 25 22:52:57 2017
(r312785)
+++ head/sys/dev/e1000/em_txrx.cWed Jan 25 23:12:03 2017
(r312786)
@@ -62,6 +62,7 @@ static int lem_isc_rxd_pkt_get(void *arg
 
 static void lem_receive_checksum(int status, int errors, if_rxd_info_t ri);
 static void em_receive_checksum(uint32_t status, if_rxd_info_t ri);
+static int em_determine_rsstype(u32 pkt_info);
 extern int em_intr(void *arg);
 
 struct if_txrx em_txrx  = {
@@ -645,6 +646,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_inf
union e1000_rx_desc_extended *rxd;
 
u16  len; 
+   u32  pkt_info;
u32  staterr = 0;
bool eop;
int  i, cidx, vtag;
@@ -655,6 +657,7 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_inf
do {
rxd = >rx_base[cidx];
staterr = le32toh(rxd->wb.upper.status_error);  
+   pkt_info = le32toh(rxd->wb.lower.mrq);

/* Error Checking then decrement count */
MPASS ((staterr & E1000_RXD_STAT_DD) != 0);
@@ -690,10 +693,14 @@ em_isc_rxd_pkt_get(void *arg, if_rxd_inf
} 

ri->iri_vtag = vtag;
-   ri->iri_nfrags = i;
if (vtag)
ri->iri_flags |= M_VLANTAG;

+ri->iri_flowid =
+le32toh(rxd->wb.lower.hi_dword.rss);
+ri->iri_rsstype = em_determine_rsstype(pkt_info);
+
+   ri->iri_nfrags = i;
return (0);
 }
 
@@ -721,6 +728,31 @@ lem_receive_checksum(int status, int err
}
 }
 
+/
+ *
+ *  Parse the packet type to determine the appropriate hash
+ *
+ **/
+static int
+em_determine_rsstype(u32 pkt_info)
+{
+switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) {
+case E1000_RXDADV_RSSTYPE_IPV4_TCP:
+return M_HASHTYPE_RSS_TCP_IPV4;
+case E1000_RXDADV_RSSTYPE_IPV4:
+return M_HASHTYPE_RSS_IPV4;
+case E1000_RXDADV_RSSTYPE_IPV6_TCP:
+return M_HASHTYPE_RSS_TCP_IPV6;
+case E1000_RXDADV_RSSTYPE_IPV6_EX: 
+return M_HASHTYPE_RSS_IPV6_EX;
+case E1000_RXDADV_RSSTYPE_IPV6:
+return M_HASHTYPE_RSS_IPV6;
+case E1000_RXDADV_RSSTYPE_IPV6_TCP_EX:
+return M_HASHTYPE_RSS_TCP_IPV6_EX;
+default:
+return M_HASHTYPE_OPAQUE;
+}
+}
 static void
 em_receive_checksum(uint32_t status, if_rxd_info_t ri)
 {
___
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"


svn commit: r312760 - head/sys/kern

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 15:54:44 2017
New Revision: 312760
URL: https://svnweb.freebsd.org/changeset/base/312760

Log:
  Replace overlooked smp_started checks and variable use in a print
  with the now used tqg_smp_started.
  
  Submitted by: bde

Modified:
  head/sys/kern/subr_gtaskqueue.c

Modified: head/sys/kern/subr_gtaskqueue.c
==
--- head/sys/kern/subr_gtaskqueue.c Wed Jan 25 15:52:03 2017
(r312759)
+++ head/sys/kern/subr_gtaskqueue.c Wed Jan 25 15:54:44 2017
(r312760)
@@ -740,7 +740,7 @@ taskqgroup_attach_cpu(struct taskqgroup 
 
CPU_ZERO();
CPU_SET(cpu, );
-   if (irq != -1 && (smp_started || mp_ncpus == 1))
+   if (irq != -1 && tqg_smp_started)
intr_setaffinity(irq, );
return (0);
 }
@@ -849,8 +849,8 @@ _taskqgroup_adjust(struct taskqgroup *qg
 
if (cnt < 1 || cnt * stride > mp_ncpus || !tqg_smp_started) {
printf("%s: failed cnt: %d stride: %d "
-  "mp_ncpus: %d smp_started: %d\n",
-   __func__, cnt, stride, mp_ncpus, smp_started);
+   "mp_ncpus: %d tqg_smp_started: %d\n",
+   __func__, cnt, stride, mp_ncpus, tqg_smp_started);
return (EINVAL);
}
if (qgroup->tqg_adjusting) {
___
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"


svn commit: r312759 - head/sys/sys

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 15:52:03 2017
New Revision: 312759
URL: https://svnweb.freebsd.org/changeset/base/312759

Log:
  Resolve a non-fatal syntax warning left in by a trailing ;
  
  Submitted by: bde

Modified:
  head/sys/sys/gtaskqueue.h

Modified: head/sys/sys/gtaskqueue.h
==
--- head/sys/sys/gtaskqueue.h   Wed Jan 25 15:42:29 2017(r312758)
+++ head/sys/sys/gtaskqueue.h   Wed Jan 25 15:52:03 2017(r312759)
@@ -94,7 +94,7 @@ taskqgroup_define_##name(void *arg)   

 }  \
\
 SYSINIT(taskqgroup_##name, SI_SUB_INIT_IF, SI_ORDER_FIRST, \
-   taskqgroup_define_##name, NULL)
+   taskqgroup_define_##name, NULL) \
 
 #else /* !EARLY_AP_STARTUP */
 #define TASKQGROUP_DEFINE(name, cnt, stride)   \
@@ -117,7 +117,7 @@ taskqgroup_adjust_##name(void *arg) 

 }  \
\
 SYSINIT(taskqgroup_adj_##name, SI_SUB_SMP, SI_ORDER_ANY,   \
-   taskqgroup_adjust_##name, NULL);\
+   taskqgroup_adjust_##name, NULL) \
 
 #endif /* EARLY_AP_STARTUP */
 
___
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"


svn commit: r312755 - head/sys/net

2017-01-25 Thread Sean Bruno
Author: sbruno
Date: Wed Jan 25 14:37:05 2017
New Revision: 312755
URL: https://svnweb.freebsd.org/changeset/base/312755

Log:
  Add error checking to the pci_find_cap(, PCIY_MSIX,) call that is returns
  success and a good value.  Only then try to use it and set the MSIX_ENABLE
  bit.
  
  With the current em(4) driver we have observed failures in this case in a
  specific environment when pci_find_cap() would not return the assumed
  value, which meant we ended up writing to PCI register 2 (PCI_DEVICE_ID)
  which is read-only.
  
  PR:   216456
  Submitted by: bz

Modified:
  head/sys/net/iflib.c

Modified: head/sys/net/iflib.c
==
--- head/sys/net/iflib.cWed Jan 25 13:42:38 2017(r312754)
+++ head/sys/net/iflib.cWed Jan 25 14:37:05 2017(r312755)
@@ -3733,6 +3733,10 @@ iflib_device_register(device_t dev, void
if (sctx->isc_flags & IFLIB_SKIP_MSIX) {
msix = scctx->isc_vectors;
} else if (scctx->isc_msix_bar != 0)
+  /*
+   * The simple fact that isc_msix_bar is not 0 does not mean we
+   * we have a good value there that is known to work.
+   */
msix = iflib_msix_init(ctx);
else {
scctx->isc_vectors = 1;
@@ -4779,15 +4783,20 @@ iflib_msix_init(if_ctx_t ctx)
uint16_t pci_cmd_word;
int msix_ctrl, rid;
 
-   rid = 0;
pci_cmd_word = pci_read_config(dev, PCIR_COMMAND, 2);
pci_cmd_word |= PCIM_CMD_BUSMASTEREN;
pci_write_config(dev, PCIR_COMMAND, pci_cmd_word, 2);
-   pci_find_cap(dev, PCIY_MSIX, );
-   rid += PCIR_MSIX_CTRL;
-   msix_ctrl = pci_read_config(dev, rid, 2);
-   msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE;
-   pci_write_config(dev, rid, msix_ctrl, 2);
+   rid = 0;
+   if (pci_find_cap(dev, PCIY_MSIX, ) == 0 && rid != 0) {
+   rid += PCIR_MSIX_CTRL;
+   msix_ctrl = pci_read_config(dev, rid, 2);
+   msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE;
+   pci_write_config(dev, rid, msix_ctrl, 2);
+   } else {
+   device_printf(dev, "PCIY_MSIX capability not found; "
+  "or rid %d == 0.\n", rid);
+   goto msi;
+   }
}
 
/*
___
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"


<    1   2   3   4   5   6   >