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 4EF26A0547; Sun, 26 Sep 2021 13:20:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9327D41101; Sun, 26 Sep 2021 13:20:13 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2070.outbound.protection.outlook.com [40.107.244.70]) by mails.dpdk.org (Postfix) with ESMTP id 85844410F7 for ; Sun, 26 Sep 2021 13:20:10 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LtwAlftt3aAwJZ4JB2vXUA7zj+q5qzXx2H8fNlvP/oq3AG0mLjhKs+NLsKQlaAIjfaAGqq3fqUs7UdKBtOXI5rGCl5WCJl0PXO4/NIdJtxxagPjkn9v9YDORauLhWyo1STNw8UczRjbrrHEJGH4Ov37NDS/2m43KiNwCUqiYGIU5fLtrSl9w99Es8mmao2o5HXrFkNQMsjL8JLczQvNZcVndxBizFWKpZkJaozHMrOttgbS+wni0LbTaZHYmL+rQllKK+Cmh7hVW//ZbMIdS2COWpZ4d9z5bsKOyYMBeBvOLqThfMGr6ejEmfcyx5DFfQ41UXuoC1kaw2LzTxaEVqw== 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; bh=NheNNYbWLQaRH1Z4kIMBbycBa4zHC84BhShVuMAB9Ws=; b=fFUByy+M4qMRl8UY0P55t/Q0hDIRtdMTX7sHFdQ/ZFZpDMd+zMi0r0Ko+rFo8d86qgQ94ecwau/J0nMw/UyA6j80EPfOKsUhhAHC5PtnjKMiunYmudr5kqrrwcmVH3NO9fgYGLlUg7SrtReIZZfoQEwcn2G6RV1vldgt6ZyfujQQpWaLHFOrdqWVVcBmBqziIky9isVBWavU1+7Iz/2JOUDGKnwy+JaSjqGnQS0bYlk5vrI3RQRCqTzgDg7uK0ybCnPIkwiLqNSiyBqMTWzFWfF9IHr2jBmM41hAaukfurlwUG0bQhlzPcmCvgaA6wkpIcIjzj1V1/YRz3Lf3+Q0Tw== 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=none 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=NheNNYbWLQaRH1Z4kIMBbycBa4zHC84BhShVuMAB9Ws=; b=oUCgfoGkEnseQP4eg8anOPfXqdA4BaKJAE8nyUgARKg4R0UaXroM/6taopKObn9yrMw13CfIuNOnUjDe4obL3h7xCyauu4A+vmJ9D9cK1ZNgBNbGEXHMK6VbxGYTkcLX0oWMKAUjh50kb2CmCl6dHDz8lUBC+N9bRjrNKMQTWPuzPbJup1AvZs9kauZHNMz7q4pXCkZFmJqpYRlJcE5LymEbhtCGej9+y6jz8BNTlijdnfq9QWy6R/Y4O6E7aKJVMMaI2E9dwH9yrAJc3aYjRkm081RRWbZ6GufePFQhcKOqVxd1oAkXmfVOaw7SuflI4gQV1Nu5d1RQb/VIADxd4Q== Received: from BN8PR15CA0067.namprd15.prod.outlook.com (2603:10b6:408:80::44) by BY5PR12MB5512.namprd12.prod.outlook.com (2603:10b6:a03:1df::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.18; Sun, 26 Sep 2021 11:20:09 +0000 Received: from BN8NAM11FT047.eop-nam11.prod.protection.outlook.com (2603:10b6:408:80:cafe::9f) by BN8PR15CA0067.outlook.office365.com (2603:10b6:408:80::44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4544.13 via Frontend Transport; Sun, 26 Sep 2021 11:20:09 +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 BN8NAM11FT047.mail.protection.outlook.com (10.13.177.220) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4544.13 via Frontend Transport; Sun, 26 Sep 2021 11:20:08 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 26 Sep 2021 11:20:06 +0000 Received: from nvidia.com (172.20.187.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sun, 26 Sep 2021 11:20:04 +0000 From: Xueming Li To: CC: , Lior Margalit , Matan Azrad , Viacheslav Ovsiienko Date: Sun, 26 Sep 2021 19:19:01 +0800 Message-ID: <20210926111904.237736-9-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210926111904.237736-1-xuemingl@nvidia.com> References: <20210926111904.237736-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 69d38e07-1b0b-463a-4815-08d980df9978 X-MS-TrafficTypeDiagnostic: BY5PR12MB5512: 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: 0TBu4CIcKzSRPQ5WyPwNeqDtC+bNylk6ejJTtLgYgMrbr2fWn/pPHgzbHeBUkQIOmbqnvIsNb/0RsBQZRiv6+5lDKNjm5QhBai6m+3kFUVBlItf0ZUQ/5Lbe0EWICNTarL5MhB0hvc4HkwDGXemN0sYruwWUpsoWItnqwCRhex973Zps5AQzAUGjCDfy7GG3BttHdz+ZRda/vYwOoDUaw2DH8FzcxlB/pvgBwcfkK24ENONZS4G5dmbLYyS3/XH9lKhtArcFMdKkKKk/71AQy1MOm0sdXhfTV090vuH9IaiSGuIJ23kbdeRaojUw+7P4qleokRnABSElkv5XHihislZ9y/bp7NZSZhQixo7AyZii9Ec8ns0X+2u78Jl2W94XPdL2EffbFMqPF4qiOzBtD29i7FKL1TG/0ADZ6M3NlURb/KEtY6Y6w8CSJ2QGMQsXFVTGXHjkW5GzWEdqx9lAnUxLQ6p8oBVixh+6GU6w/5xnb6VgsbRBcgodowZ4ZcHxz0gaPC0dx4Yewjzo/dn+9CJRbuVFM5mJ8DRZGVJ8miNCnn0XrycxiOfijox6FmWFeQBtH38aVzzGAEZTJE72C8iwq2snt1EnDwbxNPaDhz97wz05momEnpmX+PWsV3XppGdonYxfCaLRvclhvRZcQmk9ZRvqh0A8n12KwFflSV+lbqg8tN05v88d9Ds8QZ0/5fkaEF3LV3qB8N6zBgfDoA== 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)(36756003)(70206006)(316002)(55016002)(70586007)(86362001)(107886003)(4326008)(6286002)(8676002)(36906005)(7696005)(508600001)(26005)(186003)(82310400003)(1076003)(336012)(6666004)(426003)(2906002)(47076005)(54906003)(2616005)(7636003)(356005)(6916009)(83380400001)(5660300002)(8936002)(36860700001)(16526019); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2021 11:20:08.8785 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 69d38e07-1b0b-463a-4815-08d980df9978 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: BN8NAM11FT047.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB5512 Subject: [dpdk-dev] [PATCH 08/11] 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 4d479c19e6c..71e4bce1588 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 21cb1000899..3aac7cc20ba 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