netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Simon Horman <horms@kernel.org>
Cc: netdev@vger.kernel.org, kuba@kernel.org, pabeni@redhat.com,
	davem@davemloft.net, edumazet@google.com,
	jacob.e.keller@intel.com, jhs@mojatatu.com,
	johannes@sipsolutions.net, andriy.shevchenko@linux.intel.com,
	amritha.nambiar@intel.com, sdf@google.com
Subject: Re: [patch net-next v2 6/9] netlink: introduce typedef for filter function
Date: Mon, 20 Nov 2023 08:58:06 +0100	[thread overview]
Message-ID: <ZVsRjiMg2/vGnBCi@nanopsycho> (raw)
In-Reply-To: <20231119145855.GA186930@vergenet.net>

Sun, Nov 19, 2023 at 03:58:55PM CET, horms@kernel.org wrote:
>On Thu, Nov 16, 2023 at 05:48:18PM +0100, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@nvidia.com>
>> 
>> Make the code using filter function a bit nicer by consolidating the
>> filter function arguments using typedef.
>> 
>> Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
>> ---
>> v1->v2:
>> - new patch
>> ---
>>  drivers/connector/connector.c | 5 ++---
>>  include/linux/connector.h     | 6 ++----
>>  include/linux/netlink.h       | 6 ++++--
>>  net/netlink/af_netlink.c      | 6 ++----
>>  4 files changed, 10 insertions(+), 13 deletions(-)
>> 
>> diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c
>> index 7f7b94f616a6..4028e8eeba82 100644
>> --- a/drivers/connector/connector.c
>> +++ b/drivers/connector/connector.c
>> @@ -59,9 +59,8 @@ static int cn_already_initialized;
>>   * both, or if both are zero then the group is looked up and sent there.
>>   */
>>  int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
>> -	gfp_t gfp_mask,
>> -	int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
>> -	void *filter_data)
>> +			 gfp_t gfp_mask, netlink_filter_fn filter,
>> +			 void *filter_data)
>>  {
>>  	struct cn_callback_entry *__cbq;
>>  	unsigned int size;
>> diff --git a/include/linux/connector.h b/include/linux/connector.h
>> index cec2d99ae902..cb18d70d623f 100644
>> --- a/include/linux/connector.h
>> +++ b/include/linux/connector.h
>> @@ -98,10 +98,8 @@ void cn_del_callback(const struct cb_id *id);
>>   *
>>   * If there are no listeners for given group %-ESRCH can be returned.
>>   */
>> -int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid,
>> -			 u32 group, gfp_t gfp_mask,
>> -			 int (*filter)(struct sock *dsk, struct sk_buff *skb,
>> -				       void *data),
>> +int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
>> +			 gfp_t gfp_mask, netlink_filter_fn filter,
>>  			 void *filter_data);
>
>nit: It might be good to update the kernel doc to account for
>     group => group.
>     Curiously the kernel doc already documents filter_data rather
>     than data.

Ah, I copied this from .c file. There is an inconsistency in the
existing code. Will keep the inconsistency.


>
>...

  reply	other threads:[~2023-11-20  7:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16 16:48 [patch net-next v2 0/9] devlink: introduce notifications filtering Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 1/9] devlink: use devl_is_registered() helper instead xa_get_mark() Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 2/9] devlink: introduce __devl_is_registered() helper and use it instead of xa_get_mark() Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 3/9] devlink: send notifications only if there are listeners Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 4/9] devlink: introduce a helper for netlink multicast send Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 5/9] genetlink: implement release callback and free sk_user_data there Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 6/9] netlink: introduce typedef for filter function Jiri Pirko
2023-11-19 14:58   ` Simon Horman
2023-11-20  7:58     ` Jiri Pirko [this message]
2023-11-16 16:48 ` [patch net-next v2 7/9] genetlink: introduce helpers to do filtered multicast Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 8/9] devlink: add a command to set notification filter and use it for multicasts Jiri Pirko
2023-11-16 16:48 ` [patch net-next v2 9/9] devlink: extend multicast filtering by port index Jiri Pirko

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=ZVsRjiMg2/vGnBCi@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=amritha.nambiar@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jacob.e.keller@intel.com \
    --cc=jhs@mojatatu.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sdf@google.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).