All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Goutham, Sunil" <Sunil.Goutham@cavium.com>
To: David Miller <davem@davemloft.net>,
	"sunil.kovvuri@gmail.com" <sunil.kovvuri@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"linux-soc@vger.kernel.org" <linux-soc@vger.kernel.org>,
	"sgoutham@marvell.com" <sgoutham@marvell.com>,
	"amakarov@marvell.com" <amakarov@marvell.com>,
	"lbartosik@marvell.com" <lbartosik@marvell.com>
Subject: RE: [EXT] Re: [PATCH v6 04/15] octeontx2-af: Add mailbox support infra
Date: Sat, 6 Oct 2018 05:01:49 +0000	[thread overview]
Message-ID: <DM6PR07MB492380ABB3821E02FBE6E16A9EE40@DM6PR07MB4923.namprd07.prod.outlook.com> (raw)
In-Reply-To: <20181005.145043.1753276054031656255.davem@davemloft.net>



> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: 06 October 2018 03:21
> To: sunil.kovvuri@gmail.com
> Cc: netdev@vger.kernel.org; arnd@arndb.de; linux-soc@vger.kernel.org;
> sgoutham@marvell.com; amakarov@marvell.com; lbartosik@marvell.com
> Subject: [EXT] Re: [PATCH v6 04/15] octeontx2-af: Add mailbox support infra
> 
> 
> ----------------------------------------------------------------------
> From: sunil.kovvuri@gmail.com
> Date: Thu,  4 Oct 2018 23:51:47 +0530
> 
> > +int otx2_mbox_init(struct otx2_mbox *mbox, void *hwbase, struct
> pci_dev *pdev,
> > +		   void *reg_base, int direction, int ndevs) {
> > +	int devid;
> > +	struct otx2_mbox_dev *mdev;
> 
> Please order local variable declarations from longest to shortest line.
> 
> Please audit your entire series for this problem.

Sure, will fix this and re-submit.

> 
> > +int otx2_mbox_busy_poll_for_rsp(struct otx2_mbox *mbox, int devid) {
> > +	struct otx2_mbox_dev *mdev = &mbox->dev[devid];
> > +	unsigned long timeout = jiffies + 1 * HZ;
> > +
> > +	while (!time_after(jiffies, timeout)) {
> > +		if (mdev->num_msgs == mdev->msgs_acked)
> > +			return 0;
> > +		cpu_relax();
> > +	}
> > +	return -EIO;
> > +}
> 
> Probably not a good idea to poll something in the kernel for an entire
> second.  Please add a preemption point like a usleep() or similar.
> cpu_relax() does not yield the cpu to the scheduler.
> 
> Thank you.

APIs with both modes are added here i.e 
otx2_mbox_wait_for_rsp() - which sleeps on every check as you suggested.
                                                    This API will be used 99% of the cases.
otx2_mbox_busy_poll_for_rsp() - This API is a busy poll one which is intended to be used in
                                                             cases where polling is not allowed.  An example would be
                                                             ' .ndo_set_rx_mode' when netdev driver has to change mode
                                                             It frames and sends mailbox message to this AF driver and busy polls
                                                             for response.

Thanks,
Sunil.

  reply	other threads:[~2018-10-06 12:03 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-04 18:21 [PATCH v6 00/15] octeontx2-af: Add RVU Admin Function driver sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 01/15] octeontx2-af: Add Marvell OcteonTX2 RVU AF driver sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 02/15] octeontx2-af: Reset all RVU blocks sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 03/15] octeontx2-af: Gather RVU blocks HW info sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 04/15] octeontx2-af: Add mailbox support infra sunil.kovvuri
2018-10-05 21:50   ` David Miller
2018-10-06  5:01     ` Goutham, Sunil [this message]
2018-10-04 18:21 ` [PATCH v6 05/15] octeontx2-af: Add mailbox IRQ and msg handlers sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 06/15] octeontx2-af: Convert mbox msg id check to a macro sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 07/15] octeontx2-af: Scan blocks for LFs provisioned to PF/VF sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 08/15] octeontx2-af: Add RVU block LF provisioning support sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 09/15] octeontx2-af: Configure block LF's MSIX vector offset sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 10/15] octeontx2-af: Reconfig MSIX base with IOVA sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 11/15] octeontx2-af: Add Marvell OcteonTX2 CGX driver sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 12/15] octeontx2-af: Set RVU PFs to CGX LMACs mapping sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 13/15] octeontx2-af: Add support for CGX link management sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 14/15] octeontx2-af: Register for CGX lmac events sunil.kovvuri
2018-10-04 18:21 ` [PATCH v6 15/15] MAINTAINERS: Add entry for Marvell OcteonTX2 Admin Function driver sunil.kovvuri

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=DM6PR07MB492380ABB3821E02FBE6E16A9EE40@DM6PR07MB4923.namprd07.prod.outlook.com \
    --to=sunil.goutham@cavium.com \
    --cc=amakarov@marvell.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=lbartosik@marvell.com \
    --cc=linux-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgoutham@marvell.com \
    --cc=sunil.kovvuri@gmail.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 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.