浏览代码

Merge "msm:ipa: fix for EOB scatter & gather support"

qctecmdr 4 年之前
父节点
当前提交
e4a4c9197a
共有 2 个文件被更改,包括 13 次插入7 次删除
  1. 10 6
      drivers/platform/msm/ipa/ipa_v3/ipa_dp.c
  2. 3 1
      drivers/platform/msm/ipa/ipa_v3/ipa_i.h

+ 10 - 6
drivers/platform/msm/ipa/ipa_v3/ipa_dp.c

@@ -3559,6 +3559,7 @@ static struct sk_buff *handle_page_completion(struct gsi_chan_xfer_notify
 	struct list_head *head;
 	struct ipa3_sys_context *sys;
 	struct ipa_rx_page_data rx_page;
+	int size;
 
 	sys = (struct ipa3_sys_context *) notify->chan_user_data;
 	rx_pkt = (struct ipa3_rx_pkt_wrapper *) notify->xfer_user_data;
@@ -3568,9 +3569,12 @@ static struct sk_buff *handle_page_completion(struct gsi_chan_xfer_notify
 	rx_pkt->sys->len--;
 	spin_unlock_bh(&rx_pkt->sys->spinlock);
 
-	/* TODO: truesize handle for EOB */
-	if (update_truesize)
-		IPAERR("update_truesize not supported\n");
+	if (likely(notify->bytes_xfered))
+		rx_pkt->data_len = notify->bytes_xfered;
+	else {
+		IPAERR_RL("unexpected 0 byte_xfered\n");
+		rx_pkt->data_len = rx_pkt->len;
+	}
 
 	if (notify->veid >= GSI_VEID_MAX) {
 		IPAERR("notify->veid > GSI_VEID_MAX\n");
@@ -3611,9 +3615,9 @@ static struct sk_buff *handle_page_completion(struct gsi_chan_xfer_notify
 			IPA_STATS_INC_CNT(ipa3_ctx->stats.rx_page_drop_cnt);
 			return NULL;
 		}
-	/* go over the list backward to save computations on updating length */
-		list_for_each_entry_safe_reverse(rx_pkt, tmp, head, link) {
+		list_for_each_entry_safe(rx_pkt, tmp, head, link) {
 			rx_page = rx_pkt->page_data;
+			size = rx_pkt->data_len;
 
 			list_del(&rx_pkt->link);
 			if (rx_page.is_tmp_alloc)
@@ -3628,7 +3632,7 @@ static struct sk_buff *handle_page_completion(struct gsi_chan_xfer_notify
 			skb_add_rx_frag(rx_skb,
 				skb_shinfo(rx_skb)->nr_frags,
 				rx_page.page, 0,
-				notify->bytes_xfered,
+				size,
 				PAGE_SIZE << IPA_WAN_PAGE_ORDER);
 		}
 	} else {

+ 3 - 1
drivers/platform/msm/ipa/ipa_v3/ipa_i.h

@@ -1192,7 +1192,8 @@ struct ipa3_desc {
  * @skb: skb
  * @dma_address: DMA address of this Rx packet
  * @link: linked to the Rx packets on that pipe
- * @len: how many bytes are copied into skb's flat buffer
+ * @len: fixed allocated skb length (i.e. times of page size)
+ * @data_len: how many bytes are copied into skb's flat buffer
  */
 struct ipa3_rx_pkt_wrapper {
 	struct list_head link;
@@ -1201,6 +1202,7 @@ struct ipa3_rx_pkt_wrapper {
 		struct ipa_rx_page_data page_data;
 	};
 	u32 len;
+	u32 data_len;
 	struct work_struct work;
 	struct ipa3_sys_context *sys;
 };