nic.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /****************************************************************************
  3. * Driver for Solarflare network controllers and boards
  4. * Copyright 2005-2006 Fen Systems Ltd.
  5. * Copyright 2006-2013 Solarflare Communications Inc.
  6. */
  7. #include <linux/bitops.h>
  8. #include <linux/delay.h>
  9. #include <linux/interrupt.h>
  10. #include <linux/pci.h>
  11. #include <linux/module.h>
  12. #include <linux/seq_file.h>
  13. #include <linux/cpu_rmap.h>
  14. #include "net_driver.h"
  15. #include "bitfield.h"
  16. #include "efx.h"
  17. #include "nic.h"
  18. #include "farch_regs.h"
  19. #include "io.h"
  20. #include "workarounds.h"
  21. /**************************************************************************
  22. *
  23. * Generic buffer handling
  24. * These buffers are used for interrupt status, MAC stats, etc.
  25. *
  26. **************************************************************************/
  27. int ef4_nic_alloc_buffer(struct ef4_nic *efx, struct ef4_buffer *buffer,
  28. unsigned int len, gfp_t gfp_flags)
  29. {
  30. buffer->addr = dma_alloc_coherent(&efx->pci_dev->dev, len,
  31. &buffer->dma_addr, gfp_flags);
  32. if (!buffer->addr)
  33. return -ENOMEM;
  34. buffer->len = len;
  35. return 0;
  36. }
  37. void ef4_nic_free_buffer(struct ef4_nic *efx, struct ef4_buffer *buffer)
  38. {
  39. if (buffer->addr) {
  40. dma_free_coherent(&efx->pci_dev->dev, buffer->len,
  41. buffer->addr, buffer->dma_addr);
  42. buffer->addr = NULL;
  43. }
  44. }
  45. /* Check whether an event is present in the eventq at the current
  46. * read pointer. Only useful for self-test.
  47. */
  48. bool ef4_nic_event_present(struct ef4_channel *channel)
  49. {
  50. return ef4_event_present(ef4_event(channel, channel->eventq_read_ptr));
  51. }
  52. void ef4_nic_event_test_start(struct ef4_channel *channel)
  53. {
  54. channel->event_test_cpu = -1;
  55. smp_wmb();
  56. channel->efx->type->ev_test_generate(channel);
  57. }
  58. int ef4_nic_irq_test_start(struct ef4_nic *efx)
  59. {
  60. efx->last_irq_cpu = -1;
  61. smp_wmb();
  62. return efx->type->irq_test_generate(efx);
  63. }
  64. /* Hook interrupt handler(s)
  65. * Try MSI and then legacy interrupts.
  66. */
  67. int ef4_nic_init_interrupt(struct ef4_nic *efx)
  68. {
  69. struct ef4_channel *channel;
  70. unsigned int n_irqs;
  71. int rc;
  72. if (!EF4_INT_MODE_USE_MSI(efx)) {
  73. rc = request_irq(efx->legacy_irq,
  74. efx->type->irq_handle_legacy, IRQF_SHARED,
  75. efx->name, efx);
  76. if (rc) {
  77. netif_err(efx, drv, efx->net_dev,
  78. "failed to hook legacy IRQ %d\n",
  79. efx->pci_dev->irq);
  80. goto fail1;
  81. }
  82. return 0;
  83. }
  84. #ifdef CONFIG_RFS_ACCEL
  85. if (efx->interrupt_mode == EF4_INT_MODE_MSIX) {
  86. efx->net_dev->rx_cpu_rmap =
  87. alloc_irq_cpu_rmap(efx->n_rx_channels);
  88. if (!efx->net_dev->rx_cpu_rmap) {
  89. rc = -ENOMEM;
  90. goto fail1;
  91. }
  92. }
  93. #endif
  94. /* Hook MSI or MSI-X interrupt */
  95. n_irqs = 0;
  96. ef4_for_each_channel(channel, efx) {
  97. rc = request_irq(channel->irq, efx->type->irq_handle_msi,
  98. IRQF_PROBE_SHARED, /* Not shared */
  99. efx->msi_context[channel->channel].name,
  100. &efx->msi_context[channel->channel]);
  101. if (rc) {
  102. netif_err(efx, drv, efx->net_dev,
  103. "failed to hook IRQ %d\n", channel->irq);
  104. goto fail2;
  105. }
  106. ++n_irqs;
  107. #ifdef CONFIG_RFS_ACCEL
  108. if (efx->interrupt_mode == EF4_INT_MODE_MSIX &&
  109. channel->channel < efx->n_rx_channels) {
  110. rc = irq_cpu_rmap_add(efx->net_dev->rx_cpu_rmap,
  111. channel->irq);
  112. if (rc)
  113. goto fail2;
  114. }
  115. #endif
  116. }
  117. return 0;
  118. fail2:
  119. #ifdef CONFIG_RFS_ACCEL
  120. free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap);
  121. efx->net_dev->rx_cpu_rmap = NULL;
  122. #endif
  123. ef4_for_each_channel(channel, efx) {
  124. if (n_irqs-- == 0)
  125. break;
  126. free_irq(channel->irq, &efx->msi_context[channel->channel]);
  127. }
  128. fail1:
  129. return rc;
  130. }
  131. void ef4_nic_fini_interrupt(struct ef4_nic *efx)
  132. {
  133. struct ef4_channel *channel;
  134. #ifdef CONFIG_RFS_ACCEL
  135. free_irq_cpu_rmap(efx->net_dev->rx_cpu_rmap);
  136. efx->net_dev->rx_cpu_rmap = NULL;
  137. #endif
  138. if (EF4_INT_MODE_USE_MSI(efx)) {
  139. /* Disable MSI/MSI-X interrupts */
  140. ef4_for_each_channel(channel, efx)
  141. free_irq(channel->irq,
  142. &efx->msi_context[channel->channel]);
  143. } else {
  144. /* Disable legacy interrupt */
  145. free_irq(efx->legacy_irq, efx);
  146. }
  147. }
  148. /* Register dump */
  149. #define REGISTER_REVISION_FA 1
  150. #define REGISTER_REVISION_FB 2
  151. #define REGISTER_REVISION_FC 3
  152. #define REGISTER_REVISION_FZ 3 /* last Falcon arch revision */
  153. #define REGISTER_REVISION_ED 4
  154. #define REGISTER_REVISION_EZ 4 /* latest EF10 revision */
  155. struct ef4_nic_reg {
  156. u32 offset:24;
  157. u32 min_revision:3, max_revision:3;
  158. };
  159. #define REGISTER(name, arch, min_rev, max_rev) { \
  160. arch ## R_ ## min_rev ## max_rev ## _ ## name, \
  161. REGISTER_REVISION_ ## arch ## min_rev, \
  162. REGISTER_REVISION_ ## arch ## max_rev \
  163. }
  164. #define REGISTER_AA(name) REGISTER(name, F, A, A)
  165. #define REGISTER_AB(name) REGISTER(name, F, A, B)
  166. #define REGISTER_AZ(name) REGISTER(name, F, A, Z)
  167. #define REGISTER_BB(name) REGISTER(name, F, B, B)
  168. #define REGISTER_BZ(name) REGISTER(name, F, B, Z)
  169. #define REGISTER_CZ(name) REGISTER(name, F, C, Z)
  170. static const struct ef4_nic_reg ef4_nic_regs[] = {
  171. REGISTER_AZ(ADR_REGION),
  172. REGISTER_AZ(INT_EN_KER),
  173. REGISTER_BZ(INT_EN_CHAR),
  174. REGISTER_AZ(INT_ADR_KER),
  175. REGISTER_BZ(INT_ADR_CHAR),
  176. /* INT_ACK_KER is WO */
  177. /* INT_ISR0 is RC */
  178. REGISTER_AZ(HW_INIT),
  179. REGISTER_CZ(USR_EV_CFG),
  180. REGISTER_AB(EE_SPI_HCMD),
  181. REGISTER_AB(EE_SPI_HADR),
  182. REGISTER_AB(EE_SPI_HDATA),
  183. REGISTER_AB(EE_BASE_PAGE),
  184. REGISTER_AB(EE_VPD_CFG0),
  185. /* EE_VPD_SW_CNTL and EE_VPD_SW_DATA are not used */
  186. /* PMBX_DBG_IADDR and PBMX_DBG_IDATA are indirect */
  187. /* PCIE_CORE_INDIRECT is indirect */
  188. REGISTER_AB(NIC_STAT),
  189. REGISTER_AB(GPIO_CTL),
  190. REGISTER_AB(GLB_CTL),
  191. /* FATAL_INTR_KER and FATAL_INTR_CHAR are partly RC */
  192. REGISTER_BZ(DP_CTRL),
  193. REGISTER_AZ(MEM_STAT),
  194. REGISTER_AZ(CS_DEBUG),
  195. REGISTER_AZ(ALTERA_BUILD),
  196. REGISTER_AZ(CSR_SPARE),
  197. REGISTER_AB(PCIE_SD_CTL0123),
  198. REGISTER_AB(PCIE_SD_CTL45),
  199. REGISTER_AB(PCIE_PCS_CTL_STAT),
  200. /* DEBUG_DATA_OUT is not used */
  201. /* DRV_EV is WO */
  202. REGISTER_AZ(EVQ_CTL),
  203. REGISTER_AZ(EVQ_CNT1),
  204. REGISTER_AZ(EVQ_CNT2),
  205. REGISTER_AZ(BUF_TBL_CFG),
  206. REGISTER_AZ(SRM_RX_DC_CFG),
  207. REGISTER_AZ(SRM_TX_DC_CFG),
  208. REGISTER_AZ(SRM_CFG),
  209. /* BUF_TBL_UPD is WO */
  210. REGISTER_AZ(SRM_UPD_EVQ),
  211. REGISTER_AZ(SRAM_PARITY),
  212. REGISTER_AZ(RX_CFG),
  213. REGISTER_BZ(RX_FILTER_CTL),
  214. /* RX_FLUSH_DESCQ is WO */
  215. REGISTER_AZ(RX_DC_CFG),
  216. REGISTER_AZ(RX_DC_PF_WM),
  217. REGISTER_BZ(RX_RSS_TKEY),
  218. /* RX_NODESC_DROP is RC */
  219. REGISTER_AA(RX_SELF_RST),
  220. /* RX_DEBUG, RX_PUSH_DROP are not used */
  221. REGISTER_CZ(RX_RSS_IPV6_REG1),
  222. REGISTER_CZ(RX_RSS_IPV6_REG2),
  223. REGISTER_CZ(RX_RSS_IPV6_REG3),
  224. /* TX_FLUSH_DESCQ is WO */
  225. REGISTER_AZ(TX_DC_CFG),
  226. REGISTER_AA(TX_CHKSM_CFG),
  227. REGISTER_AZ(TX_CFG),
  228. /* TX_PUSH_DROP is not used */
  229. REGISTER_AZ(TX_RESERVED),
  230. REGISTER_BZ(TX_PACE),
  231. /* TX_PACE_DROP_QID is RC */
  232. REGISTER_BB(TX_VLAN),
  233. REGISTER_BZ(TX_IPFIL_PORTEN),
  234. REGISTER_AB(MD_TXD),
  235. REGISTER_AB(MD_RXD),
  236. REGISTER_AB(MD_CS),
  237. REGISTER_AB(MD_PHY_ADR),
  238. REGISTER_AB(MD_ID),
  239. /* MD_STAT is RC */
  240. REGISTER_AB(MAC_STAT_DMA),
  241. REGISTER_AB(MAC_CTRL),
  242. REGISTER_BB(GEN_MODE),
  243. REGISTER_AB(MAC_MC_HASH_REG0),
  244. REGISTER_AB(MAC_MC_HASH_REG1),
  245. REGISTER_AB(GM_CFG1),
  246. REGISTER_AB(GM_CFG2),
  247. /* GM_IPG and GM_HD are not used */
  248. REGISTER_AB(GM_MAX_FLEN),
  249. /* GM_TEST is not used */
  250. REGISTER_AB(GM_ADR1),
  251. REGISTER_AB(GM_ADR2),
  252. REGISTER_AB(GMF_CFG0),
  253. REGISTER_AB(GMF_CFG1),
  254. REGISTER_AB(GMF_CFG2),
  255. REGISTER_AB(GMF_CFG3),
  256. REGISTER_AB(GMF_CFG4),
  257. REGISTER_AB(GMF_CFG5),
  258. REGISTER_BB(TX_SRC_MAC_CTL),
  259. REGISTER_AB(XM_ADR_LO),
  260. REGISTER_AB(XM_ADR_HI),
  261. REGISTER_AB(XM_GLB_CFG),
  262. REGISTER_AB(XM_TX_CFG),
  263. REGISTER_AB(XM_RX_CFG),
  264. REGISTER_AB(XM_MGT_INT_MASK),
  265. REGISTER_AB(XM_FC),
  266. REGISTER_AB(XM_PAUSE_TIME),
  267. REGISTER_AB(XM_TX_PARAM),
  268. REGISTER_AB(XM_RX_PARAM),
  269. /* XM_MGT_INT_MSK (note no 'A') is RC */
  270. REGISTER_AB(XX_PWR_RST),
  271. REGISTER_AB(XX_SD_CTL),
  272. REGISTER_AB(XX_TXDRV_CTL),
  273. /* XX_PRBS_CTL, XX_PRBS_CHK and XX_PRBS_ERR are not used */
  274. /* XX_CORE_STAT is partly RC */
  275. };
  276. struct ef4_nic_reg_table {
  277. u32 offset:24;
  278. u32 min_revision:3, max_revision:3;
  279. u32 step:6, rows:21;
  280. };
  281. #define REGISTER_TABLE_DIMENSIONS(_, offset, arch, min_rev, max_rev, step, rows) { \
  282. offset, \
  283. REGISTER_REVISION_ ## arch ## min_rev, \
  284. REGISTER_REVISION_ ## arch ## max_rev, \
  285. step, rows \
  286. }
  287. #define REGISTER_TABLE(name, arch, min_rev, max_rev) \
  288. REGISTER_TABLE_DIMENSIONS( \
  289. name, arch ## R_ ## min_rev ## max_rev ## _ ## name, \
  290. arch, min_rev, max_rev, \
  291. arch ## R_ ## min_rev ## max_rev ## _ ## name ## _STEP, \
  292. arch ## R_ ## min_rev ## max_rev ## _ ## name ## _ROWS)
  293. #define REGISTER_TABLE_AA(name) REGISTER_TABLE(name, F, A, A)
  294. #define REGISTER_TABLE_AZ(name) REGISTER_TABLE(name, F, A, Z)
  295. #define REGISTER_TABLE_BB(name) REGISTER_TABLE(name, F, B, B)
  296. #define REGISTER_TABLE_BZ(name) REGISTER_TABLE(name, F, B, Z)
  297. #define REGISTER_TABLE_BB_CZ(name) \
  298. REGISTER_TABLE_DIMENSIONS(name, FR_BZ_ ## name, F, B, B, \
  299. FR_BZ_ ## name ## _STEP, \
  300. FR_BB_ ## name ## _ROWS), \
  301. REGISTER_TABLE_DIMENSIONS(name, FR_BZ_ ## name, F, C, Z, \
  302. FR_BZ_ ## name ## _STEP, \
  303. FR_CZ_ ## name ## _ROWS)
  304. #define REGISTER_TABLE_CZ(name) REGISTER_TABLE(name, F, C, Z)
  305. static const struct ef4_nic_reg_table ef4_nic_reg_tables[] = {
  306. /* DRIVER is not used */
  307. /* EVQ_RPTR, TIMER_COMMAND, USR_EV and {RX,TX}_DESC_UPD are WO */
  308. REGISTER_TABLE_BB(TX_IPFIL_TBL),
  309. REGISTER_TABLE_BB(TX_SRC_MAC_TBL),
  310. REGISTER_TABLE_AA(RX_DESC_PTR_TBL_KER),
  311. REGISTER_TABLE_BB_CZ(RX_DESC_PTR_TBL),
  312. REGISTER_TABLE_AA(TX_DESC_PTR_TBL_KER),
  313. REGISTER_TABLE_BB_CZ(TX_DESC_PTR_TBL),
  314. REGISTER_TABLE_AA(EVQ_PTR_TBL_KER),
  315. REGISTER_TABLE_BB_CZ(EVQ_PTR_TBL),
  316. /* We can't reasonably read all of the buffer table (up to 8MB!).
  317. * However this driver will only use a few entries. Reading
  318. * 1K entries allows for some expansion of queue count and
  319. * size before we need to change the version. */
  320. REGISTER_TABLE_DIMENSIONS(BUF_FULL_TBL_KER, FR_AA_BUF_FULL_TBL_KER,
  321. F, A, A, 8, 1024),
  322. REGISTER_TABLE_DIMENSIONS(BUF_FULL_TBL, FR_BZ_BUF_FULL_TBL,
  323. F, B, Z, 8, 1024),
  324. REGISTER_TABLE_CZ(RX_MAC_FILTER_TBL0),
  325. REGISTER_TABLE_BB_CZ(TIMER_TBL),
  326. REGISTER_TABLE_BB_CZ(TX_PACE_TBL),
  327. REGISTER_TABLE_BZ(RX_INDIRECTION_TBL),
  328. /* TX_FILTER_TBL0 is huge and not used by this driver */
  329. REGISTER_TABLE_CZ(TX_MAC_FILTER_TBL0),
  330. REGISTER_TABLE_CZ(MC_TREG_SMEM),
  331. /* MSIX_PBA_TABLE is not mapped */
  332. /* SRM_DBG is not mapped (and is redundant with BUF_FLL_TBL) */
  333. REGISTER_TABLE_BZ(RX_FILTER_TBL0),
  334. };
  335. size_t ef4_nic_get_regs_len(struct ef4_nic *efx)
  336. {
  337. const struct ef4_nic_reg *reg;
  338. const struct ef4_nic_reg_table *table;
  339. size_t len = 0;
  340. for (reg = ef4_nic_regs;
  341. reg < ef4_nic_regs + ARRAY_SIZE(ef4_nic_regs);
  342. reg++)
  343. if (efx->type->revision >= reg->min_revision &&
  344. efx->type->revision <= reg->max_revision)
  345. len += sizeof(ef4_oword_t);
  346. for (table = ef4_nic_reg_tables;
  347. table < ef4_nic_reg_tables + ARRAY_SIZE(ef4_nic_reg_tables);
  348. table++)
  349. if (efx->type->revision >= table->min_revision &&
  350. efx->type->revision <= table->max_revision)
  351. len += table->rows * min_t(size_t, table->step, 16);
  352. return len;
  353. }
  354. void ef4_nic_get_regs(struct ef4_nic *efx, void *buf)
  355. {
  356. const struct ef4_nic_reg *reg;
  357. const struct ef4_nic_reg_table *table;
  358. for (reg = ef4_nic_regs;
  359. reg < ef4_nic_regs + ARRAY_SIZE(ef4_nic_regs);
  360. reg++) {
  361. if (efx->type->revision >= reg->min_revision &&
  362. efx->type->revision <= reg->max_revision) {
  363. ef4_reado(efx, (ef4_oword_t *)buf, reg->offset);
  364. buf += sizeof(ef4_oword_t);
  365. }
  366. }
  367. for (table = ef4_nic_reg_tables;
  368. table < ef4_nic_reg_tables + ARRAY_SIZE(ef4_nic_reg_tables);
  369. table++) {
  370. size_t size, i;
  371. if (!(efx->type->revision >= table->min_revision &&
  372. efx->type->revision <= table->max_revision))
  373. continue;
  374. size = min_t(size_t, table->step, 16);
  375. for (i = 0; i < table->rows; i++) {
  376. switch (table->step) {
  377. case 4: /* 32-bit SRAM */
  378. ef4_readd(efx, buf, table->offset + 4 * i);
  379. break;
  380. case 8: /* 64-bit SRAM */
  381. ef4_sram_readq(efx,
  382. efx->membase + table->offset,
  383. buf, i);
  384. break;
  385. case 16: /* 128-bit-readable register */
  386. ef4_reado_table(efx, buf, table->offset, i);
  387. break;
  388. case 32: /* 128-bit register, interleaved */
  389. ef4_reado_table(efx, buf, table->offset, 2 * i);
  390. break;
  391. default:
  392. WARN_ON(1);
  393. return;
  394. }
  395. buf += size;
  396. }
  397. }
  398. }
  399. /**
  400. * ef4_nic_describe_stats - Describe supported statistics for ethtool
  401. * @desc: Array of &struct ef4_hw_stat_desc describing the statistics
  402. * @count: Length of the @desc array
  403. * @mask: Bitmask of which elements of @desc are enabled
  404. * @names: Buffer to copy names to, or %NULL. The names are copied
  405. * starting at intervals of %ETH_GSTRING_LEN bytes.
  406. *
  407. * Returns the number of visible statistics, i.e. the number of set
  408. * bits in the first @count bits of @mask for which a name is defined.
  409. */
  410. size_t ef4_nic_describe_stats(const struct ef4_hw_stat_desc *desc, size_t count,
  411. const unsigned long *mask, u8 *names)
  412. {
  413. size_t visible = 0;
  414. size_t index;
  415. for_each_set_bit(index, mask, count) {
  416. if (desc[index].name) {
  417. if (names) {
  418. strscpy(names, desc[index].name,
  419. ETH_GSTRING_LEN);
  420. names += ETH_GSTRING_LEN;
  421. }
  422. ++visible;
  423. }
  424. }
  425. return visible;
  426. }
  427. /**
  428. * ef4_nic_update_stats - Convert statistics DMA buffer to array of u64
  429. * @desc: Array of &struct ef4_hw_stat_desc describing the DMA buffer
  430. * layout. DMA widths of 0, 16, 32 and 64 are supported; where
  431. * the width is specified as 0 the corresponding element of
  432. * @stats is not updated.
  433. * @count: Length of the @desc array
  434. * @mask: Bitmask of which elements of @desc are enabled
  435. * @stats: Buffer to update with the converted statistics. The length
  436. * of this array must be at least @count.
  437. * @dma_buf: DMA buffer containing hardware statistics
  438. * @accumulate: If set, the converted values will be added rather than
  439. * directly stored to the corresponding elements of @stats
  440. */
  441. void ef4_nic_update_stats(const struct ef4_hw_stat_desc *desc, size_t count,
  442. const unsigned long *mask,
  443. u64 *stats, const void *dma_buf, bool accumulate)
  444. {
  445. size_t index;
  446. for_each_set_bit(index, mask, count) {
  447. if (desc[index].dma_width) {
  448. const void *addr = dma_buf + desc[index].offset;
  449. u64 val;
  450. switch (desc[index].dma_width) {
  451. case 16:
  452. val = le16_to_cpup((__le16 *)addr);
  453. break;
  454. case 32:
  455. val = le32_to_cpup((__le32 *)addr);
  456. break;
  457. case 64:
  458. val = le64_to_cpup((__le64 *)addr);
  459. break;
  460. default:
  461. WARN_ON(1);
  462. val = 0;
  463. break;
  464. }
  465. if (accumulate)
  466. stats[index] += val;
  467. else
  468. stats[index] = val;
  469. }
  470. }
  471. }
  472. void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *rx_nodesc_drops)
  473. {
  474. /* if down, or this is the first update after coming up */
  475. if (!(efx->net_dev->flags & IFF_UP) || !efx->rx_nodesc_drops_prev_state)
  476. efx->rx_nodesc_drops_while_down +=
  477. *rx_nodesc_drops - efx->rx_nodesc_drops_total;
  478. efx->rx_nodesc_drops_total = *rx_nodesc_drops;
  479. efx->rx_nodesc_drops_prev_state = !!(efx->net_dev->flags & IFF_UP);
  480. *rx_nodesc_drops -= efx->rx_nodesc_drops_while_down;
  481. }