Selaa lähdekoodia

qcacmn: Remove alignment of 4 bytes

Remove alignment of 4 bytes when allocating memory for Copy
engines. Copy engine buffer size is 2048 which is already
aligned to 4 bytes. This 4 byte alignment addition results in
64 bytes extra memory allocation for each skb since SKB_DATA_ALIGN
rounds it off to nearest 64.

Change-Id: Ib680547d2bcfe57b6eadda5301677d68e4a931a4
CRs-Fixed: 3533492
Nandha Kishore Easwaran 2 vuotta sitten
vanhempi
sitoutus
8a745cc343
3 muutettua tiedostoa jossa 4 lisäystä ja 2 poistoa
  1. 2 1
      hif/src/ce/ce_api.h
  2. 1 0
      hif/src/ce/ce_internal.h
  3. 1 1
      hif/src/ce/ce_main.c

+ 2 - 1
hif/src/ce/ce_api.h

@@ -520,7 +520,8 @@ void war_ce_src_ring_write_idx_set(struct hif_softc *scn,
  * @priority:      TBD
  * @src_nentries:  #entries in source ring - Must be a power of 2
  * @src_sz_max:    Max source send size for this CE. This is also the minimum
- *                 size of a destination buffer
+ *                 size of a destination buffer. This should be a factor of 4
+ *                 for alignment during nbuf alloc.
  * @dest_nentries: #entries in destination ring - Must be a power of 2
  * @reserved:      Future Use
  */

+ 1 - 0
hif/src/ce/ce_internal.h

@@ -170,6 +170,7 @@ struct CE_state {
 	/*Record the state of the copy compl interrupt */
 	int disable_copy_compl_intr;
 
+	/* src_sz_max should be a factor of 4 for alignment during nbuf alloc */
 	unsigned int src_sz_max;
 	struct CE_ring_state *src_ring;
 	struct CE_ring_state *dest_ring;

+ 1 - 1
hif/src/ce/ce_main.c

@@ -3532,7 +3532,7 @@ QDF_STATUS hif_post_recv_buffers_for_pipe(struct HIF_CE_pipe_info *pipe_info)
 		hif_record_ce_desc_event(scn, ce_id,
 					 HIF_RX_DESC_PRE_NBUF_ALLOC, NULL, NULL,
 					 0, 0);
-		nbuf = qdf_nbuf_alloc(scn->qdf_dev, buf_sz, 0, 4, false);
+		nbuf = qdf_nbuf_alloc(scn->qdf_dev, buf_sz, 0, 0, false);
 		if (!nbuf) {
 			hif_post_recv_buffers_failure(pipe_info, nbuf,
 					&pipe_info->nbuf_alloc_err_count,