All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Hao Lan <lanhao@huawei.com>,
	lipeng321@huawei.com, shenjian15@huawei.com,
	huangguangbin2@huawei.com, chenjunxin1@huawei.com,
	netdev@vger.kernel.org, stephen@networkplumber.org,
	Petr Machata <me@pmachata.org>
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com
Subject: Re: [PATCH iproute2] dcb: unblock mnl_socket_recvfrom if not message received
Date: Thu, 20 Oct 2022 07:23:05 -0600	[thread overview]
Message-ID: <8589e829-9331-b2bc-4f27-d224716ed120@kernel.org> (raw)
In-Reply-To: <20221019012008.11322-1-lanhao@huawei.com>

[ cc Petr ]

always add authors of patches you are fixing.

On 10/18/22 7:20 PM, Hao Lan wrote:
> From: Junxin Chen <chenjunxin1@huawei.com>
> 
> Currently, the dcb command sinks to the kernel through the netlink
> to obtain information. However, if the kernel fails to obtain infor-
> mation or is not processed, the dcb command is suspended.
> 
> For example, if we don't implement dcbnl_ops->ieee_getpfc in the
> kernel, the command "dcb pfc show dev eth1" will be stuck and subsequent
> commands cannot be executed.
> 
> This patch adds the NLM_F_ACK flag to the netlink in mnlu_msg_prepare
> to ensure that the kernel responds to user requests.
> 
> After the problem is solved, the execution result is as follows:
> $ dcb pfc show dev eth1
> Attribute not found: Success
> 
> Fixes: 67033d1c1c ("Add skeleton of a new tool, dcb")
> Signed-off-by: Junxin Chen <chenjunxin1@huawei.com>
> ---
>  dcb/dcb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/dcb/dcb.c b/dcb/dcb.c
> index 8d75ab0a..a6f457fb 100644
> --- a/dcb/dcb.c
> +++ b/dcb/dcb.c
> @@ -156,7 +156,7 @@ static struct nlmsghdr *dcb_prepare(struct dcb *dcb, const char *dev,
>  	};
>  	struct nlmsghdr *nlh;
>  
> -	nlh = mnlu_msg_prepare(dcb->buf, nlmsg_type, NLM_F_REQUEST, &dcbm, sizeof(dcbm));
> +	nlh = mnlu_msg_prepare(dcb->buf, nlmsg_type, NLM_F_REQUEST | NLM_F_ACK, &dcbm, sizeof(dcbm));
>  	mnl_attr_put_strz(nlh, DCB_ATTR_IFNAME, dev);
>  	return nlh;
>  }


  reply	other threads:[~2022-10-20 13:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  1:20 [PATCH iproute2] dcb: unblock mnl_socket_recvfrom if not message received Hao Lan
2022-10-20 13:23 ` David Ahern [this message]
2022-10-20 22:59 ` Stephen Hemminger
2022-12-20 13:34 ` Ido Schimmel

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=8589e829-9331-b2bc-4f27-d224716ed120@kernel.org \
    --to=dsahern@kernel.org \
    --cc=chenjunxin1@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=huangguangbin2@huawei.com \
    --cc=kuba@kernel.org \
    --cc=lanhao@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=me@pmachata.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shenjian15@huawei.com \
    --cc=stephen@networkplumber.org \
    /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.