From: Vladislav Yasevich <vyasevich@gmail.com> To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, mst@redhat.com, jasowang@redhat.com, nhorman@tuxdriver.com, marcelo.leitner@gmail.com, Vladislav Yasevich <vyasevic@redhat.com> Subject: [PATCH V2 net-next 5/6] macvlan/macvtap: Add support for SCTP checksum offload. Date: Tue, 1 May 2018 22:07:38 -0400 [thread overview] Message-ID: <20180502020739.19239-6-vyasevic@redhat.com> (raw) In-Reply-To: <20180502020739.19239-1-vyasevic@redhat.com> Since we now have support for software CRC32c offload, turn it on for macvlan and macvtap devices so that guests can take advantage of offload SCTP checksums to the host or host hardware. Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com> --- drivers/net/macvlan.c | 5 +++-- drivers/net/tap.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 725f4b4..646b730 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -834,7 +834,7 @@ static struct lock_class_key macvlan_netdev_addr_lock_key; #define ALWAYS_ON_OFFLOADS \ (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL) + NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL | NETIF_F_SCTP_CRC) #define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX) @@ -842,7 +842,8 @@ static struct lock_class_key macvlan_netdev_addr_lock_key; (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ NETIF_F_GSO | NETIF_F_TSO | NETIF_F_LRO | \ NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ - NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER | \ + NETIF_F_SCTP_CRC) #define MACVLAN_STATE_MASK \ ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT)) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 9b6cb78..2c8512b 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -369,8 +369,7 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb) * check, we either support them all or none. */ if (skb->ip_summed == CHECKSUM_PARTIAL && - !(features & NETIF_F_CSUM_MASK) && - skb_checksum_help(skb)) + skb_csum_hwoffload_help(skb, features)) goto drop; if (ptr_ring_produce(&q->ring, skb)) goto drop; @@ -945,6 +944,9 @@ static int set_offload(struct tap_queue *q, unsigned long arg) } } + if (arg & TUN_F_SCTP_CSUM) + feature_mask |= NETIF_F_SCTP_CRC; + /* tun/tap driver inverts the usage for TSO offloads, where * setting the TSO bit means that the userspace wants to * accept TSO frames and turning it off means that user space @@ -1077,7 +1079,7 @@ static long tap_ioctl(struct file *file, unsigned int cmd, case TUNSETOFFLOAD: /* let the user check for future flags */ if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | - TUN_F_TSO_ECN | TUN_F_UFO)) + TUN_F_TSO_ECN | TUN_F_UFO | TUN_F_SCTP_CSUM)) return -EINVAL; rtnl_lock(); -- 2.9.5
WARNING: multiple messages have this Message-ID (diff)
From: Vladislav Yasevich <vyasevich@gmail.com> To: netdev@vger.kernel.org Cc: linux-sctp@vger.kernel.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, mst@redhat.com, jasowang@redhat.com, nhorman@tuxdriver.com, marcelo.leitner@gmail.com, Vladislav Yasevich <vyasevic@redhat.com> Subject: [PATCH V2 net-next 5/6] macvlan/macvtap: Add support for SCTP checksum offload. Date: Wed, 02 May 2018 02:07:38 +0000 [thread overview] Message-ID: <20180502020739.19239-6-vyasevic@redhat.com> (raw) In-Reply-To: <20180502020739.19239-1-vyasevic@redhat.com> Since we now have support for software CRC32c offload, turn it on for macvlan and macvtap devices so that guests can take advantage of offload SCTP checksums to the host or host hardware. Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com> --- drivers/net/macvlan.c | 5 +++-- drivers/net/tap.c | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 725f4b4..646b730 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c @@ -834,7 +834,7 @@ static struct lock_class_key macvlan_netdev_addr_lock_key; #define ALWAYS_ON_OFFLOADS \ (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_GSO_SOFTWARE | \ - NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL) + NETIF_F_GSO_ROBUST | NETIF_F_GSO_ENCAP_ALL | NETIF_F_SCTP_CRC) #define ALWAYS_ON_FEATURES (ALWAYS_ON_OFFLOADS | NETIF_F_LLTX) @@ -842,7 +842,8 @@ static struct lock_class_key macvlan_netdev_addr_lock_key; (NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | \ NETIF_F_GSO | NETIF_F_TSO | NETIF_F_LRO | \ NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_GRO | NETIF_F_RXCSUM | \ - NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER) + NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_STAG_FILTER | \ + NETIF_F_SCTP_CRC) #define MACVLAN_STATE_MASK \ ((1<<__LINK_STATE_NOCARRIER) | (1<<__LINK_STATE_DORMANT)) diff --git a/drivers/net/tap.c b/drivers/net/tap.c index 9b6cb78..2c8512b 100644 --- a/drivers/net/tap.c +++ b/drivers/net/tap.c @@ -369,8 +369,7 @@ rx_handler_result_t tap_handle_frame(struct sk_buff **pskb) * check, we either support them all or none. */ if (skb->ip_summed = CHECKSUM_PARTIAL && - !(features & NETIF_F_CSUM_MASK) && - skb_checksum_help(skb)) + skb_csum_hwoffload_help(skb, features)) goto drop; if (ptr_ring_produce(&q->ring, skb)) goto drop; @@ -945,6 +944,9 @@ static int set_offload(struct tap_queue *q, unsigned long arg) } } + if (arg & TUN_F_SCTP_CSUM) + feature_mask |= NETIF_F_SCTP_CRC; + /* tun/tap driver inverts the usage for TSO offloads, where * setting the TSO bit means that the userspace wants to * accept TSO frames and turning it off means that user space @@ -1077,7 +1079,7 @@ static long tap_ioctl(struct file *file, unsigned int cmd, case TUNSETOFFLOAD: /* let the user check for future flags */ if (arg & ~(TUN_F_CSUM | TUN_F_TSO4 | TUN_F_TSO6 | - TUN_F_TSO_ECN | TUN_F_UFO)) + TUN_F_TSO_ECN | TUN_F_UFO | TUN_F_SCTP_CSUM)) return -EINVAL; rtnl_lock(); -- 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 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 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-6-vyasevic@redhat.com \ --to=vyasevich@gmail.com \ --cc=jasowang@redhat.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 \ --cc=vyasevic@redhat.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: linkBe 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.