From: Vladislav Yasevich <vyasevich@gmail.com>
To: netdev@vger.kernel.org
Cc: virtio-dev@lists.oasis-open.org, marcelo.leitner@gmail.com,
nhorman@tuxdriver.com, mst@redhat.com,
virtualization@lists.linux-foundation.org,
linux-sctp@vger.kernel.org
Subject: [PATCH V2 net-next 4/6] tun: Add support for SCTP checksum offload
Date: Tue, 1 May 2018 22:07:37 -0400 [thread overview]
Message-ID: <20180502020739.19239-5-vyasevic__4721.50453501872$1525226781$gmane$org@redhat.com> (raw)
In-Reply-To: <20180502020739.19239-1-vyasevic@redhat.com>
Adds a new tun offload flag to allow for SCTP checksum offload.
The flag has to be set by the user and defaults to "no offload".
Add SCTP checksum support to the supported tun features.
Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
---
drivers/net/tun.c | 7 ++++++-
include/uapi/linux/if_tun.h | 1 +
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index a1ba262..4f314a6 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -216,7 +216,7 @@ struct tun_struct {
struct net_device *dev;
netdev_features_t set_features;
#define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \
- NETIF_F_TSO6)
+ NETIF_F_TSO6|NETIF_F_SCTP_CRC)
int align;
int vnet_hdr_sz;
@@ -2719,6 +2719,11 @@ static int set_offload(struct tun_struct *tun, unsigned long arg)
arg &= ~TUN_F_UFO;
}
+ if (arg & TUN_F_SCTP_CSUM) {
+ features |= NETIF_F_SCTP_CRC;
+ arg &= ~TUN_F_SCTP_CSUM;
+ }
+
/* This gives the user a way to test for new features in future by
* trying to set them. */
if (arg)
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h
index ee432cd..061aea8 100644
--- a/include/uapi/linux/if_tun.h
+++ b/include/uapi/linux/if_tun.h
@@ -86,6 +86,7 @@
#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
#define TUN_F_UFO 0x10 /* I can handle UFO packets */
+#define TUN_F_SCTP_CSUM 0x20 /* I can handle SCTP checksums offloads */
/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
#define TUN_PKT_STRIP 0x0001
--
2.9.5
next prev parent reply other threads:[~2018-05-02 2:07 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-02 2:07 [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 2:07 ` [PATCH V2 net-next 1/6] virtio: Add support for SCTP checksum offloading Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 3:16 ` Michael S. Tsirkin
2018-05-02 3:16 ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 3:16 ` Michael S. Tsirkin
2018-05-02 13:00 ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:14 ` Marcelo Ricardo Leitner
2018-05-02 14:14 ` Marcelo Ricardo Leitner
2018-05-02 14:21 ` Michael S. Tsirkin
2018-05-02 14:21 ` Michael S. Tsirkin
2018-05-02 14:21 ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 14:21 ` Michael S. Tsirkin
2018-05-02 14:34 ` Marcelo Ricardo Leitner
2018-05-02 14:34 ` Marcelo Ricardo Leitner
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 2:07 ` [PATCH V2 net-next 2/6] sctp: Handle sctp packets with CHECKSUM_PARTIAL Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 14:38 ` Marcelo Ricardo Leitner
2018-05-02 14:38 ` Marcelo Ricardo Leitner
2018-08-20 14:54 ` Marcelo Ricardo Leitner
2018-08-20 14:54 ` Marcelo Ricardo Leitner
2018-08-20 15:39 ` David Laight
2018-08-20 15:39 ` David Laight
2018-08-20 15:39 ` David Laight
2018-05-02 2:07 ` [PATCH V2 net-next 3/6] sctp: Build sctp offload support into the base kernel Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 2:07 ` [PATCH V2 net-next 4/6] tun: Add support for SCTP checksum offload Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 14:53 ` Marcelo Ricardo Leitner
2018-05-02 14:53 ` Marcelo Ricardo Leitner
2018-05-02 14:56 ` Marcelo Ricardo Leitner
2018-05-02 14:56 ` Marcelo Ricardo Leitner
2018-05-02 17:17 ` Vlad Yasevich
2018-05-02 17:17 ` Vlad Yasevich
2018-05-02 17:17 ` [virtio-dev] " Vlad Yasevich
2018-05-02 17:17 ` Vlad Yasevich
2018-05-02 2:07 ` Vladislav Yasevich [this message]
2018-05-02 2:07 ` [PATCH V2 net-next 5/6] macvlan/macvtap: " Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 3:24 ` Michael S. Tsirkin
2018-05-02 3:24 ` Michael S. Tsirkin
2018-05-02 3:24 ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 3:24 ` Michael S. Tsirkin
2018-05-02 13:27 ` Vlad Yasevich
2018-05-02 13:27 ` Vlad Yasevich
2018-05-02 13:27 ` [virtio-dev] " Vlad Yasevich
2018-05-02 13:27 ` Vlad Yasevich
2018-05-02 13:46 ` Michael S. Tsirkin
2018-05-02 13:46 ` Michael S. Tsirkin
2018-05-02 13:46 ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 13:46 ` Michael S. Tsirkin
2018-05-02 14:00 ` Vlad Yasevich
2018-05-02 14:00 ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:00 ` Vlad Yasevich
2018-05-02 14:17 ` Michael S. Tsirkin
2018-05-02 14:17 ` [virtio-dev] " Michael S. Tsirkin
2018-05-02 14:17 ` Michael S. Tsirkin
2018-05-02 14:25 ` Vlad Yasevich
2018-05-02 14:25 ` Vlad Yasevich
2018-05-02 14:25 ` [virtio-dev] " Vlad Yasevich
2018-05-02 14:25 ` Vlad Yasevich
2018-05-02 14:00 ` Vlad Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 2:07 ` [PATCH V2 net-next 6/6] ipvlan: " Vladislav Yasevich
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 8:12 ` Davide Caratti
2018-05-02 8:12 ` Davide Caratti
2018-05-02 2:07 ` Vladislav Yasevich
2018-05-02 21:57 ` [PATCH V2 net-next 0/6] virtio-net: Add SCTP checksum offload support Marcelo Ricardo Leitner
2018-05-02 21:57 ` Marcelo Ricardo Leitner
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='20180502020739.19239-5-vyasevic__4721.50453501872$1525226781$gmane$org@redhat.com' \
--to=vyasevich@gmail.com \
--cc=linux-sctp@vger.kernel.org \
--cc=marcelo.leitner@gmail.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=virtio-dev@lists.oasis-open.org \
--cc=virtualization@lists.linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.