diff mbox series

[net-next,6/6] team: remove unused input parameters in lb_htpm_select_tx_port and lb_hash_select_tx_port

Message ID 20230804123116.2495908-7-shaozhengchao@huawei.com (mailing list archive)
State Superseded
Delegated to: Netdev Maintainers
Headers show
Series team: do some cleanups in team driver | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1329 this patch: 1329
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/build_clang success Errors and warnings before: 1351 this patch: 1351
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1352 this patch: 1352
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 40 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

shaozhengchao Aug. 4, 2023, 12:31 p.m. UTC
The input parameters "lb_priv" and "skb" in lb_htpm_select_tx_port and
lb_hash_select_tx_port are unused, so remove them.

Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
---
 drivers/net/team/team_mode_loadbalance.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

Comments

Jiri Pirko Aug. 4, 2023, 1:45 p.m. UTC | #1
Fri, Aug 04, 2023 at 02:31:16PM CEST, shaozhengchao@huawei.com wrote:
>The input parameters "lb_priv" and "skb" in lb_htpm_select_tx_port and
>lb_hash_select_tx_port are unused, so remove them.
>
>Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
>---
> drivers/net/team/team_mode_loadbalance.c | 10 ++--------
> 1 file changed, 2 insertions(+), 8 deletions(-)
>
>diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
>index a6021ae51d0d..00f8989c29c0 100644
>--- a/drivers/net/team/team_mode_loadbalance.c
>+++ b/drivers/net/team/team_mode_loadbalance.c
>@@ -30,8 +30,6 @@ static rx_handler_result_t lb_receive(struct team *team, struct team_port *port,
> struct lb_priv;
> 
> typedef struct team_port *lb_select_tx_port_func_t(struct team *,
>-						   struct lb_priv *,
>-						   struct sk_buff *,
> 						   unsigned char);
> 
> #define LB_TX_HASHTABLE_SIZE 256 /* hash is a char */
>@@ -118,8 +116,6 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
> 
> /* Basic tx selection based solely by hash */
> static struct team_port *lb_hash_select_tx_port(struct team *team,
>-						struct lb_priv *lb_priv,
>-						struct sk_buff *skb,
> 						unsigned char hash)
> {
> 	int port_index = team_num_to_port_index(team, hash);
>@@ -129,8 +125,6 @@ static struct team_port *lb_hash_select_tx_port(struct team *team,
> 
> /* Hash to port mapping select tx port */
> static struct team_port *lb_htpm_select_tx_port(struct team *team,
>-						struct lb_priv *lb__priv,

Squash the previous patch in this one to avoid this odd "__" thing.

Thanks!


>-						struct sk_buff *skb,
> 						unsigned char hash)
> {
> 	struct lb_priv *lb_priv = get_lb_priv(team);
>@@ -140,7 +134,7 @@ static struct team_port *lb_htpm_select_tx_port(struct team *team,
> 	if (likely(port))
> 		return port;
> 	/* If no valid port in the table, fall back to simple hash */
>-	return lb_hash_select_tx_port(team, lb_priv, skb, hash);
>+	return lb_hash_select_tx_port(team, hash);
> }
> 
> struct lb_select_tx_port {
>@@ -230,7 +224,7 @@ static bool lb_transmit(struct team *team, struct sk_buff *skb)
> 
> 	hash = lb_get_skb_hash(lb_priv, skb);
> 	select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func);
>-	port = select_tx_port_func(team, lb_priv, skb, hash);
>+	port = select_tx_port_func(team, hash);
> 	if (unlikely(!port))
> 		goto drop;
> 	if (team_dev_queue_xmit(team, port, skb))
>-- 
>2.34.1
>
shaozhengchao Aug. 4, 2023, 2:06 p.m. UTC | #2
On 2023/8/4 21:45, Jiri Pirko wrote:
> Fri, Aug 04, 2023 at 02:31:16PM CEST, shaozhengchao@huawei.com wrote:
>> The input parameters "lb_priv" and "skb" in lb_htpm_select_tx_port and
>> lb_hash_select_tx_port are unused, so remove them.
>>
>> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
>> ---
>> drivers/net/team/team_mode_loadbalance.c | 10 ++--------
>> 1 file changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
>> index a6021ae51d0d..00f8989c29c0 100644
>> --- a/drivers/net/team/team_mode_loadbalance.c
>> +++ b/drivers/net/team/team_mode_loadbalance.c
>> @@ -30,8 +30,6 @@ static rx_handler_result_t lb_receive(struct team *team, struct team_port *port,
>> struct lb_priv;
>>
>> typedef struct team_port *lb_select_tx_port_func_t(struct team *,
>> -						   struct lb_priv *,
>> -						   struct sk_buff *,
>> 						   unsigned char);
>>
>> #define LB_TX_HASHTABLE_SIZE 256 /* hash is a char */
>> @@ -118,8 +116,6 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
>>
>> /* Basic tx selection based solely by hash */
>> static struct team_port *lb_hash_select_tx_port(struct team *team,
>> -						struct lb_priv *lb_priv,
>> -						struct sk_buff *skb,
>> 						unsigned char hash)
>> {
>> 	int port_index = team_num_to_port_index(team, hash);
>> @@ -129,8 +125,6 @@ static struct team_port *lb_hash_select_tx_port(struct team *team,
>>
>> /* Hash to port mapping select tx port */
>> static struct team_port *lb_htpm_select_tx_port(struct team *team,
>> -						struct lb_priv *lb__priv,
> 
> Squash the previous patch in this one to avoid this odd "__" thing.
> 
> Thanks!
> 
Hi Jiri:
	Thank you for your review. I will change it and send v2.

Zhengchao Shao
> 
>> -						struct sk_buff *skb,
>> 						unsigned char hash)
>> {
>> 	struct lb_priv *lb_priv = get_lb_priv(team);
>> @@ -140,7 +134,7 @@ static struct team_port *lb_htpm_select_tx_port(struct team *team,
>> 	if (likely(port))
>> 		return port;
>> 	/* If no valid port in the table, fall back to simple hash */
>> -	return lb_hash_select_tx_port(team, lb_priv, skb, hash);
>> +	return lb_hash_select_tx_port(team, hash);
>> }
>>
>> struct lb_select_tx_port {
>> @@ -230,7 +224,7 @@ static bool lb_transmit(struct team *team, struct sk_buff *skb)
>>
>> 	hash = lb_get_skb_hash(lb_priv, skb);
>> 	select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func);
>> -	port = select_tx_port_func(team, lb_priv, skb, hash);
>> +	port = select_tx_port_func(team, hash);
>> 	if (unlikely(!port))
>> 		goto drop;
>> 	if (team_dev_queue_xmit(team, port, skb))
>> -- 
>> 2.34.1
>>
>
Jiri Pirko Aug. 4, 2023, 4:56 p.m. UTC | #3
Fri, Aug 04, 2023 at 04:06:39PM CEST, shaozhengchao@huawei.com wrote:
>
>
>On 2023/8/4 21:45, Jiri Pirko wrote:
>> Fri, Aug 04, 2023 at 02:31:16PM CEST, shaozhengchao@huawei.com wrote:
>> > The input parameters "lb_priv" and "skb" in lb_htpm_select_tx_port and
>> > lb_hash_select_tx_port are unused, so remove them.
>> > 
>> > Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
>> > ---
>> > drivers/net/team/team_mode_loadbalance.c | 10 ++--------
>> > 1 file changed, 2 insertions(+), 8 deletions(-)
>> > 
>> > diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
>> > index a6021ae51d0d..00f8989c29c0 100644
>> > --- a/drivers/net/team/team_mode_loadbalance.c
>> > +++ b/drivers/net/team/team_mode_loadbalance.c
>> > @@ -30,8 +30,6 @@ static rx_handler_result_t lb_receive(struct team *team, struct team_port *port,
>> > struct lb_priv;
>> > 
>> > typedef struct team_port *lb_select_tx_port_func_t(struct team *,
>> > -						   struct lb_priv *,
>> > -						   struct sk_buff *,
>> > 						   unsigned char);
>> > 
>> > #define LB_TX_HASHTABLE_SIZE 256 /* hash is a char */
>> > @@ -118,8 +116,6 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
>> > 
>> > /* Basic tx selection based solely by hash */
>> > static struct team_port *lb_hash_select_tx_port(struct team *team,
>> > -						struct lb_priv *lb_priv,
>> > -						struct sk_buff *skb,
>> > 						unsigned char hash)
>> > {
>> > 	int port_index = team_num_to_port_index(team, hash);
>> > @@ -129,8 +125,6 @@ static struct team_port *lb_hash_select_tx_port(struct team *team,
>> > 
>> > /* Hash to port mapping select tx port */
>> > static struct team_port *lb_htpm_select_tx_port(struct team *team,
>> > -						struct lb_priv *lb__priv,
>> 
>> Squash the previous patch in this one to avoid this odd "__" thing.
>> 
>> Thanks!
>> 
>Hi Jiri:
>	Thank you for your review. I will change it and send v2.

Did you hear about netdev rules by any chance?

https://www.kernel.org/doc/html/v6.5-rc4/process/maintainer-netdev.html?highlight=24h

Could you please read it?


>
>Zhengchao Shao
>> 
>> > -						struct sk_buff *skb,
>> > 						unsigned char hash)
>> > {
>> > 	struct lb_priv *lb_priv = get_lb_priv(team);
>> > @@ -140,7 +134,7 @@ static struct team_port *lb_htpm_select_tx_port(struct team *team,
>> > 	if (likely(port))
>> > 		return port;
>> > 	/* If no valid port in the table, fall back to simple hash */
>> > -	return lb_hash_select_tx_port(team, lb_priv, skb, hash);
>> > +	return lb_hash_select_tx_port(team, hash);
>> > }
>> > 
>> > struct lb_select_tx_port {
>> > @@ -230,7 +224,7 @@ static bool lb_transmit(struct team *team, struct sk_buff *skb)
>> > 
>> > 	hash = lb_get_skb_hash(lb_priv, skb);
>> > 	select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func);
>> > -	port = select_tx_port_func(team, lb_priv, skb, hash);
>> > +	port = select_tx_port_func(team, hash);
>> > 	if (unlikely(!port))
>> > 		goto drop;
>> > 	if (team_dev_queue_xmit(team, port, skb))
>> > -- 
>> > 2.34.1
>> > 
>>
shaozhengchao Aug. 5, 2023, 2:04 a.m. UTC | #4
On 2023/8/5 0:56, Jiri Pirko wrote:
> Fri, Aug 04, 2023 at 04:06:39PM CEST, shaozhengchao@huawei.com wrote:
>>
>>
>> On 2023/8/4 21:45, Jiri Pirko wrote:
>>> Fri, Aug 04, 2023 at 02:31:16PM CEST, shaozhengchao@huawei.com wrote:
>>>> The input parameters "lb_priv" and "skb" in lb_htpm_select_tx_port and
>>>> lb_hash_select_tx_port are unused, so remove them.
>>>>
>>>> Signed-off-by: Zhengchao Shao <shaozhengchao@huawei.com>
>>>> ---
>>>> drivers/net/team/team_mode_loadbalance.c | 10 ++--------
>>>> 1 file changed, 2 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
>>>> index a6021ae51d0d..00f8989c29c0 100644
>>>> --- a/drivers/net/team/team_mode_loadbalance.c
>>>> +++ b/drivers/net/team/team_mode_loadbalance.c
>>>> @@ -30,8 +30,6 @@ static rx_handler_result_t lb_receive(struct team *team, struct team_port *port,
>>>> struct lb_priv;
>>>>
>>>> typedef struct team_port *lb_select_tx_port_func_t(struct team *,
>>>> -						   struct lb_priv *,
>>>> -						   struct sk_buff *,
>>>> 						   unsigned char);
>>>>
>>>> #define LB_TX_HASHTABLE_SIZE 256 /* hash is a char */
>>>> @@ -118,8 +116,6 @@ static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
>>>>
>>>> /* Basic tx selection based solely by hash */
>>>> static struct team_port *lb_hash_select_tx_port(struct team *team,
>>>> -						struct lb_priv *lb_priv,
>>>> -						struct sk_buff *skb,
>>>> 						unsigned char hash)
>>>> {
>>>> 	int port_index = team_num_to_port_index(team, hash);
>>>> @@ -129,8 +125,6 @@ static struct team_port *lb_hash_select_tx_port(struct team *team,
>>>>
>>>> /* Hash to port mapping select tx port */
>>>> static struct team_port *lb_htpm_select_tx_port(struct team *team,
>>>> -						struct lb_priv *lb__priv,
>>>
>>> Squash the previous patch in this one to avoid this odd "__" thing.
>>>
>>> Thanks!
>>>
>> Hi Jiri:
>> 	Thank you for your review. I will change it and send v2.
> 
> Did you hear about netdev rules by any chance?
> 
> https://www.kernel.org/doc/html/v6.5-rc4/process/maintainer-netdev.html?highlight=24h
> 
> Could you please read it?
> 
Thank you. I will read it.

Zhengchao Shao
> 
>>
>> Zhengchao Shao
>>>
>>>> -						struct sk_buff *skb,
>>>> 						unsigned char hash)
>>>> {
>>>> 	struct lb_priv *lb_priv = get_lb_priv(team);
>>>> @@ -140,7 +134,7 @@ static struct team_port *lb_htpm_select_tx_port(struct team *team,
>>>> 	if (likely(port))
>>>> 		return port;
>>>> 	/* If no valid port in the table, fall back to simple hash */
>>>> -	return lb_hash_select_tx_port(team, lb_priv, skb, hash);
>>>> +	return lb_hash_select_tx_port(team, hash);
>>>> }
>>>>
>>>> struct lb_select_tx_port {
>>>> @@ -230,7 +224,7 @@ static bool lb_transmit(struct team *team, struct sk_buff *skb)
>>>>
>>>> 	hash = lb_get_skb_hash(lb_priv, skb);
>>>> 	select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func);
>>>> -	port = select_tx_port_func(team, lb_priv, skb, hash);
>>>> +	port = select_tx_port_func(team, hash);
>>>> 	if (unlikely(!port))
>>>> 		goto drop;
>>>> 	if (team_dev_queue_xmit(team, port, skb))
>>>> -- 
>>>> 2.34.1
>>>>
>>>
>
diff mbox series

Patch

diff --git a/drivers/net/team/team_mode_loadbalance.c b/drivers/net/team/team_mode_loadbalance.c
index a6021ae51d0d..00f8989c29c0 100644
--- a/drivers/net/team/team_mode_loadbalance.c
+++ b/drivers/net/team/team_mode_loadbalance.c
@@ -30,8 +30,6 @@  static rx_handler_result_t lb_receive(struct team *team, struct team_port *port,
 struct lb_priv;
 
 typedef struct team_port *lb_select_tx_port_func_t(struct team *,
-						   struct lb_priv *,
-						   struct sk_buff *,
 						   unsigned char);
 
 #define LB_TX_HASHTABLE_SIZE 256 /* hash is a char */
@@ -118,8 +116,6 @@  static void lb_tx_hash_to_port_mapping_null_port(struct team *team,
 
 /* Basic tx selection based solely by hash */
 static struct team_port *lb_hash_select_tx_port(struct team *team,
-						struct lb_priv *lb_priv,
-						struct sk_buff *skb,
 						unsigned char hash)
 {
 	int port_index = team_num_to_port_index(team, hash);
@@ -129,8 +125,6 @@  static struct team_port *lb_hash_select_tx_port(struct team *team,
 
 /* Hash to port mapping select tx port */
 static struct team_port *lb_htpm_select_tx_port(struct team *team,
-						struct lb_priv *lb__priv,
-						struct sk_buff *skb,
 						unsigned char hash)
 {
 	struct lb_priv *lb_priv = get_lb_priv(team);
@@ -140,7 +134,7 @@  static struct team_port *lb_htpm_select_tx_port(struct team *team,
 	if (likely(port))
 		return port;
 	/* If no valid port in the table, fall back to simple hash */
-	return lb_hash_select_tx_port(team, lb_priv, skb, hash);
+	return lb_hash_select_tx_port(team, hash);
 }
 
 struct lb_select_tx_port {
@@ -230,7 +224,7 @@  static bool lb_transmit(struct team *team, struct sk_buff *skb)
 
 	hash = lb_get_skb_hash(lb_priv, skb);
 	select_tx_port_func = rcu_dereference_bh(lb_priv->select_tx_port_func);
-	port = select_tx_port_func(team, lb_priv, skb, hash);
+	port = select_tx_port_func(team, hash);
 	if (unlikely(!port))
 		goto drop;
 	if (team_dev_queue_xmit(team, port, skb))