Lines Matching refs:ss

198 	struct myri10ge_slice_state *ss;  member
917 struct myri10ge_slice_state *ss; in myri10ge_reset() local
945 bytes = mgp->max_intr_slots * sizeof(*mgp->ss[0].rx_done.entry); in myri10ge_reset()
1002 ss = &mgp->ss[i]; in myri10ge_reset()
1003 cmd.data0 = MYRI10GE_LOWPART_TO_U32(ss->rx_done.bus); in myri10ge_reset()
1004 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(ss->rx_done.bus); in myri10ge_reset()
1013 ss = &mgp->ss[i]; in myri10ge_reset()
1014 ss->irq_claim = in myri10ge_reset()
1034 ss = &mgp->ss[i]; in myri10ge_reset()
1036 ss->dca_tag = (__iomem __be32 *) in myri10ge_reset()
1039 ss->dca_tag = NULL; in myri10ge_reset()
1048 ss = &mgp->ss[i]; in myri10ge_reset()
1050 memset(ss->rx_done.entry, 0, bytes); in myri10ge_reset()
1051 ss->tx.req = 0; in myri10ge_reset()
1052 ss->tx.done = 0; in myri10ge_reset()
1053 ss->tx.pkt_start = 0; in myri10ge_reset()
1054 ss->tx.pkt_done = 0; in myri10ge_reset()
1055 ss->rx_big.cnt = 0; in myri10ge_reset()
1056 ss->rx_small.cnt = 0; in myri10ge_reset()
1057 ss->rx_done.idx = 0; in myri10ge_reset()
1058 ss->rx_done.cnt = 0; in myri10ge_reset()
1059 ss->tx.wake_queue = 0; in myri10ge_reset()
1060 ss->tx.stop_queue = 0; in myri10ge_reset()
1087 myri10ge_write_dca(struct myri10ge_slice_state *ss, int cpu, int tag) in myri10ge_write_dca() argument
1089 ss->cached_dca_tag = tag; in myri10ge_write_dca()
1090 put_be32(htonl(tag), ss->dca_tag); in myri10ge_write_dca()
1093 static inline void myri10ge_update_dca(struct myri10ge_slice_state *ss) in myri10ge_update_dca() argument
1098 if (cpu != ss->cpu) { in myri10ge_update_dca()
1099 tag = dca3_get_tag(&ss->mgp->pdev->dev, cpu); in myri10ge_update_dca()
1100 if (ss->cached_dca_tag != tag) in myri10ge_update_dca()
1101 myri10ge_write_dca(ss, cpu, tag); in myri10ge_update_dca()
1102 ss->cpu = cpu; in myri10ge_update_dca()
1112 if (mgp->ss[0].dca_tag == NULL || mgp->dca_enabled) in myri10ge_setup_dca()
1128 mgp->ss[i].cpu = -1; in myri10ge_setup_dca()
1129 mgp->ss[i].cached_dca_tag = -1; in myri10ge_setup_dca()
1130 myri10ge_update_dca(&mgp->ss[i]); in myri10ge_setup_dca()
1307 myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum) in myri10ge_rx_done() argument
1309 struct myri10ge_priv *mgp = ss->mgp; in myri10ge_rx_done()
1319 rx = &ss->rx_small; in myri10ge_rx_done()
1322 rx = &ss->rx_big; in myri10ge_rx_done()
1331 skb = napi_get_frags(&ss->napi); in myri10ge_rx_done()
1333 ss->stats.rx_dropped++; in myri10ge_rx_done()
1369 skb_record_rx_queue(skb, ss - &mgp->ss[0]); in myri10ge_rx_done()
1371 napi_gro_frags(&ss->napi); in myri10ge_rx_done()
1377 myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index) in myri10ge_tx_done() argument
1379 struct pci_dev *pdev = ss->mgp->pdev; in myri10ge_tx_done()
1380 struct myri10ge_tx_buf *tx = &ss->tx; in myri10ge_tx_done()
1399 ss->stats.tx_bytes += skb->len; in myri10ge_tx_done()
1400 ss->stats.tx_packets++; in myri10ge_tx_done()
1416 dev_queue = netdev_get_tx_queue(ss->dev, ss - ss->mgp->ss); in myri10ge_tx_done()
1426 if ((ss->mgp->dev->real_num_tx_queues > 1) && in myri10ge_tx_done()
1439 ss->mgp->running == MYRI10GE_ETH_RUNNING) { in myri10ge_tx_done()
1446 myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget) in myri10ge_clean_rx_done() argument
1448 struct myri10ge_rx_done *rx_done = &ss->rx_done; in myri10ge_clean_rx_done()
1449 struct myri10ge_priv *mgp = ss->mgp; in myri10ge_clean_rx_done()
1463 rx_ok = myri10ge_rx_done(ss, length, checksum); in myri10ge_clean_rx_done()
1472 ss->stats.rx_packets += rx_packets; in myri10ge_clean_rx_done()
1473 ss->stats.rx_bytes += rx_bytes; in myri10ge_clean_rx_done()
1476 if (ss->rx_small.fill_cnt - ss->rx_small.cnt < myri10ge_fill_thresh) in myri10ge_clean_rx_done()
1477 myri10ge_alloc_rx_pages(mgp, &ss->rx_small, in myri10ge_clean_rx_done()
1479 if (ss->rx_big.fill_cnt - ss->rx_big.cnt < myri10ge_fill_thresh) in myri10ge_clean_rx_done()
1480 myri10ge_alloc_rx_pages(mgp, &ss->rx_big, mgp->big_bytes, 0); in myri10ge_clean_rx_done()
1487 struct mcp_irq_data *stats = mgp->ss[0].fw_stats; in myri10ge_check_statblock()
1522 struct myri10ge_slice_state *ss = in myri10ge_poll() local
1527 if (ss->mgp->dca_enabled) in myri10ge_poll()
1528 myri10ge_update_dca(ss); in myri10ge_poll()
1531 work_done = myri10ge_clean_rx_done(ss, budget); in myri10ge_poll()
1535 put_be32(htonl(3), ss->irq_claim); in myri10ge_poll()
1542 struct myri10ge_slice_state *ss = arg; in myri10ge_intr() local
1543 struct myri10ge_priv *mgp = ss->mgp; in myri10ge_intr()
1544 struct mcp_irq_data *stats = ss->fw_stats; in myri10ge_intr()
1545 struct myri10ge_tx_buf *tx = &ss->tx; in myri10ge_intr()
1551 if ((mgp->dev->real_num_tx_queues == 1) && (ss != mgp->ss)) { in myri10ge_intr()
1552 napi_schedule(&ss->napi); in myri10ge_intr()
1563 napi_schedule(&ss->napi); in myri10ge_intr()
1580 myri10ge_tx_done(ss, (int)send_done_count); in myri10ge_intr()
1593 if (ss == mgp->ss) in myri10ge_intr()
1596 put_be32(htonl(3), ss->irq_claim + 1); in myri10ge_intr()
1713 ring->rx_mini_max_pending = mgp->ss[0].rx_small.mask + 1; in myri10ge_get_ringparam()
1714 ring->rx_max_pending = mgp->ss[0].rx_big.mask + 1; in myri10ge_get_ringparam()
1716 ring->tx_max_pending = mgp->ss[0].tx.mask + 1; in myri10ge_get_ringparam()
1794 struct myri10ge_slice_state *ss; in myri10ge_get_ethtool_stats() local
1815 data[i++] = (unsigned int)(mgp->ss[0].dca_tag != NULL); in myri10ge_get_ethtool_stats()
1821 ss = &mgp->ss[0]; in myri10ge_get_ethtool_stats()
1822 data[i++] = (unsigned int)ntohl(ss->fw_stats->link_up); in myri10ge_get_ethtool_stats()
1823 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_link_overflow); in myri10ge_get_ethtool_stats()
1825 (unsigned int)ntohl(ss->fw_stats->dropped_link_error_or_filtered); in myri10ge_get_ethtool_stats()
1826 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_pause); in myri10ge_get_ethtool_stats()
1827 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_bad_phy); in myri10ge_get_ethtool_stats()
1828 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_bad_crc32); in myri10ge_get_ethtool_stats()
1829 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_unicast_filtered); in myri10ge_get_ethtool_stats()
1831 (unsigned int)ntohl(ss->fw_stats->dropped_multicast_filtered); in myri10ge_get_ethtool_stats()
1832 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_runt); in myri10ge_get_ethtool_stats()
1833 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_overrun); in myri10ge_get_ethtool_stats()
1834 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_no_small_buffer); in myri10ge_get_ethtool_stats()
1835 data[i++] = (unsigned int)ntohl(ss->fw_stats->dropped_no_big_buffer); in myri10ge_get_ethtool_stats()
1838 ss = &mgp->ss[slice]; in myri10ge_get_ethtool_stats()
1840 data[i++] = (unsigned int)ss->tx.pkt_start; in myri10ge_get_ethtool_stats()
1841 data[i++] = (unsigned int)ss->tx.pkt_done; in myri10ge_get_ethtool_stats()
1842 data[i++] = (unsigned int)ss->tx.req; in myri10ge_get_ethtool_stats()
1843 data[i++] = (unsigned int)ss->tx.done; in myri10ge_get_ethtool_stats()
1844 data[i++] = (unsigned int)ss->rx_small.cnt; in myri10ge_get_ethtool_stats()
1845 data[i++] = (unsigned int)ss->rx_big.cnt; in myri10ge_get_ethtool_stats()
1846 data[i++] = (unsigned int)ss->tx.wake_queue; in myri10ge_get_ethtool_stats()
1847 data[i++] = (unsigned int)ss->tx.stop_queue; in myri10ge_get_ethtool_stats()
1848 data[i++] = (unsigned int)ss->tx.linearized; in myri10ge_get_ethtool_stats()
1936 static int myri10ge_allocate_rings(struct myri10ge_slice_state *ss) in myri10ge_allocate_rings() argument
1938 struct myri10ge_priv *mgp = ss->mgp; in myri10ge_allocate_rings()
1947 slice = ss - mgp->ss; in myri10ge_allocate_rings()
1959 ss->tx.mask = tx_ring_entries - 1; in myri10ge_allocate_rings()
1960 ss->rx_small.mask = ss->rx_big.mask = rx_ring_entries - 1; in myri10ge_allocate_rings()
1967 * sizeof(*ss->tx.req_list); in myri10ge_allocate_rings()
1968 ss->tx.req_bytes = kzalloc(bytes, GFP_KERNEL); in myri10ge_allocate_rings()
1969 if (ss->tx.req_bytes == NULL) in myri10ge_allocate_rings()
1973 ss->tx.req_list = (struct mcp_kreq_ether_send *) in myri10ge_allocate_rings()
1974 ALIGN((unsigned long)ss->tx.req_bytes, 8); in myri10ge_allocate_rings()
1975 ss->tx.queue_active = 0; in myri10ge_allocate_rings()
1977 bytes = rx_ring_entries * sizeof(*ss->rx_small.shadow); in myri10ge_allocate_rings()
1978 ss->rx_small.shadow = kzalloc(bytes, GFP_KERNEL); in myri10ge_allocate_rings()
1979 if (ss->rx_small.shadow == NULL) in myri10ge_allocate_rings()
1982 bytes = rx_ring_entries * sizeof(*ss->rx_big.shadow); in myri10ge_allocate_rings()
1983 ss->rx_big.shadow = kzalloc(bytes, GFP_KERNEL); in myri10ge_allocate_rings()
1984 if (ss->rx_big.shadow == NULL) in myri10ge_allocate_rings()
1989 bytes = tx_ring_entries * sizeof(*ss->tx.info); in myri10ge_allocate_rings()
1990 ss->tx.info = kzalloc(bytes, GFP_KERNEL); in myri10ge_allocate_rings()
1991 if (ss->tx.info == NULL) in myri10ge_allocate_rings()
1994 bytes = rx_ring_entries * sizeof(*ss->rx_small.info); in myri10ge_allocate_rings()
1995 ss->rx_small.info = kzalloc(bytes, GFP_KERNEL); in myri10ge_allocate_rings()
1996 if (ss->rx_small.info == NULL) in myri10ge_allocate_rings()
1999 bytes = rx_ring_entries * sizeof(*ss->rx_big.info); in myri10ge_allocate_rings()
2000 ss->rx_big.info = kzalloc(bytes, GFP_KERNEL); in myri10ge_allocate_rings()
2001 if (ss->rx_big.info == NULL) in myri10ge_allocate_rings()
2005 ss->rx_big.cnt = 0; in myri10ge_allocate_rings()
2006 ss->rx_small.cnt = 0; in myri10ge_allocate_rings()
2007 ss->rx_big.fill_cnt = 0; in myri10ge_allocate_rings()
2008 ss->rx_small.fill_cnt = 0; in myri10ge_allocate_rings()
2009 ss->rx_small.page_offset = MYRI10GE_ALLOC_SIZE; in myri10ge_allocate_rings()
2010 ss->rx_big.page_offset = MYRI10GE_ALLOC_SIZE; in myri10ge_allocate_rings()
2011 ss->rx_small.watchdog_needed = 0; in myri10ge_allocate_rings()
2012 ss->rx_big.watchdog_needed = 0; in myri10ge_allocate_rings()
2014 ss->rx_small.fill_cnt = ss->rx_small.mask + 1; in myri10ge_allocate_rings()
2016 myri10ge_alloc_rx_pages(mgp, &ss->rx_small, in myri10ge_allocate_rings()
2020 if (ss->rx_small.fill_cnt < ss->rx_small.mask + 1) { in myri10ge_allocate_rings()
2022 slice, ss->rx_small.fill_cnt); in myri10ge_allocate_rings()
2026 myri10ge_alloc_rx_pages(mgp, &ss->rx_big, mgp->big_bytes, 0); in myri10ge_allocate_rings()
2027 if (ss->rx_big.fill_cnt < ss->rx_big.mask + 1) { in myri10ge_allocate_rings()
2029 slice, ss->rx_big.fill_cnt); in myri10ge_allocate_rings()
2036 for (i = ss->rx_big.cnt; i < ss->rx_big.fill_cnt; i++) { in myri10ge_allocate_rings()
2037 int idx = i & ss->rx_big.mask; in myri10ge_allocate_rings()
2038 myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_big.info[idx], in myri10ge_allocate_rings()
2040 put_page(ss->rx_big.info[idx].page); in myri10ge_allocate_rings()
2045 ss->rx_small.fill_cnt = ss->rx_small.cnt; in myri10ge_allocate_rings()
2046 for (i = ss->rx_small.cnt; i < ss->rx_small.fill_cnt; i++) { in myri10ge_allocate_rings()
2047 int idx = i & ss->rx_small.mask; in myri10ge_allocate_rings()
2048 myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_small.info[idx], in myri10ge_allocate_rings()
2050 put_page(ss->rx_small.info[idx].page); in myri10ge_allocate_rings()
2053 kfree(ss->rx_big.info); in myri10ge_allocate_rings()
2056 kfree(ss->rx_small.info); in myri10ge_allocate_rings()
2059 kfree(ss->tx.info); in myri10ge_allocate_rings()
2062 kfree(ss->rx_big.shadow); in myri10ge_allocate_rings()
2065 kfree(ss->rx_small.shadow); in myri10ge_allocate_rings()
2068 kfree(ss->tx.req_bytes); in myri10ge_allocate_rings()
2069 ss->tx.req_bytes = NULL; in myri10ge_allocate_rings()
2070 ss->tx.req_list = NULL; in myri10ge_allocate_rings()
2076 static void myri10ge_free_rings(struct myri10ge_slice_state *ss) in myri10ge_free_rings() argument
2078 struct myri10ge_priv *mgp = ss->mgp; in myri10ge_free_rings()
2084 if (ss->tx.req_list == NULL) in myri10ge_free_rings()
2087 for (i = ss->rx_big.cnt; i < ss->rx_big.fill_cnt; i++) { in myri10ge_free_rings()
2088 idx = i & ss->rx_big.mask; in myri10ge_free_rings()
2089 if (i == ss->rx_big.fill_cnt - 1) in myri10ge_free_rings()
2090 ss->rx_big.info[idx].page_offset = MYRI10GE_ALLOC_SIZE; in myri10ge_free_rings()
2091 myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_big.info[idx], in myri10ge_free_rings()
2093 put_page(ss->rx_big.info[idx].page); in myri10ge_free_rings()
2097 ss->rx_small.fill_cnt = ss->rx_small.cnt; in myri10ge_free_rings()
2098 for (i = ss->rx_small.cnt; i < ss->rx_small.fill_cnt; i++) { in myri10ge_free_rings()
2099 idx = i & ss->rx_small.mask; in myri10ge_free_rings()
2100 if (i == ss->rx_small.fill_cnt - 1) in myri10ge_free_rings()
2101 ss->rx_small.info[idx].page_offset = in myri10ge_free_rings()
2103 myri10ge_unmap_rx_page(mgp->pdev, &ss->rx_small.info[idx], in myri10ge_free_rings()
2105 put_page(ss->rx_small.info[idx].page); in myri10ge_free_rings()
2107 tx = &ss->tx; in myri10ge_free_rings()
2118 ss->stats.tx_dropped++; in myri10ge_free_rings()
2133 kfree(ss->rx_big.info); in myri10ge_free_rings()
2135 kfree(ss->rx_small.info); in myri10ge_free_rings()
2137 kfree(ss->tx.info); in myri10ge_free_rings()
2139 kfree(ss->rx_big.shadow); in myri10ge_free_rings()
2141 kfree(ss->rx_small.shadow); in myri10ge_free_rings()
2143 kfree(ss->tx.req_bytes); in myri10ge_free_rings()
2144 ss->tx.req_bytes = NULL; in myri10ge_free_rings()
2145 ss->tx.req_list = NULL; in myri10ge_free_rings()
2151 struct myri10ge_slice_state *ss; in myri10ge_request_irq() local
2183 ss = &mgp->ss[i]; in myri10ge_request_irq()
2184 snprintf(ss->irq_desc, sizeof(ss->irq_desc), in myri10ge_request_irq()
2187 myri10ge_intr, 0, ss->irq_desc, in myri10ge_request_irq()
2188 ss); in myri10ge_request_irq()
2195 &mgp->ss[i]); in myri10ge_request_irq()
2204 mgp->dev->name, &mgp->ss[0]); in myri10ge_request_irq()
2221 free_irq(mgp->msix_vectors[i].vector, &mgp->ss[i]); in myri10ge_free_irq()
2223 free_irq(pdev->irq, &mgp->ss[0]); in myri10ge_free_irq()
2234 struct myri10ge_slice_state *ss; in myri10ge_get_txrx() local
2237 ss = &mgp->ss[slice]; in myri10ge_get_txrx()
2243 ss->tx.lanai = (struct mcp_kreq_ether_send __iomem *) in myri10ge_get_txrx()
2249 ss->rx_small.lanai = (struct mcp_kreq_ether_recv __iomem *) in myri10ge_get_txrx()
2254 ss->rx_big.lanai = (struct mcp_kreq_ether_recv __iomem *) in myri10ge_get_txrx()
2257 ss->tx.send_go = (__iomem __be32 *) in myri10ge_get_txrx()
2259 ss->tx.send_stop = (__iomem __be32 *) in myri10ge_get_txrx()
2268 struct myri10ge_slice_state *ss; in myri10ge_set_stats() local
2271 ss = &mgp->ss[slice]; in myri10ge_set_stats()
2272 cmd.data0 = MYRI10GE_LOWPART_TO_U32(ss->fw_stats_bus); in myri10ge_set_stats()
2273 cmd.data1 = MYRI10GE_HIGHPART_TO_U32(ss->fw_stats_bus); in myri10ge_set_stats()
2277 dma_addr_t bus = ss->fw_stats_bus; in myri10ge_set_stats()
2296 struct myri10ge_slice_state *ss; in myri10ge_open() local
2390 ss = &mgp->ss[slice]; in myri10ge_open()
2397 status = myri10ge_allocate_rings(ss); in myri10ge_open()
2412 napi_enable(&(ss)->napi); in myri10ge_open()
2460 napi_disable(&mgp->ss[slice].napi); in myri10ge_open()
2463 myri10ge_free_rings(&mgp->ss[i]); in myri10ge_open()
2482 if (mgp->ss[0].tx.req_bytes == NULL) in myri10ge_close()
2488 napi_disable(&mgp->ss[i].napi); in myri10ge_close()
2509 myri10ge_free_rings(&mgp->ss[i]); in myri10ge_close()
2625 struct myri10ge_slice_state *ss; in myri10ge_xmit() local
2640 ss = &mgp->ss[queue]; in myri10ge_xmit()
2642 tx = &ss->tx; in myri10ge_xmit()
2719 ss->stats.tx_dropped += 1; in myri10ge_xmit()
2884 ss->stats.tx_dropped += 1; in myri10ge_xmit()
2894 struct myri10ge_slice_state *ss; in myri10ge_sw_tso() local
2917 ss = &mgp->ss[skb_get_queue_mapping(skb)]; in myri10ge_sw_tso()
2919 ss->stats.tx_dropped += 1; in myri10ge_sw_tso()
2931 slice_stats = &mgp->ss[i].stats; in myri10ge_get_stats()
3342 myri10ge_check_slice(struct myri10ge_slice_state *ss, int *reset_needed, in myri10ge_check_slice() argument
3345 struct myri10ge_priv *mgp = ss->mgp; in myri10ge_check_slice()
3346 int slice = ss - mgp->ss; in myri10ge_check_slice()
3348 if (ss->tx.req != ss->tx.done && in myri10ge_check_slice()
3349 ss->tx.done == ss->watchdog_tx_done && in myri10ge_check_slice()
3350 ss->watchdog_tx_req != ss->watchdog_tx_done) { in myri10ge_check_slice()
3359 slice, ss->tx.queue_active, ss->tx.req, in myri10ge_check_slice()
3360 ss->tx.done, ss->tx.pkt_start, in myri10ge_check_slice()
3361 ss->tx.pkt_done, in myri10ge_check_slice()
3362 (int)ntohl(mgp->ss[slice].fw_stats-> in myri10ge_check_slice()
3365 ss->stuck = 1; in myri10ge_check_slice()
3368 if (ss->watchdog_tx_done != ss->tx.done || in myri10ge_check_slice()
3369 ss->watchdog_rx_done != ss->rx_done.cnt) { in myri10ge_check_slice()
3372 ss->watchdog_tx_done = ss->tx.done; in myri10ge_check_slice()
3373 ss->watchdog_tx_req = ss->tx.req; in myri10ge_check_slice()
3374 ss->watchdog_rx_done = ss->rx_done.cnt; in myri10ge_check_slice()
3385 struct myri10ge_slice_state *ss; in myri10ge_watchdog() local
3436 rx_pause_cnt = ntohl(mgp->ss[0].fw_stats->dropped_pause); in myri10ge_watchdog()
3438 ss = mgp->ss; in myri10ge_watchdog()
3439 if (ss->stuck) { in myri10ge_watchdog()
3440 myri10ge_check_slice(ss, &reset_needed, in myri10ge_watchdog()
3443 ss->stuck = 0; in myri10ge_watchdog()
3476 struct myri10ge_slice_state *ss; in myri10ge_watchdog_timer() local
3483 rx_pause_cnt = ntohl(mgp->ss[0].fw_stats->dropped_pause); in myri10ge_watchdog_timer()
3488 ss = &mgp->ss[i]; in myri10ge_watchdog_timer()
3489 if (ss->rx_small.watchdog_needed) { in myri10ge_watchdog_timer()
3490 myri10ge_alloc_rx_pages(mgp, &ss->rx_small, in myri10ge_watchdog_timer()
3493 if (ss->rx_small.fill_cnt - ss->rx_small.cnt >= in myri10ge_watchdog_timer()
3495 ss->rx_small.watchdog_needed = 0; in myri10ge_watchdog_timer()
3497 if (ss->rx_big.watchdog_needed) { in myri10ge_watchdog_timer()
3498 myri10ge_alloc_rx_pages(mgp, &ss->rx_big, in myri10ge_watchdog_timer()
3500 if (ss->rx_big.fill_cnt - ss->rx_big.cnt >= in myri10ge_watchdog_timer()
3502 ss->rx_big.watchdog_needed = 0; in myri10ge_watchdog_timer()
3504 myri10ge_check_slice(ss, &reset_needed, &busy_slice_cnt, in myri10ge_watchdog_timer()
3529 struct myri10ge_slice_state *ss; in myri10ge_free_slices() local
3534 if (mgp->ss == NULL) in myri10ge_free_slices()
3538 ss = &mgp->ss[i]; in myri10ge_free_slices()
3539 if (ss->rx_done.entry != NULL) { in myri10ge_free_slices()
3541 sizeof(*ss->rx_done.entry); in myri10ge_free_slices()
3543 ss->rx_done.entry, ss->rx_done.bus); in myri10ge_free_slices()
3544 ss->rx_done.entry = NULL; in myri10ge_free_slices()
3546 if (ss->fw_stats != NULL) { in myri10ge_free_slices()
3547 bytes = sizeof(*ss->fw_stats); in myri10ge_free_slices()
3549 ss->fw_stats, ss->fw_stats_bus); in myri10ge_free_slices()
3550 ss->fw_stats = NULL; in myri10ge_free_slices()
3552 __netif_napi_del(&ss->napi); in myri10ge_free_slices()
3556 kfree(mgp->ss); in myri10ge_free_slices()
3557 mgp->ss = NULL; in myri10ge_free_slices()
3562 struct myri10ge_slice_state *ss; in myri10ge_alloc_slices() local
3567 bytes = sizeof(*mgp->ss) * mgp->num_slices; in myri10ge_alloc_slices()
3568 mgp->ss = kzalloc(bytes, GFP_KERNEL); in myri10ge_alloc_slices()
3569 if (mgp->ss == NULL) { in myri10ge_alloc_slices()
3574 ss = &mgp->ss[i]; in myri10ge_alloc_slices()
3575 bytes = mgp->max_intr_slots * sizeof(*ss->rx_done.entry); in myri10ge_alloc_slices()
3576 ss->rx_done.entry = dma_alloc_coherent(&pdev->dev, bytes, in myri10ge_alloc_slices()
3577 &ss->rx_done.bus, in myri10ge_alloc_slices()
3579 if (ss->rx_done.entry == NULL) in myri10ge_alloc_slices()
3581 bytes = sizeof(*ss->fw_stats); in myri10ge_alloc_slices()
3582 ss->fw_stats = dma_alloc_coherent(&pdev->dev, bytes, in myri10ge_alloc_slices()
3583 &ss->fw_stats_bus, in myri10ge_alloc_slices()
3585 if (ss->fw_stats == NULL) in myri10ge_alloc_slices()
3587 ss->mgp = mgp; in myri10ge_alloc_slices()
3588 ss->dev = mgp->dev; in myri10ge_alloc_slices()
3589 netif_napi_add_weight(ss->dev, &ss->napi, myri10ge_poll, in myri10ge_alloc_slices()