qcacmn: Add support to send ICMP pkts to FW

Add support to send the ICMP pakets to the firmware
at a certain interval.

Change-Id: I44af2b06793712be7236f831b6b2604123d72bb1
CRs-Fixed: 2813172
This commit is contained in:
Rakesh Pillai 2020-11-03 14:51:11 +05:30 • committed by snandini
commit fc284559a0
3 changed files with 71 additions and 4 deletions

View file

@ -1414,7 +1414,7 @@ dp_tx_hw_enqueue(struct dp_soc *soc, struct dp_vdev *vdev,
hal_tx_desc_set_addr_search_flags(hal_tx_desc_cached,
vdev->hal_desc_addr_search_flags);
if (tx_desc->flags & DP_TX_DESC_FLAG_TO_FW)
if (tx_desc->flags & DP_TX_DESC_FLAG_TO_FW || msdu_info->send_to_fw)
hal_tx_desc_set_to_fw(hal_tx_desc_cached, 1);
/* verify checksum offload configuration*/
@ -3020,6 +3020,63 @@ void dp_tx_nawds_handler(struct dp_soc *soc, struct dp_vdev *vdev,
qdf_spin_unlock_bh(&vdev->peer_list_lock);
}
#ifdef WLAN_DP_FEATURE_SEND_ICMP_TO_FW
/**
* dp_tx_mark_icmp_req_exception() - Mark the ICMP request at certain intervals
* as exception packets to be sent to FW.
* @soc: DP soc handle
* @nbuf: packet to be transmitted
* @msdu_info: MSDU info where the exception flag is setup.
*
* This function sets the is_exception flag in the msdu_info if the current
* packet is an ICMP request packet after a preset interval post the last
* marked ICMP request packet.
* The time interval is decided by an INI, which can be set to -1, to indicate
* that all the ICMP request packets need to be sent to FW.
*
* Since HTT metadata is not to be sent to FW, exception_fw flag cannot be used.
*
* Returns: None
*/
static void
dp_tx_mark_icmp_req_exception(struct dp_soc *soc,
qdf_nbuf_t nbuf,
struct dp_tx_msdu_info_s *msdu_info)
{
uint64_t curr_time, time_delta;
int time_interval_ms;
static uint64_t prev_marked_icmp_time;
/* If its an ICMP request packet, to_fw will be set in context block */
if (!qdf_unlikely(QDF_NBUF_CB_TX_PACKET_TO_FW(nbuf) == 1))
return;
time_interval_ms = wlan_cfg_send_icmp_req_to_fw(soc->wlan_cfg_ctx);
if (!time_interval_ms)
return;
if (time_interval_ms == WLAN_CFG_SEND_ALL_ICMP_REQ_TO_FW) {
msdu_info->send_to_fw = 1;
return;
}
curr_time = qdf_get_log_timestamp();
time_delta = curr_time - prev_marked_icmp_time;
if (time_delta >= (time_interval_ms *
QDF_LOG_TIMESTAMP_CYCLES_PER_10_US * 100)) {
msdu_info->send_to_fw = 1;
prev_marked_icmp_time = curr_time;
}
}
#else
static inline void
dp_tx_mark_icmp_req_exception(struct dp_soc *soc,
qdf_nbuf_t nbuf,
struct dp_tx_msdu_info_s *msdu_info)
{
}
#endif
/**
* dp_tx_send() - Transmit a frame on a given VAP
* @soc: DP soc handle
@ -3070,6 +3127,8 @@ qdf_nbuf_t dp_tx_send(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
dp_tx_wds_ext(soc, vdev, peer_id, &msdu_info);
DP_STATS_INC_PKT(vdev, tx_i.rcvd, 1, qdf_nbuf_len(nbuf));
dp_tx_mark_icmp_req_exception(soc, nbuf, &msdu_info);
if (qdf_unlikely(vdev->mesh_vdev)) {
qdf_nbuf_t nbuf_mesh = dp_tx_extract_mesh_meta_data(vdev, nbuf,
&msdu_info);

View file

@ -143,6 +143,7 @@ struct dp_tx_queue {
* @exception_fw: Duplicate frame to be sent to firmware
* @ppdu_cookie: 16-bit ppdu_cookie that has to be replayed back in completions
* @ix_tx_sniffer: Indicates if the packet has to be sniffed
* @send_to_fw: Send the packet to FW, without HTT meta data
*
* This structure holds the complete MSDU information needed to program the
* Hardware TCL and MSDU extension descriptors for different frame types
@ -164,6 +165,7 @@ struct dp_tx_msdu_info_s {
uint16_t ppdu_cookie;
uint16_t ast_idx;
uint16_t ast_hash;
uint8_t send_to_fw;
};
/**

View file

@ -192,6 +192,7 @@ typedef union {
* + (TXRX)|(HTT)|(HTC)|(HIF)|(CE)|(FREE)]
* @tx.trace.is_packet_priv:
* @tx.trace.packet_track: {NBUF_TX_PKT_[(DATA)|(MGMT)]_TRACK}
* @tx.trace.to_fw: Flag to indicate send this packet to FW
* @tx.trace.proto_type: bitmap of NBUF_PKT_TRAC_TYPE[(EAPOL)|(DHCP)|
* + (MGMT_ACTION)] - 4 bits
* @tx.trace.dp_trace: flag (Datapath trace)
@ -274,8 +275,8 @@ struct qdf_nbuf_cb {
union {
uint8_t packet_state;
uint8_t dp_trace:1,
packet_track:4,
rsrvd:3;
packet_track:3,
rsrvd:4;
} trace;
uint16_t vdev_id:8,
tid_val:4,
@ -327,7 +328,8 @@ struct qdf_nbuf_cb {
struct {
uint8_t packet_state:7,
is_packet_priv:1;
uint8_t packet_track:4,
uint8_t packet_track:3,
to_fw:1,
proto_type:4;
uint8_t dp_trace:1,
is_bcast:1,
@ -496,6 +498,10 @@ QDF_COMPILE_TIME_ASSERT(qdf_nbuf_cb_size,
(((struct qdf_nbuf_cb *) \
((skb)->cb))->u.tx.trace.packet_track)
#define QDF_NBUF_CB_TX_PACKET_TO_FW(skb)\
(((struct qdf_nbuf_cb *) \
((skb)->cb))->u.tx.trace.to_fw)
#define QDF_NBUF_CB_RX_PACKET_TRACK(skb)\
(((struct qdf_nbuf_cb *) \
((skb)->cb))->u.rx.trace.packet_track)