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 D0483A034F; Sat, 16 Oct 2021 11:13:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E949411A3; Sat, 16 Oct 2021 11:13:22 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2046.outbound.protection.outlook.com [40.107.243.46]) by mails.dpdk.org (Postfix) with ESMTP id 16C254118C for ; Sat, 16 Oct 2021 11:13:19 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hAi5NjbCoPxu4R093pMDcNZeWKBPAG7briwERSjxoxVTu7/w8Lj09ocq/3RZqMz7m4ST0LKV1wutFkE3wsEMbayC8WCOZ3W942KUcZ4e1eBiPMrPQZAW6A+qacbscDzwAIyF6ujWqyT65QrfTfTLBWWr2OizQ66JbJSqWdNJ0GPRxFtCuwBCz1lgZs2rIcRLT+x2l2/sbkOcFw7Zx4z8LJsPCFGKPSXill5LL8Kx9jFRZ5mnA/2a14FV6MSIWnJJWOn0DjKlmx3etBxAy3yHFPReFbRegiOMrT+cBjHzFDk/cUURG5Jm15+6BPi+b0zbq30OGUJtddJSMAErKWXCfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OH0wN6s3MnWC/R5xx3Ri+lwNHUeYxO2Wbr04dTOZeyk=; b=MbsbCvWRSLesy3xGGhEBzX7jW/6NUfvYAS8yPJsf1HFbLAho37MrX2mTQ1N4dKIOEmFfYA6oKUMxS6taf+ievr3gyRHwSCUOUcisq5VqgITKUGW0UYYJScb+XUbrOJiAq+EI2dR99i1g0Wd1NkdJgANIf5LxS1c4eVTrQorSPKjeexv5tfX4JMNGDPJVJI2Vl4XQhF+59Kwi7gf7Gb2wpG9sIa7bJcTp1C5z6lBWSJgD9HAGZmwF+8UZcmISqUXnf9OyY0ZbXkq4nasVGy6NPa8dEBv2eGq1tvd1WNMy/sHGF6RbZzzQc2GD2wEw6af0o+89Rp/Re+XbETsMKQLX0A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OH0wN6s3MnWC/R5xx3Ri+lwNHUeYxO2Wbr04dTOZeyk=; b=kYRG6j2dErcBbhB4XpyzzxY7LpejzShgb+kJMUiqRclpLPsnH3auuOgsJmvn2YZPxaVfnNcryU66tL+5p102nJSiq39FCi0JFaOZ18brynwq0WKvh7GRNGuBKfQyMxR6l/q3qx7CExolf6zBbmHVrBk5eWAYYGfggPdosyWCRv9HLHMDdbfBXA8dfW1r+ba9bXvQqMiu8IO7pyTqz1iUUzfzJ8dEtPubeKhRo5lVi0SLp8TmdJJL1PXbvtXebtL70CI6FQWHwdWaYwdgy57WSCEsHk4Cp4qiUA3KG1tfD46GhpHfrBD92Y1Gyu1tfh1dFu+SGFSJfdoW62YhuhwOvA== Received: from BN6PR1101CA0005.namprd11.prod.outlook.com (2603:10b6:405:4a::15) by MN2PR12MB3422.namprd12.prod.outlook.com (2603:10b6:208:ce::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Sat, 16 Oct 2021 09:13:17 +0000 Received: from BN8NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:405:4a:cafe::16) by BN6PR1101CA0005.outlook.office365.com (2603:10b6:405:4a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Sat, 16 Oct 2021 09:13:17 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by BN8NAM11FT054.mail.protection.outlook.com (10.13.177.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Sat, 16 Oct 2021 09:13:17 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 16 Oct 2021 09:13:15 +0000 From: Xueming Li To: CC: , Lior Margalit , Matan Azrad , Viacheslav Ovsiienko Date: Sat, 16 Oct 2021 17:12:09 +0800 Message-ID: <20211016091214.1831902-10-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211016091214.1831902-1-xuemingl@nvidia.com> References: <20210926111904.237736-1-xuemingl@nvidia.com> <20211016091214.1831902-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0511cbe6-e6a3-450e-450a-08d9908530e2 X-MS-TrafficTypeDiagnostic: MN2PR12MB3422: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:48; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m1XoGSuxEMeKx9NXQOXAnCwVOq+Ac4ZpbuVHuqf5/MmsYXXY8vAaP3u9pCT4/Al37r5vbR00lW8TcwuqUaG4DvuvYuY9FqBpZCcib1/5DAa0wYZlSy1+lxb10zRaDihUK25ezRzCyvhvaYopGW8hVJ0USlJyIRzP3EgzhcRqE5Y0bnrZPCt1sbhMB0pRCyWWl71sbseknoMiZYs1G8D9CRphwcc4EBm7X7X9g6YWFuefDDlZylRkby0CfRhNgvzGw1OXXE5mCT5d/FGu/NDUMlr1jQhJ5FbTnC3DniLvEAY06gRSYUYZf9KUDtcFTtONomUQcXR5EkIrYMZwWRp+hBQ3Qc5BGRrk2SfPA01revScfFuAX1hQ/srRt+GAk0oafOfNJw5pY31Gsgja7U19Rtyi3bV2301oJaj21eeaufxnXZ1956ZxNYnFUXOstk8Z/WQFr1xYXHJqa6es9v25ACXZ7U/AWd3/EiR484VfXsT0ft/4m0AI6ptJXX0ADslUbFEFjvq4LlKkwkU4MEPSVY8DBt6r88ScxkJYEoty0STxz6PDVw5ieaIZtrX/ypzb/Hul5HxxOiS5wz6CBgolXDh4vT57X8wDJ1C0T2cg9SrUpMHF+EboTznMjHYDUs7/fAZpX9nz7qcvr1FAWoL4U5p5VpCrZZ/zufRiappy7uB2xWrQ/jFQi9MG73khfA6GJaOcG/g3Dtem5xswkDhP3A== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(54906003)(36756003)(36860700001)(426003)(47076005)(2616005)(107886003)(82310400003)(2906002)(8936002)(508600001)(6916009)(70206006)(6286002)(36906005)(70586007)(316002)(336012)(6666004)(7636003)(86362001)(83380400001)(16526019)(7696005)(186003)(8676002)(1076003)(4326008)(356005)(5660300002)(26005)(55016002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2021 09:13:17.2702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0511cbe6-e6a3-450e-450a-08d9908530e2 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3422 Subject: [dpdk-dev] [PATCH v2 09/13] net/mlx5: remove port info from shareable Rx queue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" To prepare for shared Rx queue, removes port info from shareable Rx queue control. Signed-off-by: Xueming Li --- drivers/net/mlx5/mlx5_devx.c | 2 +- drivers/net/mlx5/mlx5_mr.c | 7 ++++--- drivers/net/mlx5/mlx5_rx.c | 15 +++------------ drivers/net/mlx5/mlx5_rx.h | 5 ++++- drivers/net/mlx5/mlx5_rxq.c | 10 ++++------ drivers/net/mlx5/mlx5_rxtx_vec.c | 2 +- 6 files changed, 17 insertions(+), 24 deletions(-) diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c index c65a6e5d4e7..8411e6e6418 100644 --- a/drivers/net/mlx5/mlx5_devx.c +++ b/drivers/net/mlx5/mlx5_devx.c @@ -916,7 +916,7 @@ mlx5_rxq_devx_obj_drop_create(struct rte_eth_dev *dev) } rxq->rxq_ctrl = rxq_ctrl; rxq_ctrl->type = MLX5_RXQ_TYPE_STANDARD; - rxq_ctrl->priv = priv; + rxq_ctrl->sh = priv->sh; rxq_ctrl->obj = rxq; rxq_data = &rxq_ctrl->rxq; /* Create CQ using DevX API. */ diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c index 44afda731fc..8d48b4614ee 100644 --- a/drivers/net/mlx5/mlx5_mr.c +++ b/drivers/net/mlx5/mlx5_mr.c @@ -82,10 +82,11 @@ mlx5_rx_addr2mr_bh(struct mlx5_rxq_data *rxq, uintptr_t addr) struct mlx5_rxq_ctrl *rxq_ctrl = container_of(rxq, struct mlx5_rxq_ctrl, rxq); struct mlx5_mr_ctrl *mr_ctrl = &rxq->mr_ctrl; - struct mlx5_priv *priv = rxq_ctrl->priv; + struct mlx5_priv *priv = RXQ_PORT(rxq_ctrl); + struct mlx5_dev_ctx_shared *sh = rxq_ctrl->sh; - return mlx5_mr_addr2mr_bh(priv->sh->pd, &priv->mp_id, - &priv->sh->share_cache, mr_ctrl, addr, + return mlx5_mr_addr2mr_bh(sh->pd, &priv->mp_id, + &sh->share_cache, mr_ctrl, addr, priv->config.mr_ext_memseg_en); } diff --git a/drivers/net/mlx5/mlx5_rx.c b/drivers/net/mlx5/mlx5_rx.c index e3b1051ba46..09de26c0d39 100644 --- a/drivers/net/mlx5/mlx5_rx.c +++ b/drivers/net/mlx5/mlx5_rx.c @@ -118,15 +118,7 @@ int mlx5_rx_descriptor_status(void *rx_queue, uint16_t offset) { struct mlx5_rxq_data *rxq = rx_queue; - struct mlx5_rxq_ctrl *rxq_ctrl = - container_of(rxq, struct mlx5_rxq_ctrl, rxq); - struct rte_eth_dev *dev = ETH_DEV(rxq_ctrl->priv); - if (dev->rx_pkt_burst == NULL || - dev->rx_pkt_burst == removed_rx_burst) { - rte_errno = ENOTSUP; - return -rte_errno; - } if (offset >= (1 << rxq->cqe_n)) { rte_errno = EINVAL; return -rte_errno; @@ -438,10 +430,10 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec) sm.is_wq = 1; sm.queue_id = rxq->idx; sm.state = IBV_WQS_RESET; - if (mlx5_queue_state_modify(ETH_DEV(rxq_ctrl->priv), &sm)) + if (mlx5_queue_state_modify(RXQ_DEV(rxq_ctrl), &sm)) return -1; if (rxq_ctrl->dump_file_n < - rxq_ctrl->priv->config.max_dump_files_num) { + RXQ_PORT(rxq_ctrl)->config.max_dump_files_num) { MKSTR(err_str, "Unexpected CQE error syndrome " "0x%02x CQN = %u RQN = %u wqe_counter = %u" " rq_ci = %u cq_ci = %u", u.err_cqe->syndrome, @@ -478,8 +470,7 @@ mlx5_rx_err_handle(struct mlx5_rxq_data *rxq, uint8_t vec) sm.is_wq = 1; sm.queue_id = rxq->idx; sm.state = IBV_WQS_RDY; - if (mlx5_queue_state_modify(ETH_DEV(rxq_ctrl->priv), - &sm)) + if (mlx5_queue_state_modify(RXQ_DEV(rxq_ctrl), &sm)) return -1; if (vec) { const uint32_t elts_n = diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h index 2ed544556f5..4eed4176324 100644 --- a/drivers/net/mlx5/mlx5_rx.h +++ b/drivers/net/mlx5/mlx5_rx.h @@ -23,6 +23,10 @@ /* Support tunnel matching. */ #define MLX5_FLOW_TUNNEL 10 +#define RXQ_PORT(rxq_ctrl) LIST_FIRST(&(rxq_ctrl)->owners)->priv +#define RXQ_DEV(rxq_ctrl) ETH_DEV(RXQ_PORT(rxq_ctrl)) +#define RXQ_PORT_ID(rxq_ctrl) PORT_ID(RXQ_PORT(rxq_ctrl)) + struct mlx5_rxq_stats { #ifdef MLX5_PMD_SOFT_COUNTERS uint64_t ipackets; /**< Total of successfully received packets. */ @@ -163,7 +167,6 @@ struct mlx5_rxq_ctrl { LIST_HEAD(priv, mlx5_rxq_priv) owners; /* Owner rxq list. */ struct mlx5_rxq_obj *obj; /* Verbs/DevX elements. */ struct mlx5_dev_ctx_shared *sh; /* Shared context. */ - struct mlx5_priv *priv; /* Back pointer to private data. */ enum mlx5_rxq_type type; /* Rxq type. */ unsigned int socket; /* CPU socket ID for allocations. */ unsigned int irq:1; /* Whether IRQ is enabled. */ diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c index 2b9ab7b3fc4..fc931939721 100644 --- a/drivers/net/mlx5/mlx5_rxq.c +++ b/drivers/net/mlx5/mlx5_rxq.c @@ -148,7 +148,7 @@ rxq_alloc_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) buf = rte_pktmbuf_alloc(seg->mp); if (buf == NULL) { DRV_LOG(ERR, "port %u empty mbuf pool", - PORT_ID(rxq_ctrl->priv)); + RXQ_PORT_ID(rxq_ctrl)); rte_errno = ENOMEM; goto error; } @@ -195,7 +195,7 @@ rxq_alloc_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) DRV_LOG(DEBUG, "port %u SPRQ queue %u allocated and configured %u segments" " (max %u packets)", - PORT_ID(rxq_ctrl->priv), rxq_ctrl->rxq.idx, elts_n, + RXQ_PORT_ID(rxq_ctrl), rxq_ctrl->rxq.idx, elts_n, elts_n / (1 << rxq_ctrl->rxq.sges_n)); return 0; error: @@ -207,7 +207,7 @@ rxq_alloc_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) (*rxq_ctrl->rxq.elts)[i] = NULL; } DRV_LOG(DEBUG, "port %u SPRQ queue %u failed, freed everything", - PORT_ID(rxq_ctrl->priv), rxq_ctrl->rxq.idx); + RXQ_PORT_ID(rxq_ctrl), rxq_ctrl->rxq.idx); rte_errno = err; /* Restore rte_errno. */ return -rte_errno; } @@ -284,7 +284,7 @@ rxq_free_elts_sprq(struct mlx5_rxq_ctrl *rxq_ctrl) uint16_t i; DRV_LOG(DEBUG, "port %u Rx queue %u freeing %d WRs", - PORT_ID(rxq_ctrl->priv), rxq->idx, q_n); + RXQ_PORT_ID(rxq_ctrl), rxq->idx, q_n); if (rxq->elts == NULL) return; /** @@ -1584,7 +1584,6 @@ mlx5_rxq_new(struct rte_eth_dev *dev, struct mlx5_rxq_priv *rxq, (!!(dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS)); tmpl->rxq.port_id = dev->data->port_id; tmpl->sh = priv->sh; - tmpl->priv = priv; tmpl->rxq.mp = rx_seg[0].mp; tmpl->rxq.elts_n = log2above(desc); tmpl->rxq.rq_repl_thresh = @@ -1644,7 +1643,6 @@ mlx5_rxq_hairpin_new(struct rte_eth_dev *dev, struct mlx5_rxq_priv *rxq, tmpl->rxq.rss_hash = 0; tmpl->rxq.port_id = dev->data->port_id; tmpl->sh = priv->sh; - tmpl->priv = priv; tmpl->rxq.mp = NULL; tmpl->rxq.elts_n = log2above(desc); tmpl->rxq.elts = NULL; diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.c b/drivers/net/mlx5/mlx5_rxtx_vec.c index ecd273e00a8..511681841ca 100644 --- a/drivers/net/mlx5/mlx5_rxtx_vec.c +++ b/drivers/net/mlx5/mlx5_rxtx_vec.c @@ -550,7 +550,7 @@ mlx5_rxq_check_vec_support(struct mlx5_rxq_data *rxq) struct mlx5_rxq_ctrl *ctrl = container_of(rxq, struct mlx5_rxq_ctrl, rxq); - if (!ctrl->priv->config.rx_vec_en || rxq->sges_n != 0) + if (!RXQ_PORT(ctrl)->config.rx_vec_en || rxq->sges_n != 0) return -ENOTSUP; if (rxq->lro) return -ENOTSUP; -- 2.33.0