From patchwork Sun May 14 06:18:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: longli@linuxonhyperv.com X-Patchwork-Id: 93649 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp6148670vqo; Sat, 13 May 2023 23:40:18 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mL7r2yB1xVfNAdNXBBZCXWGurDlGK5K4/maaAHSOMyQNkNdC/Pyfl/8iNxB7PkUDE27tz X-Received: by 2002:a05:6a20:8426:b0:101:90e:c0cb with SMTP id c38-20020a056a20842600b00101090ec0cbmr25208345pzd.59.1684046418589; Sat, 13 May 2023 23:40:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684046418; cv=none; d=google.com; s=arc-20160816; b=yDpO6t87rUSjYzM06d3edbVLZYTgXZZ8/kZuCm9HOHOKKpVPNHDA+u3se9nD2rXu4f f5WP2zHrK3stkcqPYRbT+8hNyJcr1Ca/txEtzrkv444ImZFhZaVA1Lqkgobz2HBHw23T 2eWUdOWSRgDF+yDNYsQvmQnkIjwm12k5jRL+qJ2Vusy4JvpAnzLivfYRYJsElXDHNTbl /KMZl56i7M+CR8vH2bpWX0cUs0fR4GREkz6EKybxYF+UK9vQl4nG8HT2c1Hvpmh1fS+h ly2Dd/tJ8cBmccJcHh4x9cMxzjxlHnSCawBX6M6nq/lzKLzHOjyO11vp6GZkWJNBN9pj L+6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=mkDSgMixtmxFXZXt8h2/2gvZqMCg8aIpGWf4AZFjQjw=; b=zWfRVAwHKAwaaqgfT7xIX31xO5tyzXfjLkthFO3A7MWoA/wWQaJKv3Zyes67R5Jug2 keMi+qdB+2E+1zAfiAsVlX65Uvl/XrurwOPaOJdi7y97DlEuBXLGh6XI16p65J2dhmks cWuY5U9/tCohLjjyi3Z6JcGpzXpo9IOaKtushT8vXANhDZoCc3eWKB/+LrohSwV8rqRz uxjHNCU2DrsjERESkGSBAgoxZwiZUtLSm3meY30Lxmn/t52IMXm9ZM3wPh0KVcMAsZLk gvI4Pkj7ujFb9Viah0GRvW4Vd/bPOQAHIlEAz0UbkyRMfXiyp4XhwNVql1ow7H35G9cD DMcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=o3tQbgag; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l63-20020a638842000000b005307b843a9dsi8216894pgd.263.2023.05.13.23.40.05; Sat, 13 May 2023 23:40:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=o3tQbgag; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxonhyperv.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230051AbjENGSd (ORCPT + 99 others); Sun, 14 May 2023 02:18:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjENGSc (ORCPT ); Sun, 14 May 2023 02:18:32 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0CB2C1FC0; Sat, 13 May 2023 23:18:31 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 7B06E20EB22D; Sat, 13 May 2023 23:18:28 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 7B06E20EB22D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1684045108; bh=mkDSgMixtmxFXZXt8h2/2gvZqMCg8aIpGWf4AZFjQjw=; h=From:To:Cc:Subject:Date:From; b=o3tQbgag6GQZOid6zYnnPELIjRY/dITiZBdzdIRYYIK+RMpGY7myQnUVzTUY1srOJ T93Js7yLO7FYg4tJmMkz03daMN/OAJIKsxVoyE6e+rYNnIHu5CPhDSFER+uAWOtjl8 tbFBzDCYUH4kuO01D69S24hKIQxAZYHgbpD29o30= From: longli@linuxonhyperv.com To: Jason Gunthorpe , Leon Romanovsky , Ajay Sharma , Dexuan Cui , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Long Li Subject: [PATCH v2] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to enable RX coalescing Date: Sat, 13 May 2023 23:18:15 -0700 Message-Id: <1684045095-31228-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765850657337774949?= X-GMAIL-MSGID: =?utf-8?q?1765850657337774949?= From: Long Li With RX coalescing, one CQE entry can be used to indicate multiple packets on the receive queue. This saves processing time and PCI bandwidth over the CQ. The MANA Ethernet driver also uses the v2 version of the protocol. It doesn't use RX coalescing and its behavior is not changed. Signed-off-by: Long Li --- Change log v2: remove the definition of v1 protocol drivers/infiniband/hw/mana/qp.c | 5 ++++- drivers/net/ethernet/microsoft/mana/mana_en.c | 5 ++++- include/net/mana/mana.h | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c index 54b61930a7fd..4b3b5b274e84 100644 --- a/drivers/infiniband/hw/mana/qp.c +++ b/drivers/infiniband/hw/mana/qp.c @@ -13,7 +13,7 @@ static int mana_ib_cfg_vport_steering(struct mana_ib_dev *dev, u8 *rx_hash_key) { struct mana_port_context *mpc = netdev_priv(ndev); - struct mana_cfg_rx_steer_req *req = NULL; + struct mana_cfg_rx_steer_req_v2 *req; struct mana_cfg_rx_steer_resp resp = {}; mana_handle_t *req_indir_tab; struct gdma_context *gc; @@ -33,6 +33,8 @@ static int mana_ib_cfg_vport_steering(struct mana_ib_dev *dev, mana_gd_init_req_hdr(&req->hdr, MANA_CONFIG_VPORT_RX, req_buf_size, sizeof(resp)); + req->hdr.req.msg_version = GDMA_MESSAGE_V2; + req->vport = mpc->port_handle; req->rx_enable = 1; req->update_default_rxobj = 1; @@ -46,6 +48,7 @@ static int mana_ib_cfg_vport_steering(struct mana_ib_dev *dev, req->num_indir_entries = MANA_INDIRECT_TABLE_SIZE; req->indir_tab_offset = sizeof(*req); req->update_indir_tab = true; + req->cqe_coalescing_enable = 1; req_indir_tab = (mana_handle_t *)(req + 1); /* The ind table passed to the hardware must have diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c index 06d6292e09b3..b3fcb767b9ab 100644 --- a/drivers/net/ethernet/microsoft/mana/mana_en.c +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c @@ -972,7 +972,7 @@ static int mana_cfg_vport_steering(struct mana_port_context *apc, bool update_tab) { u16 num_entries = MANA_INDIRECT_TABLE_SIZE; - struct mana_cfg_rx_steer_req *req = NULL; + struct mana_cfg_rx_steer_req_v2 *req; struct mana_cfg_rx_steer_resp resp = {}; struct net_device *ndev = apc->ndev; mana_handle_t *req_indir_tab; @@ -987,6 +987,8 @@ static int mana_cfg_vport_steering(struct mana_port_context *apc, mana_gd_init_req_hdr(&req->hdr, MANA_CONFIG_VPORT_RX, req_buf_size, sizeof(resp)); + req->hdr.req.msg_version = GDMA_MESSAGE_V2; + req->vport = apc->port_handle; req->num_indir_entries = num_entries; req->indir_tab_offset = sizeof(*req); @@ -996,6 +998,7 @@ static int mana_cfg_vport_steering(struct mana_port_context *apc, req->update_hashkey = update_key; req->update_indir_tab = update_tab; req->default_rxobj = apc->default_rxobj; + req->cqe_coalescing_enable = 0; if (update_key) memcpy(&req->hashkey, apc->hashkey, MANA_HASH_KEY_SIZE); diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h index cd386aa7c7cc..1512bd48df81 100644 --- a/include/net/mana/mana.h +++ b/include/net/mana/mana.h @@ -581,7 +581,7 @@ struct mana_fence_rq_resp { }; /* HW DATA */ /* Configure vPort Rx Steering */ -struct mana_cfg_rx_steer_req { +struct mana_cfg_rx_steer_req_v2 { struct gdma_req_hdr hdr; mana_handle_t vport; u16 num_indir_entries; @@ -594,6 +594,8 @@ struct mana_cfg_rx_steer_req { u8 reserved; mana_handle_t default_rxobj; u8 hashkey[MANA_HASH_KEY_SIZE]; + u8 cqe_coalescing_enable; + u8 reserved2[7]; }; /* HW DATA */ struct mana_cfg_rx_steer_resp {