All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aurelien Aptel <aaptel@nvidia.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: linux-nvme@lists.infradead.org, netdev@vger.kernel.org,
	sagi@grimberg.me, hch@lst.de, kbusch@kernel.org, axboe@fb.com,
	chaitanyak@nvidia.com, davem@davemloft.net, kuba@kernel.org,
	aurelien.aptel@gmail.com, smalin@nvidia.com, malin1024@gmail.com,
	ogerlitz@nvidia.com, yorayz@nvidia.com, borisp@nvidia.com,
	galshalom@nvidia.com, mgurtovoy@nvidia.com, edumazet@google.com,
	pabeni@redhat.com
Subject: Re: [PATCH v20 02/20] netlink: add new family to manage ULP_DDP enablement and stats
Date: Mon, 27 Nov 2023 15:17:50 +0200	[thread overview]
Message-ID: <253cyvvjpxd.fsf@nvidia.com> (raw)
In-Reply-To: <ZV98IyA3LSsk2BXs@nanopsycho>

Jiri Pirko <jiri@resnulli.us> writes:
> Overall looks good to me, couple of nits below, take it or leave it.

Glad to hear. We will send v21 with the changes below.
Hopefully we can get a RB or Ack on this patch.

>>+
>>+      ctx->ifindex = nla_get_u32(info->attrs[ULP_DDP_A_CAPS_IFINDEX]);
>
> You don't need to store ifindex. You have ctx->dev->ifindex with the
> same value.

Ok, we will remove it from the context.

>>+      switch (cmd) {
>>+      case ULP_DDP_CMD_CAPS_GET:
>>+      case ULP_DDP_CMD_CAPS_SET:
>>+      case ULP_DDP_CMD_CAPS_SET_NTF:
>
> Hmm, you never call ulp_ddp_prepare_context() with
> ULP_DDP_CMD_CAPS_SET_NTF. Perhaps just warn if this case is hit. IDK.

While that is true it also reflects what the payload is and it mirrors
ulp_ddp_reply_size(). We will keep it as is.

>>+static int ulp_ddp_write_reply(struct sk_buff *rsp,
>>+                             struct ulp_ddp_reply_context *ctx,
>>+                             int cmd,
>>+                             const struct genl_info *info)
>>+{
>>+      ctx->hdr = genlmsg_iput(rsp, info);
>
> Interesting, you use "hdr" just in this fuction. Why isn't it a local
> variable?

Good point, we will make it a local variable.

>>+      ret = ulp_ddp_write_reply(rsp, ctx, ULP_DDP_CMD_CAPS_GET, info);
>>+      if (ret < 0)
>
> You mix "if (ret)" and "if (ret < 0)" in this code, I don't see any of
> the functions return positive value on success, so you can make it
> consistent to "if (ret)".

Ok, we will change the checks to "if (ret)" and change
ulp_ddp_apply_bits() return the notify flag via an input parameter.

>>+
>>+      if (ulp_ddp_write_reply(ntf, ctx, ULP_DDP_CMD_CAPS_SET_NTF, &info)) {
>
> Always use "ret" variable to store return value before you check it.

Ok.

>>+
>>+      rsp = genlmsg_new(ulp_ddp_reply_size(ULP_DDP_CMD_STATS_GET), GFP_KERNEL);
>>+      if (!rsp)
>>+              return -EMSGSIZE;
>>+
>>+      wanted = nla_get_u64(info->attrs[ULP_DDP_A_CAPS_WANTED]);
>
> nla_get_uint()
>
>
>>+      wanted_mask = nla_get_u64(info->attrs[ULP_DDP_A_CAPS_WANTED_MASK]);
>
> nla_get_uint()
>

Ok.

>
>>+
>>+      ret = ulp_ddp_apply_bits(ctx, &wanted, &wanted_mask, info);
>
>         ret = ulp_ddp_apply_bits(ctx, &wanted, &wanted_mask, info,
>                                  &notify);
>
> Would be a bit cleaner to read perhaps.

True, we will change it to that.

Thanks


  reply	other threads:[~2023-11-27 13:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 13:48 [PATCH v20 00/20] nvme-tcp receive offloads Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 01/20] net: Introduce direct data placement tcp offload Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 02/20] netlink: add new family to manage ULP_DDP enablement and stats Aurelien Aptel
2023-11-23 16:21   ` Jiri Pirko
2023-11-27 13:17     ` Aurelien Aptel [this message]
2023-11-22 13:48 ` [PATCH v20 03/20] iov_iter: skip copy if src == dst for direct data placement Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 04/20] net/tls,core: export get_netdev_for_sock Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 05/20] nvme-tcp: Add DDP offload control path Aurelien Aptel
2023-11-28 10:31   ` Sagi Grimberg
2023-11-29 13:52     ` Aurelien Aptel
2023-12-11 17:29       ` Max Gurtovoy
2023-12-13  9:49         ` Sagi Grimberg
2023-11-22 13:48 ` [PATCH v20 06/20] nvme-tcp: Add DDP data-path Aurelien Aptel
2023-11-28 10:40   ` Sagi Grimberg
2023-11-29 13:55     ` Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 07/20] nvme-tcp: RX DDGST offload Aurelien Aptel
2023-11-28 10:42   ` Sagi Grimberg
2023-11-29 13:56     ` Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 08/20] nvme-tcp: Deal with netdevice DOWN events Aurelien Aptel
2023-11-28 10:44   ` Sagi Grimberg
2023-11-22 13:48 ` [PATCH v20 09/20] Documentation: add ULP DDP offload documentation Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 10/20] net/mlx5e: Rename from tls to transport static params Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 11/20] net/mlx5e: Refactor ico sq polling to get budget Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 12/20] net/mlx5: Add NVMEoTCP caps, HW bits, 128B CQE and enumerations Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 13/20] net/mlx5e: NVMEoTCP, offload initialization Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 14/20] net/mlx5e: TCP flow steering for nvme-tcp acceleration Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 15/20] net/mlx5e: NVMEoTCP, use KLM UMRs for buffer registration Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 16/20] net/mlx5e: NVMEoTCP, queue init/teardown Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 17/20] net/mlx5e: NVMEoTCP, ddp setup and resync Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 18/20] net/mlx5e: NVMEoTCP, async ddp invalidation Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 19/20] net/mlx5e: NVMEoTCP, data-path for DDP+DDGST offload Aurelien Aptel
2023-11-22 13:48 ` [PATCH v20 20/20] net/mlx5e: NVMEoTCP, statistics Aurelien Aptel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=253cyvvjpxd.fsf@nvidia.com \
    --to=aaptel@nvidia.com \
    --cc=aurelien.aptel@gmail.com \
    --cc=axboe@fb.com \
    --cc=borisp@nvidia.com \
    --cc=chaitanyak@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=galshalom@nvidia.com \
    --cc=hch@lst.de \
    --cc=jiri@resnulli.us \
    --cc=kbusch@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=malin1024@gmail.com \
    --cc=mgurtovoy@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@nvidia.com \
    --cc=pabeni@redhat.com \
    --cc=sagi@grimberg.me \
    --cc=smalin@nvidia.com \
    --cc=yorayz@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.