From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Qin Ke <qin.ke@corigine.com>,
Chaoyong He <chaoyong.he@corigine.com>,
Long Wu <long.wu@corigine.com>,
Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 5/8] net/nfp: add new data field into representor port structure
Date: Thu, 5 Sep 2024 14:25:08 +0800 [thread overview]
Message-ID: <20240905062511.2710102-6-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20240905062511.2710102-1-chaoyong.he@corigine.com>
From: Qin Ke <qin.ke@corigine.com>
Add a new data field 'idx' into 'nfp_flower_representor' structure
to indicate the sequential physical port number of representor
devices, also initialize it for all representor ports.
Signed-off-by: Qin Ke <qin.ke@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
drivers/net/nfp/flower/nfp_flower_representor.c | 4 ++++
drivers/net/nfp/flower/nfp_flower_representor.h | 2 ++
2 files changed, 6 insertions(+)
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.c b/drivers/net/nfp/flower/nfp_flower_representor.c
index 872b8a6db4..e7593313e2 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.c
+++ b/drivers/net/nfp/flower/nfp_flower_representor.c
@@ -649,6 +649,7 @@ nfp_flower_repr_init(struct rte_eth_dev *eth_dev,
}
/* 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;
@@ -822,6 +823,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower,
/* 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);
@@ -854,6 +856,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower,
flower_repr.port_id = nfp_flower_get_phys_port_id(eth_port->index);
flower_repr.nfp_idx = eth_port->index;
flower_repr.vf_id = i + 1;
+ flower_repr.idx = id;
/* Copy the real mac of the interface to the representor struct */
rte_ether_addr_copy(ð_port->mac_addr, &flower_repr.mac_addr);
@@ -887,6 +890,7 @@ nfp_flower_repr_alloc(struct nfp_app_fw_flower *app_fw_flower,
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);
diff --git a/drivers/net/nfp/flower/nfp_flower_representor.h b/drivers/net/nfp/flower/nfp_flower_representor.h
index 70ca7b97db..4211ddf798 100644
--- a/drivers/net/nfp/flower/nfp_flower_representor.h
+++ b/drivers/net/nfp/flower/nfp_flower_representor.h
@@ -23,6 +23,8 @@ struct nfp_flower_representor {
struct rte_eth_xstat *repr_xstats_base;
uint8_t *mac_stats;
+ /** Sequential physical port number, only valid for repr of physical port */
+ uint8_t idx;
};
int nfp_flower_repr_create(struct nfp_app_fw_flower *app_fw_flower,
--
2.39.1
next prev parent reply other threads:[~2024-09-05 6:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 6:25 [PATCH 0/8] fix the representor port link status and speed Chaoyong He
2024-09-05 6:25 ` [PATCH 1/8] net/nfp: fix incorrect type declaration of some variables Chaoyong He
2024-09-05 6:25 ` [PATCH 2/8] net/nfp: add help function to check link speed Chaoyong He
2024-09-05 6:25 ` [PATCH 3/8] net/nfp: add help function to update VF " Chaoyong He
2024-09-05 6:25 ` [PATCH 4/8] net/nfp: rename PF speed update function Chaoyong He
2024-09-05 6:25 ` Chaoyong He [this message]
2024-09-05 6:25 ` [PATCH 6/8] net/nfp: fix representor port link speed update problem Chaoyong He
2024-09-05 6:25 ` [PATCH 7/8] net/nfp: standardize the use of port index in some functions Chaoyong He
2024-09-05 6:25 ` [PATCH 8/8] net/nfp: fix representor port link status update problem Chaoyong He
2024-10-04 18:17 ` [PATCH 0/8] fix the representor port link status and speed Ferruh Yigit
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=20240905062511.2710102-6-chaoyong.he@corigine.com \
--to=chaoyong.he@corigine.com \
--cc=dev@dpdk.org \
--cc=long.wu@corigine.com \
--cc=oss-drivers@corigine.com \
--cc=peng.zhang@corigine.com \
--cc=qin.ke@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).