[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CO1PR11MB508953E890CF3EC111E1B325D6139@CO1PR11MB5089.namprd11.prod.outlook.com>
Date: Mon, 28 Nov 2022 18:16:28 +0000
From: "Keller, Jacob E" <jacob.e.keller@...el.com>
To: Jiri Pirko <jiri@...nulli.us>
CC: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Jiri Pirko <jiri@...dia.com>, Jakub Kicinski <kuba@...nel.org>
Subject: RE: [PATCH net-next v2 2/9] devlink: report extended error message in
region_read_dumpit
> -----Original Message-----
> From: Jiri Pirko <jiri@...nulli.us>
> Sent: Thursday, November 24, 2022 12:47 AM
> To: Keller, Jacob E <jacob.e.keller@...el.com>
> Cc: netdev@...r.kernel.org; Jiri Pirko <jiri@...dia.com>; Jakub Kicinski
> <kuba@...nel.org>
> Subject: Re: [PATCH net-next v2 2/9] devlink: report extended error message in
> region_read_dumpit
>
> Wed, Nov 23, 2022 at 09:38:27PM CET, jacob.e.keller@...el.com wrote:
>
> [...]
>
>
> >@@ -6525,8 +6525,14 @@ static int
> devlink_nl_cmd_region_read_dumpit(struct sk_buff *skb,
> >
> > devl_lock(devlink);
> >
> >- if (!attrs[DEVLINK_ATTR_REGION_NAME] ||
> >- !attrs[DEVLINK_ATTR_REGION_SNAPSHOT_ID]) {
> >+ if (!attrs[DEVLINK_ATTR_REGION_NAME]) {
> >+ NL_SET_ERR_MSG(cb->extack, "No region name provided");
> >+ err = -EINVAL;
> >+ goto out_unlock;
> >+ }
> >+
> >+ if (!attrs[DEVLINK_ATTR_REGION_SNAPSHOT_ID]) {
> >+ NL_SET_ERR_MSG(cb->extack, "No snapshot id provided");
> > err = -EINVAL;
> > goto out_unlock;
> > }
> >@@ -6541,7 +6547,8 @@ static int devlink_nl_cmd_region_read_dumpit(struct
> sk_buff *skb,
> > }
> > }
> >
> >- region_name = nla_data(attrs[DEVLINK_ATTR_REGION_NAME]);
> >+ region_attr = attrs[DEVLINK_ATTR_REGION_NAME];
> >+ region_name = nla_data(region_attr);
> >
> > if (port)
> > region = devlink_port_region_get_by_name(port, region_name);
> >@@ -6549,6 +6556,7 @@ static int devlink_nl_cmd_region_read_dumpit(struct
> sk_buff *skb,
> > region = devlink_region_get_by_name(devlink, region_name);
> >
> > if (!region) {
> >+ NL_SET_ERR_MSG_ATTR(cb->extack, region_attr, "requested
> region does not exist");
>
> Any reason why don't start the message with uppercase? It would be
> consistent with the other 2 messages you just introduced.
> Same goes to the message in the next patch (perhaps some others too)
>
>
No particular reason. I'll fix these.
> > err = -EINVAL;
> > goto out_unlock;
> > }
> >--
> >2.38.1.420.g319605f8f00e
> >
Powered by blists - more mailing lists