[linux-yocto] [PATCH 10/28] LSI AXM55xx: Various performance fixes for rapidio endpoint code.

Bruce Ashfield bruce.ashfield at windriver.com
Fri May 2 13:16:22 PDT 2014


On 14-05-02 03:16 PM, Charlie Paul wrote:
> From: Michael Bringmann <michael.bringmann at lsi.com>
>
> Increased the inbox mail buffer size by 8 times.

Is there a reason why it was increased ? Were events being lost under load ?

.. that's what we want to see in the commit message.

> Removed __devinit from the initialization routines

Again, this really should be two commits.

Bruce

>
> Signed-off-by: Michael Bringmann <michael.bringmann at lsi.com>
> ---
>   drivers/rapidio/devices/lsi/axxia-rio-irq.c |   24 +++++++++---------------
>   drivers/rapidio/devices/lsi/axxia-rio.c     |    4 ++--
>   drivers/rapidio/rio.c                       |    9 ++++++---
>   3 files changed, 17 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/rapidio/devices/lsi/axxia-rio-irq.c b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
> index 73b5a4c..6a4d227 100644
> --- a/drivers/rapidio/devices/lsi/axxia-rio-irq.c
> +++ b/drivers/rapidio/devices/lsi/axxia-rio-irq.c
> @@ -1010,7 +1010,7 @@ static inline int choose_ob_dme(
>   			if (len > sz)
>   				continue;
>
> -			if (dme->entries >= (dme->entries_in_use+1)) {
> +			if (dme->entries > (dme->entries_in_use+1)) {
>   				(*ob_dme) = dme;
>   				(*buf_sz) = sz;
>   				return ret + i;
> @@ -1474,7 +1474,6 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, u32 state)
>   		u32 dw0;
>   		int dme_no = 31 - CNTLZW(dme_mask);
>   		int num_new;
> -		int nPending;
>   		dme_mask ^= (1 << dme_no);
>
>   		while (mb->me[letter]->dme_no != dme_no)
> @@ -1514,7 +1513,7 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, u32 state)
>   #endif
>   		/**
>   		 * Set Valid flag to 0 on each desc with a new message.
> -		 * Flag is reset when the message beloning to the desc
> +		 * Flag is reset when the message belonging to the desc
>   		 * is fetched in get_inb_message().
>   		 * HW descriptor update and fetch is in order.
>   		 */
> @@ -1545,6 +1544,12 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, u32 state)
>   						dw0 & ~DME_DESC_DW0_VALID);
>   				}
>
> +				if (mport->inb_msg[mbox_no].mcback)
> +					mport->inb_msg[mbox_no].mcback(mport,
> +								me->dev_id,
> +								mbox_no,
> +								desc->desc_no);
> +
>   				__ib_dme_dw_dbg(priv, dw0);
>   				__ib_dme_event_dbg(priv, dme_no,
>   						   1 << RIO_IB_DME_RX_PUSH);
> @@ -1565,16 +1570,6 @@ static void ib_dme_irq_handler(struct rio_irq_handler *h, u32 state)
>   			__ib_dme_event_dbg(priv, dme_no,
>   					   1 << RIO_IB_DME_RX_RING_FULL);
>
> -		nPending = atomic_read(&me->pending);
> -		if (nPending &&
> -		    mport->inb_msg[mbox_no].mcback) {
> -
> -			mport->inb_msg[mbox_no].mcback(mport,
> -						       me->dev_id,
> -						       mbox_no,
> -						       letter);
> -		}
> -
>   		if (dme_stat & IB_DME_STAT_SLEEPING) {
>   			struct rio_msg_desc *desc;
>   			u32 dme_ctrl;
> @@ -2129,8 +2124,7 @@ static struct rio_msg_desc *get_ob_desc(struct rio_mport *mport,
>   					   DESC_TABLE_W0(desc->desc_no),
>   					   &dw0);
>   		}
> -		if (!(dw0 & DME_DESC_DW0_VALID) ||
> -		    (dw0 & DME_DESC_DW0_ERROR_MASK)) {
> +		if (!(dw0 & DME_DESC_DW0_VALID)) {
>   			if (desc_num != mb->write_idx)
>   				return NULL;
>   			if (desc_num == mb->write_idx)
> diff --git a/drivers/rapidio/devices/lsi/axxia-rio.c b/drivers/rapidio/devices/lsi/axxia-rio.c
> index 4673b6b..1f1fc39 100644
> --- a/drivers/rapidio/devices/lsi/axxia-rio.c
> +++ b/drivers/rapidio/devices/lsi/axxia-rio.c
> @@ -1369,7 +1369,7 @@ static int rio_mport_dtb_setup(struct platform_device *dev,
>   		return -ENOMEM;
>   	}
>   	rio_init_dbell_res(&mport->riores[RIO_DOORBELL_RESOURCE], 0, 0xffff);
> -	rio_init_mbox_res(&mport->riores[RIO_INB_MBOX_RESOURCE], 0, 8);
> +	rio_init_mbox_res(&mport->riores[RIO_INB_MBOX_RESOURCE], 0, 64);
>   	rio_init_mbox_res(&mport->riores[RIO_OUTB_MBOX_RESOURCE], 0, 3);
>   	sprintf(mport->name, "RIO%d mport", mport->id);
>
> @@ -1743,7 +1743,7 @@ err_ops:
>   /*
>     The probe function for RapidIO peer-to-peer network.
>   */
> -static int __devinit axxia_of_rio_rpn_probe(struct platform_device *dev)
> +static int axxia_of_rio_rpn_probe(struct platform_device *dev)
>   {
>   	IODP(KERN_INFO "Setting up RapidIO peer-to-peer network %s\n",
>   	       dev->dev.of_node->full_name);
> diff --git a/drivers/rapidio/rio.c b/drivers/rapidio/rio.c
> index 3148271..0fe82b3 100644
> --- a/drivers/rapidio/rio.c
> +++ b/drivers/rapidio/rio.c
> @@ -414,7 +414,10 @@ int rio_release_outb_mbox(struct rio_mport *mport, int mbox)
>   		mport->ops->close_outb_mbox(mport, mbox);
>
>   		/* Release the mailbox resource */
> -		return release_resource(mport->outb_msg[mbox].res);
> +		if (mport->outb_msg[mbox].res)
> +			return release_resource(mport->outb_msg[mbox].res);
> +		else
> +			return -ENOMEM;
>   	} else
>   		return -ENOSYS;
>   }
> @@ -1729,7 +1732,7 @@ static void rio_fixup_device(struct rio_dev *dev)
>   {
>   }
>
> -static int __devinit rio_init(void)
> +static int rio_init(void)
>   {
>   	struct rio_dev *dev = NULL;
>
> @@ -1741,7 +1744,7 @@ static int __devinit rio_init(void)
>    * @note No lock; Assuming this is used at boot time only,
>    *       before start of user space
>    */
> -int __devinit rio_init_mports(void)
> +int rio_init_mports(void)
>   {
>   	struct rio_mport *port;
>
>



More information about the linux-yocto mailing list