Thread (22 messages) 22 messages, 4 authors, 2014-01-07

[net-next 01/15] i40e: Record dma buffer info for dummy packets

flat view
STALE4667d SUPERSEDED: 1 (0M)

From: Jeff Kirsher <hidden>
Date: 2014-01-06 12:30:39
Subsystem: intel ethernet drivers, networking drivers, the rest · Maintainers: Tony Nguyen, Przemek Kitszel, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Revision v1 of 227 in this series; 1 review trailer.

Revisions (227)
  1. v1
  2. v1
  3. v2 [diff vs current]
  4. v1
  5. v1
  6. v1
  7. v2 [diff vs current]
  8. v1
  9. v1
  10. v1
  11. v1
  12. v1
  13. v1
  14. v1
  15. v1
  16. v1
  17. v1
  18. v2 [diff vs current]
  19. v1
  20. v3 [diff vs current]
  21. v1
  22. v1
  23. v1
  24. v2 [diff vs current]
  25. v2 [diff vs current]
  26. v1
  27. v2 [diff vs current]
  28. v1
  29. v2 [diff vs current]
  30. v3 [diff vs current]
  31. v1
  32. v1
  33. v1
  34. v2 [diff vs current]
  35. v1
  36. v1
  37. v1
  38. v2 [diff vs current]
  39. v1
  40. v1
  41. v1
  42. v1
  43. v1
  44. v2 [diff vs current]
  45. v1
  46. v2 [diff vs current]
  47. v1
  48. v1
  49. v1
  50. v1
  51. v1
  52. v1
  53. v1
  54. v1
  55. v1
  56. v1
  57. v1
  58. v1
  59. v1
  60. v1
  61. v1
  62. v1
  63. v1
  64. v1
  65. v1
  66. v1
  67. v1
  68. v2 [diff vs current]
  69. v1
  70. v2 [diff vs current]
  71. v1
  72. v1
  73. v2 [diff vs current]
  74. v1
  75. v1
  76. v1
  77. v2 [diff vs current]
  78. v3 [diff vs current]
  79. v1
  80. v2 [diff vs current]
  81. v1
  82. v1
  83. v1
  84. v1
  85. v1
  86. v1
  87. v1
  88. v1
  89. v1
  90. v1
  91. v1
  92. v1
  93. v1
  94. v1
  95. v1
  96. v1
  97. v1
  98. v1
  99. v1
  100. v1
  101. v1
  102. v2 [diff vs current]
  103. v1
  104. v1
  105. v1
  106. v1
  107. v1
  108. v1
  109. v1
  110. v1
  111. v1
  112. v2 [diff vs current]
  113. v1
  114. v1
  115. v1
  116. v1
  117. v1
  118. v2 [diff vs current]
  119. v1
  120. v1
  121. v1
  122. v1
  123. v1
  124. v2 [diff vs current]
  125. v1
  126. v2 [diff vs current]
  127. v1
  128. v1
  129. v1
  130. v1
  131. v1
  132. v1
  133. v1
  134. v1
  135. v1
  136. v1
  137. v1
  138. v1
  139. v2 [diff vs current]
  140. v1
  141. v1
  142. v2 [diff vs current]
  143. v1
  144. v1
  145. v1
  146. v1
  147. v1
  148. v1
  149. v2 [diff vs current]
  150. v1
  151. v2 [diff vs current]
  152. v2 [diff vs current]
  153. v1
  154. v2 [diff vs current]
  155. v3 [diff vs current]
  156. v1
  157. v4 [diff vs current]
  158. v1
  159. v5 [diff vs current]
  160. v6 [diff vs current]
  161. v7 [diff vs current]
  162. v1
  163. v1
  164. v2 [diff vs current]
  165. v1
  166. v1
  167. v1
  168. v2 [diff vs current]
  169. v1
  170. v1
  171. v1
  172. v1
  173. v1
  174. v2 [diff vs current]
  175. v1
  176. v1
  177. v1
  178. v1
  179. v2 [diff vs current]
  180. v1
  181. v1
  182. v1
  183. v2 [diff vs current]
  184. v3 [diff vs current]
  185. v4 [diff vs current]
  186. v1
  187. v1
  188. v2 [diff vs current]
  189. v5 [diff vs current]
  190. v1
  191. v1 current
  192. v1
  193. v2 [diff vs current]
  194. v1
  195. v1
  196. v2 [diff vs current]
  197. v3 [diff vs current]
  198. v1
  199. v2 [diff vs current]
  200. v1
  201. v1
  202. v2 [diff vs current]
  203. v1
  204. v2 [diff vs current]
  205. v1
  206. v2 [diff vs current]
  207. v3 [diff vs current]
  208. v1
  209. v1
  210. v1
  211. v2 [diff vs current]
  212. v1
  213. v1
  214. v1
  215. v1
  216. v1
  217. v1
  218. v2 [diff vs current]
  219. v1
  220. v1
  221. v1
  222. v1
  223. v2 [diff vs current]
  224. v1
  225. v1
  226. v1
  227. v2 [diff vs current]
From: Anjali Singhai Jain <redacted>

Save information that we can use while cleaning the tx ring. Also record
the time_stamp since we will need it to check tx hangs.

Change-Id: Ia3f1c17f6fec9bcb7fef2542d77eac7f6c4f115c
Signed-off-by: Anjali Singhai Jain <redacted>
Signed-off-by: Jesse Brandeburg <redacted>
Tested-by: Kavindya Deegala <redacted>
Signed-off-by: Jeff Kirsher <redacted>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 2584d6b..fac4fb3 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -77,7 +77,6 @@ int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data,
 	/* grab the next descriptor */
 	i = tx_ring->next_to_use;
 	fdir_desc = I40E_TX_FDIRDESC(tx_ring, i);
-	tx_buf = &tx_ring->tx_bi[i];
 
 	tx_ring->next_to_use = (i + 1 < tx_ring->count) ? i + 1 : 0;
 
@@ -129,15 +128,23 @@ int i40e_program_fdir_filter(struct i40e_fdir_data *fdir_data,
 	/* Now program a dummy descriptor */
 	i = tx_ring->next_to_use;
 	tx_desc = I40E_TX_DESC(tx_ring, i);
+	tx_buf = &tx_ring->tx_bi[i];
 
 	tx_ring->next_to_use = (i + 1 < tx_ring->count) ? i + 1 : 0;
 
+	/* record length, and DMA address */
+	dma_unmap_len_set(tx_buf, len, I40E_FDIR_MAX_RAW_PACKET_LOOKUP);
+	dma_unmap_addr_set(tx_buf, dma, dma);
+
 	tx_desc->buffer_addr = cpu_to_le64(dma);
 	td_cmd = I40E_TXD_CMD | I40E_TX_DESC_CMD_DUMMY;
 
 	tx_desc->cmd_type_offset_bsz =
 		build_ctob(td_cmd, 0, I40E_FDIR_MAX_RAW_PACKET_LOOKUP, 0);
 
+	/* set the timestamp */
+	tx_buf->time_stamp = jiffies;
+
 	/* Force memory writes to complete before letting h/w
 	 * know there are new descriptors to fetch.  (Only
 	 * applicable for weak-ordered memory model archs,
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help