diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/man/man7d/Makefile | 2 | ||||
-rw-r--r-- | usr/src/man/man7d/i40e.7d | 4 | ||||
-rw-r--r-- | usr/src/pkg/manifests/driver-network-i40e.mf | 2 | ||||
-rw-r--r-- | usr/src/uts/common/Makefile.files | 3 | ||||
-rw-r--r-- | usr/src/uts/common/Makefile.rules | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/i40e/i40e_gld.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/io/i40e/i40e_main.c | 62 | ||||
-rw-r--r-- | usr/src/uts/common/io/i40e/i40e_osdep.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/i40e/i40e_osdep.h | 12 | ||||
-rw-r--r-- | usr/src/uts/common/io/i40e/i40e_sw.h | 25 | ||||
-rw-r--r-- | usr/src/uts/common/io/i40e/i40e_transceiver.c | 28 | ||||
-rw-r--r-- | usr/src/uts/intel/Makefile.intel | 2 |
12 files changed, 88 insertions, 67 deletions
diff --git a/usr/src/man/man7d/Makefile b/usr/src/man/man7d/Makefile index e3404ff3a5..2173dbb961 100644 --- a/usr/src/man/man7d/Makefile +++ b/usr/src/man/man7d/Makefile @@ -14,6 +14,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # Copyright 2016 Joyent, Inc. # Copyright 2016 Garrett D'Amore <garrett@damore.org> +# Copyright 2016 Joyent, Inc. # include $(SRC)/Makefile.master @@ -213,6 +214,7 @@ i386_MANFILES= ahci.7d \ ecpp.7d \ elxl.7d \ heci.7d \ + i40e.7d \ i915.7d \ ipmi.7d \ iprb.7d \ diff --git a/usr/src/man/man7d/i40e.7d b/usr/src/man/man7d/i40e.7d index 082f8b0eeb..57d2de5adf 100644 --- a/usr/src/man/man7d/i40e.7d +++ b/usr/src/man/man7d/i40e.7d @@ -80,7 +80,9 @@ The .Nm driver is managed by the .Xr dladm 1M -utility and it is the preferred interface for setting all properties. While +utility. +.Xr dladm 1M +is the preferred interface for setting all properties. While .Xr driver.conf based configuration is possible, .Xr dladm 1M is recommended. The diff --git a/usr/src/pkg/manifests/driver-network-i40e.mf b/usr/src/pkg/manifests/driver-network-i40e.mf index 897414c3f8..99d7e093a0 100644 --- a/usr/src/pkg/manifests/driver-network-i40e.mf +++ b/usr/src/pkg/manifests/driver-network-i40e.mf @@ -14,7 +14,7 @@ # <include global_zone_only_component> -set name=pkg.fmri value=pkg:/driver/network/i40e$(PKGVERS) +set name=pkg.fmri value=pkg:/driver/network/i40e@$(PKGVERS) set name=pkg.description value="Intel XL710 10/40 Gb Ethernet Driver" set name=pkg.summary value="Intel XL710 10/40 Gb Ethernet Driver" set name=info.classification \ diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files index 16d89ee737..b86a6367e1 100644 --- a/usr/src/uts/common/Makefile.files +++ b/usr/src/uts/common/Makefile.files @@ -26,6 +26,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # Copyright 2016 Joyent, Inc. # Copyright 2016 Garrett D'Amore <garrett@damore.org> +# Copyright 2016 Joyent, Inc. # # @@ -2044,6 +2045,8 @@ I40E_OBJS = i40e_main.o i40e_osdep.o i40e_intr.o i40e_transceiver.o \ # Intel-written ones. I40E_INTC_OBJS = i40e_adminq.o i40e_common.o i40e_hmc.o i40e_lan_hmc.o \ i40e_nvm.o + +# # Solarflare 1/10/40GbE NIC driver module # # NB: The illumos specific sources are listed first, with the diff --git a/usr/src/uts/common/Makefile.rules b/usr/src/uts/common/Makefile.rules index a80ec6293f..7bbd5bccd7 100644 --- a/usr/src/uts/common/Makefile.rules +++ b/usr/src/uts/common/Makefile.rules @@ -25,6 +25,7 @@ # Copyright 2015 Nexenta Systems, Inc. All rights reserved. # Copyright 2016 Joyent, Inc. # Copyright 2013 Saso Kiselkov. All rights reserved. +# Copyright 2016 Joyent, Inc. # # diff --git a/usr/src/uts/common/io/i40e/i40e_gld.c b/usr/src/uts/common/io/i40e/i40e_gld.c index 0af4c4c71f..b599a051f5 100644 --- a/usr/src/uts/common/io/i40e/i40e_gld.c +++ b/usr/src/uts/common/io/i40e/i40e_gld.c @@ -295,9 +295,9 @@ i40e_multicast_add(i40e_t *i40e, const uint8_t *multicast_address) ret = i40e_aq_set_vsi_multicast_promiscuous(hw, i40e->i40e_vsi_id, B_TRUE, NULL); if (ret != I40E_SUCCESS) { - i40e_error(i40e, "failed to enable promiscuous " - "mode on VSI %d: %d", i40e->i40e_vsi_id, - ret); + i40e_error(i40e, "failed to enable multicast " + "promiscuous mode on VSI %d: %d", + i40e->i40e_vsi_id, ret); return (EIO); } } @@ -383,7 +383,7 @@ i40e_multicast_remove(i40e_t *i40e, const uint8_t *multicast_address) i40e->i40e_vsi_id, B_FALSE, NULL); if (ret != I40E_SUCCESS) { i40e_error(i40e, "failed to disable " - "promiscuous mode on VSI %d: %d", + "multicast promiscuous mode on VSI %d: %d", i40e->i40e_vsi_id, ret); return (EIO); } diff --git a/usr/src/uts/common/io/i40e/i40e_main.c b/usr/src/uts/common/io/i40e/i40e_main.c index 91164abf87..d765174387 100644 --- a/usr/src/uts/common/io/i40e/i40e_main.c +++ b/usr/src/uts/common/io/i40e/i40e_main.c @@ -91,8 +91,9 @@ * by the system, resulting in an instance being created and attached to. While * there are many resources that are unique to each physical function eg. * instance of the device, there are many that are shared across all of them. - * Several resources have an amount reserved for each VSI and then a static pool - * of resources, available for all functions on the card. + * Several resources have an amount reserved for each Virtual Station Interface + * (VSI) and then a static pool of resources, available for all functions on the + * card. * * The most important resource in hardware are its transmit and receive queue * pairs (i40e_trqpair_t). These should be thought of as rings in GLDv3 @@ -314,7 +315,7 @@ * ------------- * * In order to ensure that we don't deadlock, the following represents the - * lock oder being used. When grabbing locks, follow the following order. Lower + * lock order being used. When grabbing locks, follow the following order. Lower * numbers are more important. Thus, the i40e_glock which is number 0, must be * taken before any other locks in the driver. On the other hand, the * i40e_t`i40e_stat_lock, has the highest number because it's the least @@ -415,6 +416,7 @@ i40e_dev_err(i40e_t *i40e, int level, boolean_t console, const char *fmt, * and variable arguments, I need to instantiate these. Pardon the redundant * code. */ +/*PRINTFLIKE2*/ void i40e_error(i40e_t *i40e, const char *fmt, ...) { @@ -425,6 +427,7 @@ i40e_error(i40e_t *i40e, const char *fmt, ...) va_end(ap); } +/*PRINTFLIKE2*/ void i40e_log(i40e_t *i40e, const char *fmt, ...) { @@ -435,6 +438,7 @@ i40e_log(i40e_t *i40e, const char *fmt, ...) va_end(ap); } +/*PRINTFLIKE2*/ void i40e_notice(i40e_t *i40e, const char *fmt, ...) { @@ -763,7 +767,7 @@ i40e_get_vsi_id(i40e_t *i40e) rc = i40e_aq_get_switch_config(hw, sw_config, sizeof (aq_buf), &next, NULL); if (rc != I40E_SUCCESS) { - i40e_error(i40e, "i40e_aq_get_switch_config() failed %d: %d\n", + i40e_error(i40e, "i40e_aq_get_switch_config() failed %d: %d", rc, hw->aq.asq_last_status); return (-1); } @@ -793,8 +797,9 @@ i40e_get_hw_capabilities(i40e_t *i40e, i40e_hw_t *hw) uint16_t needed; int nelems = I40E_HW_CAP_DEFAULT; + len = nelems * sizeof (*buf); + for (;;) { - len = nelems * sizeof (*buf); ASSERT(len > 0); buf = kmem_alloc(len, KM_SLEEP); rc = i40e_aq_discover_capabilities(hw, buf, len, @@ -808,9 +813,10 @@ i40e_get_hw_capabilities(i40e_t *i40e, i40e_hw_t *hw) "due to byzantine common code"); return (B_FALSE); } - nelems = needed; + len = needed; continue; - } else if (hw->aq.asq_last_status != I40E_AQ_RC_OK) { + } else if (rc != I40E_SUCCESS || + hw->aq.asq_last_status != I40E_AQ_RC_OK) { i40e_error(i40e, "Capability discovery failed: %d", rc); return (B_FALSE); } @@ -852,7 +858,7 @@ i40e_get_switch_resources(i40e_t *i40e) } else if (ret != I40E_SUCCESS) { kmem_free(buf, size); i40e_error(i40e, - "failed to retrieve switch statistics: %d\n", ret); + "failed to retrieve switch statistics: %d", ret); return (B_FALSE); } @@ -1003,7 +1009,7 @@ i40e_get_available_resources(i40e_t *i40e) i40e->i40e_resources.ifr_nmcastfilt, KM_SLEEP); /* - * Initialize these a multicast address to indicate it's invalid for + * Initialize these as multicast addresses to indicate it's invalid for * sanity purposes. Think of it like 0xdeadbeef. */ for (i = 0; i < i40e->i40e_resources.ifr_nmacfilt; i++) @@ -1253,14 +1259,14 @@ i40e_common_code_init(i40e_t *i40e, i40e_hw_t *hw) hw->func_caps.num_rx_qp, 0, 0); if (rc != 0) { i40e_error(i40e, "failed to initialize hardware memory cache: " - "%d\n", rc); + "%d", rc); return (B_FALSE); } rc = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); if (rc != 0) { i40e_error(i40e, "failed to configure hardware memory cache: " - "%d\n", rc); + "%d", rc); return (B_FALSE); } @@ -1276,7 +1282,7 @@ i40e_common_code_init(i40e_t *i40e, i40e_hw_t *hw) rc = i40e_validate_mac_addr(hw->mac.addr); if (rc != 0) { i40e_error(i40e, "failed to validate internal mac address: " - "%d\n", rc); + "%d", rc); return (B_FALSE); } bcopy(hw->mac.addr, hw->mac.perm_addr, ETHERADDRL); @@ -1617,14 +1623,14 @@ i40e_alloc_intr_handles(i40e_t *i40e, dev_info_t *devinfo, int intr_type) rc = ddi_intr_get_nintrs(devinfo, intr_type, &count); if (rc != DDI_SUCCESS || count < min) { i40e_log(i40e, "Get interrupt number failed, " - "returned %d, count %d\n", rc, count); + "returned %d, count %d", rc, count); return (B_FALSE); } rc = ddi_intr_get_navail(devinfo, intr_type, &count); if (rc != DDI_SUCCESS || count < min) { i40e_log(i40e, "Get AVAILABLE interrupt number failed, " - "returned %d, count %d\n", rc, count); + "returned %d, count %d", rc, count); return (B_FALSE); } @@ -1866,7 +1872,7 @@ i40e_get_hw_state(i40e_t *i40e, i40e_hw_t *hw) */ rc = i40e_aq_set_phy_int_mask(hw, 0, NULL); if (rc != I40E_SUCCESS) { - i40e_error(i40e, "failed to update phy link mask: %d\n", rc); + i40e_error(i40e, "failed to update phy link mask: %d", rc); } } @@ -1899,7 +1905,7 @@ i40e_config_vsi(i40e_t *i40e, i40e_hw_t *hw) context.pf_num = hw->pf_id; err = i40e_aq_get_vsi_params(hw, &context, NULL); if (err != I40E_SUCCESS) { - i40e_error(i40e, "get VSI params failed with %d\n", err); + i40e_error(i40e, "get VSI params failed with %d", err); return (B_FALSE); } @@ -1947,7 +1953,7 @@ i40e_chip_start(i40e_t *i40e) if (i40e_aq_set_link_restart_an(hw, TRUE, NULL) != I40E_SUCCESS) { i40e_error(i40e, "failed to restart link: admin queue " - "error: %d\n", hw->aq.asq_last_status); + "error: %d", hw->aq.asq_last_status); return (B_FALSE); } } @@ -2112,7 +2118,7 @@ i40e_shutdown_rings_wait(i40e_t *i40e) } if ((reg & I40E_QRX_ENA_QENA_STAT_MASK) != 0) { - i40e_error(i40e, "timed out disabling rx queue %d\n", + i40e_error(i40e, "timed out disabling rx queue %d", i); return (B_FALSE); } @@ -2125,7 +2131,7 @@ i40e_shutdown_rings_wait(i40e_t *i40e) } if ((reg & I40E_QTX_ENA_QENA_STAT_MASK) != 0) { - i40e_error(i40e, "timed out disabling tx queue %d\n", + i40e_error(i40e, "timed out disabling tx queue %d", i); return (B_FALSE); } @@ -2201,14 +2207,14 @@ i40e_setup_rx_hmc(i40e_trqpair_t *itrq) err = i40e_clear_lan_rx_queue_context(hw, itrq->itrq_index); if (err != I40E_SUCCESS) { - i40e_error(i40e, "failed to clear rx queue %d context: %d\n", + i40e_error(i40e, "failed to clear rx queue %d context: %d", itrq->itrq_index, err); return (B_FALSE); } err = i40e_set_lan_rx_queue_context(hw, itrq->itrq_index, &rctx); if (err != I40E_SUCCESS) { - i40e_error(i40e, "failed to set rx queue %d context: %d\n", + i40e_error(i40e, "failed to set rx queue %d context: %d", itrq->itrq_index, err); return (B_FALSE); } @@ -2282,7 +2288,7 @@ i40e_setup_rx_rings(i40e_t *i40e) if ((reg & I40E_QRX_ENA_QENA_STAT_MASK) == 0) { i40e_error(i40e, "failed to enable rx queue %d, timed " - "out."); + "out.", i); return (B_FALSE); } } @@ -2335,21 +2341,21 @@ i40e_setup_tx_hmc(i40e_trqpair_t *itrq) context.pf_num = hw->pf_id; err = i40e_aq_get_vsi_params(hw, &context, NULL); if (err != I40E_SUCCESS) { - i40e_error(i40e, "get VSI params failed with %d\n", err); + i40e_error(i40e, "get VSI params failed with %d", err); return (B_FALSE); } tctx.rdylist = LE_16(context.info.qs_handle[0]); err = i40e_clear_lan_tx_queue_context(hw, itrq->itrq_index); if (err != I40E_SUCCESS) { - i40e_error(i40e, "failed to clear tx queue %d context: %d\n", + i40e_error(i40e, "failed to clear tx queue %d context: %d", itrq->itrq_index, err); return (B_FALSE); } err = i40e_set_lan_tx_queue_context(hw, itrq->itrq_index, &tctx); if (err != I40E_SUCCESS) { - i40e_error(i40e, "failed to set tx queue %d context: %d\n", + i40e_error(i40e, "failed to set tx queue %d context: %d", itrq->itrq_index, err); return (B_FALSE); } @@ -2424,7 +2430,7 @@ i40e_setup_tx_rings(i40e_t *i40e) if ((reg & I40E_QTX_ENA_QENA_STAT_MASK) == 0) { i40e_error(i40e, "failed to enable tx queue %d, timed " - "out"); + "out", i); return (B_FALSE); } } @@ -2567,14 +2573,14 @@ i40e_start(i40e_t *i40e, boolean_t alloc) */ err = i40e_aq_set_vsi_broadcast(hw, i40e->i40e_vsi_id, B_TRUE, NULL); if (err != I40E_SUCCESS) { - i40e_error(i40e, "failed to set default VSI: %d\n", err); + i40e_error(i40e, "failed to set default VSI: %d", err); rc = B_FALSE; goto done; } err = i40e_aq_set_mac_config(hw, i40e->i40e_frame_max, B_TRUE, 0, NULL); if (err != I40E_SUCCESS) { - i40e_error(i40e, "failed to set MAC config: %d\n", err); + i40e_error(i40e, "failed to set MAC config: %d", err); rc = B_FALSE; goto done; } diff --git a/usr/src/uts/common/io/i40e/i40e_osdep.c b/usr/src/uts/common/io/i40e/i40e_osdep.c index 41a13ee4ec..44a2c99ab6 100644 --- a/usr/src/uts/common/io/i40e/i40e_osdep.c +++ b/usr/src/uts/common/io/i40e/i40e_osdep.c @@ -86,8 +86,8 @@ i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem, ddi_dma_free_handle(&mem->idm_dma_handle); mem->idm_dma_handle = NULL; - i40e_error(i40e, "failed to allocate %d bytes of DMA memory " - "for common code", size); + i40e_error(i40e, "failed to allocate %" PRIu64 " bytes of DMA " + "memory for common code", size); return (I40E_ERR_NO_MEMORY); } @@ -106,7 +106,7 @@ i40e_allocate_dma_mem(struct i40e_hw *hw, struct i40e_dma_mem *mem, ddi_dma_free_handle(&mem->idm_dma_handle); mem->idm_dma_handle = NULL; - i40e_error(i40e, "failed to bind %d byte sized dma region: %d", + i40e_error(i40e, "failed to bind %ld byte sized dma region: %d", len, rc); switch (rc) { case DDI_DMA_INUSE: diff --git a/usr/src/uts/common/io/i40e/i40e_osdep.h b/usr/src/uts/common/io/i40e/i40e_osdep.h index 12f498bc72..9ee85c520f 100644 --- a/usr/src/uts/common/io/i40e/i40e_osdep.h +++ b/usr/src/uts/common/io/i40e/i40e_osdep.h @@ -29,8 +29,10 @@ extern "C" { /* * For the moment, we use this to basically deal with a few custom changes - * particularly around mutex initialization. This is used to indicate that we - * should take illumos variants. + * particularly around the use of sprintf() in the common code. The DDI defines + * sprintf() in a rather different way than the rest of the world expects it. + * This is currently necessary to indicate that we should use an alternate + * behavior. */ #define I40E_ILLUMOS 1 @@ -53,7 +55,7 @@ extern "C" { #define UNREFERENCED_1PARAMETER(_p) UNREFERENCED_PARAMETER(_p) #define UNREFERENCED_2PARAMETER(_p, _q) _NOTE(ARGUNUSED(_p, _q)) #define UNREFERENCED_3PARAMETER(_p, _q, _r) _NOTE(ARGUNUSED(_p, _q, _r)) -#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) _NOTE(ARGUNUSED(_p, _q,_r, _s)) +#define UNREFERENCED_4PARAMETER(_p, _q, _r, _s) _NOTE(ARGUNUSED(_p, _q, _r, _s)) #define INLINE inline @@ -169,7 +171,7 @@ struct i40e_hw; /* forward decl */ (pci_config_put16(OS_DEP(hw)->ios_cfg_handle, (reg), (value))) /* - * Intel expects that the symbol wr32 and r32 be defined to something which can + * Intel expects that the symbol wr32 and rd32 be defined to something which can * read and write the 32-bit register in PCI space. * * To make it easier for readers and satisfy the general agreement that macros @@ -185,7 +187,7 @@ struct i40e_hw; /* forward decl */ #define I40E_READ_REG rd32 /* - * The use of GLEN_STAT presumes that we're only using this file for a PF + * The use of GLGEN_STAT presumes that we're only using this file for a PF * driver. If we end up doing a VF driver, then we'll want to logically change * this. */ diff --git a/usr/src/uts/common/io/i40e/i40e_sw.h b/usr/src/uts/common/io/i40e/i40e_sw.h index 04959b1590..4995f53107 100644 --- a/usr/src/uts/common/io/i40e/i40e_sw.h +++ b/usr/src/uts/common/io/i40e/i40e_sw.h @@ -107,7 +107,7 @@ extern "C" { /* * Note, while the min and maximum values are based upon the sizing of the ring * itself, the default is taken from ixgbe without much thought. It's basically - * been cargo culted. See i40e_transciever.c for a bit more information. + * been cargo culted. See i40e_transceiver.c for a bit more information. */ #define I40E_MIN_RX_LIMIT_PER_INTR 16 #define I40E_MAX_RX_LIMIT_PER_INTR 4096 @@ -166,9 +166,9 @@ typedef enum i40e_itr_index { #define I40E_QUEUE_TYPE_EOL 0x7FF /* - * See the comments in i40e_buf.c as to the purpose of this value and how it's - * used to ensure that the IP header is eventually aligned when it's received by - * the OS. + * See the comments in i40e_transceiver.c as to the purpose of this value and + * how it's used to ensure that the IP header is eventually aligned when it's + * received by the OS. */ #define I40E_BUF_IPHDR_ALIGNMENT 2 @@ -310,7 +310,7 @@ typedef enum i40e_attach_state { I40E_ATTACH_ALLOC_INTR = 0x0008, /* Interrupts allocated */ I40E_ATTACH_ALLOC_RINGSLOCKS = 0x0010, /* Rings & locks allocated */ I40E_ATTACH_ADD_INTR = 0x0020, /* Intr handlers added */ - I40E_ATTACH_COMMON_CODE = 0x0040, /* Intel code initialized */ + I40E_ATTACH_COMMON_CODE = 0x0040, /* Intel code initialized */ I40E_ATTACH_INIT = 0x0080, /* Device initialized */ I40E_ATTACH_STATS = 0x0200, /* Kstats created */ I40E_ATTACH_MAC = 0x0800, /* MAC registered */ @@ -420,7 +420,7 @@ typedef struct i40e_rx_data { /* * RX software ring settings */ - uint32_t rxd_ring_size; /* Rx descriptor ring size */ + uint32_t rxd_ring_size; /* Rx descriptor ring size */ uint32_t rxd_free_list_size; /* Rx free list size */ /* @@ -830,8 +830,8 @@ typedef struct i40e { boolean_t i40e_intr_poll; /* - * DMA attributes. See i40e_buf.c for why we have copies of them in the - * i40e_t. + * DMA attributes. See i40e_transceiver.c for why we have copies of them + * in the i40e_t. */ ddi_dma_attr_t i40e_static_dma_attr; ddi_dma_attr_t i40e_txbind_dma_attr; @@ -894,9 +894,12 @@ typedef struct i40e_device { /* * Logging functions. */ -extern void i40e_error(i40e_t *, const char *, ...); -extern void i40e_notice(i40e_t *, const char *, ...); -extern void i40e_log(i40e_t *, const char *, ...); +/*PRINTFLIKE2*/ +extern void i40e_error(i40e_t *, const char *, ...) __KPRINTFLIKE(2); +/*PRINTFLIKE2*/ +extern void i40e_notice(i40e_t *, const char *, ...) __KPRINTFLIKE(2); +/*PRINTFLIKE2*/ +extern void i40e_log(i40e_t *, const char *, ...) __KPRINTFLIKE(2); /* * General link handling functions. diff --git a/usr/src/uts/common/io/i40e/i40e_transceiver.c b/usr/src/uts/common/io/i40e/i40e_transceiver.c index 06f82f856e..75132e27f0 100644 --- a/usr/src/uts/common/io/i40e/i40e_transceiver.c +++ b/usr/src/uts/common/io/i40e/i40e_transceiver.c @@ -87,8 +87,9 @@ * memory, which means that we need to have the receive specific control block. * We have a couple different, but related goals: * - * o Once we've completed the mc_start GLDv3 endpoint, we do not want to do - * any additional memory allocations or DMA allocations if we don't have to. + * o Once we've completed the mc_start GLDv3 endpoint (i40e_m_start), we do + * not want to do any additional memory allocations or DMA allocations if + * we don't have to. * * o We'd like to try and do as much zero-copy as possible, while taking into * account the cost of mapping in DMA resources. @@ -306,10 +307,10 @@ * they correspond to. Once we are indicated that the corresponding descriptor * has been freed, we'll return it to the list. * - * The thread control block free list is managed by keeping track of the number - * of entries in it, i40e_trqpair_t`itrq_tcb_free. We use it as a way to index - * into the free list and add things to it. In effect, we always push and pop - * from the tail and protect it with a single lock, + * The transmit control block free list is managed by keeping track of the + * number of entries in it, i40e_trqpair_t`itrq_tcb_free. We use it as a way to + * index into the free list and add things to it. In effect, we always push and + * pop from the tail and protect it with a single lock, * i40e_trqpair_t`itrq_tcb_lock. This scheme is somewhat simplistic and may not * stand up to further performance testing; however, it does allow us to get off * the ground with the device driver. @@ -581,7 +582,7 @@ i40e_alloc_dma_buffer(i40e_t *i40e, i40e_dma_buffer_t *dmap, DDI_DMA_DONTWAIT, NULL, &dmap->dmab_address, &len, &dmap->dmab_acc_handle); if (ret != DDI_SUCCESS) { - i40e_error(i40e, "failed to allocate %d bytes of DMA for I/O " + i40e_error(i40e, "failed to allocate %ld bytes of DMA for I/O " "buffers", size); dmap->dmab_address = NULL; dmap->dmab_acc_handle = NULL; @@ -602,7 +603,7 @@ i40e_alloc_dma_buffer(i40e_t *i40e, i40e_dma_buffer_t *dmap, dmap->dmab_address, len, DDI_DMA_RDWR | flags, DDI_DMA_DONTWAIT, NULL, &cookie, &ncookies); if (ret != DDI_DMA_MAPPED) { - i40e_error(i40e, "failed to allocate %d bytes of DMA for I/O " + i40e_error(i40e, "failed to allocate %ld bytes of DMA for I/O " "buffers: %d", size, ret); i40e_free_dma_buffer(dmap); return (B_FALSE); @@ -642,6 +643,7 @@ i40e_free_rx_data(i40e_rx_data_t *rxd) kmem_free(rxd->rxd_work_list, sizeof (i40e_rx_control_block_t *) * rxd->rxd_ring_size); + rxd->rxd_work_list = NULL; } kmem_free(rxd, sizeof (i40e_rx_data_t)); @@ -956,8 +958,8 @@ i40e_alloc_tx_dma(i40e_trqpair_t *itrq) if (i40e_alloc_dma_buffer(i40e, &tcb->tcb_dma, &i40e->i40e_static_dma_attr, &i40e->i40e_buf_acc_attr, B_TRUE, B_FALSE, dmasz) == B_FALSE) { - i40e_error(i40e, "failed to allocate %d bytes of " - "DMA for tx data binding on ring %d: %d", dmasz, + i40e_error(i40e, "failed to allocate %ld bytes of " + "DMA for tx data binding on ring %d", dmasz, itrq->itrq_index); goto cleanup; } @@ -1415,7 +1417,7 @@ i40e_ring_rx(i40e_trqpair_t *itrq, int poll_bytes) stword = LE64_TO_CPU(cur_desc->wb.qword1.status_error_len); /* - * Note, the primary invariant of this loop should be tha cur_head, + * Note, the primary invariant of this loop should be that cur_head, * cur_desc, and stword always point to the currently processed * descriptor. When we leave the loop, it should point to a descriptor * that HAS NOT been processed. Meaning, that if we haven't consumed the @@ -1766,7 +1768,7 @@ mac_ether_offload_info(mblk_t *mp, mac_ether_offload_info_t *meoi) * to properly program the hardware for checksum offload as well as the * generally required flags. * - * The i40e_tx_contex_t`itc_cmdflags contains the set of flags we need to or + * The i40e_tx_context_t`itc_cmdflags contains the set of flags we need to or * into the descriptor based on the checksum flags for this mblk_t and the * actual information we care about. */ @@ -1927,7 +1929,7 @@ i40e_tcb_reset(i40e_tx_control_block_t *tcb) break; case I40E_TX_NONE: /* Cast to pacify lint */ - panic("trying to free tcb %p with bad type none\n", (void *)tcb); + panic("trying to free tcb %p with bad type none", (void *)tcb); default: panic("unknown i40e tcb type: %d", tcb->tcb_type); } diff --git a/usr/src/uts/intel/Makefile.intel b/usr/src/uts/intel/Makefile.intel index 7f93a02262..f7002cf92a 100644 --- a/usr/src/uts/intel/Makefile.intel +++ b/usr/src/uts/intel/Makefile.intel @@ -21,7 +21,7 @@ # # Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2013 Andrew Stormont. All rights reserved. -# Copyright 2016, Joyent, Inc. +# Copyright 2016 Joyent, Inc. # Copyright 2016 Garrett D'Amore <garrett@damore.org> # Copyright 2016 Nexenta Systems, Inc. # |