Skip to content

Commit

Permalink
Merge tag 'ntb-4.2-rc7' of git://github.com/jonmason/ntb
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Aug 10, 2015
2 parents a3ca013 + e15f940 commit 016a9f5
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 79 deletions.
9 changes: 8 additions & 1 deletion drivers/net/ntb_netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data,

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

if (len < 0) {
ndev->stats.rx_errors++;
ndev->stats.rx_length_errors++;
goto enqueue_again;
}

skb_put(skb, len);
skb->protocol = eth_type_trans(skb, ndev);
skb->ip_summed = CHECKSUM_NONE;
Expand All @@ -121,6 +127,7 @@ static void ntb_netdev_rx_handler(struct ntb_transport_qp *qp, void *qp_data,
return;
}

enqueue_again:
rc = ntb_transport_rx_enqueue(qp, skb, skb->data, ndev->mtu + ETH_HLEN);
if (rc) {
dev_kfree_skb(skb);
Expand Down Expand Up @@ -184,7 +191,7 @@ static int ntb_netdev_open(struct net_device *ndev)

rc = ntb_transport_rx_enqueue(dev->qp, skb, skb->data,
ndev->mtu + ETH_HLEN);
if (rc == -EINVAL) {
if (rc) {
dev_kfree_skb(skb);
goto err;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/ntb/ntb.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int ntb_register_device(struct ntb_dev *ntb)
ntb->dev.bus = &ntb_bus;
ntb->dev.parent = &ntb->pdev->dev;
ntb->dev.release = ntb_dev_release;
dev_set_name(&ntb->dev, pci_name(ntb->pdev));
dev_set_name(&ntb->dev, "%s", pci_name(ntb->pdev));

ntb->ctx = NULL;
ntb->ctx_ops = NULL;
Expand Down
Loading

0 comments on commit 016a9f5

Please sign in to comment.