From: Alexander Stein <alexander.stein@systec-electronic.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH RFC] can: add Virtual CAN Tunnel driver (vxcan)
Date: Tue, 25 Apr 2017 07:35:47 +0200 [thread overview]
Message-ID: <1817567.PFpAbEA6ZR@ws-stein> (raw)
In-Reply-To: <20170424201238.3587-1-socketcan@hartkopp.net>
On Monday 24 April 2017 22:12:37, Oliver Hartkopp wrote:
> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
> --- /dev/null
> +++ b/drivers/net/can/vxcan.c
> @@ -0,0 +1,313 @@
> [...]
> +static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev)
> +{
> + struct vxcan_priv *priv = netdev_priv(dev);
> + struct net_device *peer;
> + struct canfd_frame *cfd = (struct canfd_frame *)skb->data;
> + struct net_device_stats *stats = &dev->stats;
> +
> + if (can_dropped_invalid_skb(dev, skb))
> + return NETDEV_TX_OK;
> +
> + rcu_read_lock();
> + peer = rcu_dereference(priv->peer);
> + if (unlikely(!peer)) {
> + kfree_skb(skb);
> + dev->stats.tx_dropped++;
> + goto out_unlock;
> + }
> +
> + skb = can_create_echo_skb(skb);
> + if (!skb)
> + return NETDEV_TX_OK;
> +
> + stats->tx_packets++;
> + stats->tx_bytes += cfd->len;
> +
> + /* reset CAN GW hop counter */
> + skb->csum_start = 0;
> +
> + stats = &peer->stats;
> +
> + stats->rx_packets++;
> + stats->rx_bytes += cfd->len;
> +
> + skb->pkt_type = PACKET_BROADCAST;
> + skb->dev = peer;
> + skb->ip_summed = CHECKSUM_UNNECESSARY;
> +
> + netif_rx_ni(skb);
^^^^^^^^^^
Wouldn't this result in the known out-of-order problem on SMP systems?
Best regards,
Alexander
next prev parent reply other threads:[~2017-04-25 5:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-24 20:12 [PATCH RFC] can: add Virtual CAN Tunnel driver (vxcan) Oliver Hartkopp
2017-04-24 20:12 ` [PATCH RFC] ip: link add vxcan support Oliver Hartkopp
2017-04-25 5:35 ` Alexander Stein [this message]
2017-04-25 6:28 ` [PATCH RFC] can: add Virtual CAN Tunnel driver (vxcan) Oliver Hartkopp
2017-04-25 8:14 ` Alexander Stein
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=1817567.PFpAbEA6ZR@ws-stein \
--to=alexander.stein@systec-electronic.com \
--cc=linux-can@vger.kernel.org \
--cc=socketcan@hartkopp.net \
/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