qcacld-3.0: Use dp_link in txrx path

Use dp_link in the core TX/RX path instead
of currently used dp_intf.

Change-Id: Id32a4053094fae844d190043d57f85a8e9659339
CRs-Fixed: 3518897
This commit is contained in:
Rakesh Pillai
2023-03-08 02:44:26 -08:00
committed by Rahul Choudhary
parent a3161f8f5b
commit 1e093bec44
7 changed files with 74 additions and 37 deletions

View File

@@ -561,6 +561,16 @@ dp_del_latency_critical_client(struct wlan_objmgr_vdev *vdev,
*/
int is_dp_intf_valid(struct wlan_dp_intf *dp_intf);
/**
* is_dp_link_valid() - check if DP link is valid
* @dp_link: DP link handle
*
* API to check whether DP link is valid
*
* Return: true if dp_link is valid, else false.
*/
bool is_dp_link_valid(struct wlan_dp_link *dp_link);
/**
* dp_send_rps_ind() - send rps indication to daemon
* @dp_intf: DP interface

View File

@@ -162,11 +162,11 @@ QDF_STATUS dp_rx_flush_packet_cbk(void *dp_link_context, uint8_t link_id);
/**
* dp_softap_start_xmit() - Transmit a frame for SAP interface
* @nbuf: pointer to Network buffer
* @dp_intf: DP interface
* @dp_link: DP link handle
*
* Return: QDF_STATUS_SUCCESS on successful transmission
*/
QDF_STATUS dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_dp_intf *dp_intf);
QDF_STATUS dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_dp_link *dp_link);
/**
* dp_softap_tx_timeout() - TX timeout handler
@@ -297,7 +297,7 @@ QDF_STATUS dp_rx_thread_gro_flush_ind_cbk(void *intf_ctx, int rx_ctx_id);
/**
* dp_rx_pkt_thread_enqueue_cbk() - receive pkt handler to enqueue into thread
* @intf_ctx: pointer to DP interface context
* @link_ctx: pointer to DP link context
* @nbuf_list: pointer to qdf_nbuf list
*
* Receive callback registered with DP layer which enqueues packets into dp rx
@@ -306,7 +306,7 @@ QDF_STATUS dp_rx_thread_gro_flush_ind_cbk(void *intf_ctx, int rx_ctx_id);
* Return: QDF_STATUS_E_FAILURE if any errors encountered,
* QDF_STATUS_SUCCESS otherwise
*/
QDF_STATUS dp_rx_pkt_thread_enqueue_cbk(void *intf_ctx,
QDF_STATUS dp_rx_pkt_thread_enqueue_cbk(void *link_ctx,
qdf_nbuf_t nbuf_list);
/**
@@ -426,12 +426,12 @@ qdf_nbuf_t dp_nbuf_orphan(struct wlan_dp_intf *dp_intf,
/**
* dp_get_tx_resource() - check tx resources and take action
* @dp_intf: DP interface
* @dp_link: DP link handle
* @mac_addr: mac address
*
* Return: none
*/
void dp_get_tx_resource(struct wlan_dp_intf *dp_intf,
void dp_get_tx_resource(struct wlan_dp_link *dp_link,
struct qdf_mac_addr *mac_addr);
#else
@@ -481,13 +481,13 @@ qdf_nbuf_t dp_nbuf_orphan(struct wlan_dp_intf *dp_intf,
/**
* dp_get_tx_resource() - check tx resources and take action
* @dp_intf: DP interface
* @dp_link: DP link handle
* @mac_addr: mac address
*
* Return: none
*/
static inline
void dp_get_tx_resource(struct wlan_dp_intf *dp_intf,
void dp_get_tx_resource(struct wlan_dp_link *dp_link,
struct qdf_mac_addr *mac_addr)
{
}

View File

@@ -177,22 +177,24 @@ dp_get_intf_by_netdev(struct wlan_dp_psoc_context *dp_ctx, qdf_netdev_t dev)
}
/**
* validate_interface_id() - Check if interface ID is valid
* @intf_id: interface ID
* validate_link_id() - Check if link ID is valid
* @link_id: DP link ID
*
* Return: 0 on success, error code on failure
* Return: true on success, false on failure
*/
static int validate_interface_id(uint8_t intf_id)
static bool validate_link_id(uint8_t link_id)
{
if (intf_id == WLAN_UMAC_VDEV_ID_MAX) {
if (link_id == WLAN_UMAC_VDEV_ID_MAX) {
dp_err("Interface is not up: %ps", QDF_RET_IP);
return -EINVAL;
return false;
}
if (intf_id >= WLAN_MAX_VDEVS) {
dp_err("Bad interface id:%u", intf_id);
return -EINVAL;
if (link_id >= WLAN_MAX_VDEVS) {
dp_err("Bad interface id:%u", link_id);
return false;
}
return 0;
return true;
}
int is_dp_intf_valid(struct wlan_dp_intf *dp_intf)
@@ -213,7 +215,25 @@ int is_dp_intf_valid(struct wlan_dp_intf *dp_intf)
return -EAGAIN;
}
return validate_interface_id(dp_intf->intf_id);
return 0;
}
bool is_dp_link_valid(struct wlan_dp_link *dp_link)
{
struct wlan_dp_intf *dp_intf;
int ret;
if (!dp_link) {
dp_err("link is NULL");
return false;
}
dp_intf = dp_link->dp_intf;
ret = is_dp_intf_valid(dp_intf);
if (ret)
return false;
return validate_link_id(dp_link->link_id);
}
QDF_STATUS dp_get_front_link_no_lock(struct wlan_dp_intf *dp_intf,

View File

@@ -392,13 +392,15 @@ qdf_nbuf_t dp_sap_nbuf_orphan(struct wlan_dp_intf *dp_intf,
#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
static
void dp_softap_get_tx_resource(struct wlan_dp_intf *dp_intf,
void dp_softap_get_tx_resource(struct wlan_dp_link *dp_link,
qdf_nbuf_t nbuf)
{
struct wlan_dp_intf *dp_intf = dp_link->dp_intf;
if (QDF_NBUF_CB_GET_IS_BCAST(nbuf) || QDF_NBUF_CB_GET_IS_MCAST(nbuf))
dp_get_tx_resource(dp_intf, &dp_intf->mac_addr);
dp_get_tx_resource(dp_link, &dp_intf->mac_addr);
else
dp_get_tx_resource(dp_intf,
dp_get_tx_resource(dp_link,
(struct qdf_mac_addr *)(qdf_nbuf_data(nbuf) +
QDF_NBUF_DEST_MAC_OFFSET));
}
@@ -613,12 +615,13 @@ dp_softap_inspect_traffic_end_indication_pkt(struct wlan_dp_intf *dp_intf,
/**
* dp_softap_start_xmit() - Transmit a frame
* @nbuf: pointer to Network buffer
* @dp_intf: DP interface
* @dp_link: DP link handle
*
* Return: QDF_STATUS_SUCCESS on successful transmission
*/
QDF_STATUS dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_dp_intf *dp_intf)
QDF_STATUS dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_dp_link *dp_link)
{
struct wlan_dp_intf *dp_intf = dp_link->dp_intf;
struct wlan_dp_psoc_context *dp_ctx = dp_intf->dp_ctx;
struct qdf_mac_addr *dest_mac_addr;
void *soc = cds_get_context(QDF_MODULE_ID_SOC);
@@ -639,7 +642,7 @@ QDF_STATUS dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_dp_intf *dp_intf)
if (QDF_IS_STATUS_ERROR(dp_softap_validate_peer_state(dp_intf, nbuf)))
goto drop_pkt;
dp_softap_get_tx_resource(dp_intf, nbuf);
dp_softap_get_tx_resource(dp_link, nbuf);
nbuf = dp_sap_nbuf_orphan(dp_intf, nbuf);
if (!nbuf)

View File

@@ -64,12 +64,13 @@ void dp_rx_skip_fisa(struct wlan_dp_psoc_context *dp_ctx, uint32_t value)
#endif
#ifdef QCA_LL_LEGACY_TX_FLOW_CONTROL
void dp_get_tx_resource(struct wlan_dp_intf *dp_intf,
void dp_get_tx_resource(struct wlan_dp_link *dp_link,
struct qdf_mac_addr *mac_addr)
{
struct wlan_dp_intf *dp_intf = dp_link->dp_intf;
struct wlan_dp_psoc_callbacks *dp_ops = &dp_intf->dp_ctx->dp_ops;
dp_ops->dp_get_tx_resource(dp_intf->intf_id,
dp_ops->dp_get_tx_resource(dp_link->link_id,
mac_addr);
}
#endif /* QCA_LL_LEGACY_TX_FLOW_CONTROL */
@@ -627,7 +628,7 @@ dp_start_xmit(struct wlan_dp_link *dp_link, qdf_nbuf_t nbuf)
goto drop_pkt;
}
dp_get_tx_resource(dp_intf, &mac_addr_tx_allowed);
dp_get_tx_resource(dp_link, &mac_addr_tx_allowed);
if (!qdf_nbuf_ipa_owned_get(nbuf)) {
nbuf = dp_nbuf_orphan(dp_intf, nbuf);
@@ -1341,32 +1342,34 @@ dp_rx_thread_gro_flush_ind_cbk(void *intf_ctx, int rx_ctx_id)
rx_ctx_id, gro_flush_code);
}
QDF_STATUS dp_rx_pkt_thread_enqueue_cbk(void *intf_ctx,
QDF_STATUS dp_rx_pkt_thread_enqueue_cbk(void *link_ctx,
qdf_nbuf_t nbuf_list)
{
struct wlan_dp_intf *dp_intf;
uint8_t intf_id;
struct wlan_dp_link *dp_link;
uint8_t link_id;
qdf_nbuf_t head_ptr;
if (qdf_unlikely(!intf_ctx || !nbuf_list)) {
if (qdf_unlikely(!link_ctx || !nbuf_list)) {
dp_err("Null params being passed");
return QDF_STATUS_E_FAILURE;
}
dp_intf = (struct wlan_dp_intf *)intf_ctx;
if (is_dp_intf_valid(dp_intf))
dp_link = (struct wlan_dp_link *)link_ctx;
if (!is_dp_link_valid(dp_link))
return QDF_STATUS_E_FAILURE;
dp_intf = dp_link->dp_intf;
if (dp_intf->runtime_disable_rx_thread &&
dp_intf->txrx_ops.rx.rx_stack)
return dp_intf->txrx_ops.rx.rx_stack(dp_intf, nbuf_list);
intf_id = dp_intf->intf_id;
link_id = dp_link->link_id;
head_ptr = nbuf_list;
while (head_ptr) {
qdf_nbuf_cb_update_vdev_id(head_ptr,
intf_id);
link_id);
head_ptr = qdf_nbuf_next(head_ptr);
}

View File

@@ -641,7 +641,8 @@ struct wlan_dp_psoc_callbacks {
qdf_netdev_t (*dp_get_netdev_by_vdev_mac)(struct qdf_mac_addr *mac_addr);
unsigned int (*dp_get_tx_flow_low_watermark)(hdd_cb_handle cb_ctx,
uint8_t intf_id);
void (*dp_get_tx_resource)(uint8_t intf_id, struct qdf_mac_addr *mac_addr);
void (*dp_get_tx_resource)(uint8_t link_id_id,
struct qdf_mac_addr *mac_addr);
void (*dp_get_tsf_time)(uint8_t intf_id,
uint64_t input_time, uint64_t *tsf_time);

View File

@@ -1321,7 +1321,7 @@ ucfg_dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_objmgr_vdev *vdev)
dp_intf = dp_link->dp_intf;
qdf_atomic_inc(&dp_intf->num_active_task);
status = dp_softap_start_xmit(nbuf, dp_intf);
status = dp_softap_start_xmit(nbuf, dp_link);
qdf_atomic_dec(&dp_intf->num_active_task);
return status;