linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/ncsi: add response handlers for PLDM over NC-SI
@ 2019-08-27 23:03 Ben Wei
  2019-08-28 23:00 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Wei @ 2019-08-27 23:03 UTC (permalink / raw)
  To: David Miller, sam, netdev, linux-kernel, openbmc; +Cc: Ben Wei

This patch adds handlers for PLDM over NC-SI command response.

This enables NC-SI driver recognizes the packet type so the responses don't get dropped as unknown packet type.

PLDM over NC-SI are not handled in kernel driver for now, but can be passed back to user space via Netlink for further handling.

Signed-off-by: Ben Wei <benwei@fb.com>
---
 net/ncsi/ncsi-pkt.h |  5 +++++
 net/ncsi/ncsi-rsp.c | 11 +++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/net/ncsi/ncsi-pkt.h b/net/ncsi/ncsi-pkt.h index a8e9def593f2..80938b338fee 100644
--- a/net/ncsi/ncsi-pkt.h
+++ b/net/ncsi/ncsi-pkt.h
@@ -387,6 +387,9 @@ struct ncsi_aen_hncdsc_pkt {
 #define NCSI_PKT_CMD_OEM	0x50 /* OEM                              */
 #define NCSI_PKT_CMD_PLDM	0x51 /* PLDM request over NCSI over RBT  */
 #define NCSI_PKT_CMD_GPUUID	0x52 /* Get package UUID                 */
+#define NCSI_PKT_CMD_QPNPR	0x56 /* Query Pending NC PLDM request */
+#define NCSI_PKT_CMD_SNPR	0x57 /* Send NC PLDM Reply  */
+
 
 /* NCSI packet responses */
 #define NCSI_PKT_RSP_CIS	(NCSI_PKT_CMD_CIS    + 0x80)
@@ -419,6 +422,8 @@ struct ncsi_aen_hncdsc_pkt {
 #define NCSI_PKT_RSP_OEM	(NCSI_PKT_CMD_OEM    + 0x80)
 #define NCSI_PKT_RSP_PLDM	(NCSI_PKT_CMD_PLDM   + 0x80)
 #define NCSI_PKT_RSP_GPUUID	(NCSI_PKT_CMD_GPUUID + 0x80)
+#define NCSI_PKT_RSP_QPNPR	(NCSI_PKT_CMD_QPNPR   + 0x80)
+#define NCSI_PKT_RSP_SNPR	(NCSI_PKT_CMD_SNPR   + 0x80)
 
 /* NCSI response code/reason */
 #define NCSI_PKT_RSP_C_COMPLETED	0x0000 /* Command Completed        */
diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c index 5254004f2b42..524974af0db6 100644
--- a/net/ncsi/ncsi-rsp.c
+++ b/net/ncsi/ncsi-rsp.c
@@ -1035,6 +1035,11 @@ static int ncsi_rsp_handler_gpuuid(struct ncsi_request *nr)
 	return 0;
 }
 
+static int ncsi_rsp_handler_pldm(struct ncsi_request *nr) {
+	return 0;
+}
+
 static int ncsi_rsp_handler_netlink(struct ncsi_request *nr)  {
 	struct ncsi_dev_priv *ndp = nr->ndp;
@@ -1088,8 +1093,10 @@ static struct ncsi_rsp_handler {
 	{ NCSI_PKT_RSP_GNPTS,  48, ncsi_rsp_handler_gnpts   },
 	{ NCSI_PKT_RSP_GPS,     8, ncsi_rsp_handler_gps     },
 	{ NCSI_PKT_RSP_OEM,    -1, ncsi_rsp_handler_oem     },
-	{ NCSI_PKT_RSP_PLDM,    0, NULL                     },
-	{ NCSI_PKT_RSP_GPUUID, 20, ncsi_rsp_handler_gpuuid  }
+	{ NCSI_PKT_RSP_PLDM,   -1, ncsi_rsp_handler_pldm    },
+	{ NCSI_PKT_RSP_GPUUID, 20, ncsi_rsp_handler_gpuuid  },
+	{ NCSI_PKT_RSP_QPNPR,  -1, ncsi_rsp_handler_pldm    },
+	{ NCSI_PKT_RSP_SNPR,   -1, ncsi_rsp_handler_pldm    }
 };
 
 int ncsi_rcv_rsp(struct sk_buff *skb, struct net_device *dev,
--
2.17.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/ncsi: add response handlers for PLDM over NC-SI
  2019-08-27 23:03 [PATCH net-next] net/ncsi: add response handlers for PLDM over NC-SI Ben Wei
@ 2019-08-28 23:00 ` David Miller
  2019-08-30 20:57   ` Ben Wei
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2019-08-28 23:00 UTC (permalink / raw)
  To: benwei; +Cc: sam, netdev, linux-kernel, openbmc

From: Ben Wei <benwei@fb.com>
Date: Tue, 27 Aug 2019 23:03:53 +0000

> This patch adds handlers for PLDM over NC-SI command response.
> 
> This enables NC-SI driver recognizes the packet type so the responses don't get dropped as unknown packet type.
> 
> PLDM over NC-SI are not handled in kernel driver for now, but can be passed back to user space via Netlink for further handling.
> 
> Signed-off-by: Ben Wei <benwei@fb.com>

I don't know why but patchwork puts part of your patch into the commit message, see:

https://patchwork.ozlabs.org/patch/1154104/

It's probably an encoding issue or similar.

> +static int ncsi_rsp_handler_pldm(struct ncsi_request *nr) {
> +	return 0;
> +}
> +
>  static int ncsi_rsp_handler_netlink(struct ncsi_request *nr)  {

I know other functions in this file do it, but please put the openning
curly braces of a function on a separate line.

Thank you.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net/ncsi: add response handlers for PLDM over NC-SI
  2019-08-28 23:00 ` David Miller
@ 2019-08-30 20:57   ` Ben Wei
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Wei @ 2019-08-30 20:57 UTC (permalink / raw)
  To: David Miller; +Cc: sam, netdev, linux-kernel, openbmc


> > This patch adds handlers for PLDM over NC-SI command response.
> > 
> > This enables NC-SI driver recognizes the packet type so the responses don't get dropped as unknown packet type.
> > 
> > PLDM over NC-SI are not handled in kernel driver for now, but can be passed back to user space via Netlink for further handling.
> > 
> > Signed-off-by: Ben Wei <benwei@fb.com>
>
> I don't know why but patchwork puts part of your patch into the commit message, see:
>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__patchwork.ozlabs.org_patch_1154104_&d=DwICAg&c=5VD0RTtNlTh3ycd41b3MUw&r=U35IaQ-> 7Tnwjs7q_Fwf_bQ&m=vxOIQa5Sv7aY4LKSUvlobJd_TtHOz1KLjxZw8WXmkJM&s=A8rpxgac6iuSEH2DqCSzBDdM82Eu3pD8_nGHx9YtGW8&e= 
>
> It's probably an encoding issue or similar.
>
> > +static int ncsi_rsp_handler_pldm(struct ncsi_request *nr) {
>>  +	return 0;
> > +}
> > +
> >  static int ncsi_rsp_handler_netlink(struct ncsi_request *nr)  {
>
> I know other functions in this file do it, but please put the openning
> curly braces of a function on a separate line.
>
> Thank you.

Thanks David. I think the issue is related to my email client setting. I fixed it and resubmitted a v2 version of this patch.

Thanks,
-Ben

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-30 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-27 23:03 [PATCH net-next] net/ncsi: add response handlers for PLDM over NC-SI Ben Wei
2019-08-28 23:00 ` David Miller
2019-08-30 20:57   ` Ben Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).