From: Ferruh Yigit <ferruh.yigit@intel.com>
To: <ssebasti@amd.com>, <dev@dpdk.org>
Cc: <chandu@amd.com>
Subject: Re: [PATCH v1 1/2] net/axgbe: add support for Yellow Carp ethernet device
Date: Tue, 1 Feb 2022 14:26:17 +0000 [thread overview]
Message-ID: <357547fd-2e00-f0b0-5ea8-dfeca8c6cd30@intel.com> (raw)
In-Reply-To: <20220131053920.167230-2-ssebasti@amd.com>
On 1/31/2022 5:39 AM, ssebasti@amd.com wrote:
> From: Selwin Sebastian <selwin.sebastian@amd.com>
>
> Yellow Carp ethernet devices (V3xxx) use the existing PCI ID but
> the window settings for the indirect PCS access have been
Can you please explain (again) what is happening here?
Was is same IP used in multiple CPUs with same PCI id but slightly different
configuration, and you are trying to detect the device by checking root complex
device PCI ID?
If so why the device name (Yellow Carp) is different, or is it the name of the CPU?
> altered. Add the check for Yellow Carp Ethernet devices to
> use the new register values.
>
> Signed-off-by: Selwin Sebastian <selwin.sebastian@amd.com>
> ---
> drivers/net/axgbe/axgbe_common.h | 2 ++
> drivers/net/axgbe/axgbe_ethdev.c | 34 +++++++++++++++++++++-----------
> 2 files changed, 25 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h
> index 5310ac54f5..b9ebf64fb8 100644
> --- a/drivers/net/axgbe/axgbe_common.h
> +++ b/drivers/net/axgbe/axgbe_common.h
> @@ -901,6 +901,8 @@
> #define PCS_V2_WINDOW_SELECT 0x9064
> #define PCS_V2_RV_WINDOW_DEF 0x1060
> #define PCS_V2_RV_WINDOW_SELECT 0x1064
> +#define PCS_V2_YC_WINDOW_DEF 0x18060
> +#define PCS_V2_YC_WINDOW_SELECT 0x18064
>
> /* PCS register entry bit positions and sizes */
> #define PCS_V2_WINDOW_DEF_OFFSET_INDEX 6
> diff --git a/drivers/net/axgbe/axgbe_ethdev.c b/drivers/net/axgbe/axgbe_ethdev.c
> index e9546469f3..2be9387f98 100644
> --- a/drivers/net/axgbe/axgbe_ethdev.c
> +++ b/drivers/net/axgbe/axgbe_ethdev.c
> @@ -173,6 +173,8 @@ static const struct axgbe_xstats axgbe_xstats_strings[] = {
> /* The set of PCI devices this driver supports */
> #define AMD_PCI_VENDOR_ID 0x1022
> #define AMD_PCI_RV_ROOT_COMPLEX_ID 0x15d0
> +#define AMD_PCI_YC_ROOT_COMPLEX_ID 0x14b5
> +#define AMD_PCI_SNOWY_ROOT_COMPLEX_ID 0x1450
> #define AMD_PCI_AXGBE_DEVICE_V2A 0x1458
> #define AMD_PCI_AXGBE_DEVICE_V2B 0x1459
>
> @@ -2178,17 +2180,6 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
> pci_dev = RTE_DEV_TO_PCI(eth_dev->device);
> pdata->pci_dev = pci_dev;
>
> - /*
> - * Use root complex device ID to differentiate RV AXGBE vs SNOWY AXGBE
> - */
> - if ((get_pci_rc_devid()) == AMD_PCI_RV_ROOT_COMPLEX_ID) {
> - pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF;
> - pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT;
> - } else {
> - pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
> - pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
> - }
> -
> pdata->xgmac_regs =
> (void *)pci_dev->mem_resource[AXGBE_AXGMAC_BAR].addr;
> pdata->xprop_regs = (void *)((uint8_t *)pdata->xgmac_regs
> @@ -2203,6 +2194,27 @@ eth_axgbe_dev_init(struct rte_eth_dev *eth_dev)
> else
> pdata->vdata = &axgbe_v2b;
>
> + /*
> + * Use PCI root complex device ID to identify the CPU
> + */
> + switch (get_pci_rc_devid()) {
> + case AMD_PCI_RV_ROOT_COMPLEX_ID:
> + pdata->xpcs_window_def_reg = PCS_V2_RV_WINDOW_DEF;
> + pdata->xpcs_window_sel_reg = PCS_V2_RV_WINDOW_SELECT;
> + break;
> + case AMD_PCI_YC_ROOT_COMPLEX_ID:
> + pdata->xpcs_window_def_reg = PCS_V2_YC_WINDOW_DEF;
> + pdata->xpcs_window_sel_reg = PCS_V2_YC_WINDOW_SELECT;
> + break;
> + case AMD_PCI_SNOWY_ROOT_COMPLEX_ID:
> + pdata->xpcs_window_def_reg = PCS_V2_WINDOW_DEF;
> + pdata->xpcs_window_sel_reg = PCS_V2_WINDOW_SELECT;
> + break;
> + default:
> + PMD_DRV_LOG(ERR, "No supported devices found\n");
> + return -ENODEV;
> + }
> +
> /* Configure the PCS indirect addressing support */
> reg = XPCS32_IOREAD(pdata, pdata->xpcs_window_def_reg);
> pdata->xpcs_window = XPCS_GET_BITS(reg, PCS_V2_WINDOW_DEF, OFFSET);
next prev parent reply other threads:[~2022-02-01 14:26 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-31 5:39 [PATCH v1 0/2] net/axgbe: Add support for Yellow Carp ethernet ssebasti
2022-01-31 5:39 ` [PATCH v1 1/2] net/axgbe: add support for Yellow Carp ethernet device ssebasti
2022-01-31 6:48 ` Namburu, Chandu-babu
2022-02-03 11:56 ` Ferruh Yigit
2022-02-01 14:26 ` Ferruh Yigit [this message]
2022-02-02 8:56 ` Sebastian, Selwin
2022-02-02 10:53 ` Ferruh Yigit
2022-02-02 11:56 ` Sebastian, Selwin
2022-01-31 5:39 ` [PATCH v1 2/2] net/axgbe: disable the CDR wa for Yellow Carp devices ssebasti
2022-02-01 14:23 ` [PATCH v1 0/2] net/axgbe: Add support for Yellow Carp ethernet 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=357547fd-2e00-f0b0-5ea8-dfeca8c6cd30@intel.com \
--to=ferruh.yigit@intel.com \
--cc=chandu@amd.com \
--cc=dev@dpdk.org \
--cc=ssebasti@amd.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).