diff mbox

[net-next] net: atl1c: add BQL support

Message ID 20150812224020.GA31826@electric-eye.fr.zoreil.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Francois Romieu Aug. 12, 2015, 10:40 p.m. UTC
Ron Angeles <ronangeles@gmail.com> :
> This BQL implementation is mostly derived from its related driver, alx.
> Tested on AR8131 (rev c0) [1969:1063]. Saturated a 100mbps link with 5
> concurrent runs of netperf. Ping latency dropped from 14ms to 3ms.

Could you use some time to test the attached experimental stuff as well ?

Comments

Ron Angeles Aug. 13, 2015, 5:12 a.m. UTC | #1
On 08/12/2015 03:40 PM, Francois Romieu wrote:
> Ron Angeles <ronangeles@gmail.com> :
>> This BQL implementation is mostly derived from its related driver, alx.
>> Tested on AR8131 (rev c0) [1969:1063]. Saturated a 100mbps link with 5
>> concurrent runs of netperf. Ping latency dropped from 14ms to 3ms.
>
> Could you use some time to test the attached experimental stuff as well ?
>

I only have one of these NICs and it is running on something critical 
throughout the weekdays. I can try running these when I have time on a 
weekend. Is there any particular way you would suggest testing? Would an 
overnight smoke test with netperf suffice?

-Ron
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Francois Romieu Aug. 13, 2015, 10:16 p.m. UTC | #2
Ron Angeles <ronangeles@gmail.com> :
[...]
> I only have one of these NICs and it is running on something critical
> throughout the weekdays. I can try running these when I have time on a
> weekend.

Thanks, it would be perfect: I can't promise it won't crash.

> Is there any particular way you would suggest testing? Would an
> overnight smoke test with netperf suffice?

Anything that changes timing, packet size, and plays with different
contexts (link change, retrieve stats, etc.).

I'll send an updated patchkit tomorrow. The xmit part is a bit different
from what I'm used to.
diff mbox

Patch

diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 932bd18..282ec17 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -56,8 +56,7 @@  static int atl1c_stop_mac(struct atl1c_hw *hw);
 static void atl1c_disable_l0s_l1(struct atl1c_hw *hw);
 static void atl1c_set_aspm(struct atl1c_hw *hw, u16 link_speed);
 static void atl1c_start_mac(struct atl1c_adapter *adapter);
-static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter,
-		   int *work_done, int work_to_do);
+static int atl1c_clean_rx_irq(struct atl1c_adapter *adapter, int budget);
 static int atl1c_up(struct atl1c_adapter *adapter);
 static void atl1c_down(struct atl1c_adapter *adapter);
 static int atl1c_reset_mac(struct atl1c_hw *hw);
@@ -1787,11 +1786,10 @@  static void atl1c_clean_rfd(struct atl1c_rfd_ring *rfd_ring,
 	rfd_ring->next_to_clean = rfd_index;
 }
 
-static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter,
-		   int *work_done, int work_to_do)
+static int atl1c_clean_rx_irq(struct atl1c_adapter *adapter, int budget)
 {
 	u16 rfd_num, rfd_index;
-	u16 count = 0;
+	u16 count;
 	u16 length;
 	struct pci_dev *pdev = adapter->pdev;
 	struct net_device *netdev  = adapter->netdev;
@@ -1801,9 +1799,7 @@  static void atl1c_clean_rx_irq(struct atl1c_adapter *adapter,
 	struct atl1c_recv_ret_status *rrs;
 	struct atl1c_buffer *buffer_info;
 
-	while (1) {
-		if (*work_done >= work_to_do)
-			break;
+	for (count = 0; count < budget; count++) {
 		rrs = ATL1C_RRD_DESC(rrd_ring, rrd_ring->next_to_clean);
 		if (likely(RRS_RXD_IS_VALID(rrs->word3))) {
 			rfd_num = (rrs->word0 >> RRS_RX_RFD_CNT_SHIFT) &
@@ -1857,12 +1853,11 @@  rrs_checked:
 			__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan);
 		}
 		netif_receive_skb(skb);
-
-		(*work_done)++;
-		count++;
 	}
 	if (count)
 		atl1c_alloc_rx_buffer(adapter);
+
+	return count;
 }
 
 /**
@@ -1875,10 +1870,10 @@  static int atl1c_clean(struct napi_struct *napi, int budget)
 	int work_done = 0;
 
 	/* Keep link state information with original netdev */
-	if (!netif_carrier_ok(adapter->netdev))
+	if (unlikely(!netif_carrier_ok(adapter->netdev)))
 		goto quit_polling;
 	/* just enable one RXQ */
-	atl1c_clean_rx_irq(adapter, &work_done, budget);
+	work_done = atl1c_clean_rx_irq(adapter, budget);
 
 	if (work_done < budget) {
 quit_polling: