From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D111A0552; Fri, 26 Aug 2022 09:24:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E45B640146; Fri, 26 Aug 2022 09:24:44 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 087F240143 for ; Fri, 26 Aug 2022 09:24:42 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1661498683; x=1693034683; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=36mvFwea9pnGDTtXDYaytUL1efP+D+ZUn249N2+xWf8=; b=m/q3OFYGKvfyS72sip6FisSx9P4kF28kkyWwq4u/KeFSlpO6zwB2IYn1 NcBtdoHflmc2Jbz6oLPDLVetSP/J8Ts6BX8aGm1rRJvpB+VrWOmrURgqF B1ZECdgvK+iB9Jc/rw3d40AXvMOgFeDr5ag7gRo2Yt2PfQAKT9/bo4TwT CElPF3TRfRindaJb7ecPa3DCnncJz+yDLq4WXSQbHYiH11dgb02bY+IuU 1rwITcN1VIuHmRoR1vPwpy4TmPsAKAleo1lxRA+XUUKQVHo2+25YFdUQP b8WhQBag0Qc6EMOz47FYBRGDYCu/Z53izZ6AQF/+N57g2cvTONqqyMxm2 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10450"; a="358411996" X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="358411996" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 00:24:41 -0700 X-IronPort-AV: E=Sophos;i="5.93,264,1654585200"; d="scan'208";a="671357019" Received: from unknown (HELO localhost.localdomain) ([10.239.252.103]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 00:24:39 -0700 From: zhichaox.zeng@intel.com To: dev@dpdk.org Cc: qiming.yang@intel.com, yidingx.zhou@intel.com, Zhichao Zeng , Qi Zhang Subject: [PATCH] net/ice: support original represented_port action Date: Fri, 26 Aug 2022 15:25:44 +0800 Message-Id: <20220826072545.18127-1-zhichaox.zeng@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Zhichao Zeng Add support to send matching traffic to the original DCF port with represented_port action by using DCF port id as ethdev_port_id. Signed-off-by: Zhichao Zeng --- drivers/net/ice/ice_switch_filter.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index da81e49bfa..dbcb8bdfdc 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -1623,6 +1623,7 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad, const struct rte_eth_dev *repr_dev; enum rte_flow_action_type action_type; uint16_t rule_port_id, backer_port_id; + const char *pf_dev_name; for (action = actions; action->type != RTE_FLOW_ACTION_TYPE_END; action++) { @@ -1638,8 +1639,11 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad, rule_port_id = ad->parent.pf.dev_data->port_id; backer_port_id = repr_dev->data->backer_port_id; + pf_dev_name = ad->parent.pf.dev_data->name; - if (backer_port_id != rule_port_id) + if (backer_port_id != rule_port_id && + strncmp(pf_dev_name, repr_dev->data->name, + strlen(pf_dev_name))) goto invalid; rule_info->sw_act.vsi_handle = repr_dev->data->representor_id; -- 2.25.1