Skip to content

Commit 016a9f5

Browse files
committed
Merge tag 'ntb-4.2-rc7' of git://github.com/jonmason/ntb
Pull NTB bugfixes from Jon Mason: "NTB bug fixes to address transport receive issues, stats, link negotiation issues, and string formatting" * tag 'ntb-4.2-rc7' of git://github.com/jonmason/ntb: ntb: avoid format string in dev_set_name NTB: Fix dereference before check NTB: Fix zero size or integer overflow in ntb_set_mw NTB: Schedule to receive on QP link up NTB: Fix oops in debugfs when transport is half-up NTB: ntb_netdev not covering all receive errors NTB: Fix transport stats for multiple devices NTB: Fix ntb_transport out-of-order RX update
2 parents a3ca013 + e15f940 commit 016a9f5

File tree

3 files changed

+133
-79
lines changed

3 files changed

+133
-79
lines changed

drivers/net/ntb_netdev.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data,
102102

103103
netdev_dbg(ndev, "%s: %d byte payload received\n", __func__, len);
104104

105+
if (len < 0) {
106+
ndev->stats.rx_errors++;
107+
ndev->stats.rx_length_errors++;
108+
goto enqueue_again;
109+
}
110+
105111
skb_put(skb, len);
106112
skb->protocol = eth_type_trans(skb, ndev);
107113
skb->ip_summed = CHECKSUM_NONE;
@@ -121,6 +127,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data,
121127
return;
122128
}
123129

130+
enqueue_again:
124131
rc = ntb_transport_rx_enqueue(qp, skb, skb->data, ndev->mtu + ETH_HLEN);
125132
if (rc) {
126133
dev_kfree_skb(skb);
@@ -184,7 +191,7 @@ static int ntb_netdev_open(struct net_device *ndev)
184191

185192
rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data,
186193
ndev->mtu + ETH_HLEN);
187-
if (rc == -EINVAL) {
194+
if (rc) {
188195
dev_kfree_skb(skb);
189196
goto err;
190197
}

drivers/ntb/ntb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ int ntb_register_device(struct ntb_dev *ntb)
114114
ntb->dev.bus = &ntb_bus;
115115
ntb->dev.parent = &ntb->pdev->dev;
116116
ntb->dev.release = ntb_dev_release;
117-
dev_set_name(&ntb->dev, pci_name(ntb->pdev));
117+
dev_set_name(&ntb->dev, "%s", pci_name(ntb->pdev));
118118

119119
ntb->ctx = NULL;
120120
ntb->ctx_ops = NULL;

0 commit comments

Comments
 (0)