No functional change: - modify comment - whitespace fixdiff -r1.62 -r1.63 src/sys/dev/pci/ixgbe/ix_txrx.c
(msaitoh)
--- src/sys/dev/pci/ixgbe/ix_txrx.c 2020/02/05 07:45:46 1.62
+++ src/sys/dev/pci/ixgbe/ix_txrx.c 2020/04/17 02:21:25 1.63
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ix_txrx.c,v 1.62 2020/02/05 07:45:46 msaitoh Exp $ */ | 1 | /* $NetBSD: ix_txrx.c,v 1.63 2020/04/17 02:21:25 msaitoh Exp $ */ | |
2 | 2 | |||
3 | /****************************************************************************** | 3 | /****************************************************************************** | |
4 | 4 | |||
5 | Copyright (c) 2001-2017, Intel Corporation | 5 | Copyright (c) 2001-2017, Intel Corporation | |
6 | All rights reserved. | 6 | All rights reserved. | |
7 | 7 | |||
8 | Redistribution and use in source and binary forms, with or without | 8 | Redistribution and use in source and binary forms, with or without | |
9 | modification, are permitted provided that the following conditions are met: | 9 | modification, are permitted provided that the following conditions are met: | |
10 | 10 | |||
11 | 1. Redistributions of source code must retain the above copyright notice, | 11 | 1. Redistributions of source code must retain the above copyright notice, | |
12 | this list of conditions and the following disclaimer. | 12 | this list of conditions and the following disclaimer. | |
13 | 13 | |||
14 | 2. Redistributions in binary form must reproduce the above copyright | 14 | 2. Redistributions in binary form must reproduce the above copyright | |
@@ -909,27 +909,27 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, | @@ -909,27 +909,27 @@ ixgbe_tx_ctx_setup(struct tx_ring *txr, | |||
909 | break; | 909 | break; | |
910 | #endif | 910 | #endif | |
911 | default: | 911 | default: | |
912 | offload = false; | 912 | offload = false; | |
913 | break; | 913 | break; | |
914 | } | 914 | } | |
915 | 915 | |||
916 | if ((mp->m_pkthdr.csum_flags & M_CSUM_IPv4) != 0) | 916 | if ((mp->m_pkthdr.csum_flags & M_CSUM_IPv4) != 0) | |
917 | *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; | 917 | *olinfo_status |= IXGBE_TXD_POPTS_IXSM << 8; | |
918 | 918 | |||
919 | vlan_macip_lens |= ip_hlen; | 919 | vlan_macip_lens |= ip_hlen; | |
920 | 920 | |||
921 | /* No support for offloads for non-L4 next headers */ | 921 | /* No support for offloads for non-L4 next headers */ | |
922 | switch (ipproto) { | 922 | switch (ipproto) { | |
923 | case IPPROTO_TCP: | 923 | case IPPROTO_TCP: | |
924 | if (mp->m_pkthdr.csum_flags & | 924 | if (mp->m_pkthdr.csum_flags & | |
925 | (M_CSUM_TCPv4 | M_CSUM_TCPv6)) | 925 | (M_CSUM_TCPv4 | M_CSUM_TCPv6)) | |
926 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; | 926 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_TCP; | |
927 | else | 927 | else | |
928 | offload = false; | 928 | offload = false; | |
929 | break; | 929 | break; | |
930 | case IPPROTO_UDP: | 930 | case IPPROTO_UDP: | |
931 | if (mp->m_pkthdr.csum_flags & | 931 | if (mp->m_pkthdr.csum_flags & | |
932 | (M_CSUM_UDPv4 | M_CSUM_UDPv6)) | 932 | (M_CSUM_UDPv4 | M_CSUM_UDPv6)) | |
933 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; | 933 | type_tucmd_mlhl |= IXGBE_ADVTXD_TUCMD_L4T_UDP; | |
934 | else | 934 | else | |
935 | offload = false; | 935 | offload = false; | |
@@ -2210,27 +2210,27 @@ ixgbe_dma_free(struct adapter *adapter, | @@ -2210,27 +2210,27 @@ ixgbe_dma_free(struct adapter *adapter, | |||
2210 | ************************************************************************/ | 2210 | ************************************************************************/ | |
2211 | int | 2211 | int | |
2212 | ixgbe_allocate_queues(struct adapter *adapter) | 2212 | ixgbe_allocate_queues(struct adapter *adapter) | |
2213 | { | 2213 | { | |
2214 | device_t dev = adapter->dev; | 2214 | device_t dev = adapter->dev; | |
2215 | struct ix_queue *que; | 2215 | struct ix_queue *que; | |
2216 | struct tx_ring *txr; | 2216 | struct tx_ring *txr; | |
2217 | struct rx_ring *rxr; | 2217 | struct rx_ring *rxr; | |
2218 | int rsize, tsize, error = IXGBE_SUCCESS; | 2218 | int rsize, tsize, error = IXGBE_SUCCESS; | |
2219 | int txconf = 0, rxconf = 0; | 2219 | int txconf = 0, rxconf = 0; | |
2220 | 2220 | |||
2221 | /* First, allocate the top level queue structs */ | 2221 | /* First, allocate the top level queue structs */ | |
2222 | adapter->queues = (struct ix_queue *)malloc(sizeof(struct ix_queue) * | 2222 | adapter->queues = (struct ix_queue *)malloc(sizeof(struct ix_queue) * | |
2223 | adapter->num_queues, M_DEVBUF, M_WAITOK | M_ZERO); | 2223 | adapter->num_queues, M_DEVBUF, M_WAITOK | M_ZERO); | |
2224 | 2224 | |||
2225 | /* Second, allocate the TX ring struct memory */ | 2225 | /* Second, allocate the TX ring struct memory */ | |
2226 | adapter->tx_rings = malloc(sizeof(struct tx_ring) * | 2226 | adapter->tx_rings = malloc(sizeof(struct tx_ring) * | |
2227 | adapter->num_queues, M_DEVBUF, M_WAITOK | M_ZERO); | 2227 | adapter->num_queues, M_DEVBUF, M_WAITOK | M_ZERO); | |
2228 | 2228 | |||
2229 | /* Third, allocate the RX ring */ | 2229 | /* Third, allocate the RX ring */ | |
2230 | adapter->rx_rings = (struct rx_ring *)malloc(sizeof(struct rx_ring) * | 2230 | adapter->rx_rings = (struct rx_ring *)malloc(sizeof(struct rx_ring) * | |
2231 | adapter->num_queues, M_DEVBUF, M_WAITOK | M_ZERO); | 2231 | adapter->num_queues, M_DEVBUF, M_WAITOK | M_ZERO); | |
2232 | 2232 | |||
2233 | /* For the ring itself */ | 2233 | /* For the ring itself */ | |
2234 | tsize = roundup2(adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc), | 2234 | tsize = roundup2(adapter->num_tx_desc * sizeof(union ixgbe_adv_tx_desc), | |
2235 | DBA_ALIGN); | 2235 | DBA_ALIGN); | |
2236 | 2236 | |||
@@ -2262,27 +2262,27 @@ ixgbe_allocate_queues(struct adapter *ad | @@ -2262,27 +2262,27 @@ ixgbe_allocate_queues(struct adapter *ad | |||
2262 | "Unable to allocate TX Descriptor memory\n"); | 2262 | "Unable to allocate TX Descriptor memory\n"); | |
2263 | error = ENOMEM; | 2263 | error = ENOMEM; | |
2264 | goto err_tx_desc; | 2264 | goto err_tx_desc; | |
2265 | } | 2265 | } | |
2266 | txr->tx_base = (union ixgbe_adv_tx_desc *)txr->txdma.dma_vaddr; | 2266 | txr->tx_base = (union ixgbe_adv_tx_desc *)txr->txdma.dma_vaddr; | |
2267 | bzero((void *)txr->tx_base, tsize); | 2267 | bzero((void *)txr->tx_base, tsize); | |
2268 | 2268 | |||
2269 | /* Now allocate transmit buffers for the ring */ | 2269 | /* Now allocate transmit buffers for the ring */ | |
2270 | if (ixgbe_allocate_transmit_buffers(txr)) { | 2270 | if (ixgbe_allocate_transmit_buffers(txr)) { | |
2271 | aprint_error_dev(dev, | 2271 | aprint_error_dev(dev, | |
2272 | "Critical Failure setting up transmit buffers\n"); | 2272 | "Critical Failure setting up transmit buffers\n"); | |
2273 | error = ENOMEM; | 2273 | error = ENOMEM; | |
2274 | goto err_tx_desc; | 2274 | goto err_tx_desc; | |
2275 | } | 2275 | } | |
2276 | if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) { | 2276 | if (!(adapter->feat_en & IXGBE_FEATURE_LEGACY_TX)) { | |
2277 | /* Allocate a buf ring */ | 2277 | /* Allocate a buf ring */ | |
2278 | txr->txr_interq = pcq_create(IXGBE_BR_SIZE, KM_SLEEP); | 2278 | txr->txr_interq = pcq_create(IXGBE_BR_SIZE, KM_SLEEP); | |
2279 | if (txr->txr_interq == NULL) { | 2279 | if (txr->txr_interq == NULL) { | |
2280 | aprint_error_dev(dev, | 2280 | aprint_error_dev(dev, | |
2281 | "Critical Failure setting up buf ring\n"); | 2281 | "Critical Failure setting up buf ring\n"); | |
2282 | error = ENOMEM; | 2282 | error = ENOMEM; | |
2283 | goto err_tx_desc; | 2283 | goto err_tx_desc; | |
2284 | } | 2284 | } | |
2285 | } | 2285 | } | |
2286 | } | 2286 | } | |
2287 | 2287 | |||
2288 | /* | 2288 | /* |
--- src/sys/dev/pci/ixgbe/ixgbe.c 2020/03/15 23:04:50 1.227
+++ src/sys/dev/pci/ixgbe/ixgbe.c 2020/04/17 02:21:25 1.228
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ixgbe.c,v 1.227 2020/03/15 23:04:50 thorpej Exp $ */ | 1 | /* $NetBSD: ixgbe.c,v 1.228 2020/04/17 02:21:25 msaitoh Exp $ */ | |
2 | 2 | |||
3 | /****************************************************************************** | 3 | /****************************************************************************** | |
4 | 4 | |||
5 | Copyright (c) 2001-2017, Intel Corporation | 5 | Copyright (c) 2001-2017, Intel Corporation | |
6 | All rights reserved. | 6 | All rights reserved. | |
7 | 7 | |||
8 | Redistribution and use in source and binary forms, with or without | 8 | Redistribution and use in source and binary forms, with or without | |
9 | modification, are permitted provided that the following conditions are met: | 9 | modification, are permitted provided that the following conditions are met: | |
10 | 10 | |||
11 | 1. Redistributions of source code must retain the above copyright notice, | 11 | 1. Redistributions of source code must retain the above copyright notice, | |
12 | this list of conditions and the following disclaimer. | 12 | this list of conditions and the following disclaimer. | |
13 | 13 | |||
14 | 2. Redistributions in binary form must reproduce the above copyright | 14 | 2. Redistributions in binary form must reproduce the above copyright | |
@@ -3217,27 +3217,27 @@ ixgbe_sysctl_interrupt_rate_handler(SYSC | @@ -3217,27 +3217,27 @@ ixgbe_sysctl_interrupt_rate_handler(SYSC | |||
3217 | usec = ((reg & 0x0FF8) >> 3); | 3217 | usec = ((reg & 0x0FF8) >> 3); | |
3218 | if (usec > 0) | 3218 | if (usec > 0) | |
3219 | rate = 500000 / usec; | 3219 | rate = 500000 / usec; | |
3220 | else | 3220 | else | |
3221 | rate = 0; | 3221 | rate = 0; | |
3222 | node.sysctl_data = &rate; | 3222 | node.sysctl_data = &rate; | |
3223 | error = sysctl_lookup(SYSCTLFN_CALL(&node)); | 3223 | error = sysctl_lookup(SYSCTLFN_CALL(&node)); | |
3224 | if (error || newp == NULL) | 3224 | if (error || newp == NULL) | |
3225 | return error; | 3225 | return error; | |
3226 | reg &= ~0xfff; /* default, no limitation */ | 3226 | reg &= ~0xfff; /* default, no limitation */ | |
3227 | if (rate > 0 && rate < 500000) { | 3227 | if (rate > 0 && rate < 500000) { | |
3228 | if (rate < 1000) | 3228 | if (rate < 1000) | |
3229 | rate = 1000; | 3229 | rate = 1000; | |
3230 | reg |= ((4000000/rate) & 0xff8); | 3230 | reg |= ((4000000 / rate) & 0xff8); | |
3231 | /* | 3231 | /* | |
3232 | * When RSC is used, ITR interval must be larger than | 3232 | * When RSC is used, ITR interval must be larger than | |
3233 | * RSC_DELAY. Currently, we use 2us for RSC_DELAY. | 3233 | * RSC_DELAY. Currently, we use 2us for RSC_DELAY. | |
3234 | * The minimum value is always greater than 2us on 100M | 3234 | * The minimum value is always greater than 2us on 100M | |
3235 | * (and 10M?(not documented)), but it's not on 1G and higher. | 3235 | * (and 10M?(not documented)), but it's not on 1G and higher. | |
3236 | */ | 3236 | */ | |
3237 | if ((adapter->link_speed != IXGBE_LINK_SPEED_100_FULL) | 3237 | if ((adapter->link_speed != IXGBE_LINK_SPEED_100_FULL) | |
3238 | && (adapter->link_speed != IXGBE_LINK_SPEED_10_FULL)) { | 3238 | && (adapter->link_speed != IXGBE_LINK_SPEED_10_FULL)) { | |
3239 | if ((adapter->num_queues > 1) | 3239 | if ((adapter->num_queues > 1) | |
3240 | && (reg < IXGBE_MIN_RSC_EITR_10G1G)) | 3240 | && (reg < IXGBE_MIN_RSC_EITR_10G1G)) | |
3241 | return EINVAL; | 3241 | return EINVAL; | |
3242 | } | 3242 | } | |
3243 | ixgbe_max_interrupt_rate = rate; | 3243 | ixgbe_max_interrupt_rate = rate; |
--- src/sys/dev/pci/ixgbe/ixgbe_netbsd.c 2020/02/01 02:33:08 1.13
+++ src/sys/dev/pci/ixgbe/ixgbe_netbsd.c 2020/04/17 02:21:25 1.14
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ixgbe_netbsd.c,v 1.13 2020/02/01 02:33:08 riastradh Exp $ */ | 1 | /* $NetBSD: ixgbe_netbsd.c,v 1.14 2020/04/17 02:21:25 msaitoh Exp $ */ | |
2 | /* | 2 | /* | |
3 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | 3 | * Copyright (c) 2011 The NetBSD Foundation, Inc. | |
4 | * All rights reserved. | 4 | * All rights reserved. | |
5 | * | 5 | * | |
6 | * This code is derived from software contributed to The NetBSD Foundation | 6 | * This code is derived from software contributed to The NetBSD Foundation | |
7 | * by Coyote Point Systems, Inc. | 7 | * by Coyote Point Systems, Inc. | |
8 | * | 8 | * | |
9 | * Redistribution and use in source and binary forms, with or without | 9 | * Redistribution and use in source and binary forms, with or without | |
10 | * modification, are permitted provided that the following conditions | 10 | * modification, are permitted provided that the following conditions | |
11 | * are met: | 11 | * are met: | |
12 | * 1. Redistributions of source code must retain the above copyright | 12 | * 1. Redistributions of source code must retain the above copyright | |
13 | * notice, this list of conditions and the following disclaimer. | 13 | * notice, this list of conditions and the following disclaimer. | |
14 | * 2. Redistributions in binary form must reproduce the above copyright | 14 | * 2. Redistributions in binary form must reproduce the above copyright | |
@@ -69,27 +69,27 @@ ixgbe_dma_tag_create(bus_dma_tag_t dmat, | @@ -69,27 +69,27 @@ ixgbe_dma_tag_create(bus_dma_tag_t dmat, | |||
69 | 69 | |||
70 | return 0; | 70 | return 0; | |
71 | } | 71 | } | |
72 | 72 | |||
73 | void | 73 | void | |
74 | ixgbe_dmamap_destroy(ixgbe_dma_tag_t *dt, bus_dmamap_t dmam) | 74 | ixgbe_dmamap_destroy(ixgbe_dma_tag_t *dt, bus_dmamap_t dmam) | |
75 | { | 75 | { | |
76 | bus_dmamap_destroy(dt->dt_dmat, dmam); | 76 | bus_dmamap_destroy(dt->dt_dmat, dmam); | |
77 | } | 77 | } | |
78 | 78 | |||
79 | void | 79 | void | |
80 | ixgbe_dmamap_sync(ixgbe_dma_tag_t *dt, bus_dmamap_t dmam, int ops) | 80 | ixgbe_dmamap_sync(ixgbe_dma_tag_t *dt, bus_dmamap_t dmam, int ops) | |
81 | { | 81 | { | |
82 | bus_dmamap_sync(dt->dt_dmat, dmam, 0, dt->dt_maxsize, ops); | 82 | bus_dmamap_sync(dt->dt_dmat, dmam, 0, dt->dt_maxsize, ops); | |
83 | } | 83 | } | |
84 | 84 | |||
85 | void | 85 | void | |
86 | ixgbe_dmamap_unload(ixgbe_dma_tag_t *dt, bus_dmamap_t dmam) | 86 | ixgbe_dmamap_unload(ixgbe_dma_tag_t *dt, bus_dmamap_t dmam) | |
87 | { | 87 | { | |
88 | bus_dmamap_unload(dt->dt_dmat, dmam); | 88 | bus_dmamap_unload(dt->dt_dmat, dmam); | |
89 | } | 89 | } | |
90 | 90 | |||
91 | int | 91 | int | |
92 | ixgbe_dmamap_create(ixgbe_dma_tag_t *dt, int flags, bus_dmamap_t *dmamp) | 92 | ixgbe_dmamap_create(ixgbe_dma_tag_t *dt, int flags, bus_dmamap_t *dmamp) | |
93 | { | 93 | { | |
94 | return bus_dmamap_create(dt->dt_dmat, dt->dt_maxsize, dt->dt_nsegments, | 94 | return bus_dmamap_create(dt->dt_dmat, dt->dt_maxsize, dt->dt_nsegments, | |
95 | dt->dt_maxsegsize, dt->dt_boundary, flags, dmamp); | 95 | dt->dt_maxsegsize, dt->dt_boundary, flags, dmamp); |
--- src/sys/dev/pci/ixgbe/ixgbe_phy.c 2019/12/23 09:36:18 1.20
+++ src/sys/dev/pci/ixgbe/ixgbe_phy.c 2020/04/17 02:21:25 1.21
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: ixgbe_phy.c,v 1.20 2019/12/23 09:36:18 msaitoh Exp $ */ | 1 | /* $NetBSD: ixgbe_phy.c,v 1.21 2020/04/17 02:21:25 msaitoh Exp $ */ | |
2 | 2 | |||
3 | /****************************************************************************** | 3 | /****************************************************************************** | |
4 | SPDX-License-Identifier: BSD-3-Clause | 4 | SPDX-License-Identifier: BSD-3-Clause | |
5 | 5 | |||
6 | Copyright (c) 2001-2017, Intel Corporation | 6 | Copyright (c) 2001-2017, Intel Corporation | |
7 | All rights reserved. | 7 | All rights reserved. | |
8 | 8 | |||
9 | Redistribution and use in source and binary forms, with or without | 9 | Redistribution and use in source and binary forms, with or without | |
10 | modification, are permitted provided that the following conditions are met: | 10 | modification, are permitted provided that the following conditions are met: | |
11 | 11 | |||
12 | 1. Redistributions of source code must retain the above copyright notice, | 12 | 1. Redistributions of source code must retain the above copyright notice, | |
13 | this list of conditions and the following disclaimer. | 13 | this list of conditions and the following disclaimer. | |
14 | 14 | |||
@@ -1776,27 +1776,27 @@ s32 ixgbe_identify_qsfp_module_generic(s | @@ -1776,27 +1776,27 @@ s32 ixgbe_identify_qsfp_module_generic(s | |||
1776 | if (hw->phy.sfp_type != stored_sfp_type) | 1776 | if (hw->phy.sfp_type != stored_sfp_type) | |
1777 | hw->phy.sfp_setup_needed = TRUE; | 1777 | hw->phy.sfp_setup_needed = TRUE; | |
1778 | 1778 | |||
1779 | /* Determine if the QSFP+ PHY is dual speed or not. */ | 1779 | /* Determine if the QSFP+ PHY is dual speed or not. */ | |
1780 | hw->phy.multispeed_fiber = FALSE; | 1780 | hw->phy.multispeed_fiber = FALSE; | |
1781 | if (((comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) && | 1781 | if (((comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) && | |
1782 | (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)) || | 1782 | (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)) || | |
1783 | ((comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) && | 1783 | ((comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) && | |
1784 | (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE))) | 1784 | (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE))) | |
1785 | hw->phy.multispeed_fiber = TRUE; | 1785 | hw->phy.multispeed_fiber = TRUE; | |
1786 | 1786 | |||
1787 | /* Determine PHY vendor for optical modules */ | 1787 | /* Determine PHY vendor for optical modules */ | |
1788 | if (comp_codes_10g & (IXGBE_SFF_10GBASESR_CAPABLE | | 1788 | if (comp_codes_10g & (IXGBE_SFF_10GBASESR_CAPABLE | | |
1789 | IXGBE_SFF_10GBASELR_CAPABLE)) { | 1789 | IXGBE_SFF_10GBASELR_CAPABLE)) { | |
1790 | status = hw->phy.ops.read_i2c_eeprom(hw, | 1790 | status = hw->phy.ops.read_i2c_eeprom(hw, | |
1791 | IXGBE_SFF_QSFP_VENDOR_OUI_BYTE0, | 1791 | IXGBE_SFF_QSFP_VENDOR_OUI_BYTE0, | |
1792 | &oui_bytes[0]); | 1792 | &oui_bytes[0]); | |
1793 | 1793 | |||
1794 | if (status != IXGBE_SUCCESS) | 1794 | if (status != IXGBE_SUCCESS) | |
1795 | goto err_read_i2c_eeprom; | 1795 | goto err_read_i2c_eeprom; | |
1796 | 1796 | |||
1797 | status = hw->phy.ops.read_i2c_eeprom(hw, | 1797 | status = hw->phy.ops.read_i2c_eeprom(hw, | |
1798 | IXGBE_SFF_QSFP_VENDOR_OUI_BYTE1, | 1798 | IXGBE_SFF_QSFP_VENDOR_OUI_BYTE1, | |
1799 | &oui_bytes[1]); | 1799 | &oui_bytes[1]); | |
1800 | 1800 | |||
1801 | if (status != IXGBE_SUCCESS) | 1801 | if (status != IXGBE_SUCCESS) | |
1802 | goto err_read_i2c_eeprom; | 1802 | goto err_read_i2c_eeprom; |
--- src/sys/dev/pci/ixgbe/ixv.c 2020/03/15 23:04:50 1.147
+++ src/sys/dev/pci/ixgbe/ixv.c 2020/04/17 02:21:25 1.148
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /*$NetBSD: ixv.c,v 1.147 2020/03/15 23:04:50 thorpej Exp $*/ | 1 | /*$NetBSD: ixv.c,v 1.148 2020/04/17 02:21:25 msaitoh Exp $*/ | |
2 | 2 | |||
3 | /****************************************************************************** | 3 | /****************************************************************************** | |
4 | 4 | |||
5 | Copyright (c) 2001-2017, Intel Corporation | 5 | Copyright (c) 2001-2017, Intel Corporation | |
6 | All rights reserved. | 6 | All rights reserved. | |
7 | 7 | |||
8 | Redistribution and use in source and binary forms, with or without | 8 | Redistribution and use in source and binary forms, with or without | |
9 | modification, are permitted provided that the following conditions are met: | 9 | modification, are permitted provided that the following conditions are met: | |
10 | 10 | |||
11 | 1. Redistributions of source code must retain the above copyright notice, | 11 | 1. Redistributions of source code must retain the above copyright notice, | |
12 | this list of conditions and the following disclaimer. | 12 | this list of conditions and the following disclaimer. | |
13 | 13 | |||
14 | 2. Redistributions in binary form must reproduce the above copyright | 14 | 2. Redistributions in binary form must reproduce the above copyright | |
@@ -1158,27 +1158,27 @@ ixv_set_rxfilter(struct adapter *adapter | @@ -1158,27 +1158,27 @@ ixv_set_rxfilter(struct adapter *adapter | |||
1158 | device_printf(adapter->dev, | 1158 | device_printf(adapter->dev, | |
1159 | "the PF doesn't support allmulti mode\n"); | 1159 | "the PF doesn't support allmulti mode\n"); | |
1160 | error = EOPNOTSUPP; | 1160 | error = EOPNOTSUPP; | |
1161 | } else if (error) { | 1161 | } else if (error) { | |
1162 | device_printf(adapter->dev, | 1162 | device_printf(adapter->dev, | |
1163 | "number of Ethernet multicast addresses " | 1163 | "number of Ethernet multicast addresses " | |
1164 | "exceeds the limit (%d). error = %d\n", | 1164 | "exceeds the limit (%d). error = %d\n", | |
1165 | IXGBE_MAX_VF_MC, error); | 1165 | IXGBE_MAX_VF_MC, error); | |
1166 | error = ENOSPC; | 1166 | error = ENOSPC; | |
1167 | } else { | 1167 | } else { | |
1168 | ETHER_LOCK(ec); | 1168 | ETHER_LOCK(ec); | |
1169 | ec->ec_flags |= ETHER_F_ALLMULTI; | 1169 | ec->ec_flags |= ETHER_F_ALLMULTI; | |
1170 | ETHER_UNLOCK(ec); | 1170 | ETHER_UNLOCK(ec); | |
1171 | return rc; /* Promisc might failed */ | 1171 | return rc; /* Promisc might have failed */ | |
1172 | } | 1172 | } | |
1173 | 1173 | |||
1174 | if (rc == 0) | 1174 | if (rc == 0) | |
1175 | rc = error; | 1175 | rc = error; | |
1176 | 1176 | |||
1177 | /* Continue to update the multicast table as many as we can */ | 1177 | /* Continue to update the multicast table as many as we can */ | |
1178 | } | 1178 | } | |
1179 | 1179 | |||
1180 | /* 4: For normal operation */ | 1180 | /* 4: For normal operation */ | |
1181 | error = hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_MULTI); | 1181 | error = hw->mac.ops.update_xcast_mode(hw, IXGBEVF_XCAST_MODE_MULTI); | |
1182 | if ((error == IXGBE_ERR_FEATURE_NOT_SUPPORTED) || (error == 0)) { | 1182 | if ((error == IXGBE_ERR_FEATURE_NOT_SUPPORTED) || (error == 0)) { | |
1183 | /* Normal operation */ | 1183 | /* Normal operation */ | |
1184 | ETHER_LOCK(ec); | 1184 | ETHER_LOCK(ec); | |
@@ -2419,27 +2419,27 @@ ixv_sysctl_interrupt_rate_handler(SYSCTL | @@ -2419,27 +2419,27 @@ ixv_sysctl_interrupt_rate_handler(SYSCTL | |||
2419 | usec = ((reg & 0x0FF8) >> 3); | 2419 | usec = ((reg & 0x0FF8) >> 3); | |
2420 | if (usec > 0) | 2420 | if (usec > 0) | |
2421 | rate = 500000 / usec; | 2421 | rate = 500000 / usec; | |
2422 | else | 2422 | else | |
2423 | rate = 0; | 2423 | rate = 0; | |
2424 | node.sysctl_data = &rate; | 2424 | node.sysctl_data = &rate; | |
2425 | error = sysctl_lookup(SYSCTLFN_CALL(&node)); | 2425 | error = sysctl_lookup(SYSCTLFN_CALL(&node)); | |
2426 | if (error || newp == NULL) | 2426 | if (error || newp == NULL) | |
2427 | return error; | 2427 | return error; | |
2428 | reg &= ~0xfff; /* default, no limitation */ | 2428 | reg &= ~0xfff; /* default, no limitation */ | |
2429 | if (rate > 0 && rate < 500000) { | 2429 | if (rate > 0 && rate < 500000) { | |
2430 | if (rate < 1000) | 2430 | if (rate < 1000) | |
2431 | rate = 1000; | 2431 | rate = 1000; | |
2432 | reg |= ((4000000/rate) & 0xff8); | 2432 | reg |= ((4000000 / rate) & 0xff8); | |
2433 | /* | 2433 | /* | |
2434 | * When RSC is used, ITR interval must be larger than | 2434 | * When RSC is used, ITR interval must be larger than | |
2435 | * RSC_DELAY. Currently, we use 2us for RSC_DELAY. | 2435 | * RSC_DELAY. Currently, we use 2us for RSC_DELAY. | |
2436 | * The minimum value is always greater than 2us on 100M | 2436 | * The minimum value is always greater than 2us on 100M | |
2437 | * (and 10M?(not documented)), but it's not on 1G and higher. | 2437 | * (and 10M?(not documented)), but it's not on 1G and higher. | |
2438 | */ | 2438 | */ | |
2439 | if ((adapter->link_speed != IXGBE_LINK_SPEED_100_FULL) | 2439 | if ((adapter->link_speed != IXGBE_LINK_SPEED_100_FULL) | |
2440 | && (adapter->link_speed != IXGBE_LINK_SPEED_10_FULL)) { | 2440 | && (adapter->link_speed != IXGBE_LINK_SPEED_10_FULL)) { | |
2441 | if ((adapter->num_queues > 1) | 2441 | if ((adapter->num_queues > 1) | |
2442 | && (reg < IXGBE_MIN_RSC_EITR_10G1G)) | 2442 | && (reg < IXGBE_MIN_RSC_EITR_10G1G)) | |
2443 | return EINVAL; | 2443 | return EINVAL; | |
2444 | } | 2444 | } | |
2445 | ixv_max_interrupt_rate = rate; | 2445 | ixv_max_interrupt_rate = rate; |