| 296 | DEFINE_PER_CPU(int, in_batched_polling); |
| 297 | |
| 298 | static void sn_process_loopback(struct sn_device *dev, |
| 299 | struct sk_buff *skbs[], int cnt) |
| 300 | { |
| 301 | struct sn_queue *tx_queue; |
| 302 | |
| 303 | int qid; |
| 304 | int cpu; |
| 305 | int i; |
| 306 | |
| 307 | int lock_required; |
| 308 | |
| 309 | cpu = raw_smp_processor_id(); |
| 310 | qid = dev->cpu_to_txq[cpu]; |
| 311 | tx_queue = dev->tx_queues[qid]; |
| 312 | |
| 313 | lock_required = (tx_queue->tx.netdev_txq->xmit_lock_owner != cpu); |
| 314 | |
| 315 | if (lock_required) |
| 316 | HARD_TX_LOCK(dev->netdev, tx_queue->tx.netdev_txq, cpu); |
| 317 | |
| 318 | for (i = 0; i < cnt; i++) { |
| 319 | if (!skbs[i]) |
| 320 | continue; |
| 321 | |
| 322 | /* Ignoring return value here */ |
| 323 | sn_send_tx_queue(tx_queue, dev, skbs[i]); |
| 324 | } |
| 325 | |
| 326 | if (lock_required) |
| 327 | HARD_TX_UNLOCK(dev->netdev, tx_queue->tx.netdev_txq); |
| 328 | } |
| 329 | |
| 330 | static int sn_poll_action_batch(struct sn_queue *rx_queue, int budget) |
| 331 | { |
no test coverage detected