linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luo Jie <quic_luoj@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Lei Wei <quic_leiwei@quicinc.com>,
	Suruchi Agarwal <quic_suruchia@quicinc.com>,
	Pavithra R <quic_pavir@quicinc.com>,
	Simon Horman <horms@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
	Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: <linux-arm-msm@vger.kernel.org>, <netdev@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-doc@vger.kernel.org>, <linux-hardening@vger.kernel.org>,
	<quic_kkumarcs@quicinc.com>, <quic_linchen@quicinc.com>
Subject: Re: [PATCH net-next v5 10/14] net: ethernet: qualcomm: Initialize PPE RSS hash settings
Date: Fri, 18 Jul 2025 15:41:24 +0800	[thread overview]
Message-ID: <13ca4d6e-d5db-4fd5-af14-9ccda55ddba2@quicinc.com> (raw)
In-Reply-To: <793434f9-7cdc-409f-b855-380be7a2b0db@oss.qualcomm.com>



On 7/18/2025 4:48 AM, Konrad Dybcio wrote:
> On 6/26/25 4:31 PM, Luo Jie wrote:
>> The PPE RSS hash is generated during PPE receive, based on the packet
>> content (3 tuples or 5 tuples) and as per the configured RSS seed. The
>> hash is then used to select the queue to transmit the packet to the
>> ARM CPU.
>>
>> This patch initializes the RSS hash settings that are used to generate
>> the hash for the packet during PPE packet receive.
>>
>> Signed-off-by: Luo Jie <quic_luoj@quicinc.com>
>> ---
>>   drivers/net/ethernet/qualcomm/ppe/ppe_config.c | 194 ++++++++++++++++++++++++-
>>   drivers/net/ethernet/qualcomm/ppe/ppe_config.h |  39 +++++
>>   drivers/net/ethernet/qualcomm/ppe/ppe_regs.h   |  40 +++++
>>   3 files changed, 272 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c
>> index dd7a4949f049..3b290eda7633 100644
>> --- a/drivers/net/ethernet/qualcomm/ppe/ppe_config.c
>> +++ b/drivers/net/ethernet/qualcomm/ppe/ppe_config.c
>> @@ -1216,6 +1216,143 @@ int ppe_counter_enable_set(struct ppe_device *ppe_dev, int port)
>>   	return regmap_set_bits(ppe_dev->regmap, reg, PPE_PORT_EG_VLAN_TBL_TX_COUNTING_EN);
>>   }
>>   
>> +static int ppe_rss_hash_ipv4_config(struct ppe_device *ppe_dev, int index,
>> +				    struct ppe_rss_hash_cfg cfg)
>> +{
>> +	u32 reg, val;
>> +
>> +	switch (index) {
>> +	case 0:
>> +		val = FIELD_PREP(PPE_RSS_HASH_MIX_IPV4_VAL, cfg.hash_sip_mix[0]);
>> +		break;
>> +	case 1:
>> +		val = FIELD_PREP(PPE_RSS_HASH_MIX_IPV4_VAL, cfg.hash_dip_mix[0]);
>> +		break;
>> +	case 2:
>> +		val = FIELD_PREP(PPE_RSS_HASH_MIX_IPV4_VAL, cfg.hash_protocol_mix);
>> +		break;
>> +	case 3:
>> +		val = FIELD_PREP(PPE_RSS_HASH_MIX_IPV4_VAL, cfg.hash_dport_mix);
>> +		break;
>> +	case 4:
>> +		val = FIELD_PREP(PPE_RSS_HASH_MIX_IPV4_VAL, cfg.hash_sport_mix);
>> +		break;
>> +	default:
>> +		return -EINVAL;
>> +	}
>> +
>> +	reg = PPE_RSS_HASH_MIX_IPV4_ADDR + index * PPE_RSS_HASH_MIX_IPV4_INC;
>> +
>> +	return regmap_write(ppe_dev->regmap, reg, val);
> 
> FWIW you can assign the value in the switch statement and only FIELD_PREP
> it in the regmap_write, since the bitfield is the same
> 
> Konrad

Thank you for the suggestion, I'll update the code accordingly.


  reply	other threads:[~2025-07-18  7:41 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-26 14:30 [PATCH net-next v5 00/14] Add PPE driver for Qualcomm IPQ9574 SoC Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 01/14] dt-bindings: net: Add PPE " Luo Jie
2025-07-01  7:11   ` Krzysztof Kozlowski
2025-07-03  9:36     ` Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 02/14] docs: networking: Add PPE driver documentation " Luo Jie
2025-06-26 22:02   ` Randy Dunlap
2025-06-27 13:09     ` Lei Wei
2025-06-26 14:31 ` [PATCH net-next v5 03/14] net: ethernet: qualcomm: Add PPE driver for " Luo Jie
2025-06-27 16:21   ` Konrad Dybcio
2025-07-01 12:24     ` Luo Jie
2025-07-30 11:57       ` Konrad Dybcio
2025-08-01 14:42         ` Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 04/14] net: ethernet: qualcomm: Initialize PPE buffer management for IPQ9574 Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 05/14] net: ethernet: qualcomm: Initialize PPE queue " Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 06/14] net: ethernet: qualcomm: Initialize the PPE scheduler settings Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 07/14] net: ethernet: qualcomm: Initialize PPE queue settings Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 08/14] net: ethernet: qualcomm: Initialize PPE service code settings Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 09/14] net: ethernet: qualcomm: Initialize PPE port control settings Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 10/14] net: ethernet: qualcomm: Initialize PPE RSS hash settings Luo Jie
2025-07-17 20:48   ` Konrad Dybcio
2025-07-18  7:41     ` Luo Jie [this message]
2025-06-26 14:31 ` [PATCH net-next v5 11/14] net: ethernet: qualcomm: Initialize PPE queue to Ethernet DMA ring mapping Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 12/14] net: ethernet: qualcomm: Initialize PPE L2 bridge settings Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 13/14] net: ethernet: qualcomm: Add PPE debugfs support for PPE counters Luo Jie
2025-06-26 14:31 ` [PATCH net-next v5 14/14] MAINTAINERS: Add maintainer for Qualcomm PPE driver Luo Jie

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=13ca4d6e-d5db-4fd5-af14-9ccda55ddba2@quicinc.com \
    --to=quic_luoj@quicinc.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@google.com \
    --cc=gustavoars@kernel.org \
    --cc=horms@kernel.org \
    --cc=kees@kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=quic_kkumarcs@quicinc.com \
    --cc=quic_leiwei@quicinc.com \
    --cc=quic_linchen@quicinc.com \
    --cc=quic_pavir@quicinc.com \
    --cc=quic_suruchia@quicinc.com \
    --cc=robh@kernel.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 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).