Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'qed-misc'

Yuval Mintz says:

====================
qed*: Driver updates

Usually I try to provide a sensible description of the patch set even if
it lacks a general 'motif', but this simply contains several small,
unrelated and self-explenatory tweaks and additions.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

+63 -18
+16 -3
drivers/net/ethernet/qlogic/qed/qed_main.c
··· 29 29 #include "qed_mcp.h" 30 30 #include "qed_hw.h" 31 31 32 - static const char version[] = 33 - "QLogic QL4xxx 40G/100G Ethernet Driver qed " DRV_MODULE_VERSION "\n"; 32 + static char version[] = 33 + "QLogic FastLinQ 4xxxx Core Module qed " DRV_MODULE_VERSION "\n"; 34 34 35 - MODULE_DESCRIPTION("QLogic 25G/40G/50G/100G Core Module"); 35 + MODULE_DESCRIPTION("QLogic FastLinQ 4xxxx Core Module"); 36 36 MODULE_LICENSE("GPL"); 37 37 MODULE_VERSION(DRV_MODULE_VERSION); 38 38 ··· 44 44 45 45 #define QED_FW_FILE_NAME \ 46 46 "qed/qed_init_values_zipped-" FW_FILE_VERSION ".bin" 47 + 48 + MODULE_FIRMWARE(QED_FW_FILE_NAME); 47 49 48 50 static int __init qed_init(void) 49 51 { ··· 99 97 pci_disable_device(pdev); 100 98 } 101 99 100 + #define PCI_REVISION_ID_ERROR_VAL 0xff 101 + 102 102 /* Performs PCI initializations as well as initializing PCI-related parameters 103 103 * in the device structrue. Returns 0 in case of success. 104 104 */ 105 105 static int qed_init_pci(struct qed_dev *cdev, 106 106 struct pci_dev *pdev) 107 107 { 108 + u8 rev_id; 108 109 int rc; 109 110 110 111 cdev->pdev = pdev; ··· 141 136 pci_save_state(pdev); 142 137 } 143 138 139 + pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); 140 + if (rev_id == PCI_REVISION_ID_ERROR_VAL) { 141 + DP_NOTICE(cdev, 142 + "Detected PCI device error [rev_id 0x%x]. Probably due to prior indication. Aborting.\n", 143 + rev_id); 144 + rc = -ENODEV; 145 + goto err2; 146 + } 144 147 if (!pci_is_pcie(pdev)) { 145 148 DP_NOTICE(cdev, "The bus is not PCI Express\n"); 146 149 rc = -EIO;
+47 -15
drivers/net/ethernet/qlogic/qede/qede_main.c
··· 39 39 40 40 #include "qede.h" 41 41 42 - static const char version[] = "QLogic QL4xxx 40G/100G Ethernet Driver qede " 43 - DRV_MODULE_VERSION "\n"; 42 + static char version[] = 43 + "QLogic FastLinQ 4xxxx Ethernet Driver qede " DRV_MODULE_VERSION "\n"; 44 44 45 - MODULE_DESCRIPTION("QLogic 40G/100G Ethernet Driver"); 45 + MODULE_DESCRIPTION("QLogic FastLinQ 4xxxx Ethernet Driver"); 46 46 MODULE_LICENSE("GPL"); 47 47 MODULE_VERSION(DRV_MODULE_VERSION); 48 48 ··· 53 53 static const struct qed_eth_ops *qed_ops; 54 54 55 55 #define CHIP_NUM_57980S_40 0x1634 56 - #define CHIP_NUM_57980S_10 0x1635 56 + #define CHIP_NUM_57980S_10 0x1666 57 57 #define CHIP_NUM_57980S_MF 0x1636 58 58 #define CHIP_NUM_57980S_100 0x1644 59 59 #define CHIP_NUM_57980S_50 0x1654 ··· 380 380 return 0; 381 381 } 382 382 383 + /* +2 for 1st BD for headers and 2nd BD for headlen (if required) */ 384 + #if ((MAX_SKB_FRAGS + 2) > ETH_TX_MAX_BDS_PER_NON_LSO_PACKET) 385 + static bool qede_pkt_req_lin(struct qede_dev *edev, struct sk_buff *skb, 386 + u8 xmit_type) 387 + { 388 + int allowed_frags = ETH_TX_MAX_BDS_PER_NON_LSO_PACKET - 1; 389 + 390 + if (xmit_type & XMIT_LSO) { 391 + int hlen; 392 + 393 + hlen = skb_transport_header(skb) + 394 + tcp_hdrlen(skb) - skb->data; 395 + 396 + /* linear payload would require its own BD */ 397 + if (skb_headlen(skb) > hlen) 398 + allowed_frags--; 399 + } 400 + 401 + return (skb_shinfo(skb)->nr_frags > allowed_frags); 402 + } 403 + #endif 404 + 383 405 /* Main transmit function */ 384 406 static 385 407 netdev_tx_t qede_start_xmit(struct sk_buff *skb, ··· 429 407 txq = QEDE_TX_QUEUE(edev, txq_index); 430 408 netdev_txq = netdev_get_tx_queue(ndev, txq_index); 431 409 432 - /* Current code doesn't support SKB linearization, since the max number 433 - * of skb frags can be passed in the FW HSI. 434 - */ 435 - BUILD_BUG_ON(MAX_SKB_FRAGS > ETH_TX_MAX_BDS_PER_NON_LSO_PACKET); 436 - 437 410 WARN_ON(qed_chain_get_elem_left(&txq->tx_pbl) < 438 411 (MAX_SKB_FRAGS + 1)); 439 412 440 413 xmit_type = qede_xmit_type(edev, skb, &ipv6_ext); 414 + 415 + #if ((MAX_SKB_FRAGS + 2) > ETH_TX_MAX_BDS_PER_NON_LSO_PACKET) 416 + if (qede_pkt_req_lin(edev, skb, xmit_type)) { 417 + if (skb_linearize(skb)) { 418 + DP_NOTICE(edev, 419 + "SKB linearization failed - silently dropping this SKB\n"); 420 + dev_kfree_skb_any(skb); 421 + return NETDEV_TX_OK; 422 + } 423 + } 424 + #endif 441 425 442 426 /* Fill the entry in the SW ring and the BDs in the FW ring */ 443 427 idx = txq->sw_tx_prod & NUM_TX_BDS_MAX; ··· 2780 2752 } 2781 2753 2782 2754 if (link->link_up) { 2783 - DP_NOTICE(edev, "Link is up\n"); 2784 - netif_tx_start_all_queues(edev->ndev); 2785 - netif_carrier_on(edev->ndev); 2755 + if (!netif_carrier_ok(edev->ndev)) { 2756 + DP_NOTICE(edev, "Link is up\n"); 2757 + netif_tx_start_all_queues(edev->ndev); 2758 + netif_carrier_on(edev->ndev); 2759 + } 2786 2760 } else { 2787 - DP_NOTICE(edev, "Link is down\n"); 2788 - netif_tx_disable(edev->ndev); 2789 - netif_carrier_off(edev->ndev); 2761 + if (netif_carrier_ok(edev->ndev)) { 2762 + DP_NOTICE(edev, "Link is down\n"); 2763 + netif_tx_disable(edev->ndev); 2764 + netif_carrier_off(edev->ndev); 2765 + } 2790 2766 } 2791 2767 } 2792 2768