From: Junfeng Guo <junfeng.guo@intel.com>
To: qi.z.zhang@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com
Cc: dev@dpdk.org, junfeng.guo@intel.com
Subject: [RFC v3 05/11] net/idpf: support getting device information
Date: Wed, 18 May 2022 16:25:25 +0800 [thread overview]
Message-ID: <20220518082531.1604266-6-junfeng.guo@intel.com> (raw)
In-Reply-To: <20220518082531.1604266-1-junfeng.guo@intel.com>
Add ops dev_infos_get.
Signed-off-by: Beilei Xing <beilei.xing@intel.com>
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
---
drivers/net/idpf/idpf_ethdev.c | 69 ++++++++++++++++++++++++++++++++++
1 file changed, 69 insertions(+)
diff --git a/drivers/net/idpf/idpf_ethdev.c b/drivers/net/idpf/idpf_ethdev.c
index b48a722b80..02e0760fc4 100644
--- a/drivers/net/idpf/idpf_ethdev.c
+++ b/drivers/net/idpf/idpf_ethdev.c
@@ -28,6 +28,8 @@ static int idpf_dev_configure(struct rte_eth_dev *dev);
static int idpf_dev_start(struct rte_eth_dev *dev);
static int idpf_dev_stop(struct rte_eth_dev *dev);
static int idpf_dev_close(struct rte_eth_dev *dev);
+static int idpf_dev_info_get(struct rte_eth_dev *dev,
+ struct rte_eth_dev_info *dev_info);
static const struct eth_dev_ops idpf_eth_dev_ops = {
.dev_configure = idpf_dev_configure,
@@ -42,8 +44,75 @@ static const struct eth_dev_ops idpf_eth_dev_ops = {
.rx_queue_release = idpf_dev_rx_queue_release,
.tx_queue_setup = idpf_tx_queue_setup,
.tx_queue_release = idpf_dev_tx_queue_release,
+ .dev_infos_get = idpf_dev_info_get,
};
+static int
+idpf_dev_info_get(__rte_unused struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
+{
+ dev_info->max_rx_queues = adapter->caps->max_rx_q;
+ dev_info->max_tx_queues = adapter->caps->max_tx_q;
+ dev_info->min_rx_bufsize = IDPF_MIN_BUF_SIZE;
+ dev_info->max_rx_pktlen = IDPF_MAX_FRAME_SIZE;
+
+ dev_info->max_mtu = dev_info->max_rx_pktlen - IDPF_ETH_OVERHEAD;
+ dev_info->min_mtu = RTE_ETHER_MIN_MTU;
+
+ dev_info->max_mac_addrs = IDPF_NUM_MACADDR_MAX;
+ dev_info->dev_capa &= ~RTE_ETH_DEV_CAPA_FLOW_RULE_KEEP;
+ dev_info->rx_offload_capa =
+ RTE_ETH_RX_OFFLOAD_VLAN_STRIP |
+ RTE_ETH_RX_OFFLOAD_QINQ_STRIP |
+ RTE_ETH_RX_OFFLOAD_IPV4_CKSUM |
+ RTE_ETH_RX_OFFLOAD_UDP_CKSUM |
+ RTE_ETH_RX_OFFLOAD_TCP_CKSUM |
+ RTE_ETH_RX_OFFLOAD_OUTER_IPV4_CKSUM |
+ RTE_ETH_RX_OFFLOAD_SCATTER |
+ RTE_ETH_RX_OFFLOAD_VLAN_FILTER |
+ RTE_ETH_RX_OFFLOAD_RSS_HASH;
+
+ dev_info->tx_offload_capa =
+ RTE_ETH_TX_OFFLOAD_VLAN_INSERT |
+ RTE_ETH_TX_OFFLOAD_QINQ_INSERT |
+ RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |
+ RTE_ETH_TX_OFFLOAD_UDP_CKSUM |
+ RTE_ETH_TX_OFFLOAD_TCP_CKSUM |
+ RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |
+ RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM |
+ RTE_ETH_TX_OFFLOAD_TCP_TSO |
+ RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO |
+ RTE_ETH_TX_OFFLOAD_GRE_TNL_TSO |
+ RTE_ETH_TX_OFFLOAD_IPIP_TNL_TSO |
+ RTE_ETH_TX_OFFLOAD_GENEVE_TNL_TSO |
+ RTE_ETH_TX_OFFLOAD_MULTI_SEGS |
+ RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE;
+
+ dev_info->default_rxconf = (struct rte_eth_rxconf) {
+ .rx_free_thresh = IDPF_DEFAULT_RX_FREE_THRESH,
+ .rx_drop_en = 0,
+ .offloads = 0,
+ };
+
+ dev_info->default_txconf = (struct rte_eth_txconf) {
+ .tx_free_thresh = IDPF_DEFAULT_RX_FREE_THRESH,
+ .tx_rs_thresh = IDPF_DEFAULT_TX_RS_THRESH,
+ .offloads = 0,
+ };
+
+ dev_info->rx_desc_lim = (struct rte_eth_desc_lim) {
+ .nb_max = IDPF_MAX_RING_DESC,
+ .nb_min = IDPF_MIN_RING_DESC,
+ .nb_align = IDPF_ALIGN_RING_DESC,
+ };
+
+ dev_info->tx_desc_lim = (struct rte_eth_desc_lim) {
+ .nb_max = IDPF_MAX_RING_DESC,
+ .nb_min = IDPF_MIN_RING_DESC,
+ .nb_align = IDPF_ALIGN_RING_DESC,
+ };
+
+ return 0;
+}
static int
idpf_init_vport_req_info(struct rte_eth_dev *dev)
--
2.25.1
next prev parent reply other threads:[~2022-05-18 8:26 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-07 7:07 [RFC 0/9] add support for idpf PMD in DPDK Junfeng Guo
2022-05-07 7:07 ` [RFC 1/9] net/idpf/base: introduce base code Junfeng Guo
2022-05-09 9:11 ` [RFC v2 0/9] add support for idpf PMD in DPDK Junfeng Guo
2022-05-09 9:11 ` [RFC v2 1/9] net/idpf/base: introduce base code Junfeng Guo
2022-05-09 9:11 ` [RFC v2 2/9] net/idpf/base: add OS specific implementation Junfeng Guo
2022-05-09 9:11 ` [RFC v2 3/9] net/idpf: support device initialization Junfeng Guo
2022-05-09 9:11 ` [RFC v2 4/9] net/idpf: support queue ops Junfeng Guo
2022-05-09 9:11 ` [RFC v2 5/9] net/idpf: support getting device information Junfeng Guo
2022-05-09 9:11 ` [RFC v2 6/9] net/idpf: support packet type getting Junfeng Guo
2022-05-09 9:11 ` [RFC v2 7/9] net/idpf: support link update Junfeng Guo
2022-05-09 9:11 ` [RFC v2 8/9] net/idpf: support basic Rx/Tx Junfeng Guo
2022-05-09 9:11 ` [RFC v2 9/9] net/idpf: support RSS Junfeng Guo
2022-05-18 8:25 ` [RFC v3 00/11] add support for idpf PMD in DPDK Junfeng Guo
2022-05-18 8:25 ` [RFC v3 01/11] net/idpf/base: introduce base code Junfeng Guo
2022-05-18 15:26 ` Stephen Hemminger
2022-05-18 8:25 ` [RFC v3 02/11] net/idpf/base: add OS specific implementation Junfeng Guo
2022-05-18 8:25 ` [RFC v3 03/11] net/idpf: support device initialization Junfeng Guo
2022-05-18 8:25 ` [RFC v3 04/11] net/idpf: support queue ops Junfeng Guo
2022-05-18 8:25 ` Junfeng Guo [this message]
2022-05-18 8:25 ` [RFC v3 06/11] net/idpf: support packet type getting Junfeng Guo
2022-05-18 8:25 ` [RFC v3 07/11] net/idpf: support link update Junfeng Guo
2022-05-18 8:25 ` [RFC v3 08/11] net/idpf: support basic Rx/Tx Junfeng Guo
2022-05-18 8:25 ` [RFC v3 09/11] net/idpf: support RSS Junfeng Guo
2022-05-18 8:25 ` [RFC v3 10/11] net/idpf: support MTU configuration Junfeng Guo
2022-05-18 8:25 ` [RFC v3 11/11] net/idpf: add CPF device ID for idpf map table Junfeng Guo
2022-05-07 7:07 ` [RFC 2/9] net/idpf/base: add OS specific implementation Junfeng Guo
2022-05-07 7:07 ` [RFC 3/9] net/idpf: support device initialization Junfeng Guo
2022-05-07 7:07 ` [RFC 4/9] net/idpf: support queue ops Junfeng Guo
2022-05-07 7:07 ` [RFC 5/9] net/idpf: support getting device information Junfeng Guo
2022-05-07 7:07 ` [RFC 6/9] net/idpf: support packet type getting Junfeng Guo
2022-05-07 7:07 ` [RFC 7/9] net/idpf: support link update Junfeng Guo
2022-05-07 7:07 ` [RFC 8/9] net/idpf: support basic Rx/Tx Junfeng Guo
2022-05-07 7:07 ` [RFC 9/9] net/idpf: support RSS Junfeng Guo
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=20220518082531.1604266-6-junfeng.guo@intel.com \
--to=junfeng.guo@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=qi.z.zhang@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).