From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4A8F425E5 for ; Wed, 20 Sep 2023 05:11:54 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AEA2B4027A; Wed, 20 Sep 2023 05:11:54 +0200 (CEST) Received: from mail-yw1-f226.google.com (mail-yw1-f226.google.com [209.85.128.226]) by mails.dpdk.org (Postfix) with ESMTP id 5FF924027A for ; Wed, 20 Sep 2023 05:11:53 +0200 (CEST) Received: by mail-yw1-f226.google.com with SMTP id 00721157ae682-579de633419so61346427b3.3 for ; Tue, 19 Sep 2023 20:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iol.unh.edu; s=unh-iol; t=1695179513; x=1695784313; darn=dpdk.org; h=cc:to:from:subject:message-id:date:from:to:cc:subject:date :message-id:reply-to; bh=0qZYBQ1jf6+LHWQboff6lS+OsfqDHQPlxDgK8zK7jO8=; b=KbBJjFzGM4Tjtdj6RedcW4BCm2SgPhy5qeyG6wYueEdDdq4kP1+DrriI4hb55XO9NR adbGR+9gD7ppOKzayD43+FBs2DAD7HoLKDUBpXR6ona8XP/fRIqRZnFwxXADM7xiwrVR xbmDBmAfyenFEbWA2tjPDd7FMC+K2cYorqahY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695179513; x=1695784313; h=cc:to:from:subject:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0qZYBQ1jf6+LHWQboff6lS+OsfqDHQPlxDgK8zK7jO8=; b=gkjnrc0JI12WS+IFs2Z2wIDW20nLLezoxe9/e017mJbeYVeoRCW9MHnssunXH/jo2+ L+ksyzqun8BOcTgEIH5ZGtaqVMAjNqoHonav42hRCT7d9dqO4J+HxusFF2xcCYGTIj7u vTYjIGbR0m3F1etPP66ej8xXt2WUSzLqsxaWxxky30XRMj6ENoCzqPNTBKEEwEcxoP4t zGrGz8LJMDmR/DOCAemRP3wXKN/7JJM2euoOkXMZzs6jHbO6wPkM7ZhD3ilriDP4wxsD 0241wRGGdBSUEt4evGJxzDcvWJDA9nmKmu/gOWfbOOwQGFYS2zXvQ+9RhmapJ86LDSHm C8yQ== X-Gm-Message-State: AOJu0YyPTNxBDwUi2acHK9zE9YQ/hn9bbezZ3cgYm8VW07zpYem2pPFF Kl5YCMA9OlrTM8kcPWeEJNsRnaRIue3aS0ljwhz8a34jOqOVWMiZJTw31LT0Jp0jebEDzVWM5A= = X-Google-Smtp-Source: AGHT+IGVx9ANuvhXF+RkONfl7T7iSpf66HsW6vDrU/c1sF/HFN5kEMIfNhCxKrjggYpKrPk8q/qfYUeneKdj X-Received: by 2002:a0d:fbc6:0:b0:583:d9de:8509 with SMTP id l189-20020a0dfbc6000000b00583d9de8509mr1050196ywf.27.1695179512794; Tue, 19 Sep 2023 20:11:52 -0700 (PDT) Received: from postal.iol.unh.edu (postal.iol.unh.edu. [2606:4100:3880:1234::84]) by smtp-relay.gmail.com with ESMTPS id u5-20020a814705000000b00589e1b65401sm1496737ywa.1.2023.09.19.20.11.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Sep 2023 20:11:52 -0700 (PDT) X-Relaying-Domain: iol.unh.edu Date: Tue, 19 Sep 2023 20:11:52 -0700 (PDT) Message-ID: <650a62f8.810a0220.70cc7.d0e7SMTPIN_ADDED_MISSING@mx.google.com> Received: from [172.21.0.2] (unknown [172.18.0.240]) by postal.iol.unh.edu (Postfix) with ESMTP id 6B4BF6052514; Tue, 19 Sep 2023 23:11:52 -0400 (EDT) Subject: |WARNING| pw131655 [PATCH] [v5, 25/26] net/nfp: refact the cppcore and PCIe module From: dpdklab@iol.unh.edu To: test-report@dpdk.org Cc: dpdk-test-reports@iol.unh.edu Content-Type: text/plain X-BeenThere: test-report@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: automatic DPDK test reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: test-report-bounces@dpdk.org Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/131655 _apply patch failure_ Submitter: Chaoyong He Date: Wednesday, September 20 2023 01:28:46 Applied on: CommitID:a4e700a878e7fa2651fd718e61f7228c3277e556 Apply patch set 131655 failed: Checking patch drivers/net/nfp/nfp_ethdev.c... Hunk #2 succeeded at 915 (offset -5 lines). Hunk #3 succeeded at 1124 (offset 3 lines). Checking patch drivers/net/nfp/nfpcore/nfp6000_pcie.c... error: drivers/net/nfp/nfpcore/nfp6000_pcie.c: does not exist in index Checking patch drivers/net/nfp/nfpcore/nfp6000_pcie.h... error: drivers/net/nfp/nfpcore/nfp6000_pcie.h: does not exist in index Checking patch drivers/net/nfp/nfpcore/nfp_cpp.h... error: while searching for: /* NFP CPP core interface for CPP clients */ struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed); void nfp_cpp_free(struct nfp_cpp *cpp); #define NFP_CPP_MODEL_INVALID 0xffffffff /** * Retrieve the chip ID from the model ID * * The chip ID is a 16-bit BCD+A-F encoding for the chip type. * * @param model * NFP CPP model id * * @return * NFP CPP chip id */ #define NFP_CPP_MODEL_CHIP_of(model) (((model) >> 16) & 0xffff) /** * Check for the NFP6000 family of devices * * NOTE: The NFP4000 series is considered as a NFP6000 series variant. * * @param model * NFP CPP model id * * @return * true if model is in the NFP6000 family, false otherwise. */ #define NFP_CPP_MODEL_IS_6000(model) \ ((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \ (NFP_CPP_MODEL_CHIP_of(model) < 0x7000)) uint32_t nfp_cpp_model(struct nfp_cpp *cpp); /* error: patch failed: drivers/net/nfp/nfpcore/nfp_cpp.h:226 error: while searching for: */ #define NFP_CPP_INTERFACE_CHANNEL_of(interface) (((interface) >> 0) & 0xff) uint16_t nfp_cpp_interface(struct nfp_cpp *cpp); uint32_t nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial); error: patch failed: drivers/net/nfp/nfpcore/nfp_cpp.h:330 Checking patch drivers/net/nfp/nfpcore/nfp_cppcore.c... error: while searching for: } static struct nfp_cpp * nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed) { int err; struct nfp_cpp *cpp; const struct nfp_cpp_operations *ops; error: patch failed: drivers/net/nfp/nfpcore/nfp_cppcore.c:909 error: while searching for: return NULL; cpp->op = ops; cpp->driver_lock_needed = driver_lock_needed; if (cpp->op->init) { err = cpp->op->init(cpp, dev); if (err < 0) { free(cpp); return NULL; } } if (NFP_CPP_MODEL_IS_6000(nfp_cpp_model(cpp))) { uint32_t xpb_addr; size_t target; for (target = 0; target < RTE_DIM(cpp->imb_cat_table); target++) { /* Hardcoded XPB IMB Base, island 0 */ xpb_addr = 0x000a0000 + (target * 4); err = nfp_xpb_readl(cpp, xpb_addr, (uint32_t *)&cpp->imb_cat_table[target]); if (err < 0) { free(cpp); return NULL; } } } err = nfp_cpp_set_mu_locality_lsb(cpp); if (err < 0) { PMD_DRV_LOG(ERR, "Can't calculate MU locality bit offset"); error: patch failed: drivers/net/nfp/nfpcore/nfp_cppcore.c:925 error: while searching for: * * @param dev * PCI device * @param driver_lock_needed * Driver lock flag * error: patch failed: drivers/net/nfp/nfpcore/nfp_cppcore.c:981 error: while searching for: */ struct nfp_cpp * nfp_cpp_from_device_name(struct rte_pci_device *dev, int driver_lock_needed) { return nfp_cpp_alloc(dev, driver_lock_needed); } /** error: patch failed: drivers/net/nfp/nfpcore/nfp_cppcore.c:991 Applied patch drivers/net/nfp/nfp_ethdev.c cleanly. Applying patch drivers/net/nfp/nfpcore/nfp_cpp.h with 2 rejects... Rejected hunk #1. Rejected hunk #2. Applying patch drivers/net/nfp/nfpcore/nfp_cppcore.c with 4 rejects... Rejected hunk #1. Rejected hunk #2. Rejected hunk #3. Rejected hunk #4. hint: Use 'git am --show-current-patch' to see the failed patch diff a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h (rejected hunks) @@ -226,40 +226,12 @@ uint32_t nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model); /* NFP CPP core interface for CPP clients */ struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev, - int driver_lock_needed); + void *priv, bool driver_lock_needed); void nfp_cpp_free(struct nfp_cpp *cpp); #define NFP_CPP_MODEL_INVALID 0xffffffff -/** - * Retrieve the chip ID from the model ID - * - * The chip ID is a 16-bit BCD+A-F encoding for the chip type. - * - * @param model - * NFP CPP model id - * - * @return - * NFP CPP chip id - */ -#define NFP_CPP_MODEL_CHIP_of(model) (((model) >> 16) & 0xffff) - -/** - * Check for the NFP6000 family of devices - * - * NOTE: The NFP4000 series is considered as a NFP6000 series variant. - * - * @param model - * NFP CPP model id - * - * @return - * true if model is in the NFP6000 family, false otherwise. - */ -#define NFP_CPP_MODEL_IS_6000(model) \ - ((NFP_CPP_MODEL_CHIP_of(model) >= 0x3800) && \ - (NFP_CPP_MODEL_CHIP_of(model) < 0x7000)) - uint32_t nfp_cpp_model(struct nfp_cpp *cpp); /* @@ -330,6 +302,12 @@ uint32_t nfp_cpp_model(struct nfp_cpp *cpp); */ #define NFP_CPP_INTERFACE_CHANNEL_of(interface) (((interface) >> 0) & 0xff) +/* + * Use this channel ID for multiple virtual channel interfaces + * (ie ARM and PCIe) when setting up the interface field. + */ +#define NFP_CPP_INTERFACE_CHANNEL_PEROPENER 255 + uint16_t nfp_cpp_interface(struct nfp_cpp *cpp); uint32_t nfp_cpp_serial(struct nfp_cpp *cpp, const uint8_t **serial); diff a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c (rejected hunks) @@ -909,10 +909,13 @@ nfp_xpb_readl(struct nfp_cpp *cpp, } static struct nfp_cpp * -nfp_cpp_alloc(struct rte_pci_device *dev, - int driver_lock_needed) +nfp_cpp_alloc(struct rte_pci_device *pci_dev, + void *priv, + bool driver_lock_needed) { int err; + size_t target; + uint32_t xpb_addr; struct nfp_cpp *cpp; const struct nfp_cpp_operations *ops; @@ -925,32 +928,50 @@ nfp_cpp_alloc(struct rte_pci_device *dev, return NULL; cpp->op = ops; + cpp->priv = priv; cpp->driver_lock_needed = driver_lock_needed; - if (cpp->op->init) { - err = cpp->op->init(cpp, dev); + err = ops->get_interface(pci_dev, &cpp->interface); + if (err != 0) { + free(cpp); + return NULL; + } + + err = ops->get_serial(pci_dev, cpp->serial, NFP_SERIAL_LEN); + if (err != 0) { + free(cpp); + return NULL; + } + + /* + * NOTE: cpp_lock is NOT locked for op->init, + * since it may call NFP CPP API operations + */ + err = cpp->op->init(cpp, pci_dev); + if (err < 0) { + PMD_DRV_LOG(ERR, "NFP interface initialization failed"); + free(cpp); + return NULL; + } + + err = nfp_cpp_model_autodetect(cpp, &cpp->model); + if (err < 0) { + PMD_DRV_LOG(ERR, "NFP model detection failed"); + free(cpp); + return NULL; + } + + for (target = 0; target < RTE_DIM(cpp->imb_cat_table); target++) { + /* Hardcoded XPB IMB Base, island 0 */ + xpb_addr = 0x000a0000 + (target * 4); + err = nfp_xpb_readl(cpp, xpb_addr, &cpp->imb_cat_table[target]); if (err < 0) { + PMD_DRV_LOG(ERR, "Can't read CPP mapping from device"); free(cpp); return NULL; } } - if (NFP_CPP_MODEL_IS_6000(nfp_cpp_model(cpp))) { - uint32_t xpb_addr; - size_t target; - - for (target = 0; target < RTE_DIM(cpp->imb_cat_table); target++) { - /* Hardcoded XPB IMB Base, island 0 */ - xpb_addr = 0x000a0000 + (target * 4); - err = nfp_xpb_readl(cpp, xpb_addr, - (uint32_t *)&cpp->imb_cat_table[target]); - if (err < 0) { - free(cpp); - return NULL; - } - } - } - err = nfp_cpp_set_mu_locality_lsb(cpp); if (err < 0) { PMD_DRV_LOG(ERR, "Can't calculate MU locality bit offset"); @@ -981,6 +1002,8 @@ nfp_cpp_free(struct nfp_cpp *cpp) * * @param dev * PCI device + * @param priv + * Private data of low-level implementation * @param driver_lock_needed * Driver lock flag * @@ -991,9 +1014,10 @@ nfp_cpp_free(struct nfp_cpp *cpp) */ struct nfp_cpp * nfp_cpp_from_device_name(struct rte_pci_device *dev, - int driver_lock_needed) + void *priv, + bool driver_lock_needed) { - return nfp_cpp_alloc(dev, driver_lock_needed); + return nfp_cpp_alloc(dev, priv, driver_lock_needed); } /** https://lab.dpdk.org/results/dashboard/patchsets/27656/ UNH-IOL DPDK Community Lab