From: Chenxu Di <chenxux.di@intel.com> To: dev@dpdk.org Cc: beilei.xing@intel.com, Yang Qiming <qiming.yang@intel.com>, Chenxu Di <chenxux.di@intel.com> Subject: [dpdk-dev] [PATCH 2/5] net/ixgbe: add private APIs Date: Thu, 11 Jun 2020 06:01:39 +0000 Message-ID: <20200611060142.75465-3-chenxux.di@intel.com> (raw) In-Reply-To: <20200611060142.75465-1-chenxux.di@intel.com> The legacy filter API will be superseded by rte_flow. There are also several small features which can not be implemented in rte_flow. This patch re-implemented these features as private API. Two APIs are added: rte_pmd_ixgbe_get_fdir_info. rte_pmd_ixgbe_get_fdir_stats. Signed-off-by: Chenxu Di <chenxux.di@intel.com> --- drivers/net/ixgbe/ixgbe_ethdev.h | 4 +++ drivers/net/ixgbe/ixgbe_fdir.c | 8 ++--- drivers/net/ixgbe/rte_pmd_ixgbe.c | 33 +++++++++++++++++++++ drivers/net/ixgbe/rte_pmd_ixgbe.h | 31 +++++++++++++++++++ drivers/net/ixgbe/rte_pmd_ixgbe_version.map | 2 ++ 5 files changed, 72 insertions(+), 6 deletions(-) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index 3d78b2ee2..9bdef87fb 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -697,6 +697,10 @@ int ixgbe_fdir_set_flexbytes_offset(struct rte_eth_dev *dev, int ixgbe_fdir_filter_program(struct rte_eth_dev *dev, struct ixgbe_fdir_rule *rule, bool del, bool update); +void ixgbe_fdir_info_get(struct rte_eth_dev *dev, + struct rte_eth_fdir_info *fdir_info); +void ixgbe_fdir_stats_get(struct rte_eth_dev *dev, + struct rte_eth_fdir_stats *fdir_stats); void ixgbe_configure_dcb(struct rte_eth_dev *dev); diff --git a/drivers/net/ixgbe/ixgbe_fdir.c b/drivers/net/ixgbe/ixgbe_fdir.c index 166dae1e0..6faaa8f06 100644 --- a/drivers/net/ixgbe/ixgbe_fdir.c +++ b/drivers/net/ixgbe/ixgbe_fdir.c @@ -109,10 +109,6 @@ static int ixgbe_add_del_fdir_filter(struct rte_eth_dev *dev, bool del, bool update); static int ixgbe_fdir_flush(struct rte_eth_dev *dev); -static void ixgbe_fdir_info_get(struct rte_eth_dev *dev, - struct rte_eth_fdir_info *fdir_info); -static void ixgbe_fdir_stats_get(struct rte_eth_dev *dev, - struct rte_eth_fdir_stats *fdir_stats); /** * This function is based on ixgbe_fdir_enable_82599() in base/ixgbe_82599.c. @@ -1414,7 +1410,7 @@ ixgbe_fdir_flush(struct rte_eth_dev *dev) } #define FDIRENTRIES_NUM_SHIFT 10 -static void +void ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); @@ -1473,7 +1469,7 @@ ixgbe_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir_info (uint8_t)((info->mask.flex_bytes_mask & 0xFF00) >> 8); } -static void +void ixgbe_fdir_stats_get(struct rte_eth_dev *dev, struct rte_eth_fdir_stats *fdir_stats) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 9bff557f9..d2f708242 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -1139,3 +1139,36 @@ rte_pmd_ixgbe_mdio_unlocked_write(uint16_t port, uint32_t reg_addr, } return 0; } + +int +rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); + + dev = &rte_eth_devices[port]; + if (!is_ixgbe_supported(dev)) + return -ENOTSUP; + + ixgbe_fdir_info_get(dev, fdir_info); + + return 0; +} + +int +rte_pmd_ixgbe_get_fdir_stats(uint16_t port, + struct rte_eth_fdir_stats *fdir_stats) +{ + struct rte_eth_dev *dev; + + RTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV); + + dev = &rte_eth_devices[port]; + if (!is_ixgbe_supported(dev)) + return -ENOTSUP; + + ixgbe_fdir_stats_get(dev, fdir_stats); + + return 0; +} diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.h b/drivers/net/ixgbe/rte_pmd_ixgbe.h index f62fd761d..41c52ecc1 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.h +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.h @@ -726,4 +726,35 @@ enum { __rte_experimental int rte_pmd_ixgbe_upd_fctrl_sbp(uint16_t port, int enable); + +/** + * Get port fdir info + * + * @param port + * The port identifier of the Ethernet device. + * @param fdir_info + * The fdir info of the port + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if operation not supported. + */ +int +rte_pmd_ixgbe_get_fdir_info(uint16_t port, struct rte_eth_fdir_info *fdir_info); + +/** + * Get port fdir status + * + * @param port + * The port identifier of the Ethernet device. + * @param fdir_stats + * The fdir status of the port + * @return + * - (0) if successful. + * - (-ENODEV) if *port* invalid. + * - (-ENOTSUP) if operation not supported. + */ +int +rte_pmd_ixgbe_get_fdir_stats(uint16_t port, + struct rte_eth_fdir_stats *fdir_stats); #endif /* _PMD_IXGBE_H_ */ diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map index 21534dbc3..911f8083f 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe_version.map +++ b/drivers/net/ixgbe/rte_pmd_ixgbe_version.map @@ -38,6 +38,8 @@ DPDK_20.0 { EXPERIMENTAL { global: + rte_pmd_ixgbe_get_fdir_info; + rte_pmd_ixgbe_get_fdir_stats; rte_pmd_ixgbe_mdio_lock; rte_pmd_ixgbe_mdio_unlock; rte_pmd_ixgbe_mdio_unlocked_read; -- 2.17.1
next prev parent reply other threads:[~2020-06-11 6:14 UTC|newest] Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-06-11 6:01 [dpdk-dev] [PATCH 0/5] re-implement legacy filter functions by private API Chenxu Di 2020-06-11 6:01 ` [dpdk-dev] [PATCH 1/5] net/i40e: add private APIs Chenxu Di 2020-06-11 6:01 ` Chenxu Di [this message] 2020-06-11 6:01 ` [dpdk-dev] [PATCH 3/5] app/testpmd: re-implement commands by using private API Chenxu Di 2020-06-16 20:12 ` Kevin Traynor 2020-06-17 10:12 ` Di, ChenxuX 2020-06-30 6:20 ` Jeff Guo 2020-06-11 6:01 ` [dpdk-dev] [PATCH 4/5] net/i40e: enable flow query RSS Chenxu Di 2020-06-11 6:01 ` [dpdk-dev] [PATCH 5/5] app/testpmd: support query RSS config in flow query Chenxu Di 2020-06-15 2:18 ` [dpdk-dev] [PATCH v2 0/5] re-implement legacy filter functions by private API Chenxu Di 2020-06-15 2:18 ` [dpdk-dev] [PATCH v2 1/5] net/i40e: add private APIs Chenxu Di 2020-06-30 4:22 ` Jeff Guo 2020-06-30 10:24 ` Yang, Qiming 2020-07-01 1:30 ` Di, ChenxuX 2020-06-15 2:18 ` [dpdk-dev] [PATCH v2 2/5] net/ixgbe: " Chenxu Di 2020-06-30 5:25 ` Jeff Guo 2020-06-30 10:25 ` Yang, Qiming 2020-06-15 2:18 ` [dpdk-dev] [PATCH v2 3/5] app/testpmd: re-implement commands by using private API Chenxu Di 2020-06-30 10:34 ` Yang, Qiming 2020-06-15 2:18 ` [dpdk-dev] [PATCH v2 4/5] net/i40e: enable flow query RSS Chenxu Di 2020-06-30 6:48 ` Jeff Guo 2020-06-30 10:27 ` Yang, Qiming 2020-07-01 1:15 ` Di, ChenxuX 2020-06-15 2:18 ` [dpdk-dev] [PATCH v2 5/5] app/testpmd: support query RSS config in flow query Chenxu Di 2020-06-30 6:37 ` Jeff Guo 2020-06-30 10:40 ` Yang, Qiming 2020-07-01 1:25 ` Di, ChenxuX 2020-07-01 8:24 ` [dpdk-dev] [PATCH v3 0/5] re-implement legacy filter functions by private API Chenxu Di 2020-07-01 8:24 ` [dpdk-dev] [PATCH v3 1/5] net/i40e: add private APIs Chenxu Di 2020-07-03 5:44 ` Jeff Guo 2020-07-01 8:24 ` [dpdk-dev] [PATCH v3 2/5] net/ixgbe: " Chenxu Di 2020-07-03 5:44 ` Jeff Guo 2020-07-01 8:24 ` [dpdk-dev] [PATCH v3 3/5] app/testpmd: re-implement commands by using private API Chenxu Di 2020-07-03 5:54 ` Jeff Guo 2020-07-06 9:10 ` Yang, Qiming 2020-07-01 8:24 ` [dpdk-dev] [PATCH v3 4/5] net/i40e: enable flow query RSS Chenxu Di 2020-07-03 5:57 ` Jeff Guo 2020-07-01 8:24 ` [dpdk-dev] [PATCH v3 5/5] app/testpmd: support query RSS config in flow query Chenxu Di 2020-07-08 1:18 ` [dpdk-dev] [PATCH v4 0/5] re-implement legacy filter functions by private API Chenxu Di 2020-07-08 1:18 ` [dpdk-dev] [PATCH v4 1/5] net/i40e: add private APIs Chenxu Di 2020-07-08 1:18 ` [dpdk-dev] [PATCH v4 2/5] net/ixgbe: " Chenxu Di 2020-07-08 1:18 ` [dpdk-dev] [PATCH v4 3/5] app/testpmd: re-implement commands by using private API Chenxu Di 2020-07-08 3:31 ` Yang, Qiming 2020-07-08 1:18 ` [dpdk-dev] [PATCH v4 4/5] net/i40e: enable flow query RSS Chenxu Di 2020-07-08 1:18 ` [dpdk-dev] [PATCH v4 5/5] app/testpmd: support query RSS config in flow query Chenxu Di 2020-07-08 3:32 ` Yang, Qiming 2020-07-08 9:05 ` [dpdk-dev] [PATCH v4 0/5] re-implement legacy filter functions by private API Zhang, Qi Z
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=20200611060142.75465-3-chenxux.di@intel.com \ --to=chenxux.di@intel.com \ --cc=beilei.xing@intel.com \ --cc=dev@dpdk.org \ --cc=qiming.yang@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
DPDK patches and discussions This inbox may be cloned and mirrored by anyone: git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \ dev@dpdk.org public-inbox-index dev Example config snippet for mirrors. Newsgroup available over NNTP: nntp://inbox.dpdk.org/inbox.dpdk.dev AGPL code for this site: git clone https://public-inbox.org/public-inbox.git