rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alice Ryhl <alice@ryhl.io>
To: Andrew Lunn <andrew@lunn.ch>, FUJITA Tomonori <tomo@exabit.dev>
Cc: rust-for-linux@vger.kernel.org, aliceryhl@google.com,
	FUJITA Tomonori <fujita.tomonori@gmail.com>
Subject: Re: [PATCH v2 1/5] rust: core abstractions for network device drivers
Date: Sun, 11 Jun 2023 10:03:39 +0200	[thread overview]
Message-ID: <964b5c9f-6eab-d7ff-1ce6-dc11f15898d4@ryhl.io> (raw)
In-Reply-To: <18368b79-f204-4bc2-b591-859d3ddb22f1@lunn.ch>

On 6/10/23 16:11, Andrew Lunn wrote:
>> diff --git a/rust/helpers.c b/rust/helpers.c
>> index 81e80261d597..a91d2a99035b 100644
>> --- a/rust/helpers.c
>> +++ b/rust/helpers.c
>> @@ -23,10 +23,26 @@
>>   #include <linux/err.h>
>>   #include <linux/refcount.h>
>>   #include <linux/mutex.h>
>> +#include <linux/netdevice.h>
>> +#include <linux/skbuff.h>
>>   #include <linux/spinlock.h>
>>   #include <linux/sched/signal.h>
>>   #include <linux/wait.h>
>>   
>> +#ifdef CONFIG_NET
>> +void *rust_helper_netdev_priv(const struct net_device *dev)
>> +{
>> +	return netdev_priv(dev);
>> +}
>> +EXPORT_SYMBOL_GPL(rust_helper_netdev_priv);
>> +
>> +void rust_helper_skb_tx_timestamp(struct sk_buff *skb)
>> +{
>> +	skb_tx_timestamp(skb);
>> +}
>> +EXPORT_SYMBOL_GPL(rust_helper_skb_tx_timestamp);
> 
> This question is probably due to me not knowing about rust. Why have
> these helpers? They don't appear to don't do anything.

It's because we can't call inline C functions directly, so we need a 
non-inline version of it. (Similarly for #defines.)

Alice

  reply	other threads:[~2023-06-11  8:03 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20230610071848.3722492-1-tomo@exabit.dev>
2023-06-10  7:20 ` [PATCH v2 1/5] rust: core abstractions for network device drivers FUJITA Tomonori
2023-06-10 14:11   ` Andrew Lunn
2023-06-11  8:03     ` Alice Ryhl [this message]
2023-06-11 15:30       ` Andrew Lunn
2023-06-11 17:48         ` Miguel Ojeda
2023-06-12  6:47     ` FUJITA Tomonori
2023-06-12 12:46       ` Andrew Lunn
2023-06-10 19:49   ` Miguel Ojeda
2023-06-12  5:04     ` FUJITA Tomonori
2023-06-12 13:26       ` Miguel Ojeda
2023-06-10  7:20 ` [PATCH v2 2/5] rust: add support for ethernet operations FUJITA Tomonori
2023-06-10 16:48   ` Andrew Lunn
2023-06-12  6:51     ` FUJITA Tomonori
2023-06-10 19:14   ` Miguel Ojeda
2023-06-12  8:51     ` FUJITA Tomonori
2023-06-12 13:35       ` Miguel Ojeda
2023-06-10  7:20 ` [PATCH v2 5/5] samples: rust: add dummy network driver FUJITA Tomonori
2023-06-10 16:59   ` Andrew Lunn
2023-06-12  7:02     ` FUJITA Tomonori
2023-06-10 19:14   ` Miguel Ojeda
2023-06-10  7:20 ` [PATCH v2 3/5] rust: add support for get_stats64 in struct net_device_ops FUJITA Tomonori
2023-06-10  7:20 ` [PATCH v2 4/5] rust: add methods for configure net_device FUJITA Tomonori
2023-07-10  7:36 [PATCH v2 0/5] Rust abstractions for network device drivers FUJITA Tomonori
2023-07-10  7:36 ` [PATCH v2 1/5] rust: core " FUJITA Tomonori
2023-07-14 18:59   ` Benno Lossin

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=964b5c9f-6eab-d7ff-1ce6-dc11f15898d4@ryhl.io \
    --to=alice@ryhl.io \
    --cc=aliceryhl@google.com \
    --cc=andrew@lunn.ch \
    --cc=fujita.tomonori@gmail.com \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tomo@exabit.dev \
    /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).