-/**
- * Internal function to mark all the nat resources allocated that
- * Truflow does not own.
- */
-static void
-tf_rm_rsvd_sram_nat(struct tf_session *tfs)
-{
- uint32_t index = TF_RESC_TYPE_SRAM_NAT_SPORT;
- uint16_t end = 0;
-
- /* nat source port rx direction */
- if (tfs->resc.rx.sram_entry[index].stride > 0)
- end = tfs->resc.rx.sram_entry[index].start +
- tfs->resc.rx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.rx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_SPORT_BEGIN_IDX_RX,
- end,
- TF_RSVD_SRAM_NAT_SPORT_RX,
- tfs->TF_SRAM_NAT_SPORT_POOL_NAME_RX);
-
- /* nat source port tx direction */
- if (tfs->resc.tx.sram_entry[index].stride > 0)
- end = tfs->resc.tx.sram_entry[index].start +
- tfs->resc.tx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.tx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_SPORT_BEGIN_IDX_TX,
- end,
- TF_RSVD_SRAM_NAT_SPORT_TX,
- tfs->TF_SRAM_NAT_SPORT_POOL_NAME_TX);
-
- index = TF_RESC_TYPE_SRAM_NAT_DPORT;
-
- /* nat destination port rx direction */
- if (tfs->resc.rx.sram_entry[index].stride > 0)
- end = tfs->resc.rx.sram_entry[index].start +
- tfs->resc.rx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.rx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_DPORT_BEGIN_IDX_RX,
- end,
- TF_RSVD_SRAM_NAT_DPORT_RX,
- tfs->TF_SRAM_NAT_DPORT_POOL_NAME_RX);
-
- /* nat destination port tx direction */
- if (tfs->resc.tx.sram_entry[index].stride > 0)
- end = tfs->resc.tx.sram_entry[index].start +
- tfs->resc.tx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.tx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_DPORT_BEGIN_IDX_TX,
- end,
- TF_RSVD_SRAM_NAT_DPORT_TX,
- tfs->TF_SRAM_NAT_DPORT_POOL_NAME_TX);
-
- index = TF_RESC_TYPE_SRAM_NAT_S_IPV4;
-
- /* nat source port ipv4 rx direction */
- if (tfs->resc.rx.sram_entry[index].stride > 0)
- end = tfs->resc.rx.sram_entry[index].start +
- tfs->resc.rx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.rx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_S_IPV4_BEGIN_IDX_RX,
- end,
- TF_RSVD_SRAM_NAT_S_IPV4_RX,
- tfs->TF_SRAM_NAT_S_IPV4_POOL_NAME_RX);
-
- /* nat source ipv4 port tx direction */
- if (tfs->resc.tx.sram_entry[index].stride > 0)
- end = tfs->resc.tx.sram_entry[index].start +
- tfs->resc.tx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.tx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_S_IPV4_BEGIN_IDX_TX,
- end,
- TF_RSVD_SRAM_NAT_S_IPV4_TX,
- tfs->TF_SRAM_NAT_S_IPV4_POOL_NAME_TX);
-
- index = TF_RESC_TYPE_SRAM_NAT_D_IPV4;
-
- /* nat destination port ipv4 rx direction */
- if (tfs->resc.rx.sram_entry[index].stride > 0)
- end = tfs->resc.rx.sram_entry[index].start +
- tfs->resc.rx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.rx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_D_IPV4_BEGIN_IDX_RX,
- end,
- TF_RSVD_SRAM_NAT_D_IPV4_RX,
- tfs->TF_SRAM_NAT_D_IPV4_POOL_NAME_RX);
-
- /* nat destination ipv4 port tx direction */
- if (tfs->resc.tx.sram_entry[index].stride > 0)
- end = tfs->resc.tx.sram_entry[index].start +
- tfs->resc.tx.sram_entry[index].stride - 1;
-
- tf_rm_reserve_range(tfs->resc.tx.sram_entry[index].stride,
- TF_RSVD_SRAM_NAT_D_IPV4_BEGIN_IDX_TX,
- end,
- TF_RSVD_SRAM_NAT_D_IPV4_TX,
- tfs->TF_SRAM_NAT_D_IPV4_POOL_NAME_TX);
-}