From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BCA66A0524; Fri, 8 Jan 2021 03:08:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9275B140DD8; Fri, 8 Jan 2021 03:08:22 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 76B23140DCE for ; Fri, 8 Jan 2021 03:08:20 +0100 (CET) IronPort-SDR: xXKyBnhdwJ7AmAIhSu6ionTnDcQ1XbXcbG/UVP0MAOs+p5TcQnvkiaLO1C/5EH2sLAwOpdXLIV Cl0qyuIjhEVw== X-IronPort-AV: E=McAfee;i="6000,8403,9857"; a="174018230" X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="174018230" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jan 2021 18:08:20 -0800 IronPort-SDR: 6nw4fkqvgDIQLEemKqBiHJgmn21J9siIHiM8bkTat7pvvqON014oxFZf6tOrf0W+yfcm7ELDfY NS6je1yZah2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,330,1602572400"; d="scan'208";a="403224973" Received: from dpdk51.sh.intel.com ([10.67.111.142]) by FMSMGA003.fm.intel.com with ESMTP; 07 Jan 2021 18:08:18 -0800 From: Qi Zhang To: beilei.xing@intel.com, haiyue.wang@intel.com Cc: jingjing.wu@intel.com, dev@dpdk.org, Qi Zhang , Qiming Yang Date: Fri, 8 Jan 2021 10:12:07 +0800 Message-Id: <20210108021208.225419-3-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210108021208.225419-1-qi.z.zhang@intel.com> References: <20210108021208.225419-1-qi.z.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/3] common/iavf: add opcode to set VLAN offload by DCF 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 Sender: "dev" Add new opcode VIRTCHNL_OP_DCF_VLAN_OFFLOAD to set VLAN offload by DCF, the virtchnl message includes: 1. A valid target VF 2. Type of VLAN to be supported: outer or inner 3. Ethertype of the VLAN (either 0x8100 or 0x88A8 or 0x9100) 4. VLAN insert settings a). No insert offload, VLAN ID in the packet (default) b). Offload via transmit descriptor c). Insert as a port VLAN (via VSI) 5. VLAN strip settings a). Strip (and discard) b). Strip and place in descriptor c). No Strip 6. VLAN ID for the target VF Signed-off-by: Qiming Yang Signed-off-by: Haiyue Wang Signed-off-by: Qi Zhang --- drivers/common/iavf/virtchnl.h | 38 +++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/common/iavf/virtchnl.h b/drivers/common/iavf/virtchnl.h index ca18f8da82..380d9126f7 100644 --- a/drivers/common/iavf/virtchnl.h +++ b/drivers/common/iavf/virtchnl.h @@ -128,7 +128,8 @@ enum virtchnl_ops { VIRTCHNL_OP_DISABLE_CHANNELS = 31, VIRTCHNL_OP_ADD_CLOUD_FILTER = 32, VIRTCHNL_OP_DEL_CLOUD_FILTER = 33, - /* opcodes 34, 35, 36, 37 and 38 are reserved */ + /* opcodes 34, 35, 36, and 37 are reserved */ + VIRTCHNL_OP_DCF_VLAN_OFFLOAD = 38, VIRTCHNL_OP_DCF_CMD_DESC = 39, VIRTCHNL_OP_DCF_CMD_BUFF = 40, VIRTCHNL_OP_DCF_DISABLE = 41, @@ -1089,6 +1090,38 @@ struct virtchnl_pkg_info { VIRTCHNL_CHECK_STRUCT_LEN(48, virtchnl_pkg_info); +/* VIRTCHNL_OP_DCF_VLAN_OFFLOAD + * DCF negotiates the VIRTCHNL_VF_OFFLOAD_VLAN_V2 capabilitiy firstly to get + * the double VLAN configuration, then DCF sends this message to configure the + * outer or inner VLAN offloads (insertion and strip) for the target VF. + */ +struct virtchnl_dcf_vlan_offload { + u16 vf_id; + u16 tpid; + u16 vlan_flags; +#define VIRTCHNL_DCF_VLAN_TYPE_S 0 +#define VIRTCHNL_DCF_VLAN_TYPE_M \ + (0x1 << VIRTCHNL_DCF_VLAN_TYPE_S) +#define VIRTCHNL_DCF_VLAN_TYPE_INNER 0x0 +#define VIRTCHNL_DCF_VLAN_TYPE_OUTER 0x1 +#define VIRTCHNL_DCF_VLAN_INSERT_MODE_S 1 +#define VIRTCHNL_DCF_VLAN_INSERT_MODE_M \ + (0x7 << VIRTCHNL_DCF_VLAN_INSERT_MODE_S) +#define VIRTCHNL_DCF_VLAN_INSERT_DISABLE 0x1 +#define VIRTCHNL_DCF_VLAN_INSERT_PORT_BASED 0x2 +#define VIRTCHNL_DCF_VLAN_INSERT_VIA_TX_DESC 0x3 +#define VIRTCHNL_DCF_VLAN_STRIP_MODE_S 4 +#define VIRTCHNL_DCF_VLAN_STRIP_MODE_M \ + (0x7 << VIRTCHNL_DCF_VLAN_STRIP_MODE_S) +#define VIRTCHNL_DCF_VLAN_STRIP_DISABLE 0x1 +#define VIRTCHNL_DCF_VLAN_STRIP_ONLY 0x2 +#define VIRTCHNL_DCF_VLAN_STRIP_INTO_RX_DESC 0x3 + u16 vlan_id; + u16 pad[4]; +}; + +VIRTCHNL_CHECK_STRUCT_LEN(16, virtchnl_dcf_vlan_offload); + struct virtchnl_supported_rxdids { u64 supported_rxdids; }; @@ -1804,6 +1837,9 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode, case VIRTCHNL_OP_DEL_CLOUD_FILTER: valid_len = sizeof(struct virtchnl_filter); break; + case VIRTCHNL_OP_DCF_VLAN_OFFLOAD: + valid_len = sizeof(struct virtchnl_dcf_vlan_offload); + break; case VIRTCHNL_OP_DCF_CMD_DESC: case VIRTCHNL_OP_DCF_CMD_BUFF: /* These two opcodes are specific to handle the AdminQ command, -- 2.26.2