| @@ -49,27 +49,27 @@ | | | @@ -49,27 +49,27 @@ |
49 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS | | 49 | * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
50 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 50 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
51 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 51 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
52 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 52 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
53 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 53 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
54 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 54 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
55 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 55 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
56 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 56 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
57 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 57 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
58 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 58 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
59 | * POSSIBILITY OF SUCH DAMAGE. | | 59 | * POSSIBILITY OF SUCH DAMAGE. |
60 | */ | | 60 | */ |
61 | /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/ | | 61 | /*$FreeBSD: head/sys/dev/ixgbe/if_ix.c 302384 2016-07-07 03:39:18Z sbruno $*/ |
62 | /*$NetBSD: ixgbe.c,v 1.68 2017/02/08 03:59:12 msaitoh Exp $*/ | | 62 | /*$NetBSD: ixgbe.c,v 1.69 2017/02/08 04:05:13 msaitoh Exp $*/ |
63 | | | 63 | |
64 | #include "opt_inet.h" | | 64 | #include "opt_inet.h" |
65 | #include "opt_inet6.h" | | 65 | #include "opt_inet6.h" |
66 | | | 66 | |
67 | #include "ixgbe.h" | | 67 | #include "ixgbe.h" |
68 | #include "vlan.h" | | 68 | #include "vlan.h" |
69 | | | 69 | |
70 | #include <sys/cprng.h> | | 70 | #include <sys/cprng.h> |
71 | | | 71 | |
72 | /********************************************************************* | | 72 | /********************************************************************* |
73 | * Driver version | | 73 | * Driver version |
74 | *********************************************************************/ | | 74 | *********************************************************************/ |
75 | char ixgbe_driver_version[] = "3.1.13-k"; | | 75 | char ixgbe_driver_version[] = "3.1.13-k"; |
| @@ -497,27 +497,27 @@ ixgbe_attach(device_t parent, device_t d | | | @@ -497,27 +497,27 @@ ixgbe_attach(device_t parent, device_t d |
497 | if (ixgbe_allocate_pci_resources(adapter, pa)) { | | 497 | if (ixgbe_allocate_pci_resources(adapter, pa)) { |
498 | aprint_error_dev(dev, "Allocation of PCI resources failed\n"); | | 498 | aprint_error_dev(dev, "Allocation of PCI resources failed\n"); |
499 | error = ENXIO; | | 499 | error = ENXIO; |
500 | goto err_out; | | 500 | goto err_out; |
501 | } | | 501 | } |
502 | | | 502 | |
503 | /* Sysctls for limiting the amount of work done in the taskqueues */ | | 503 | /* Sysctls for limiting the amount of work done in the taskqueues */ |
504 | ixgbe_set_sysctl_value(adapter, "rx_processing_limit", | | 504 | ixgbe_set_sysctl_value(adapter, "rx_processing_limit", |
505 | "max number of rx packets to process", | | 505 | "max number of rx packets to process", |
506 | &adapter->rx_process_limit, ixgbe_rx_process_limit); | | 506 | &adapter->rx_process_limit, ixgbe_rx_process_limit); |
507 | | | 507 | |
508 | ixgbe_set_sysctl_value(adapter, "tx_processing_limit", | | 508 | ixgbe_set_sysctl_value(adapter, "tx_processing_limit", |
509 | "max number of tx packets to process", | | 509 | "max number of tx packets to process", |
510 | &adapter->tx_process_limit, ixgbe_tx_process_limit); | | 510 | &adapter->tx_process_limit, ixgbe_tx_process_limit); |
511 | | | 511 | |
512 | /* Do descriptor calc and sanity checks */ | | 512 | /* Do descriptor calc and sanity checks */ |
513 | if (((ixgbe_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 || | | 513 | if (((ixgbe_txd * sizeof(union ixgbe_adv_tx_desc)) % DBA_ALIGN) != 0 || |
514 | ixgbe_txd < MIN_TXD || ixgbe_txd > MAX_TXD) { | | 514 | ixgbe_txd < MIN_TXD || ixgbe_txd > MAX_TXD) { |
515 | aprint_error_dev(dev, "TXD config issue, using default!\n"); | | 515 | aprint_error_dev(dev, "TXD config issue, using default!\n"); |
516 | adapter->num_tx_desc = DEFAULT_TXD; | | 516 | adapter->num_tx_desc = DEFAULT_TXD; |
517 | } else | | 517 | } else |
518 | adapter->num_tx_desc = ixgbe_txd; | | 518 | adapter->num_tx_desc = ixgbe_txd; |
519 | | | 519 | |
520 | /* | | 520 | /* |
521 | ** With many RX rings it is easy to exceed the | | 521 | ** With many RX rings it is easy to exceed the |
522 | ** system mbuf allocation. Tuning nmbclusters | | 522 | ** system mbuf allocation. Tuning nmbclusters |
523 | ** can alleviate this. | | 523 | ** can alleviate this. |
| @@ -2674,28 +2674,28 @@ ixgbe_allocate_msix(struct adapter *adap | | | @@ -2674,28 +2674,28 @@ ixgbe_allocate_msix(struct adapter *adap |
2674 | } | | 2674 | } |
2675 | #endif | | 2675 | #endif |
2676 | | | 2676 | |
2677 | adapter->osdep.nintrs = adapter->num_queues + 1; | | 2677 | adapter->osdep.nintrs = adapter->num_queues + 1; |
2678 | if (pci_msix_alloc_exact(pa, &adapter->osdep.intrs, | | 2678 | if (pci_msix_alloc_exact(pa, &adapter->osdep.intrs, |
2679 | adapter->osdep.nintrs) != 0) { | | 2679 | adapter->osdep.nintrs) != 0) { |
2680 | aprint_error_dev(dev, | | 2680 | aprint_error_dev(dev, |
2681 | "failed to allocate MSI-X interrupt\n"); | | 2681 | "failed to allocate MSI-X interrupt\n"); |
2682 | return (ENXIO); | | 2682 | return (ENXIO); |
2683 | } | | 2683 | } |
2684 | | | 2684 | |
2685 | kcpuset_create(&affinity, false); | | 2685 | kcpuset_create(&affinity, false); |
2686 | for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) { | | 2686 | for (int i = 0; i < adapter->num_queues; i++, vector++, que++, txr++) { |
2687 | snprintf(intr_xname, sizeof(intr_xname), "%s TX/RX", | | 2687 | snprintf(intr_xname, sizeof(intr_xname), "%s TXRX%d", |
2688 | device_xname(dev)); | | 2688 | device_xname(dev), i); |
2689 | intrstr = pci_intr_string(pc, adapter->osdep.intrs[i], intrbuf, | | 2689 | intrstr = pci_intr_string(pc, adapter->osdep.intrs[i], intrbuf, |
2690 | sizeof(intrbuf)); | | 2690 | sizeof(intrbuf)); |
2691 | #ifdef IXG_MPSAFE | | 2691 | #ifdef IXG_MPSAFE |
2692 | pci_intr_setattr(pc, adapter->osdep.intrs[i], PCI_INTR_MPSAFE, | | 2692 | pci_intr_setattr(pc, adapter->osdep.intrs[i], PCI_INTR_MPSAFE, |
2693 | true); | | 2693 | true); |
2694 | #endif | | 2694 | #endif |
2695 | /* Set the handler function */ | | 2695 | /* Set the handler function */ |
2696 | que->res = adapter->osdep.ihs[i] = pci_intr_establish_xname(pc, | | 2696 | que->res = adapter->osdep.ihs[i] = pci_intr_establish_xname(pc, |
2697 | adapter->osdep.intrs[i], IPL_NET, ixgbe_msix_que, que, | | 2697 | adapter->osdep.intrs[i], IPL_NET, ixgbe_msix_que, que, |
2698 | intr_xname); | | 2698 | intr_xname); |
2699 | if (que->res == NULL) { | | 2699 | if (que->res == NULL) { |
2700 | pci_intr_release(pc, adapter->osdep.intrs, | | 2700 | pci_intr_release(pc, adapter->osdep.intrs, |
2701 | adapter->osdep.nintrs); | | 2701 | adapter->osdep.nintrs); |