diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index 3e9220ca76c0..a2651cb1f834 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -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); diff --git a/dp/wifi3.0/dp_tx.h b/dp/wifi3.0/dp_tx.h index 49f9b4db909f..555bfc258453 100644 --- a/dp/wifi3.0/dp_tx.h +++ b/dp/wifi3.0/dp_tx.h @@ -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; }; /** diff --git a/qdf/linux/src/i_qdf_nbuf.h b/qdf/linux/src/i_qdf_nbuf.h index 557aa0f18d9a..84bb26cd1070 100644 --- a/qdf/linux/src/i_qdf_nbuf.h +++ b/qdf/linux/src/i_qdf_nbuf.h @@ -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)