DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Qiu, Michael" <michael.qiu@intel.com>
To: "Zhang, Helin" <helin.zhang@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] i40e: code style fix
Date: Wed, 29 Oct 2014 08:06:50 +0000	[thread overview]
Message-ID: <533710CFB86FA344BFBF2D6802E60286C7CC69@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <F35DEAC7BCE34641BA9FAC6BCA4A12E70A7AC7D5@SHSMSX104.ccr.corp.intel.com>

10/29/2014 2:26 PM, Zhang, Helin:
> Hi Michael
>
>> -----Original Message-----
>> From: Qiu, Michael
>> Sent: Wednesday, October 29, 2014 2:11 PM
>> To: Zhang, Helin; dev@dpdk.org
>> Subject: Re: [dpdk-dev] [PATCH 1/2] i40e: code style fix
>>
>>  10/29/2014 11:44 AM, Helin Zhang  :
>>> Add several code style fixes.
>>>
>>> Signed-off-by: Helin Zhang <helin.zhang@intel.com>
>>> ---
>>>  lib/librte_pmd_i40e/i40e_ethdev.c | 20 +++++++++++---------
>>>  1 file changed, 11 insertions(+), 9 deletions(-)
>>>
>>> diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c
>>> b/lib/librte_pmd_i40e/i40e_ethdev.c
>>> index e1f581a..20c99a4 100644
>>> --- a/lib/librte_pmd_i40e/i40e_ethdev.c
>>> +++ b/lib/librte_pmd_i40e/i40e_ethdev.c
>>> @@ -580,7 +580,8 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi)
>>>  	uint32_t val;
>>>  	struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
>>>  	uint16_t msix_vect = vsi->msix_intr;
>>> -	uint16_t interval = i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL);
>>> +	uint16_t interval =
>>> +		i40e_calc_itr_interval(RTE_LIBRTE_I40E_ITR_INTERVAL);
>>>  	int i;
>>>
>>>  	for (i = 0; i < vsi->nb_qps; i++)
>>> @@ -603,25 +604,26 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi)
>>>  	/* Write first RX queue to Link list register as the head element */
>>>  	if (vsi->type != I40E_VSI_SRIOV) {
>>>  		I40E_WRITE_REG(hw, I40E_PFINT_LNKLSTN(msix_vect - 1),
>>> -			(vsi->base_queue << I40E_PFINT_LNKLSTN_FIRSTQ_INDX_SHIFT)
>> |
>>> +						(vsi->base_queue <<
>>                                   ^^^^^^^^^^^^^^^^^^
>>> +				I40E_PFINT_LNKLSTN_FIRSTQ_INDX_SHIFT) |
>> Here why so many indentations? or just my mail agent's display issue, if it does
>> pls ignor. anyway, it is not a beautiful style in my mind :)
> I do not know why. The right patch can be downloaded directly from dpdk.org. The email editor may not show the correct format.

OK, if so, pls ignore my comment:)

Thanks,
Michael
>
>>  		I40E_WRITE_REG(hw, I40E_PFINT_LNKLSTN(msix_vect - 1),
>> -			(vsi->base_queue << I40E_PFINT_LNKLSTN_FIRSTQ_INDX_SHIFT)
>> |
>> +			       (vsi->base_queue <<
>> +				I40E_PFINT_LNKLSTN_FIRSTQ_INDX_SHIFT) |
>>
>> BTW, for coding style, I think we can follow the linux kernel, for kernel
>> indentations, it always use the format like: n"Tab"+m"space", 0 <= m <=7.
>> Another example is qemu, it is all "space" without "tab".
> Yes, we have DPDK style, tab or tab + space. Space only is not allowed. Checkpatch.pl can check it for us.
>
>>>  			(0x0 << I40E_PFINT_LNKLSTN_FIRSTQ_TYPE_SHIFT));
>>>
>>>  		I40E_WRITE_REG(hw, I40E_PFINT_ITRN(I40E_ITR_INDEX_DEFAULT,
>>> -				msix_vect - 1), interval);
>>> +						msix_vect - 1), interval);
>>>
>>>  		/* Disable auto-mask on enabling of all none-zero  interrupt */
>>>  		I40E_WRITE_REG(hw, I40E_GLINT_CTL,
>>> -				I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK);
>>> -	}
>>> -	else {
>>> +			I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK);
>>> +	} else {
>>>  		uint32_t reg;
>>> +
>>>  		/* num_msix_vectors_vf needs to minus irq0 */
>>>  		reg = (hw->func_caps.num_msix_vectors_vf - 1) *
>>>  			vsi->user_param + (msix_vect - 1);
>>>
>>> -		I40E_WRITE_REG(hw, I40E_VPINT_LNKLSTN(reg),
>>> -			(vsi->base_queue << I40E_VPINT_LNKLSTN_FIRSTQ_INDX_SHIFT)
>> |
>>> -			(0x0 << I40E_VPINT_LNKLSTN_FIRSTQ_TYPE_SHIFT));
>>> +		I40E_WRITE_REG(hw, I40E_VPINT_LNKLSTN(reg), (vsi->base_queue
>> <<
>>> +					I40E_VPINT_LNKLSTN_FIRSTQ_INDX_SHIFT) |
>>> +				(0x0 << I40E_VPINT_LNKLSTN_FIRSTQ_TYPE_SHIFT));
>> Here the same I think.
>>
>> Thanks,
>> Michael
>>>  	}
>>>
>>>  	I40E_WRITE_FLUSH(hw);
> Regards,
> Helin
>


  reply	other threads:[~2014-10-29  8:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29  3:42 [dpdk-dev] [PATCH 0/2] fix of configuring inside NIC RX interrupt Helin Zhang
2014-10-29  3:42 ` [dpdk-dev] [PATCH 1/2] i40e: code style fix Helin Zhang
2014-10-29  6:11   ` Qiu, Michael
2014-10-29  6:26     ` Zhang, Helin
2014-10-29  8:06       ` Qiu, Michael [this message]
2014-10-29  3:42 ` [dpdk-dev] [PATCH 2/2] i40e: fix of configuring inside NIC RX interrupt Helin Zhang
2014-10-29  5:00 ` [dpdk-dev] [PATCH 0/2] " Chen, Jing D
2014-10-29 22:44   ` Thomas Monjalon

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=533710CFB86FA344BFBF2D6802E60286C7CC69@SHSMSX101.ccr.corp.intel.com \
    --to=michael.qiu@intel.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.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 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).