+int
+cnxk_nix_tm_mark_vlan_dei(struct rte_eth_dev *eth_dev, int mark_green,
+ int mark_yellow, int mark_red,
+ struct rte_tm_error *error)
+{
+ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+ struct roc_nix *roc_nix = &dev->nix;
+ int rc;
+
+ if (mark_green) {
+ error->type = RTE_TM_ERROR_TYPE_CAPABILITIES;
+ error->message = "Green VLAN marking not supported";
+ return -EINVAL;
+ }
+
+ if (eth_dev->data->dev_started) {
+ error->type = RTE_TM_ERROR_TYPE_CAPABILITIES;
+ error->message = "VLAN DEI mark for running ports not "
+ "supported";
+ return -EBUSY;
+ }
+
+ rc = roc_nix_tm_mark_config(roc_nix, ROC_NIX_TM_MARK_VLAN_DEI,
+ mark_yellow, mark_red);
+ if (rc) {
+ error->type = roc_nix_tm_err_to_rte_err(rc);
+ error->message = roc_error_msg_get(rc);
+ }
+ return rc;
+}
+
+int
+cnxk_nix_tm_mark_ip_ecn(struct rte_eth_dev *eth_dev, int mark_green,
+ int mark_yellow, int mark_red,
+ struct rte_tm_error *error)
+{
+ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+ struct roc_nix *roc_nix = &dev->nix;
+ int rc;
+
+ if (mark_green) {
+ error->type = RTE_TM_ERROR_TYPE_CAPABILITIES;
+ error->message = "Green IP ECN marking not supported";
+ return -EINVAL;
+ }
+
+ if (eth_dev->data->dev_started) {
+ error->type = RTE_TM_ERROR_TYPE_CAPABILITIES;
+ error->message = "IP ECN mark for running ports not "
+ "supported";
+ return -EBUSY;
+ }
+
+ rc = roc_nix_tm_mark_config(roc_nix, ROC_NIX_TM_MARK_IPV4_ECN,
+ mark_yellow, mark_red);
+ if (rc < 0)
+ goto exit;
+
+ rc = roc_nix_tm_mark_config(roc_nix, ROC_NIX_TM_MARK_IPV6_ECN,
+ mark_yellow, mark_red);
+exit:
+ if (rc < 0) {
+ error->type = roc_nix_tm_err_to_rte_err(rc);
+ error->message = roc_error_msg_get(rc);
+ }
+ return rc;
+}
+
+int
+cnxk_nix_tm_mark_ip_dscp(struct rte_eth_dev *eth_dev, int mark_green,
+ int mark_yellow, int mark_red,
+ struct rte_tm_error *error)
+{
+ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+ struct roc_nix *roc_nix = &dev->nix;
+ int rc;
+
+ if (mark_green) {
+ error->type = RTE_TM_ERROR_TYPE_CAPABILITIES;
+ error->message = "Green IP DSCP marking not supported";
+ return -EINVAL;
+ }
+
+ if (eth_dev->data->dev_started) {
+ error->type = RTE_TM_ERROR_TYPE_CAPABILITIES;
+ error->message = "IP DSCP mark for running ports not "
+ "supported";
+ return -EBUSY;
+ }
+
+ rc = roc_nix_tm_mark_config(roc_nix, ROC_NIX_TM_MARK_IPV4_DSCP,
+ mark_yellow, mark_red);
+ if (rc < 0)
+ goto exit;
+
+ rc = roc_nix_tm_mark_config(roc_nix, ROC_NIX_TM_MARK_IPV6_DSCP,
+ mark_yellow, mark_red);
+exit:
+ if (rc < 0) {
+ error->type = roc_nix_tm_err_to_rte_err(rc);
+ error->message = roc_error_msg_get(rc);
+ }
+ return rc;
+}
+
+struct rte_tm_ops cnxk_tm_ops = {