aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/benet/be.h4
-rw-r--r--drivers/net/benet/be_main.c31
2 files changed, 9 insertions, 26 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index ed709a5d07d7..4ac0d72660fe 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -220,9 +220,7 @@ struct be_rx_obj {
220 struct be_rx_stats stats; 220 struct be_rx_stats stats;
221 u8 rss_id; 221 u8 rss_id;
222 bool rx_post_starved; /* Zero rx frags have been posted to BE */ 222 bool rx_post_starved; /* Zero rx frags have been posted to BE */
223 u16 last_frag_index; 223 u32 cache_line_barrier[16];
224 u16 rsvd;
225 u32 cache_line_barrier[15];
226}; 224};
227 225
228struct be_drv_stats { 226struct be_drv_stats {
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index ef66dc61e6ea..bf344347b5a6 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -909,17 +909,11 @@ static void be_rx_compl_discard(struct be_adapter *adapter,
909 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp); 909 rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
910 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp); 910 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, rxcp);
911 911
912 /* Skip out-of-buffer compl(lancer) or flush compl(BE) */ 912 for (i = 0; i < num_rcvd; i++) {
913 if (likely(rxq_idx != rxo->last_frag_index && num_rcvd != 0)) { 913 page_info = get_rx_page_info(adapter, rxo, rxq_idx);
914 914 put_page(page_info->page);
915 rxo->last_frag_index = rxq_idx; 915 memset(page_info, 0, sizeof(*page_info));
916 916 index_inc(&rxq_idx, rxq->len);
917 for (i = 0; i < num_rcvd; i++) {
918 page_info = get_rx_page_info(adapter, rxo, rxq_idx);
919 put_page(page_info->page);
920 memset(page_info, 0, sizeof(*page_info));
921 index_inc(&rxq_idx, rxq->len);
922 }
923 } 917 }
924} 918}
925 919
@@ -1579,9 +1573,6 @@ static int be_rx_queues_create(struct be_adapter *adapter)
1579 adapter->big_page_size = (1 << get_order(rx_frag_size)) * PAGE_SIZE; 1573 adapter->big_page_size = (1 << get_order(rx_frag_size)) * PAGE_SIZE;
1580 for_all_rx_queues(adapter, rxo, i) { 1574 for_all_rx_queues(adapter, rxo, i) {
1581 rxo->adapter = adapter; 1575 rxo->adapter = adapter;
1582 /* Init last_frag_index so that the frag index in the first
1583 * completion will never match */
1584 rxo->last_frag_index = 0xffff;
1585 rxo->rx_eq.max_eqd = BE_MAX_EQD; 1576 rxo->rx_eq.max_eqd = BE_MAX_EQD;
1586 rxo->rx_eq.enable_aic = true; 1577 rxo->rx_eq.enable_aic = true;
1587 1578
@@ -1722,7 +1713,7 @@ static int be_poll_rx(struct napi_struct *napi, int budget)
1722 struct be_queue_info *rx_cq = &rxo->cq; 1713 struct be_queue_info *rx_cq = &rxo->cq;
1723 struct be_eth_rx_compl *rxcp; 1714 struct be_eth_rx_compl *rxcp;
1724 u32 work_done; 1715 u32 work_done;
1725 u16 frag_index, num_rcvd; 1716 u16 num_rcvd;
1726 u8 err; 1717 u8 err;
1727 1718
1728 rxo->stats.rx_polls++; 1719 rxo->stats.rx_polls++;
@@ -1732,16 +1723,10 @@ static int be_poll_rx(struct napi_struct *napi, int budget)
1732 break; 1723 break;
1733 1724
1734 err = AMAP_GET_BITS(struct amap_eth_rx_compl, err, rxcp); 1725 err = AMAP_GET_BITS(struct amap_eth_rx_compl, err, rxcp);
1735 frag_index = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx,
1736 rxcp);
1737 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags, 1726 num_rcvd = AMAP_GET_BITS(struct amap_eth_rx_compl, numfrags,
1738 rxcp); 1727 rxcp);
1739 1728 /* Ignore flush completions */
1740 /* Skip out-of-buffer compl(lancer) or flush compl(BE) */ 1729 if (num_rcvd) {
1741 if (likely(frag_index != rxo->last_frag_index &&
1742 num_rcvd != 0)) {
1743 rxo->last_frag_index = frag_index;
1744
1745 if (do_gro(rxo, rxcp, err)) 1730 if (do_gro(rxo, rxcp, err))
1746 be_rx_compl_process_gro(adapter, rxo, rxcp); 1731 be_rx_compl_process_gro(adapter, rxo, rxcp);
1747 else 1732 else