qcacmn: Add peer isolation support per vap
Configure the client as isolated peer if part of isolation list while creating/associating the node or adding the peer to the isolation list. Do not forward the packets to and from clients in isolation list instead accelerate to upper stack. CRs-Fixed: 2689868 Change-Id: I67fd4dee0fb76c993746cdd66c70c241d407239a
This commit is contained in:

committed by
nshrivas

parent
30f07a9dc1
commit
a497ea80aa
@@ -978,10 +978,12 @@ struct cdp_soc_t {
|
|||||||
* to set values in peer
|
* to set values in peer
|
||||||
* @CDP_CONFIG_NAWDS: Enable nawds mode
|
* @CDP_CONFIG_NAWDS: Enable nawds mode
|
||||||
* @CDP_CONFIG_NAC: Enable nac
|
* @CDP_CONFIG_NAC: Enable nac
|
||||||
|
* @CDP_CONFIG_ISOLATION : Enable isolation
|
||||||
*/
|
*/
|
||||||
enum cdp_peer_param_type {
|
enum cdp_peer_param_type {
|
||||||
CDP_CONFIG_NAWDS,
|
CDP_CONFIG_NAWDS,
|
||||||
CDP_CONFIG_NAC,
|
CDP_CONFIG_NAC,
|
||||||
|
CDP_CONFIG_ISOLATION,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1050,6 +1052,7 @@ enum cdp_pdev_param_type {
|
|||||||
* to set values into dp handles.
|
* to set values into dp handles.
|
||||||
*
|
*
|
||||||
* @cdp_peer_param_nawds: Enable nawds mode
|
* @cdp_peer_param_nawds: Enable nawds mode
|
||||||
|
* @cdp_peer_param_isolation: Enable isolation
|
||||||
* @cdp_peer_param_nac: Enable nac
|
* @cdp_peer_param_nac: Enable nac
|
||||||
*
|
*
|
||||||
* @cdp_vdev_param_nawds: set nawds enable/disable
|
* @cdp_vdev_param_nawds: set nawds enable/disable
|
||||||
@@ -1104,6 +1107,7 @@ enum cdp_pdev_param_type {
|
|||||||
typedef union cdp_config_param_t {
|
typedef union cdp_config_param_t {
|
||||||
/* peer params */
|
/* peer params */
|
||||||
bool cdp_peer_param_nawds;
|
bool cdp_peer_param_nawds;
|
||||||
|
bool cdp_peer_param_isolation;
|
||||||
uint8_t cdp_peer_param_nac;
|
uint8_t cdp_peer_param_nac;
|
||||||
|
|
||||||
/* vdev params */
|
/* vdev params */
|
||||||
|
@@ -340,6 +340,25 @@ while (0)
|
|||||||
#define DP_TX_HIST_STATS_PER_PDEV()
|
#define DP_TX_HIST_STATS_PER_PDEV()
|
||||||
#endif /* DISABLE_DP_STATS */
|
#endif /* DISABLE_DP_STATS */
|
||||||
|
|
||||||
|
#ifdef QCA_SUPPORT_PEER_ISOLATION
|
||||||
|
#define dp_get_peer_isolation(_peer) ((_peer)->isolation)
|
||||||
|
|
||||||
|
static inline void dp_set_peer_isolation(struct dp_peer *peer, bool val)
|
||||||
|
{
|
||||||
|
peer->isolation = val;
|
||||||
|
QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
|
||||||
|
"peer:%pM isolation:%d",
|
||||||
|
peer->mac_addr.raw, peer->isolation);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
#define dp_get_peer_isolation(_peer) (0)
|
||||||
|
|
||||||
|
static inline void dp_set_peer_isolation(struct dp_peer *peer, bool val)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif /* QCA_SUPPORT_PEER_ISOLATION */
|
||||||
|
|
||||||
#ifdef FEATURE_TSO_STATS
|
#ifdef FEATURE_TSO_STATS
|
||||||
/**
|
/**
|
||||||
* dp_init_tso_stats() - Clear tso stats
|
* dp_init_tso_stats() - Clear tso stats
|
||||||
|
@@ -5227,6 +5227,9 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
|||||||
* update tx_cap_enabled flag to support peer filter.
|
* update tx_cap_enabled flag to support peer filter.
|
||||||
*/
|
*/
|
||||||
dp_peer_tx_capture_filter_check(pdev, peer);
|
dp_peer_tx_capture_filter_check(pdev, peer);
|
||||||
|
|
||||||
|
dp_set_peer_isolation(peer, false);
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
@@ -5354,6 +5357,8 @@ dp_peer_create_wifi3(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
|
|||||||
*/
|
*/
|
||||||
dp_peer_tx_capture_filter_check(pdev, peer);
|
dp_peer_tx_capture_filter_check(pdev, peer);
|
||||||
|
|
||||||
|
dp_set_peer_isolation(peer, false);
|
||||||
|
|
||||||
return QDF_STATUS_SUCCESS;
|
return QDF_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7688,6 +7693,9 @@ static QDF_STATUS dp_set_peer_param(struct cdp_soc_t *cdp_soc, uint8_t vdev_id,
|
|||||||
case CDP_CONFIG_NAC:
|
case CDP_CONFIG_NAC:
|
||||||
peer->nac = !!(val.cdp_peer_param_nac);
|
peer->nac = !!(val.cdp_peer_param_nac);
|
||||||
break;
|
break;
|
||||||
|
case CDP_CONFIG_ISOLATION:
|
||||||
|
dp_set_peer_isolation(peer, val.cdp_peer_param_isolation);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -495,6 +495,13 @@ dp_rx_intrabss_fwd(struct dp_soc *soc,
|
|||||||
is_frag = qdf_nbuf_is_frag(nbuf);
|
is_frag = qdf_nbuf_is_frag(nbuf);
|
||||||
memset(nbuf->cb, 0x0, sizeof(nbuf->cb));
|
memset(nbuf->cb, 0x0, sizeof(nbuf->cb));
|
||||||
|
|
||||||
|
/* If the source or destination peer in the isolation
|
||||||
|
* list then dont forward instead push to bridge stack.
|
||||||
|
*/
|
||||||
|
if (dp_get_peer_isolation(ta_peer) ||
|
||||||
|
dp_get_peer_isolation(da_peer))
|
||||||
|
return false;
|
||||||
|
|
||||||
/* linearize the nbuf just before we send to
|
/* linearize the nbuf just before we send to
|
||||||
* dp_tx_send()
|
* dp_tx_send()
|
||||||
*/
|
*/
|
||||||
@@ -544,6 +551,12 @@ dp_rx_intrabss_fwd(struct dp_soc *soc,
|
|||||||
if (!dp_rx_check_ndi_mdns_fwding(ta_peer, nbuf))
|
if (!dp_rx_check_ndi_mdns_fwding(ta_peer, nbuf))
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
|
/* If the source peer in the isolation list
|
||||||
|
* then dont forward instead push to bridge stack
|
||||||
|
*/
|
||||||
|
if (dp_get_peer_isolation(ta_peer))
|
||||||
|
goto end;
|
||||||
|
|
||||||
nbuf_copy = qdf_nbuf_copy(nbuf);
|
nbuf_copy = qdf_nbuf_copy(nbuf);
|
||||||
if (!nbuf_copy)
|
if (!nbuf_copy)
|
||||||
goto end;
|
goto end;
|
||||||
|
@@ -2240,6 +2240,10 @@ struct dp_peer {
|
|||||||
rx_cap_enabled:1, /* Peer's rx-capture is enabled */
|
rx_cap_enabled:1, /* Peer's rx-capture is enabled */
|
||||||
valid:1; /* valid bit */
|
valid:1; /* valid bit */
|
||||||
|
|
||||||
|
#ifdef QCA_SUPPORT_PEER_ISOLATION
|
||||||
|
bool isolation; /* enable peer isolation for this peer */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* MCL specific peer local id */
|
/* MCL specific peer local id */
|
||||||
uint16_t local_id;
|
uint16_t local_id;
|
||||||
enum ol_txrx_peer_state state;
|
enum ol_txrx_peer_state state;
|
||||||
|
Reference in New Issue
Block a user