From: Beilei Xing <beilei.xing@intel.com>
To: jingjing.wu@intel.com
Cc: helin.zhang@intel.com, dev@dpdk.org
Subject: [dpdk-dev] [PATCH 3/6] net/i40e: add ppp processing
Date: Fri, 3 Mar 2017 15:26:14 +0800 [thread overview]
Message-ID: <1488525977-15321-10-git-send-email-beilei.xing@intel.com> (raw)
In-Reply-To: <1488525977-15321-1-git-send-email-beilei.xing@intel.com>
Add loading profile function.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
drivers/net/i40e/i40e_ethdev.c | 59 +++++++++++++++++++++++++++++++++++++++++
drivers/net/i40e/rte_pmd_i40e.h | 7 +++++
2 files changed, 66 insertions(+)
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index ca4a87d..dae4b97 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -11456,3 +11456,62 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw,
return status;
}
+
+int
+i40e_process_package(uint8_t port, uint8_t *buff)
+{
+ struct rte_eth_dev *dev = &rte_eth_devices[port];
+ struct i40e_hw *hw = I40E_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+ struct i40e_package_header *pkg_hdr;
+ struct i40e_generic_seg_header *profile_seg_hdr;
+ struct i40e_generic_seg_header *metadata_seg_hdr;
+ uint32_t track_id;
+ uint8_t *profile_info_sec;
+ enum i40e_status_code status;
+
+ pkg_hdr = (struct i40e_package_header *)buff;
+
+ if (!pkg_hdr) {
+ PMD_DRV_LOG(ERR, "Failed to fill the package structure");
+ return -EINVAL;
+ }
+
+ /* Find metadata segment */
+ metadata_seg_hdr = i40e_find_segment_in_package(SEGMENT_TYPE_METADATA,
+ pkg_hdr);
+ if (!metadata_seg_hdr) {
+ PMD_DRV_LOG(ERR, "Failed to find metadata segment header");
+ return -EINVAL;
+ }
+ track_id = ((struct i40e_metadata_segment *)metadata_seg_hdr)->track_id;
+
+ /* Find profile segment */
+ profile_seg_hdr = i40e_find_segment_in_package(SEGMENT_TYPE_I40E,
+ pkg_hdr);
+ if (!profile_seg_hdr) {
+ PMD_DRV_LOG(ERR, "Failed to find profile segment header");
+ return -EINVAL;
+ }
+
+ /* Write profile to HW */
+ status = i40e_write_profile(hw,
+ (struct i40e_profile_segment *)profile_seg_hdr,
+ track_id);
+ if (!status)
+ printf("Write profile successfully.\n");
+
+ /* Add the profile info to the list of loaded profiles */
+ profile_info_sec = rte_zmalloc("i40e_profile_info",
+ sizeof(struct i40e_profile_section_header) +
+ sizeof(struct i40e_profile_info),
+ 0);
+ status = i40e_add_pinfo_to_list(hw,
+ (struct i40e_profile_segment *)profile_seg_hdr,
+ profile_info_sec, track_id);
+ if (!status)
+ printf("Add profile info successfully.\n");
+
+ rte_free(profile_info_sec);
+
+ return status;
+}
diff --git a/drivers/net/i40e/rte_pmd_i40e.h b/drivers/net/i40e/rte_pmd_i40e.h
index a0ad88c..7bd444c 100644
--- a/drivers/net/i40e/rte_pmd_i40e.h
+++ b/drivers/net/i40e/rte_pmd_i40e.h
@@ -332,4 +332,11 @@ int rte_pmd_i40e_get_vf_stats(uint8_t port,
int rte_pmd_i40e_reset_vf_stats(uint8_t port,
uint16_t vf_id);
+/**
+ * i40e_process_package - Load package
+ * @port: port id
+ * @buff: buffer of package
+ **/
+int i40e_process_package(uint8_t port, uint8_t *buff);
+
#endif /* _PMD_I40E_H_ */
--
2.5.5
next prev parent reply other threads:[~2017-03-03 7:27 UTC|newest]
Thread overview: 82+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-03 7:26 [dpdk-dev] [PATCH] MPSL enabling Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH 1/2] net/i40e: change tunnel filter function name Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH] ppp implemantation Beilei Xing
2017-03-03 9:39 ` Bruce Richardson
2017-03-03 9:41 ` Bruce Richardson
2017-03-03 7:26 ` [dpdk-dev] [PATCH 2/2] net/i40e: parse NVGRE filter Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH] PPP prototype Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH] ppp implemantation Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH 0/6] net/i40e: support pipeline personalization profile Beilei Xing
2017-03-03 7:39 ` [dpdk-dev] [PATCH v2 0/5] " Beilei Xing
2017-03-03 7:39 ` [dpdk-dev] [PATCH v2 1/5] " Beilei Xing
2017-03-08 12:07 ` Ferruh Yigit
2017-03-09 3:30 ` Xing, Beilei
2017-03-03 7:39 ` [dpdk-dev] [PATCH v2 2/5] net/i40e: add ppp processing Beilei Xing
2017-03-08 12:07 ` Ferruh Yigit
2017-03-03 7:39 ` [dpdk-dev] [PATCH v2 3/5] app/testpmd: add command for writing personalization profile Beilei Xing
2017-03-08 12:10 ` Ferruh Yigit
2017-03-03 7:39 ` [dpdk-dev] [PATCH v2 4/5] net/i40e: add get all loaded profiles Beilei Xing
2017-03-03 7:39 ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: add command for getting " Beilei Xing
2017-03-08 11:43 ` [dpdk-dev] [PATCH v2 0/5] net/i40e: support pipeline personalization profile Ferruh Yigit
2017-03-09 3:07 ` Xing, Beilei
2017-03-23 10:02 ` [dpdk-dev] [PATCH v3 0/5] pipeline personalization profile support Beilei Xing
2017-03-23 10:02 ` [dpdk-dev] [PATCH v3 1/5] net/i40e: add pipeline personalization profile processing Beilei Xing
2017-03-23 14:50 ` Iremonger, Bernard
2017-03-24 2:01 ` Xing, Beilei
2017-03-23 10:02 ` [dpdk-dev] [PATCH v3 2/5] app/testpmd: add command for loading a profile Beilei Xing
2017-03-23 10:02 ` [dpdk-dev] [PATCH v3 3/5] net/i40e: add get all loaded profiles Beilei Xing
2017-03-23 10:02 ` [dpdk-dev] [PATCH v3 4/5] app/testpmd: add command for getting " Beilei Xing
2017-03-23 10:02 ` [dpdk-dev] [PATCH v3 5/5] doc: add pipeline personalization profile support for i40e Beilei Xing
2017-03-24 10:19 ` [dpdk-dev] [PATCH v4 0/5] pipeline personalization profile support Beilei Xing
2017-03-24 10:19 ` [dpdk-dev] [PATCH v4 1/5] net/i40e: add pipeline personalization profile processing Beilei Xing
2017-03-24 14:52 ` Chilikin, Andrey
2017-03-25 4:04 ` Xing, Beilei
2017-03-25 21:03 ` Chilikin, Andrey
2017-03-27 2:09 ` Xing, Beilei
2017-03-24 10:19 ` [dpdk-dev] [PATCH v4 2/5] app/testpmd: add command for loading a profile Beilei Xing
2017-03-24 10:19 ` [dpdk-dev] [PATCH v4 3/5] net/i40e: add get all loaded profiles Beilei Xing
2017-03-24 10:19 ` [dpdk-dev] [PATCH v4 4/5] app/testpmd: add command for getting " Beilei Xing
2017-03-24 10:19 ` [dpdk-dev] [PATCH v4 5/5] doc: add pipeline personalization profile support for i40e Beilei Xing
2017-03-24 14:31 ` Mcnamara, John
2017-03-27 6:17 ` [dpdk-dev] [PATCH v5 0/5] pipeline personalization profile support Beilei Xing
2017-03-27 6:17 ` [dpdk-dev] [PATCH v5 1/5] net/i40e: add pipeline personalization profile processing Beilei Xing
2017-03-27 6:17 ` [dpdk-dev] [PATCH v5 2/5] app/testpmd: add command for loading a profile Beilei Xing
2017-03-27 6:17 ` [dpdk-dev] [PATCH v5 3/5] net/i40e: add get all loaded profiles Beilei Xing
2017-03-27 6:17 ` [dpdk-dev] [PATCH v5 4/5] app/testpmd: add command for getting " Beilei Xing
2017-03-27 6:17 ` [dpdk-dev] [PATCH v5 5/5] doc: add pipeline personalization profile support for i40e Beilei Xing
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 0/6] dynamic device profile support Beilei Xing
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 1/6] net/i40e/base: change ppp to ddp Beilei Xing
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 2/6] net/i40e: add dynamic device profile processing Beilei Xing
2017-03-29 13:17 ` Wu, Jingjing
2017-03-29 14:25 ` Xing, Beilei
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 3/6] app/testpmd: add command for loading a profile Beilei Xing
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 4/6] net/i40e: add get all loaded profiles Beilei Xing
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 5/6] app/testpmd: add command for getting " Beilei Xing
2017-03-29 12:26 ` [dpdk-dev] [PATCH v6 6/6] doc: add dynamic device profile support for i40e Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 0/6] dynamic device profile support Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 1/6] net/i40e/base: change ppp to ddp Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 2/6] net/i40e: add dynamic device profile processing Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 3/6] app/testpmd: add command for loading a profile Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 4/6] net/i40e: add get all loaded profiles Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 5/6] app/testpmd: add command for getting " Beilei Xing
2017-03-29 14:44 ` [dpdk-dev] [PATCH v7 6/6] doc: add dynamic device profile support for i40e Beilei Xing
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 0/6] dynamic device personalization support Beilei Xing
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 1/6] net/i40e/base: change ppp to ddp Beilei Xing
2017-03-30 14:06 ` Ferruh Yigit
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 2/6] net/i40e: add dynamic device personalization processing Beilei Xing
2017-03-30 14:06 ` Ferruh Yigit
2017-03-30 14:08 ` Ferruh Yigit
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 3/6] app/testpmd: add command for loading ddp Beilei Xing
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 4/6] net/i40e: add get all loaded profiles Beilei Xing
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 5/6] app/testpmd: add command for getting " Beilei Xing
2017-03-30 14:07 ` Ferruh Yigit
2017-03-30 2:51 ` [dpdk-dev] [PATCH v8 6/6] doc: add dynamic device personalization support for i40e Beilei Xing
2017-03-30 6:18 ` [dpdk-dev] [PATCH v8 0/6] dynamic device personalization support Wu, Jingjing
2017-03-30 14:05 ` Ferruh Yigit
2017-03-03 7:52 ` [dpdk-dev] [PATCH 0/6] net/i40e: support pipeline personalization profile Xing, Beilei
2017-03-03 7:26 ` [dpdk-dev] [PATCH 1/6] net/i40e: fix a typo in flow Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH 2/6] net/i40e: support pipeline personalization profile Beilei Xing
2017-03-03 7:26 ` Beilei Xing [this message]
2017-03-03 7:26 ` [dpdk-dev] [PATCH 4/6] app/testpmd: add command for writing " Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH 5/6] net/i40e: add get all loaded profiles Beilei Xing
2017-03-03 7:26 ` [dpdk-dev] [PATCH 6/6] app/testpmd: add command for getting " Beilei Xing
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1488525977-15321-10-git-send-email-beilei.xing@intel.com \
--to=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=helin.zhang@intel.com \
--cc=jingjing.wu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).