@@ -1691,6 +1691,29 @@ static int qlcnic_83xx_process_rcv_ring(struct qlcnic_host_sds_ring *sds_ring,
16911691 return count ;
16921692}
16931693
1694+ static int qlcnic_83xx_msix_sriov_vf_poll (struct napi_struct * napi , int budget )
1695+ {
1696+ int tx_complete ;
1697+ int work_done ;
1698+ struct qlcnic_host_sds_ring * sds_ring ;
1699+ struct qlcnic_adapter * adapter ;
1700+ struct qlcnic_host_tx_ring * tx_ring ;
1701+
1702+ sds_ring = container_of (napi , struct qlcnic_host_sds_ring , napi );
1703+ adapter = sds_ring -> adapter ;
1704+ /* tx ring count = 1 */
1705+ tx_ring = adapter -> tx_ring ;
1706+
1707+ tx_complete = qlcnic_process_cmd_ring (adapter , tx_ring , budget );
1708+ work_done = qlcnic_83xx_process_rcv_ring (sds_ring , budget );
1709+ if ((work_done < budget ) && tx_complete ) {
1710+ napi_complete (& sds_ring -> napi );
1711+ qlcnic_83xx_enable_intr (adapter , sds_ring );
1712+ }
1713+
1714+ return work_done ;
1715+ }
1716+
16941717static int qlcnic_83xx_poll (struct napi_struct * napi , int budget )
16951718{
16961719 int tx_complete ;
@@ -1768,7 +1791,8 @@ void qlcnic_83xx_napi_enable(struct qlcnic_adapter *adapter)
17681791 qlcnic_83xx_enable_intr (adapter , sds_ring );
17691792 }
17701793
1771- if (adapter -> flags & QLCNIC_MSIX_ENABLED ) {
1794+ if ((adapter -> flags & QLCNIC_MSIX_ENABLED ) &&
1795+ !(adapter -> flags & QLCNIC_TX_INTR_SHARED )) {
17721796 for (ring = 0 ; ring < adapter -> max_drv_tx_rings ; ring ++ ) {
17731797 tx_ring = & adapter -> tx_ring [ring ];
17741798 napi_enable (& tx_ring -> napi );
@@ -1795,7 +1819,8 @@ void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter)
17951819 napi_disable (& sds_ring -> napi );
17961820 }
17971821
1798- if (adapter -> flags & QLCNIC_MSIX_ENABLED ) {
1822+ if ((adapter -> flags & QLCNIC_MSIX_ENABLED ) &&
1823+ !(adapter -> flags & QLCNIC_TX_INTR_SHARED )) {
17991824 for (ring = 0 ; ring < adapter -> max_drv_tx_rings ; ring ++ ) {
18001825 tx_ring = & adapter -> tx_ring [ring ];
18011826 qlcnic_83xx_disable_tx_intr (adapter , tx_ring );
@@ -1808,7 +1833,7 @@ void qlcnic_83xx_napi_disable(struct qlcnic_adapter *adapter)
18081833int qlcnic_83xx_napi_add (struct qlcnic_adapter * adapter ,
18091834 struct net_device * netdev )
18101835{
1811- int ring , max_sds_rings ;
1836+ int ring , max_sds_rings , temp ;
18121837 struct qlcnic_host_sds_ring * sds_ring ;
18131838 struct qlcnic_host_tx_ring * tx_ring ;
18141839 struct qlcnic_recv_context * recv_ctx = adapter -> recv_ctx ;
@@ -1819,22 +1844,32 @@ int qlcnic_83xx_napi_add(struct qlcnic_adapter *adapter,
18191844 max_sds_rings = adapter -> max_sds_rings ;
18201845 for (ring = 0 ; ring < adapter -> max_sds_rings ; ring ++ ) {
18211846 sds_ring = & recv_ctx -> sds_rings [ring ];
1822- if (adapter -> flags & QLCNIC_MSIX_ENABLED )
1823- netif_napi_add (netdev , & sds_ring -> napi ,
1824- qlcnic_83xx_rx_poll ,
1825- QLCNIC_NETDEV_WEIGHT * 2 );
1826- else
1847+ if (adapter -> flags & QLCNIC_MSIX_ENABLED ) {
1848+ if (!(adapter -> flags & QLCNIC_TX_INTR_SHARED )) {
1849+ netif_napi_add (netdev , & sds_ring -> napi ,
1850+ qlcnic_83xx_rx_poll ,
1851+ QLCNIC_NETDEV_WEIGHT * 2 );
1852+ } else {
1853+ temp = QLCNIC_NETDEV_WEIGHT / max_sds_rings ;
1854+ netif_napi_add (netdev , & sds_ring -> napi ,
1855+ qlcnic_83xx_msix_sriov_vf_poll ,
1856+ temp );
1857+ }
1858+
1859+ } else {
18271860 netif_napi_add (netdev , & sds_ring -> napi ,
18281861 qlcnic_83xx_poll ,
18291862 QLCNIC_NETDEV_WEIGHT / max_sds_rings );
1863+ }
18301864 }
18311865
18321866 if (qlcnic_alloc_tx_rings (adapter , netdev )) {
18331867 qlcnic_free_sds_rings (recv_ctx );
18341868 return - ENOMEM ;
18351869 }
18361870
1837- if (adapter -> flags & QLCNIC_MSIX_ENABLED ) {
1871+ if ((adapter -> flags & QLCNIC_MSIX_ENABLED ) &&
1872+ !(adapter -> flags & QLCNIC_TX_INTR_SHARED )) {
18381873 for (ring = 0 ; ring < adapter -> max_drv_tx_rings ; ring ++ ) {
18391874 tx_ring = & adapter -> tx_ring [ring ];
18401875 netif_napi_add (netdev , & tx_ring -> napi ,
@@ -1860,7 +1895,8 @@ void qlcnic_83xx_napi_del(struct qlcnic_adapter *adapter)
18601895
18611896 qlcnic_free_sds_rings (adapter -> recv_ctx );
18621897
1863- if ((adapter -> flags & QLCNIC_MSIX_ENABLED )) {
1898+ if ((adapter -> flags & QLCNIC_MSIX_ENABLED ) &&
1899+ !(adapter -> flags & QLCNIC_TX_INTR_SHARED )) {
18641900 for (ring = 0 ; ring < adapter -> max_drv_tx_rings ; ring ++ ) {
18651901 tx_ring = & adapter -> tx_ring [ring ];
18661902 netif_napi_del (& tx_ring -> napi );
0 commit comments