Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9146e13

Browse files
Handle NULL skb->dev after ip_queue_xmit in __homa_xmit_control
1 parent b242816 commit 9146e13

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

homa_outgoing.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,6 @@ int __homa_xmit_control(void *contents, size_t length, struct homa_peer *peer,
454454
int extra_bytes;
455455
int result;
456456

457-
IF_NO_STRIP(struct netdev_queue *txq);
458457
IF_NO_STRIP(int priority);
459458

460459
skb = homa_skb_alloc_tx(HOMA_MAX_HEADER);
@@ -494,11 +493,15 @@ int __homa_xmit_control(void *contents, size_t length, struct homa_peer *peer,
494493
if (unlikely(result != 0))
495494
INC_METRIC(control_xmit_errors, 1);
496495
#ifndef __STRIP__ /* See strip.py */
497-
txq = netdev_get_tx_queue(skb->dev, skb->queue_mapping);
498-
if (netif_tx_queue_stopped(txq))
499-
tt_record4("__homa_xmit_control found stopped txq for id %d, qid %u, num_queued %u, limit %d",
500-
be64_to_cpu(h->sender_id), skb->queue_mapping,
501-
txq->dql.num_queued, txq->dql.adj_limit);
496+
if (skb->dev) {
497+
struct netdev_queue *txq;
498+
499+
txq = netdev_get_tx_queue(skb->dev, skb->queue_mapping);
500+
if (netif_tx_queue_stopped(txq))
501+
tt_record4("__homa_xmit_control found stopped txq for id %d, qid %u, num_queued %u, limit %d",
502+
be64_to_cpu(h->sender_id), skb->queue_mapping,
503+
txq->dql.num_queued, txq->dql.adj_limit);
504+
}
502505
#endif /* See strip.py */
503506
INC_METRIC(packets_sent[h->type - DATA], 1);
504507
INC_METRIC(priority_bytes[priority], skb->len);

0 commit comments

Comments
 (0)