Netdev List
 help / color / mirror / Atom feed
From: Vijay Khemka <vijaykhemka@fb.com>
To: "Justin.Lee1@Dell.com" <Justin.Lee1@Dell.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"openbmc@lists.ozlabs.org" <openbmc@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"sam@mendozajonas.com" <sam@mendozajonas.com>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: Re: [PATCH] net/ncsi: Fix the payload copying for the request coming from Netlink
Date: Thu, 22 Aug 2019 20:34:22 +0000	[thread overview]
Message-ID: <0B7D4454-2976-4E22-AF0D-385616F3B7CF@fb.com> (raw)
In-Reply-To: <a94e5fa397a64ae3a676ec11ea09aaba@AUSX13MPS302.AMER.DELL.COM>

LGTM.



On 8/21/19, 2:26 PM, "openbmc on behalf of Justin.Lee1@Dell.com" <openbmc-bounces+vijaykhemka=fb.com@lists.ozlabs.org on behalf of Justin.Lee1@Dell.com> wrote:

    The request coming from Netlink should use the OEM generic handler.
    
    The standard command handler expects payload in bytes/words/dwords
    but the actual payload is stored in data if the request is coming from Netlink.
    
    Signed-off-by: Justin Lee <justin.lee1@dell.com>
Reviewed-by: Vijay Khemka <vijaykhemka@fb.com>
    
    ---
     net/ncsi/ncsi-cmd.c | 11 +++++++++--
     1 file changed, 9 insertions(+), 2 deletions(-)
    
    diff --git a/net/ncsi/ncsi-cmd.c b/net/ncsi/ncsi-cmd.c
    index eab4346..0187e65 100644
    --- a/net/ncsi/ncsi-cmd.c
    +++ b/net/ncsi/ncsi-cmd.c
    @@ -309,14 +309,21 @@ static struct ncsi_request *ncsi_alloc_command(struct ncsi_cmd_arg *nca)
     
     int ncsi_xmit_cmd(struct ncsi_cmd_arg *nca)
     {
    +	struct ncsi_cmd_handler *nch = NULL;
     	struct ncsi_request *nr;
    +	unsigned char type;
     	struct ethhdr *eh;
    -	struct ncsi_cmd_handler *nch = NULL;
     	int i, ret;
     
    +	/* Use OEM generic handler for Netlink request */
    +	if (nca->req_flags == NCSI_REQ_FLAG_NETLINK_DRIVEN)
    +		type = NCSI_PKT_CMD_OEM;
    +	else
    +		type = nca->type;
    +
     	/* Search for the handler */
     	for (i = 0; i < ARRAY_SIZE(ncsi_cmd_handlers); i++) {
    -		if (ncsi_cmd_handlers[i].type == nca->type) {
    +		if (ncsi_cmd_handlers[i].type == type) {
     			if (ncsi_cmd_handlers[i].handler)
     				nch = &ncsi_cmd_handlers[i];
     			else
    -- 
    2.9.3
    


  reply	other threads:[~2019-08-22 20:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-21 21:24 [PATCH] net/ncsi: Fix the payload copying for the request coming from Netlink Justin.Lee1
2019-08-22 20:34 ` Vijay Khemka [this message]
2019-08-23  2:27 ` David Miller

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=0B7D4454-2976-4E22-AF0D-385616F3B7CF@fb.com \
    --to=vijaykhemka@fb.com \
    --cc=Justin.Lee1@Dell.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=openbmc@lists.ozlabs.org \
    --cc=sam@mendozajonas.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox