qcacmn: TSO fixes
1. Unmap tso common segment only after receiving completions for all the tso segments for a given skb. 2. Keep a track of num of free tso descriptors available in the pool of tso descriptors. Change-Id: I01bdbb9e40b7259f77dbcfeec22c6d8cd0c0a6dd CRs-Fixed: 2042950
This commit is contained in:

committed by
snandini

父節點
ae66cda533
當前提交
35503cce26
@@ -103,9 +103,11 @@
|
||||
|
||||
/* Enable flag to print TSO specific prints in datapath */
|
||||
#ifdef TSO_DEBUG_LOG_ENABLE
|
||||
#define TSO_DEBUG(args ...) printk(args)
|
||||
#define TSO_DEBUG(fmt, args ...) \
|
||||
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_NONE, \
|
||||
fmt, ## args)
|
||||
#else
|
||||
#define TSO_DEBUG(args ...)
|
||||
#define TSO_DEBUG(fmt, args ...)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@@ -467,6 +467,14 @@ void __printf(3, 4) qdf_snprintf(char *str_buffer, unsigned int size,
|
||||
|
||||
#define QDF_SNPRINTF qdf_snprintf
|
||||
|
||||
#else
|
||||
|
||||
#define DPTRACE(x)
|
||||
#define qdf_trace_hex_dump(x, y, z, q)
|
||||
|
||||
#endif /* CONFIG_MCL */
|
||||
|
||||
|
||||
#ifdef TSOSEG_DEBUG
|
||||
static inline
|
||||
int qdf_tso_seg_dbg_record(struct qdf_tso_seg_elem_t *tsoseg,
|
||||
@@ -522,12 +530,6 @@ qdf_tso_seg_dbg_zero(struct qdf_tso_seg_elem_t *tsoseg)
|
||||
};
|
||||
|
||||
#endif /* TSOSEG_DEBUG */
|
||||
#else
|
||||
|
||||
#define DPTRACE(x)
|
||||
#define qdf_trace_hex_dump(x, y, z, q)
|
||||
|
||||
#endif /* CONFIG_MCL */
|
||||
|
||||
#define ERROR_CODE -1
|
||||
#define QDF_MAX_NAME_SIZE 32
|
||||
|
@@ -1740,7 +1740,6 @@ static uint8_t __qdf_nbuf_get_tso_cmn_seg_info(qdf_device_t osdev,
|
||||
tso_info->ethproto);
|
||||
return 1;
|
||||
}
|
||||
|
||||
tso_info->l2_len = (skb_network_header(skb) - skb_mac_header(skb));
|
||||
tso_info->tcphdr = tcp_hdr(skb);
|
||||
tso_info->tcp_seq_num = ntohl(tcp_hdr(skb)->seq);
|
||||
@@ -1886,6 +1885,7 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb,
|
||||
qdf_print("TSO: error getting common segment info\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
total_num_seg = tso_info->tso_num_seg_list;
|
||||
curr_seg = tso_info->tso_seg_list;
|
||||
|
||||
@@ -1921,6 +1921,7 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb,
|
||||
int i = 1; /* tso fragment index */
|
||||
uint8_t more_tso_frags = 1;
|
||||
|
||||
curr_seg->seg.num_frags = 0;
|
||||
tso_info->num_segs++;
|
||||
total_num_seg->num_seg.tso_cmn_num_seg++;
|
||||
|
||||
@@ -1943,6 +1944,7 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb,
|
||||
skb_proc = skb_proc - tso_frag_len;
|
||||
|
||||
/* increment the TCP sequence number */
|
||||
|
||||
tso_cmn_info.tcp_seq_num += tso_frag_len;
|
||||
curr_seg->seg.tso_frags[i].paddr = tso_frag_paddr;
|
||||
TSO_DEBUG("%s[%d] frag %d frag len %d total_len %u vaddr %p\n",
|
||||
@@ -1997,6 +1999,12 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb,
|
||||
__func__, __LINE__, skb_frag_len, tso_frag_len,
|
||||
tso_seg_size);
|
||||
|
||||
if (!(tso_frag_vaddr)) {
|
||||
TSO_DEBUG("%s: Fragment virtual addr is NULL",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
tso_frag_paddr =
|
||||
dma_map_single(osdev->dev,
|
||||
tso_frag_vaddr,
|
||||
@@ -2009,6 +2017,8 @@ uint32_t __qdf_nbuf_get_tso_info(qdf_device_t osdev, struct sk_buff *skb,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
TSO_DEBUG("%s tcp_seq_num: %u", __func__,
|
||||
curr_seg->seg.tso_flags.tcp_seq_num);
|
||||
num_seg--;
|
||||
/* if TCP FIN flag was set, set it in the last segment */
|
||||
if (!num_seg)
|
||||
|
Reference in New Issue
Block a user