All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eli Cohen <eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
To: Matan Barak <matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Jason Gunthorpe
	<jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>,
	Yann Droneaud <ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.org>,
	linux-rdma <linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	Eran Ben Elisha <eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	matanbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH ib-next 2/3] IB/core: IB/core: Allow legacy verbs through extended interfaces
Date: Mon, 9 Nov 2015 17:55:39 +0200	[thread overview]
Message-ID: <20151109155539.GA116821@x-vnc01.mtx.labs.mlnx> (raw)
In-Reply-To: <CAAKD3BDq_o+J3yM1qAKg_x35Dps5Ne_ffaD_Mz55a272pwQcJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Sun, Nov 08, 2015 at 05:04:55PM +0200, Matan Barak wrote:
> > +static int verify_command_mask(struct ib_device *ib_dev, __u32 command)
> > +{
> > +       u64 mask;
> > +
> > +       if (command <= IB_USER_VERBS_CMD_OPEN_QP)
> 
> I think using IB_USER_VERBS_CMD_THRESHOLD is clearer, but I don't
> think we need two uverbs_cmd_mask vendor variables.
> IMHO, a vendor shouldn't care if it's an extended/legacy uverb
> command. Maybe we should replace uverbs_cmd_mask with a bitmap.
> 
> > +               mask = ib_dev->uverbs_cmd_mask;
> > +       else
> > +               mask = ib_dev->uverbs_ex_cmd_mask;
> > +
> > +       if (mask & ((u64)1 << command))
> > +               return 0;
> > +
> > +       return -1;
> > +}
> > +

But IB_USER_VERBS_CMD_OPEN_QP is the last legacy verbs and I prefer a
more restrictive approach to avoid potentail issues in the future.

> >  static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
> >                              size_t count, loff_t *pos)
> >  {
> > @@ -704,6 +719,10 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf,
> >         }
> >
> >         command = hdr.command & IB_USER_VERBS_CMD_COMMAND_MASK;
> > +       if (verify_command_mask(ib_dev, command)) {
> > +               ret = -EINVAL;
> 
> Why did you replace ENOSYS with EINVAL?
> 

Like Haggai mentioned in the other response, checkpatch issues error
on this claiming that ENOSYS is reserved to unavailable system calls.
Is it applicable only for new implementations I am not sure. I don't
have clear preference for either ENOSYS or EINAVL.
> > +               goto out;
> > +       }
> >
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-11-09 15:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 17:40 [PATCH ib-next 0/3] IB core uverbs support for leagacy commands Eli Cohen
     [not found] ` <1446745208-17733-1-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-05 17:40   ` [PATCH ib-next 1/3] IB/core: Avoid duplicate code Eli Cohen
2015-11-05 17:40   ` [PATCH ib-next 2/3] IB/core: IB/core: Allow legacy verbs through extended interfaces Eli Cohen
     [not found]     ` <1446745208-17733-3-git-send-email-eli-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-08 15:04       ` Matan Barak
     [not found]         ` <CAAKD3BDq_o+J3yM1qAKg_x35Dps5Ne_ffaD_Mz55a272pwQcJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-09  6:48           ` Haggai Eran
     [not found]             ` <564041C4.1090303-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-11-09 22:35               ` Jason Gunthorpe
     [not found]                 ` <20151109223531.GB1305-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-11-09 23:05                   ` Eli Cohen
     [not found]                     ` <20151109230531.GF20103-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-09 23:15                       ` Jason Gunthorpe
     [not found]                         ` <20151109231542.GA20707-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-11-09 23:24                           ` Eli Cohen
     [not found]                             ` <20151109232431.GA114170-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-09 23:30                               ` Jason Gunthorpe
     [not found]                                 ` <20151109233059.GA21475-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-11-10 15:23                                   ` Eli Cohen
     [not found]                                     ` <20151110152310.GB114170-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-10 15:40                                       ` Eli Cohen
     [not found]                                         ` <20151110154026.GC114170-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-10 17:28                                           ` Jason Gunthorpe
2015-11-10 19:23                                           ` Bart Van Assche
     [not found]                                             ` <56424437.9090908-XdAiOPVOjttBDgjK7y7TUQ@public.gmane.org>
2015-11-10 20:02                                               ` Eli Cohen
     [not found]                                                 ` <20151110200226.GB21849-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-10 20:10                                                   ` Jason Gunthorpe
2015-11-10 10:25                           ` Matan Barak
     [not found]                             ` <CAAKD3BAkJiYV8mHUUqAwPZwCsyRR7579+jUC4idGy6snM6rbHA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-10 17:39                               ` Jason Gunthorpe
2015-11-09 15:55           ` Eli Cohen [this message]
     [not found]             ` <20151109155539.GA116821-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-09 16:11               ` Matan Barak
     [not found]                 ` <CAAKD3BAJi0XSU1VW10jogaHL7wYT6fcDSw=q1Zpu+4+Mf760nQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-11-09 16:25                   ` Eli Cohen
     [not found]                     ` <20151109162513.GB116821-lgQlq6cFzJSjLWYaRI30zHI+JuX82XLG@public.gmane.org>
2015-11-09 16:29                       ` Matan Barak
2015-11-05 17:40   ` [PATCH ib-next 3/3] IB/core: Modify conditional on ucontext existence Eli Cohen
2015-11-19 21:56   ` [PATCH ib-next 0/3] IB core uverbs support for leagacy commands Eli Cohen

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=20151109155539.GA116821@x-vnc01.mtx.labs.mlnx \
    --to=eli-vpraknaxozvwk0htik3j/w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=eranbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=matanb-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=matanbe-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=ydroneaud-RlY5vtjFyJ3QT0dZR+AlfA@public.gmane.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.