return otx2_mbox_process(mbox);
}
+int
+otx2_eth_sec_update_tag_type(struct rte_eth_dev *eth_dev)
+{
+ struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev);
+ struct otx2_mbox *mbox = dev->mbox;
+ struct nix_aq_enq_rsp *rsp;
+ struct nix_aq_enq_req *aq;
+ int ret;
+
+ aq = otx2_mbox_alloc_msg_nix_aq_enq(mbox);
+ aq->qidx = 0; /* Read RQ:0 context */
+ aq->ctype = NIX_AQ_CTYPE_RQ;
+ aq->op = NIX_AQ_INSTOP_READ;
+
+ ret = otx2_mbox_process_msg(mbox, (void *)&rsp);
+ if (ret < 0) {
+ otx2_err("Could not read RQ context");
+ return ret;
+ }
+
+ /* Update tag type */
+ ret = eth_sec_ipsec_cfg(eth_dev, rsp->rq.sso_tt);
+ if (ret < 0)
+ otx2_err("Could not update sec eth tag type");
+
+ return ret;
+}
+
int
otx2_eth_sec_init(struct rte_eth_dev *eth_dev)
{
void otx2_eth_sec_ctx_destroy(struct rte_eth_dev *eth_dev);
+int otx2_eth_sec_update_tag_type(struct rte_eth_dev *eth_dev);
+
int otx2_eth_sec_init(struct rte_eth_dev *eth_dev);
void otx2_eth_sec_fini(struct rte_eth_dev *eth_dev);
*/
#include "otx2_ethdev.h"
+#include "otx2_ethdev_sec.h"
#include "otx2_flow.h"
int
return 0;
}
+static int
+flow_update_sec_tt(struct rte_eth_dev *eth_dev,
+ const struct rte_flow_action actions[])
+{
+ int rc = 0;
+
+ for (; actions->type != RTE_FLOW_ACTION_TYPE_END; actions++) {
+ if (actions->type == RTE_FLOW_ACTION_TYPE_SECURITY) {
+ rc = otx2_eth_sec_update_tag_type(eth_dev);
+ break;
+ }
+ }
+
+ return rc;
+}
static int
flow_parse_meta_items(__rte_unused struct otx2_parse_state *pst)
goto err_exit;
}
+ if (hw->rx_offloads & DEV_RX_OFFLOAD_SECURITY) {
+ rc = flow_update_sec_tt(dev, actions);
+ if (rc != 0) {
+ rte_flow_error_set(error, EIO,
+ RTE_FLOW_ERROR_TYPE_UNSPECIFIED,
+ NULL,
+ "Failed to update tt with sec act");
+ goto err_exit;
+ }
+ }
list = &hw->npc_flow.flow_list[flow->priority];
/* List in ascending order of mcam entries */