+static int
+enic_fm_check_transfer_dst(struct enic *enic, uint16_t dst_port_id,
+ struct rte_eth_dev **dst_dev,
+ struct rte_flow_error *error)
+{
+ struct rte_eth_dev *dev;
+
+ ENICPMD_LOG(DEBUG, "port id %u", dst_port_id);
+ if (!rte_eth_dev_is_valid_port(dst_port_id)) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "invalid port_id");
+ }
+ dev = &rte_eth_devices[dst_port_id];
+ if (!dev_is_enic(dev)) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "port_id is not enic");
+ }
+ if (enic->switch_domain_id != pmd_priv(dev)->switch_domain_id) {
+ return rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION,
+ NULL, "destination and source ports are not in the same switch domain");
+ }
+
+ *dst_dev = dev;
+ return 0;
+}
+