Print this page
5255 uts shouldn't open-code ISP2


 708         /*
 709          * Reduce number of regular rcv desc to half on x86.
 710          */
 711         maxrx = MAX_RCV_DESCRIPTORS;
 712 #if !defined(_LP64)
 713         maxrx /= 2;
 714 #endif /* !_LP64 */
 715 
 716         verbmsg = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 717             dmesg_propname, 0);
 718 
 719         adapter->tx_bcopy_threshold = ddi_prop_get_int(DDI_DEV_T_ANY,
 720             dip, DDI_PROP_DONTPASS, txbcopythreshold_propname,
 721             UNM_TX_BCOPY_THRESHOLD);
 722         adapter->rx_bcopy_threshold = ddi_prop_get_int(DDI_DEV_T_ANY,
 723             dip, DDI_PROP_DONTPASS, rxbcopythreshold_propname,
 724             UNM_RX_BCOPY_THRESHOLD);
 725 
 726         tx_desc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 727             txringsize_propname, MAX_CMD_DESCRIPTORS_HOST);
 728         if (tx_desc >= 256 && tx_desc <= MAX_CMD_DESCRIPTORS &&
 729             !(tx_desc & (tx_desc - 1))) {
 730                 adapter->MaxTxDescCount = tx_desc;
 731         } else {
 732                 cmn_err(CE_WARN, "%s%d: TxRingSize defaulting to %d, since "
 733                     ".conf value is not 2 power aligned in range 256 - %d\n",
 734                     adapter->name, adapter->instance, MAX_CMD_DESCRIPTORS_HOST,
 735                     MAX_CMD_DESCRIPTORS);
 736                 adapter->MaxTxDescCount = MAX_CMD_DESCRIPTORS_HOST;
 737         }
 738 
 739         rx_desc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 740             rxringsize_propname, maxrx);
 741         if (rx_desc >= NX_MIN_DRIVER_RDS_SIZE &&
 742             rx_desc <= NX_MAX_SUPPORTED_RDS_SIZE &&
 743             !(rx_desc & (rx_desc - 1))) {
 744                 adapter->MaxRxDescCount = rx_desc;
 745         } else {
 746                 cmn_err(CE_WARN, "%s%d: RxRingSize defaulting to %d, since "
 747                     ".conf value is not 2 power aligned in range %d - %d\n",
 748                     adapter->name, adapter->instance, MAX_RCV_DESCRIPTORS,
 749                     NX_MIN_DRIVER_RDS_SIZE, NX_MAX_SUPPORTED_RDS_SIZE);
 750                 adapter->MaxRxDescCount = MAX_RCV_DESCRIPTORS;
 751         }
 752 
 753         rx_jdesc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 754             jumborxringsize_propname, MAX_JUMBO_RCV_DESCRIPTORS);
 755         if (rx_jdesc >= NX_MIN_DRIVER_RDS_SIZE &&
 756             rx_jdesc <= NX_MAX_SUPPORTED_JUMBO_RDS_SIZE &&
 757             !(rx_jdesc & (rx_jdesc - 1))) {
 758                 adapter->MaxJumboRxDescCount = rx_jdesc;
 759         } else {
 760                 cmn_err(CE_WARN, "%s%d: JumboRingSize defaulting to %d, since "
 761                     ".conf value is not 2 power aligned in range %d - %d\n",
 762                     adapter->name, adapter->instance, MAX_JUMBO_RCV_DESCRIPTORS,
 763                     NX_MIN_DRIVER_RDS_SIZE, NX_MAX_SUPPORTED_JUMBO_RDS_SIZE);
 764                 adapter->MaxJumboRxDescCount = MAX_JUMBO_RCV_DESCRIPTORS;
 765         }
 766 
 767         /*
 768          * Solaris does not use LRO, but older firmware needs to have a
 769          * couple of descriptors for initialization.
 770          */
 771         adapter->MaxLroRxDescCount = (adapter->fw_major < 4) ? 2 : 0;
 772 
 773         adapter->mtu = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
 774             DDI_PROP_DONTPASS, defaultmtu_propname, MTU_SIZE);
 775 
 776         if (adapter->mtu < MTU_SIZE) {
 777                 cmn_err(CE_WARN, "Raising mtu to %d\n", MTU_SIZE);




 708         /*
 709          * Reduce number of regular rcv desc to half on x86.
 710          */
 711         maxrx = MAX_RCV_DESCRIPTORS;
 712 #if !defined(_LP64)
 713         maxrx /= 2;
 714 #endif /* !_LP64 */
 715 
 716         verbmsg = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 717             dmesg_propname, 0);
 718 
 719         adapter->tx_bcopy_threshold = ddi_prop_get_int(DDI_DEV_T_ANY,
 720             dip, DDI_PROP_DONTPASS, txbcopythreshold_propname,
 721             UNM_TX_BCOPY_THRESHOLD);
 722         adapter->rx_bcopy_threshold = ddi_prop_get_int(DDI_DEV_T_ANY,
 723             dip, DDI_PROP_DONTPASS, rxbcopythreshold_propname,
 724             UNM_RX_BCOPY_THRESHOLD);
 725 
 726         tx_desc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 727             txringsize_propname, MAX_CMD_DESCRIPTORS_HOST);
 728         if (tx_desc >= 256 && tx_desc <= MAX_CMD_DESCRIPTORS && ISP2(tx_desc)) {

 729                 adapter->MaxTxDescCount = tx_desc;
 730         } else {
 731                 cmn_err(CE_WARN, "%s%d: TxRingSize defaulting to %d, since "
 732                     ".conf value is not 2 power aligned in range 256 - %d\n",
 733                     adapter->name, adapter->instance, MAX_CMD_DESCRIPTORS_HOST,
 734                     MAX_CMD_DESCRIPTORS);
 735                 adapter->MaxTxDescCount = MAX_CMD_DESCRIPTORS_HOST;
 736         }
 737 
 738         rx_desc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 739             rxringsize_propname, maxrx);
 740         if (rx_desc >= NX_MIN_DRIVER_RDS_SIZE &&
 741             rx_desc <= NX_MAX_SUPPORTED_RDS_SIZE && ISP2(rx_desc)) {

 742                 adapter->MaxRxDescCount = rx_desc;
 743         } else {
 744                 cmn_err(CE_WARN, "%s%d: RxRingSize defaulting to %d, since "
 745                     ".conf value is not 2 power aligned in range %d - %d\n",
 746                     adapter->name, adapter->instance, MAX_RCV_DESCRIPTORS,
 747                     NX_MIN_DRIVER_RDS_SIZE, NX_MAX_SUPPORTED_RDS_SIZE);
 748                 adapter->MaxRxDescCount = MAX_RCV_DESCRIPTORS;
 749         }
 750 
 751         rx_jdesc = ddi_prop_get_int(DDI_DEV_T_ANY, dip, DDI_PROP_DONTPASS,
 752             jumborxringsize_propname, MAX_JUMBO_RCV_DESCRIPTORS);
 753         if (rx_jdesc >= NX_MIN_DRIVER_RDS_SIZE &&
 754             rx_jdesc <= NX_MAX_SUPPORTED_JUMBO_RDS_SIZE && ISP2(rx_jdesc)) {

 755                 adapter->MaxJumboRxDescCount = rx_jdesc;
 756         } else {
 757                 cmn_err(CE_WARN, "%s%d: JumboRingSize defaulting to %d, since "
 758                     ".conf value is not 2 power aligned in range %d - %d\n",
 759                     adapter->name, adapter->instance, MAX_JUMBO_RCV_DESCRIPTORS,
 760                     NX_MIN_DRIVER_RDS_SIZE, NX_MAX_SUPPORTED_JUMBO_RDS_SIZE);
 761                 adapter->MaxJumboRxDescCount = MAX_JUMBO_RCV_DESCRIPTORS;
 762         }
 763 
 764         /*
 765          * Solaris does not use LRO, but older firmware needs to have a
 766          * couple of descriptors for initialization.
 767          */
 768         adapter->MaxLroRxDescCount = (adapter->fw_major < 4) ? 2 : 0;
 769 
 770         adapter->mtu = ddi_prop_get_int(DDI_DEV_T_ANY, dip,
 771             DDI_PROP_DONTPASS, defaultmtu_propname, MTU_SIZE);
 772 
 773         if (adapter->mtu < MTU_SIZE) {
 774                 cmn_err(CE_WARN, "Raising mtu to %d\n", MTU_SIZE);