From: Anatoly Burakov <anatoly.burakov@intel.com>
To: dev@dpdk.org, Vladimir Medvedkin <vladimir.medvedkin@intel.com>
Cc: bruce.richardson@intel.com
Subject: [PATCH v2 1/3] net/ixgbe: use check for VF function
Date: Thu, 27 Mar 2025 15:12:17 +0000 [thread overview]
Message-ID: <91f6e1e3f59faf66e6d5f32e4198bfd13b30a317.1743088329.git.anatoly.burakov@intel.com> (raw)
In-Reply-To: <91f6e1e3f59faf66e6d5f32e4198bfd13b30a317.1743085431.git.anatoly.burakov@intel.com>
In a couple of places, we are using explicit mac type comparisons to
trigger a VF-specific path, but we already have a function that does the
same thing, so use it.
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/ixgbe/ixgbe_rxtx.c | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
index 0c8a9ec763..b216e0612a 100644
--- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
@@ -87,6 +87,9 @@
#define rte_ixgbe_prefetch(p) do {} while (0)
#endif
+/* forward-declare some functions */
+static int ixgbe_is_vf(struct rte_eth_dev *dev);
+
/*********************************************************************
*
* TX functions
@@ -2766,12 +2769,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev,
/*
* Modification to set VFTDT for virtual function if vf is detected
*/
- if (hw->mac.type == ixgbe_mac_82599_vf ||
- hw->mac.type == ixgbe_mac_E610_vf ||
- hw->mac.type == ixgbe_mac_X540_vf ||
- hw->mac.type == ixgbe_mac_X550_vf ||
- hw->mac.type == ixgbe_mac_X550EM_x_vf ||
- hw->mac.type == ixgbe_mac_X550EM_a_vf)
+ if (ixgbe_is_vf(dev))
txq->qtx_tail = IXGBE_PCI_REG_ADDR(hw, IXGBE_VFTDT(queue_idx));
else
txq->qtx_tail = IXGBE_PCI_REG_ADDR(hw, IXGBE_TDT(txq->reg_idx));
@@ -3154,12 +3152,7 @@ ixgbe_dev_rx_queue_setup(struct rte_eth_dev *dev,
/*
* Modified to setup VFRDT for Virtual Function
*/
- if (hw->mac.type == ixgbe_mac_82599_vf ||
- hw->mac.type == ixgbe_mac_E610_vf ||
- hw->mac.type == ixgbe_mac_X540_vf ||
- hw->mac.type == ixgbe_mac_X550_vf ||
- hw->mac.type == ixgbe_mac_X550EM_x_vf ||
- hw->mac.type == ixgbe_mac_X550EM_a_vf) {
+ if (ixgbe_is_vf(dev)) {
rxq->rdt_reg_addr =
IXGBE_PCI_REG_ADDR(hw, IXGBE_VFRDT(queue_idx));
rxq->rdh_reg_addr =
--
2.47.1
next prev parent reply other threads:[~2025-03-27 15:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-27 14:24 [PATCH v1 " Anatoly Burakov
2025-03-27 14:24 ` [PATCH v1 2/3] net/ixgbe: fix VF registers for E610 Anatoly Burakov
2025-03-27 14:24 ` [PATCH v1 3/3] net/ixgbe: support MDD on VF Tx path Anatoly Burakov
2025-03-27 15:12 ` Anatoly Burakov [this message]
2025-03-27 15:12 ` [PATCH v2 2/3] net/ixgbe: fix VF registers for E610 Anatoly Burakov
2025-03-27 15:12 ` [PATCH v2 3/3] net/ixgbe: support MDD on VF Tx path Anatoly Burakov
2025-03-28 15:24 ` [PATCH v2 1/3] net/ixgbe: use check for VF function Bruce Richardson
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=91f6e1e3f59faf66e6d5f32e4198bfd13b30a317.1743088329.git.anatoly.burakov@intel.com \
--to=anatoly.burakov@intel.com \
--cc=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
--cc=vladimir.medvedkin@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).