Message ID | 1683312708-24872-1-git-send-email-longli@linuxonhyperv.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp635275vqo; Fri, 5 May 2023 12:13:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5kDpjPgSAzaaUpwen7qZvCoVdKhVMcOj/9xDHrdKAzU7bqHGV5+33x2bk8nggv3tcZ5eXm X-Received: by 2002:a17:902:b591:b0:1a5:2760:74ef with SMTP id a17-20020a170902b59100b001a5276074efmr2338420pls.25.1683314026463; Fri, 05 May 2023 12:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683314026; cv=none; d=google.com; s=arc-20160816; b=sal5AHRdNCj0Nf6pugtXTbl4ogD9wG3fEX2k8ZDowIJvCB7iA5ygADoXy759Xmrx99 R4MbYuRFS7+6Ir6b1eUU1/AQb7JZ1WaG4OX1Nfnj6YYhbq3Fwj5RwiPd1t107Kmy2NM1 YTykvbc+5vuiE12dCZ6AKJxehlwgnCtmRoWZdEzx0U9GhCN4Psvk2/r5MT3JbQAcqBdw ptyBA1yI0/JJcgt+wyw4WIiRpLwzUyQW9kK4bDm8U7EQD/Bx59r0TlakXwUIQslSRVT1 1UllH/iZ0FEN1QG7IQzUbpcbdqHMpsU1x54q8eCl9gTI4VI+ySXKt3pf1NyiguoVcnwB cZ5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=mb5lvwg5ohLnnbkdoeBM8lxdqhlZn5srSg8X66I10YQ=; b=THIjiIZ5LNR1/pz2gyn9bCTcnB/7CcWq7eiwXwezTKudgENBDlwl5fYSHRMqmp1o3X Yrc6MktoD4dySsYn9/quydhSADPQBpbX0JEyIj/rVxxqnwVFrcVNf8WZwsZ2KYHKOIVd mtQFZMZkIViG5s1gKVRqaboXj5PSOHGu1lYVy+1VmzGkMe5+9t67URcYbrgJhCf61RJp QIDTaNu990r5h0czWUXYbtVV7xhaPrNgxyy1A+sduHxygcXqj0dWb4HIjxTo9oePag/z ILKKHJpPIlP30FwZ4hmtyptyQJGP3+yRKkoh/Wqp3zsQkFDwygZ+5LOKEe9p6mftlC3a 40nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxonhyperv.com header.s=default header.b=FGPYeoob; 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 ix19-20020a170902f81300b001aad4ba0de5si2227753plb.158.2023.05.05.12.13.32; Fri, 05 May 2023 12:13:46 -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=FGPYeoob; 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 S233360AbjEESwN (ORCPT <rfc822;baris.duru.linux@gmail.com> + 99 others); Fri, 5 May 2023 14:52:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233062AbjEESwL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 5 May 2023 14:52:11 -0400 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8D21112A; Fri, 5 May 2023 11:51:59 -0700 (PDT) Received: by linux.microsoft.com (Postfix, from userid 1004) id 0E5D220EA203; Fri, 5 May 2023 11:51:59 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 0E5D220EA203 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxonhyperv.com; s=default; t=1683312719; bh=mb5lvwg5ohLnnbkdoeBM8lxdqhlZn5srSg8X66I10YQ=; h=From:To:Cc:Subject:Date:Reply-To:From; b=FGPYeoobBbC8zpKtp262vui8o6VTAI05CAw2wWRvQj7vOvJOgCkmGRsoxzUd4ognE 8hgvhBdXC4TabrBsmVt5QU2yZvs1DgNBfj09deVQkxZEKDpolp5jO8Q3y/plDgNGrU JBDyMi63+Xf5VRF+oIQq0/gqUqe2cYzdjMvIM2MI= From: longli@linuxonhyperv.com To: Jason Gunthorpe <jgg@ziepe.ca>, Leon Romanovsky <leon@kernel.org>, Ajay Sharma <sharmaajay@microsoft.com>, Dexuan Cui <decui@microsoft.com>, "K. Y. Srinivasan" <kys@microsoft.com>, Haiyang Zhang <haiyangz@microsoft.com>, Wei Liu <wei.liu@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Long Li <longli@microsoft.com> Subject: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to enable RX coalescing Date: Fri, 5 May 2023 11:51:48 -0700 Message-Id: <1683312708-24872-1-git-send-email-longli@linuxonhyperv.com> X-Mailer: git-send-email 1.8.3.1 Reply-To: longli@microsoft.com 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765082688615261618?= X-GMAIL-MSGID: =?utf-8?q?1765082688615261618?= |
Series |
RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to enable RX coalescing
|
|
Commit Message
longli@linuxonhyperv.com
May 5, 2023, 6:51 p.m. UTC
From: Long Li <longli@microsoft.com> 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. Signed-off-by: Long Li <longli@microsoft.com> --- drivers/infiniband/hw/mana/qp.c | 5 ++++- include/net/mana/mana.h | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-)
Comments
On Fri, May 05, 2023 at 11:51:48AM -0700, longli@linuxonhyperv.com wrote: > From: Long Li <longli@microsoft.com> > > 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. > > Signed-off-by: Long Li <longli@microsoft.com> > --- > drivers/infiniband/hw/mana/qp.c | 5 ++++- > include/net/mana/mana.h | 17 +++++++++++++++++ > 2 files changed, 21 insertions(+), 1 deletion(-) Why didn't you change mana_cfg_vport_steering() too? > > diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c > index 54b61930a7fd..83c768f96506 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 = NULL; There is no need in NULL here, req is going to be overwritten almost immediately. Thanks > 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 = true; > > req_indir_tab = (mana_handle_t *)(req + 1); > /* The ind table passed to the hardware must have > diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h > index cd386aa7c7cc..f8314b7c386c 100644 > --- a/include/net/mana/mana.h > +++ b/include/net/mana/mana.h > @@ -596,6 +596,23 @@ struct mana_cfg_rx_steer_req { > u8 hashkey[MANA_HASH_KEY_SIZE]; > }; /* HW DATA */ > > +struct mana_cfg_rx_steer_req_v2 { > + struct gdma_req_hdr hdr; > + mana_handle_t vport; > + u16 num_indir_entries; > + u16 indir_tab_offset; > + u32 rx_enable; > + u32 rss_enable; > + u8 update_default_rxobj; > + u8 update_hashkey; > + u8 update_indir_tab; > + 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 { > struct gdma_resp_hdr hdr; > }; /* HW DATA */ > -- > 2.17.1 >
> -----Original Message----- > From: Leon Romanovsky <leon@kernel.org> > Sent: Sunday, May 7, 2023 4:11 AM > To: Long Li <longli@microsoft.com> > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY > Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; > Wei Liu <wei.liu@kernel.org>; David S. Miller <davem@davemloft.net>; Eric > Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; linux- > hyperv@vger.kernel.org; netdev@vger.kernel.org; linux- > kernel@vger.kernel.org > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > enable RX coalescing > > On Fri, May 05, 2023 at 11:51:48AM -0700, longli@linuxonhyperv.com > wrote: > > From: Long Li <longli@microsoft.com> > > > > 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. > > > > Signed-off-by: Long Li <longli@microsoft.com> > > --- > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > > include/net/mana/mana.h | 17 +++++++++++++++++ > > 2 files changed, 21 insertions(+), 1 deletion(-) > > Why didn't you change mana_cfg_vport_steering() too? The mana_cfg_vport_steering() is for mana_en (Enthernet) driver, not the mana_ib driver. The changes for mana_en will be done in a separate patch together with changes for mana_en RX code patch to support multiple packets / CQE. Thanks, - Haiyang
On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: > > > > -----Original Message----- > > From: Leon Romanovsky <leon@kernel.org> > > Sent: Sunday, May 7, 2023 4:11 AM > > To: Long Li <longli@microsoft.com> > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > > <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY > > Srinivasan <kys@microsoft.com>; Haiyang Zhang <haiyangz@microsoft.com>; > > Wei Liu <wei.liu@kernel.org>; David S. Miller <davem@davemloft.net>; Eric > > Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; linux- > > hyperv@vger.kernel.org; netdev@vger.kernel.org; linux- > > kernel@vger.kernel.org > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > > enable RX coalescing > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, longli@linuxonhyperv.com > > wrote: > > > From: Long Li <longli@microsoft.com> > > > > > > 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. > > > > > > Signed-off-by: Long Li <longli@microsoft.com> > > > --- > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > > > include/net/mana/mana.h | 17 +++++++++++++++++ > > > 2 files changed, 21 insertions(+), 1 deletion(-) > > > > Why didn't you change mana_cfg_vport_steering() too? > > The mana_cfg_vport_steering() is for mana_en (Enthernet) driver, not the > mana_ib driver. > > The changes for mana_en will be done in a separate patch together with > changes for mana_en RX code patch to support multiple packets / CQE. I'm aware of the difference between mana_en and mana_ib. The change you proposed doesn't depend on "support multiple packets / CQE." and works perfectly with one packet/CQE also, does it? Thanks > > Thanks, > - Haiyang >
> -----Original Message----- > From: Leon Romanovsky <leon@kernel.org> > Sent: Monday, May 8, 2023 2:10 AM > To: Haiyang Zhang <haiyangz@microsoft.com> > Cc: Long Li <longli@microsoft.com>; Jason Gunthorpe <jgg@ziepe.ca>; Ajay > Sharma <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; > KY Srinivasan <kys@microsoft.com>; Wei Liu <wei.liu@kernel.org>; David S. > Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; linux- > rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; > netdev@vger.kernel.org; linux-kernel@vger.kernel.org > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > enable RX coalescing > > On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: > > > > > > > -----Original Message----- > > > From: Leon Romanovsky <leon@kernel.org> > > > Sent: Sunday, May 7, 2023 4:11 AM > > > To: Long Li <longli@microsoft.com> > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > > > <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY > > > Srinivasan <kys@microsoft.com>; Haiyang Zhang > <haiyangz@microsoft.com>; > > > Wei Liu <wei.liu@kernel.org>; David S. Miller <davem@davemloft.net>; Eric > > > Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; > Paolo > > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; linux- > > > hyperv@vger.kernel.org; netdev@vger.kernel.org; linux- > > > kernel@vger.kernel.org > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req > to > > > enable RX coalescing > > > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, longli@linuxonhyperv.com > > > wrote: > > > > From: Long Li <longli@microsoft.com> > > > > > > > > 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. > > > > > > > > Signed-off-by: Long Li <longli@microsoft.com> > > > > --- > > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > > > > include/net/mana/mana.h | 17 +++++++++++++++++ > > > > 2 files changed, 21 insertions(+), 1 deletion(-) > > > > > > Why didn't you change mana_cfg_vport_steering() too? > > > > The mana_cfg_vport_steering() is for mana_en (Enthernet) driver, not the > > mana_ib driver. > > > > The changes for mana_en will be done in a separate patch together with > > changes for mana_en RX code patch to support multiple packets / CQE. > > I'm aware of the difference between mana_en and mana_ib. > > The change you proposed doesn't depend on "support multiple packets / > CQE." > and works perfectly with one packet/CQE also, does it? No. If we add the following setting to the mana_en / mana_cfg_vport_steering(), the NIC may put multiple packets in one CQE, so we need to have the changes for mana_en RX code path to support multiple packets / CQE. + req->cqe_coalescing_enable = true; So we plan to set this cqe_coalescing_enable, and the changes for mana_en RX code path to support multiple packets / CQE in another patch. Thanks, - Haiyang
On Mon, May 08, 2023 at 02:45:44PM +0000, Haiyang Zhang wrote: > > > > -----Original Message----- > > From: Leon Romanovsky <leon@kernel.org> > > Sent: Monday, May 8, 2023 2:10 AM > > To: Haiyang Zhang <haiyangz@microsoft.com> > > Cc: Long Li <longli@microsoft.com>; Jason Gunthorpe <jgg@ziepe.ca>; Ajay > > Sharma <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; > > KY Srinivasan <kys@microsoft.com>; Wei Liu <wei.liu@kernel.org>; David S. > > Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > > Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; linux- > > rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > > enable RX coalescing > > > > On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: > > > > > > > > > > -----Original Message----- > > > > From: Leon Romanovsky <leon@kernel.org> > > > > Sent: Sunday, May 7, 2023 4:11 AM > > > > To: Long Li <longli@microsoft.com> > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > > > > <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY > > > > Srinivasan <kys@microsoft.com>; Haiyang Zhang > > <haiyangz@microsoft.com>; > > > > Wei Liu <wei.liu@kernel.org>; David S. Miller <davem@davemloft.net>; Eric > > > > Dumazet <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; > > Paolo > > > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; linux- > > > > hyperv@vger.kernel.org; netdev@vger.kernel.org; linux- > > > > kernel@vger.kernel.org > > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req > > to > > > > enable RX coalescing > > > > > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, longli@linuxonhyperv.com > > > > wrote: > > > > > From: Long Li <longli@microsoft.com> > > > > > > > > > > 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. > > > > > > > > > > Signed-off-by: Long Li <longli@microsoft.com> > > > > > --- > > > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > > > > > include/net/mana/mana.h | 17 +++++++++++++++++ > > > > > 2 files changed, 21 insertions(+), 1 deletion(-) > > > > > > > > Why didn't you change mana_cfg_vport_steering() too? > > > > > > The mana_cfg_vport_steering() is for mana_en (Enthernet) driver, not the > > > mana_ib driver. > > > > > > The changes for mana_en will be done in a separate patch together with > > > changes for mana_en RX code patch to support multiple packets / CQE. > > > > I'm aware of the difference between mana_en and mana_ib. > > > > The change you proposed doesn't depend on "support multiple packets / > > CQE." > > and works perfectly with one packet/CQE also, does it? > > No. > If we add the following setting to the mana_en / mana_cfg_vport_steering(), > the NIC may put multiple packets in one CQE, so we need to have the changes > for mana_en RX code path to support multiple packets / CQE. > + req->cqe_coalescing_enable = true; You can leave "cqe_coalescing_enable = false" for ETH and still reuse your new v2 struct. H> > So we plan to set this cqe_coalescing_enable, and the changes for mana_en > RX code path to support multiple packets / CQE in another patch. And how does it work with IB without changing anything except this proposed patch? Thanks > > Thanks, > - Haiyang >
> Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > enable RX coalescing > > On Mon, May 08, 2023 at 02:45:44PM +0000, Haiyang Zhang wrote: > > > > > > > -----Original Message----- > > > From: Leon Romanovsky <leon@kernel.org> > > > Sent: Monday, May 8, 2023 2:10 AM > > > To: Haiyang Zhang <haiyangz@microsoft.com> > > > Cc: Long Li <longli@microsoft.com>; Jason Gunthorpe <jgg@ziepe.ca>; > > > Ajay Sharma <sharmaajay@microsoft.com>; Dexuan Cui > > > <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Wei Liu > <wei.liu@kernel.org>; David S. > > > Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > > > Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; > > > linux- rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; > > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > > > cfg_rx_steer_req to enable RX coalescing > > > > > > On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: > > > > > > > > > > > > > -----Original Message----- > > > > > From: Leon Romanovsky <leon@kernel.org> > > > > > Sent: Sunday, May 7, 2023 4:11 AM > > > > > To: Long Li <longli@microsoft.com> > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > > > > > <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY > > > > > Srinivasan <kys@microsoft.com>; Haiyang Zhang > > > <haiyangz@microsoft.com>; > > > > > Wei Liu <wei.liu@kernel.org>; David S. Miller > > > > > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > Jakub > > > > > Kicinski <kuba@kernel.org>; > > > Paolo > > > > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; linux- > > > > > hyperv@vger.kernel.org; netdev@vger.kernel.org; linux- > > > > > kernel@vger.kernel.org > > > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > > > > > cfg_rx_steer_req > > > to > > > > > enable RX coalescing > > > > > > > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, > > > > > longli@linuxonhyperv.com > > > > > wrote: > > > > > > From: Long Li <longli@microsoft.com> > > > > > > > > > > > > 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. > > > > > > > > > > > > Signed-off-by: Long Li <longli@microsoft.com> > > > > > > --- > > > > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > > > > > > include/net/mana/mana.h | 17 +++++++++++++++++ > > > > > > 2 files changed, 21 insertions(+), 1 deletion(-) > > > > > > > > > > Why didn't you change mana_cfg_vport_steering() too? > > > > > > > > The mana_cfg_vport_steering() is for mana_en (Enthernet) driver, > > > > not the mana_ib driver. > > > > > > > > The changes for mana_en will be done in a separate patch together > > > > with changes for mana_en RX code patch to support multiple packets / > CQE. > > > > > > I'm aware of the difference between mana_en and mana_ib. > > > > > > The change you proposed doesn't depend on "support multiple packets > > > / CQE." > > > and works perfectly with one packet/CQE also, does it? > > > > No. > > If we add the following setting to the mana_en / > > mana_cfg_vport_steering(), the NIC may put multiple packets in one > > CQE, so we need to have the changes for mana_en RX code path to support > multiple packets / CQE. > > + req->cqe_coalescing_enable = true; > > You can leave "cqe_coalescing_enable = false" for ETH and still reuse your new > v2 struct. I think your proposal will work for both Ethernet and IB. The idea is that we want this patch to change the behavior of the IB driver. We plan to make another patch for the Ethernet driver. This makes it easier to track all changes for a driver. > > H> > > So we plan to set this cqe_coalescing_enable, and the changes for > > mana_en RX code path to support multiple packets / CQE in another patch. > > And how does it work with IB without changing anything except this proposed > patch? The RX CQE Coalescing is implemented in the user-mode. This feature is always turned on from cluster. The user-mode code is written in a way that can deal with both CQE Coalescing and CQE non-coalescing, so it doesn't depend on kernel version for the correct behavior. Thanks, Long
On Tue, May 09, 2023 at 07:08:36PM +0000, Long Li wrote: > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > > enable RX coalescing > > > > On Mon, May 08, 2023 at 02:45:44PM +0000, Haiyang Zhang wrote: > > > > > > > > > > -----Original Message----- > > > > From: Leon Romanovsky <leon@kernel.org> > > > > Sent: Monday, May 8, 2023 2:10 AM > > > > To: Haiyang Zhang <haiyangz@microsoft.com> > > > > Cc: Long Li <longli@microsoft.com>; Jason Gunthorpe <jgg@ziepe.ca>; > > > > Ajay Sharma <sharmaajay@microsoft.com>; Dexuan Cui > > > > <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; Wei Liu > > <wei.liu@kernel.org>; David S. > > > > Miller <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > > > > Jakub Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; > > > > linux- rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; > > > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org > > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > > > > cfg_rx_steer_req to enable RX coalescing > > > > > > > > On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > From: Leon Romanovsky <leon@kernel.org> > > > > > > Sent: Sunday, May 7, 2023 4:11 AM > > > > > > To: Long Li <longli@microsoft.com> > > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > > > > > > <sharmaajay@microsoft.com>; Dexuan Cui <decui@microsoft.com>; KY > > > > > > Srinivasan <kys@microsoft.com>; Haiyang Zhang > > > > <haiyangz@microsoft.com>; > > > > > > Wei Liu <wei.liu@kernel.org>; David S. Miller > > > > > > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > > Jakub > > > > > > Kicinski <kuba@kernel.org>; > > > > Paolo > > > > > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; linux- > > > > > > hyperv@vger.kernel.org; netdev@vger.kernel.org; linux- > > > > > > kernel@vger.kernel.org > > > > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > > > > > > cfg_rx_steer_req > > > > to > > > > > > enable RX coalescing > > > > > > > > > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, > > > > > > longli@linuxonhyperv.com > > > > > > wrote: > > > > > > > From: Long Li <longli@microsoft.com> > > > > > > > > > > > > > > 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. > > > > > > > > > > > > > > Signed-off-by: Long Li <longli@microsoft.com> > > > > > > > --- > > > > > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > > > > > > > include/net/mana/mana.h | 17 +++++++++++++++++ > > > > > > > 2 files changed, 21 insertions(+), 1 deletion(-) > > > > > > > > > > > > Why didn't you change mana_cfg_vport_steering() too? > > > > > > > > > > The mana_cfg_vport_steering() is for mana_en (Enthernet) driver, > > > > > not the mana_ib driver. > > > > > > > > > > The changes for mana_en will be done in a separate patch together > > > > > with changes for mana_en RX code patch to support multiple packets / > > CQE. > > > > > > > > I'm aware of the difference between mana_en and mana_ib. > > > > > > > > The change you proposed doesn't depend on "support multiple packets > > > > / CQE." > > > > and works perfectly with one packet/CQE also, does it? > > > > > > No. > > > If we add the following setting to the mana_en / > > > mana_cfg_vport_steering(), the NIC may put multiple packets in one > > > CQE, so we need to have the changes for mana_en RX code path to support > > multiple packets / CQE. > > > + req->cqe_coalescing_enable = true; > > > > You can leave "cqe_coalescing_enable = false" for ETH and still reuse your new > > v2 struct. > > I think your proposal will work for both Ethernet and IB. > > The idea is that we want this patch to change the behavior of the IB driver. We plan to make another patch for the Ethernet driver. This makes it easier to track all changes for a driver. And I don't want to deal with deletion of v1 struct for two/three kernel cycles instead of one patch in one cycle. > > > > > H> > > > So we plan to set this cqe_coalescing_enable, and the changes for > > > mana_en RX code path to support multiple packets / CQE in another patch. > > > > And how does it work with IB without changing anything except this proposed > > patch? > > The RX CQE Coalescing is implemented in the user-mode. This feature is always turned on from cluster. The user-mode code is written in a way that can deal with both CQE Coalescing and CQE non-coalescing, so it doesn't depend on kernel version for the correct behavior. Yes, but how does userspace know that CQE coalescing was enabled? Thanks > Thanks, > Long
>Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to >enable RX coalescing > >On Tue, May 09, 2023 at 07:08:36PM +0000, Long Li wrote: >> > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of >> > cfg_rx_steer_req to enable RX coalescing >> > >> > On Mon, May 08, 2023 at 02:45:44PM +0000, Haiyang Zhang wrote: >> > > >> > > >> > > > -----Original Message----- >> > > > From: Leon Romanovsky <leon@kernel.org> >> > > > Sent: Monday, May 8, 2023 2:10 AM >> > > > To: Haiyang Zhang <haiyangz@microsoft.com> >> > > > Cc: Long Li <longli@microsoft.com>; Jason Gunthorpe >> > > > <jgg@ziepe.ca>; Ajay Sharma <sharmaajay@microsoft.com>; Dexuan >> > > > Cui <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; >> > > > Wei Liu >> > <wei.liu@kernel.org>; David S. >> > > > Miller <davem@davemloft.net>; Eric Dumazet >> > > > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo >> > > > Abeni <pabeni@redhat.com>; >> > > > linux- rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; >> > > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org >> > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of >> > > > cfg_rx_steer_req to enable RX coalescing >> > > > >> > > > On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: >> > > > > >> > > > > >> > > > > > -----Original Message----- >> > > > > > From: Leon Romanovsky <leon@kernel.org> >> > > > > > Sent: Sunday, May 7, 2023 4:11 AM >> > > > > > To: Long Li <longli@microsoft.com> >> > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma >> > > > > > <sharmaajay@microsoft.com>; Dexuan Cui >> > > > > > <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; >> > > > > > Haiyang Zhang >> > > > <haiyangz@microsoft.com>; >> > > > > > Wei Liu <wei.liu@kernel.org>; David S. Miller >> > > > > > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; >> > Jakub >> > > > > > Kicinski <kuba@kernel.org>; >> > > > Paolo >> > > > > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; >> > > > > > linux- hyperv@vger.kernel.org; netdev@vger.kernel.org; >> > > > > > linux- kernel@vger.kernel.org >> > > > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of >> > > > > > cfg_rx_steer_req >> > > > to >> > > > > > enable RX coalescing >> > > > > > >> > > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, >> > > > > > longli@linuxonhyperv.com >> > > > > > wrote: >> > > > > > > From: Long Li <longli@microsoft.com> >> > > > > > > >> > > > > > > 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. >> > > > > > > >> > > > > > > Signed-off-by: Long Li <longli@microsoft.com> >> > > > > > > --- >> > > > > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- >> > > > > > > include/net/mana/mana.h | 17 +++++++++++++++++ >> > > > > > > 2 files changed, 21 insertions(+), 1 deletion(-) >> > > > > > >> > > > > > Why didn't you change mana_cfg_vport_steering() too? >> > > > > >> > > > > The mana_cfg_vport_steering() is for mana_en (Enthernet) >> > > > > driver, not the mana_ib driver. >> > > > > >> > > > > The changes for mana_en will be done in a separate patch >> > > > > together with changes for mana_en RX code patch to support >> > > > > multiple packets / >> > CQE. >> > > > >> > > > I'm aware of the difference between mana_en and mana_ib. >> > > > >> > > > The change you proposed doesn't depend on "support multiple >> > > > packets / CQE." >> > > > and works perfectly with one packet/CQE also, does it? >> > > >> > > No. >> > > If we add the following setting to the mana_en / >> > > mana_cfg_vport_steering(), the NIC may put multiple packets in one >> > > CQE, so we need to have the changes for mana_en RX code path to >> > > support >> > multiple packets / CQE. >> > > + req->cqe_coalescing_enable = true; >> > >> > You can leave "cqe_coalescing_enable = false" for ETH and still >> > reuse your new >> > v2 struct. >> >> I think your proposal will work for both Ethernet and IB. >> >> The idea is that we want this patch to change the behavior of the IB driver. We >plan to make another patch for the Ethernet driver. This makes it easier to track >all changes for a driver. > >And I don't want to deal with deletion of v1 struct for two/three kernel cycles >instead of one patch in one cycle. I'm resubmitting this patch to replace v1 for both driver. > >> >> > >> > H> >> > > So we plan to set this cqe_coalescing_enable, and the changes for >> > > mana_en RX code path to support multiple packets / CQE in another >patch. >> > >> > And how does it work with IB without changing anything except this >> > proposed patch? >> >> The RX CQE Coalescing is implemented in the user-mode. This feature is >always turned on from cluster. The user-mode code is written in a way that can >deal with both CQE Coalescing and CQE non-coalescing, so it doesn't depend on >kernel version for the correct behavior. > >Yes, but how does userspace know that CQE coalescing was enabled? The user-mode doesn't know if CQE is enabled in advance. If this information is required I can modify the patch to pass this information along to rdma-core. However, this is not useful as the cluster is running with CQE coalescing enabled by default, there is no need to know this information.
On Wed, May 10, 2023 at 04:37:57PM +0000, Long Li wrote: > >Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of cfg_rx_steer_req to > >enable RX coalescing > > > >On Tue, May 09, 2023 at 07:08:36PM +0000, Long Li wrote: > >> > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > >> > cfg_rx_steer_req to enable RX coalescing > >> > > >> > On Mon, May 08, 2023 at 02:45:44PM +0000, Haiyang Zhang wrote: > >> > > > >> > > > >> > > > -----Original Message----- > >> > > > From: Leon Romanovsky <leon@kernel.org> > >> > > > Sent: Monday, May 8, 2023 2:10 AM > >> > > > To: Haiyang Zhang <haiyangz@microsoft.com> > >> > > > Cc: Long Li <longli@microsoft.com>; Jason Gunthorpe > >> > > > <jgg@ziepe.ca>; Ajay Sharma <sharmaajay@microsoft.com>; Dexuan > >> > > > Cui <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; > >> > > > Wei Liu > >> > <wei.liu@kernel.org>; David S. > >> > > > Miller <davem@davemloft.net>; Eric Dumazet > >> > > > <edumazet@google.com>; Jakub Kicinski <kuba@kernel.org>; Paolo > >> > > > Abeni <pabeni@redhat.com>; > >> > > > linux- rdma@vger.kernel.org; linux-hyperv@vger.kernel.org; > >> > > > netdev@vger.kernel.org; linux-kernel@vger.kernel.org > >> > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > >> > > > cfg_rx_steer_req to enable RX coalescing > >> > > > > >> > > > On Sun, May 07, 2023 at 09:39:27PM +0000, Haiyang Zhang wrote: > >> > > > > > >> > > > > > >> > > > > > -----Original Message----- > >> > > > > > From: Leon Romanovsky <leon@kernel.org> > >> > > > > > Sent: Sunday, May 7, 2023 4:11 AM > >> > > > > > To: Long Li <longli@microsoft.com> > >> > > > > > Cc: Jason Gunthorpe <jgg@ziepe.ca>; Ajay Sharma > >> > > > > > <sharmaajay@microsoft.com>; Dexuan Cui > >> > > > > > <decui@microsoft.com>; KY Srinivasan <kys@microsoft.com>; > >> > > > > > Haiyang Zhang > >> > > > <haiyangz@microsoft.com>; > >> > > > > > Wei Liu <wei.liu@kernel.org>; David S. Miller > >> > > > > > <davem@davemloft.net>; Eric Dumazet <edumazet@google.com>; > >> > Jakub > >> > > > > > Kicinski <kuba@kernel.org>; > >> > > > Paolo > >> > > > > > Abeni <pabeni@redhat.com>; linux-rdma@vger.kernel.org; > >> > > > > > linux- hyperv@vger.kernel.org; netdev@vger.kernel.org; > >> > > > > > linux- kernel@vger.kernel.org > >> > > > > > Subject: Re: [PATCH] RDMA/mana_ib: Use v2 version of > >> > > > > > cfg_rx_steer_req > >> > > > to > >> > > > > > enable RX coalescing > >> > > > > > > >> > > > > > On Fri, May 05, 2023 at 11:51:48AM -0700, > >> > > > > > longli@linuxonhyperv.com > >> > > > > > wrote: > >> > > > > > > From: Long Li <longli@microsoft.com> > >> > > > > > > > >> > > > > > > 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. > >> > > > > > > > >> > > > > > > Signed-off-by: Long Li <longli@microsoft.com> > >> > > > > > > --- > >> > > > > > > drivers/infiniband/hw/mana/qp.c | 5 ++++- > >> > > > > > > include/net/mana/mana.h | 17 +++++++++++++++++ > >> > > > > > > 2 files changed, 21 insertions(+), 1 deletion(-) > >> > > > > > > >> > > > > > Why didn't you change mana_cfg_vport_steering() too? > >> > > > > > >> > > > > The mana_cfg_vport_steering() is for mana_en (Enthernet) > >> > > > > driver, not the mana_ib driver. > >> > > > > > >> > > > > The changes for mana_en will be done in a separate patch > >> > > > > together with changes for mana_en RX code patch to support > >> > > > > multiple packets / > >> > CQE. > >> > > > > >> > > > I'm aware of the difference between mana_en and mana_ib. > >> > > > > >> > > > The change you proposed doesn't depend on "support multiple > >> > > > packets / CQE." > >> > > > and works perfectly with one packet/CQE also, does it? > >> > > > >> > > No. > >> > > If we add the following setting to the mana_en / > >> > > mana_cfg_vport_steering(), the NIC may put multiple packets in one > >> > > CQE, so we need to have the changes for mana_en RX code path to > >> > > support > >> > multiple packets / CQE. > >> > > + req->cqe_coalescing_enable = true; > >> > > >> > You can leave "cqe_coalescing_enable = false" for ETH and still > >> > reuse your new > >> > v2 struct. > >> > >> I think your proposal will work for both Ethernet and IB. > >> > >> The idea is that we want this patch to change the behavior of the IB driver. We > >plan to make another patch for the Ethernet driver. This makes it easier to track > >all changes for a driver. > > > >And I don't want to deal with deletion of v1 struct for two/three kernel cycles > >instead of one patch in one cycle. > > I'm resubmitting this patch to replace v1 for both driver. Great > > > > >> > >> > > >> > H> > >> > > So we plan to set this cqe_coalescing_enable, and the changes for > >> > > mana_en RX code path to support multiple packets / CQE in another > >patch. > >> > > >> > And how does it work with IB without changing anything except this > >> > proposed patch? > >> > >> The RX CQE Coalescing is implemented in the user-mode. This feature is > >always turned on from cluster. The user-mode code is written in a way that can > >deal with both CQE Coalescing and CQE non-coalescing, so it doesn't depend on > >kernel version for the correct behavior. > > > >Yes, but how does userspace know that CQE coalescing was enabled? > > The user-mode doesn't know if CQE is enabled in advance. If this information is required I can modify the patch to pass this information along to rdma-core. However, this is not useful as the cluster is running with CQE coalescing enabled by default, there is no need to know this information. It is ok, not needed. if we can do something without UAPI involvement, it will be always preferable way. Thanks
diff --git a/drivers/infiniband/hw/mana/qp.c b/drivers/infiniband/hw/mana/qp.c index 54b61930a7fd..83c768f96506 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 = NULL; 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 = true; req_indir_tab = (mana_handle_t *)(req + 1); /* The ind table passed to the hardware must have diff --git a/include/net/mana/mana.h b/include/net/mana/mana.h index cd386aa7c7cc..f8314b7c386c 100644 --- a/include/net/mana/mana.h +++ b/include/net/mana/mana.h @@ -596,6 +596,23 @@ struct mana_cfg_rx_steer_req { u8 hashkey[MANA_HASH_KEY_SIZE]; }; /* HW DATA */ +struct mana_cfg_rx_steer_req_v2 { + struct gdma_req_hdr hdr; + mana_handle_t vport; + u16 num_indir_entries; + u16 indir_tab_offset; + u32 rx_enable; + u32 rss_enable; + u8 update_default_rxobj; + u8 update_hashkey; + u8 update_indir_tab; + 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 { struct gdma_resp_hdr hdr; }; /* HW DATA */