DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Chaoyong He <chaoyong.he@corigine.com>,
	peng.zhang@corigine.com
Subject: [PATCH 1/4] net/nfp: fix port index problem
Date: Wed, 30 Oct 2024 16:27:56 +0800	[thread overview]
Message-ID: <20241030082759.209617-2-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20241030082759.209617-1-chaoyong.he@corigine.com>

Fix one port index problem imported by mistake.

Fixes: 97b6825d9a7b ("net/nfp: extract function to allocate PHY")
Fixes: fd1ec7bc8f0a ("net/nfp: extract function to initialize PF")
Fixes: bb9f9fdcbe00 ("net/nfp: extract function to allocate PF")
Fixes: c8e29c168c20 ("net/nfp: extract function to allocate VF")
Cc: peng.zhang@corigine.com

Signed-off-by: Chaoyong He <chaoyong.he@corigine.com>
---
 drivers/net/nfp/flower/nfp_flower_representor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 1f1b462b41..7c55f0ed21 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -672,6 +672,7 @@ nfp_flower_repr_base_init(struct rte_eth_dev *eth_dev,
 	init_repr_data = repr_init->flower_repr;
 
 	/* Copy data here from the input representor template */
+	repr->idx              = init_repr_data->idx;
 	repr->vf_id            = init_repr_data->vf_id;
 	repr->switch_domain_id = init_repr_data->switch_domain_id;
 	repr->port_id          = init_repr_data->port_id;
@@ -930,6 +931,7 @@ nfp_flower_phy_repr_alloc(struct nfp_net_hw_priv *hw_priv,
 		flower_repr->repr_type = NFP_REPR_TYPE_PHYS_PORT;
 		flower_repr->port_id = nfp_flower_get_phys_port_id(eth_port->index);
 		flower_repr->nfp_idx = eth_port->index;
+		flower_repr->idx = id;
 
 		/* Copy the real mac of the interface to the representor struct */
 		rte_ether_addr_copy(&eth_port->mac_addr, &flower_repr->mac_addr);
@@ -985,6 +987,7 @@ nfp_flower_vf_repr_alloc(struct nfp_net_hw_priv *hw_priv,
 				NFP_FLOWER_CMSG_PORT_VNIC_TYPE_VF, i + pf_dev->vf_base_id, 0);
 		flower_repr->nfp_idx = 0;
 		flower_repr->vf_id = i;
+		flower_repr->idx = 0;
 
 		/* VF reprs get a random MAC address */
 		rte_eth_random_addr(flower_repr->mac_addr.addr_bytes);
@@ -1022,6 +1025,7 @@ nfp_flower_pf_repr_alloc(struct nfp_net_hw_priv *hw_priv,
 
 	/* Create a rte_eth_dev for PF vNIC representor */
 	flower_repr->repr_type = NFP_REPR_TYPE_PF;
+	flower_repr->idx = 0;
 
 	/* PF vNIC reprs get a random MAC address */
 	rte_eth_random_addr(flower_repr->mac_addr.addr_bytes);
-- 
2.43.5


  reply	other threads:[~2024-10-30  8:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-30  8:19 [PATCH 0/3] NFP PMD enhancement Chaoyong He
2024-10-30  8:19 ` [PATCH 1/3] net/nfp: extract function to check physical reprsentor Chaoyong He
2024-10-30  8:19 ` [PATCH 2/3] net/nfp: add support for EEPROM functions Chaoyong He
2024-10-30  8:19 ` [PATCH 3/3] net/nfp: add support for port identify Chaoyong He
2024-10-30  8:27 ` [PATCH 0/4] NFP PMD enhancement Chaoyong He
2024-10-30  8:27   ` Chaoyong He [this message]
2024-10-30  8:27   ` [PATCH 2/4] net/nfp: extract function to check physical reprsentor Chaoyong He
2024-10-30  8:27   ` [PATCH 3/4] net/nfp: add support for EEPROM functions Chaoyong He
2024-10-30  8:27   ` [PATCH 4/4] net/nfp: add support for port identify Chaoyong He

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=20241030082759.209617-2-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.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).