File tree Expand file tree Collapse file tree 1 file changed +19
-7
lines changed
drivers/net/ethernet/freescale/enetc Expand file tree Collapse file tree 1 file changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -167,6 +167,24 @@ static bool enetc_skb_is_tcp(struct sk_buff *skb)
167
167
return skb -> csum_offset == offsetof(struct tcphdr , check );
168
168
}
169
169
170
+ /**
171
+ * enetc_unwind_tx_frame() - Unwind the DMA mappings of a multi-buffer Tx frame
172
+ * @tx_ring: Pointer to the Tx ring on which the buffer descriptors are located
173
+ * @count: Number of Tx buffer descriptors which need to be unmapped
174
+ * @i: Index of the last successfully mapped Tx buffer descriptor
175
+ */
176
+ static void enetc_unwind_tx_frame (struct enetc_bdr * tx_ring , int count , int i )
177
+ {
178
+ while (count -- ) {
179
+ struct enetc_tx_swbd * tx_swbd = & tx_ring -> tx_swbd [i ];
180
+
181
+ enetc_free_tx_frame (tx_ring , tx_swbd );
182
+ if (i == 0 )
183
+ i = tx_ring -> bd_count ;
184
+ i -- ;
185
+ }
186
+ }
187
+
170
188
static int enetc_map_tx_buffs (struct enetc_bdr * tx_ring , struct sk_buff * skb )
171
189
{
172
190
bool do_vlan , do_onestep_tstamp = false, do_twostep_tstamp = false;
@@ -372,13 +390,7 @@ static int enetc_map_tx_buffs(struct enetc_bdr *tx_ring, struct sk_buff *skb)
372
390
dma_err :
373
391
dev_err (tx_ring -> dev , "DMA map error" );
374
392
375
- do {
376
- tx_swbd = & tx_ring -> tx_swbd [i ];
377
- enetc_free_tx_frame (tx_ring , tx_swbd );
378
- if (i == 0 )
379
- i = tx_ring -> bd_count ;
380
- i -- ;
381
- } while (count -- );
393
+ enetc_unwind_tx_frame (tx_ring , count , i );
382
394
383
395
return 0 ;
384
396
}
You can’t perform that action at this time.
0 commit comments