[iproute PATCH 0/3] improve MACsec support

2016-07-26 Thread Davide Caratti
parsing of 'cipher' and 'icvlen' arguments has been improved; while at it, a couple of missing printouts have been added to usage() functions in "ip addr help" and "ip link help". Finally, some errors in the man pages have been fixed. Signed-off-by: Davide Caratti <dcara

[iproute PATCH 1/3] man: macsec: fix macsec related typos

2016-07-26 Thread Davide Caratti
Signed-off-by: Davide Caratti <dcara...@redhat.com> --- man/man8/ip-link.8.in | 8 man/man8/ip-macsec.8 | 11 --- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index 2cd6133..c91ef95 100644 --- a/man/man8/ip-

[iproute PATCH 3/3] macsec: cipher and icvlen can be set separately

2016-07-26 Thread Davide Caratti
since kernel driver has valid default values for 'cipher' and 'icvlen', there is no need for requiring users to specify both of them when a new link is added. Also, prompt an error message and exit with appropriate exit status in case of unsupported cipher suite. Signed-off-by: Davide Caratti

[iproute PATCH 2/3] ip {link,address}: add 'macsec' item to TYPE list

2016-07-26 Thread Davide Caratti
fix output of "ip address help" and "ip link help". Update TYPE list in man pages ip-address.8 and ip-link.8 as well. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- ip/ipaddress.c | 2 +- ip/iplink.c | 2 +- man/man8/ip-address.8.in |

[iproute PATCH] ip-macsec.8: fix typo in 'examples' section

2016-07-12 Thread Davide Caratti
fix wrong 'device' keyword in 'ip link add device eth0' Signed-off-by: Davide Caratti <dcara...@redhat.com> --- man/man8/ip-macsec.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/ip-macsec.8 b/man/man8/ip-macsec.8 index e8455d7..03ed700 100644 --- a/man/m

Re: [iproute PATCH v2] ip-macsec.8: fix typo in 'examples' section

2016-07-14 Thread Davide Caratti
On Tue, 2016-07-12 at 17:28 +0200, Davide Caratti wrote: > fix wrong 'device' keyword in 'ip link add device eth0' > > changes since v1: > while at it, add missing description of 'validate' keyword and remove > spurious bracket near 'encrypt' keyword. Also, wrong 'es' and 'encod

[iproute PATCH v2] ip-macsec.8: fix typo in 'examples' section

2016-07-12 Thread Davide Caratti
fix wrong 'device' keyword in 'ip link add device eth0' changes since v1: while at it, add missing description of 'validate' keyword and remove spurious bracket near 'encrypt' keyword. Also, wrong 'es' and 'encoding' keywords in MACsec section of ip-link.8 have been fixed. Signed-off-by: Davide

[PATCH net 0/3] macsec: fix configurable ICV length

2016-07-22 Thread Davide Caratti
to avoid creation of macsec interfaces having user-provided ICV length values that are not supported by the cipher suite. Signed-off-by: Davide Caratti <dcara...@redhat.com> Davide Caratti (3): macsec: limit ICV length to 16 octets macsec: fix error codes when a SA is created macsec: valida

[PATCH net 2/3] macsec: fix error codes when a SA is created

2016-07-22 Thread Davide Caratti
preserve the return value of AEAD functions that are called when a SA is created, to avoid inappropriate display of "RTNETLINK answers: Cannot allocate memory" message. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/n

[PATCH net 3/3] macsec: validate ICV length on link creation

2016-07-22 Thread Davide Caratti
by unsupported user-provided values of the ICV length. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/macsec.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/macsec.c b/drivers/net/macsec.c index 6d45ba6..5441517 100644 --- a/drive

[PATCH net 1/3] macsec: limit ICV length to 16 octets

2016-07-22 Thread Davide Caratti
for backwards compatibility with userspace programs. Fixes: dece8d2b78d1 ("uapi: add MACsec bits") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/macsec.c | 4 ++-- include/uapi/linux/if_macsec.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletion

Re: [RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-02-02 Thread Davide Caratti
hello Tom and David, thank you for the attention. > From: Tom Herbert > > > > Sent: 23 January 2017 21:00 > .. > > > > skb_checksum_help is specific to the Internet checksum. For instance, > > CHECKSUM_COMPLETE can _only_ refer to Internet checksum calculation > > nothing else will work.

[RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-01-23 Thread Davide Caratti
skb_checksum_help is designed to compute the Internet Checksum only. To avoid duplicating code when other checksumming algorithms (e.g. crc32c) are used, separate common part from RFC1624-specific part. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide C

[RFC PATCH net-next 0/5] net: improve support for SCTP checksums

2017-01-23 Thread Davide Caratti
and patch 3] - skb_csum_hwoffload_help, called by validate xmit skb to perform SW checksumming using the correct algorithm based on the value of IP protocol number and netdev features bitmask [patch 4] - an update to Linux documentation [patch 5] Davide Caratti (5): skbuff: add stub to help

[RFC PATCH net-next 4/5] net: more accurate checksumming in validate_xmit_skb

2017-01-23 Thread Davide Caratti
and on presence of IPPROTO_SCTP as protocol number in IPv4/IPv6 header. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/core/dev.c | 52 ++-- 1 file changed, 50 inse

[RFC PATCH net-next 1/5] skbuff: add stub to help computing crc32c on SCTP packets

2017-01-23 Thread Davide Caratti
libcrc32c) has been loaded. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 20 net/sctp/offload.c | 7 +++ 3 files changed, 2

[RFC PATCH net-next 5/5] Documentation: add description of skb_sctp_csum_help

2017-01-23 Thread Davide Caratti
y: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- Documentation/networking/checksum-offloads.txt | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Documentation/networking/checksum-offloads.txt b/Do

[RFC PATCH net-next 3/5] net: introduce skb_sctp_csum_help

2017-01-23 Thread Davide Caratti
to compute crc32c without sctp.ko Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 3 ++- net/core/dev.c| 29 + 3 f

[PATCH iproute2 net-next] tc: m_csum: add support for SCTP checksum

2017-01-19 Thread Davide Caratti
'sctp' parameter can now be used as 'csum' target to enable CRC32c computation on SCTP packets. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- tc/m_csum.c | 11 --- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tc/m_csum.c b/tc/m_csum.c index d5b1af6..0

[PATCH iproute2 net-next v2] tc: m_csum: add support for SCTP checksum

2017-01-20 Thread Davide Caratti
'sctp' parameter can now be used as 'csum' target to enable CRC32c computation on SCTP packets. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- Notes: V2 - update man/man8/tc-csum.8 to include 'sctp' target man/man8/tc-csum.8 | 7 +-- tc/m_csum.c| 11

[PATCH RFC net-next v2 4/4] Documentation: update notes on checksum offloading

2017-02-28 Thread Davide Caratti
quot;net: Add driver helper functions to determine checksum""), and add missing explaination of CHECKSUM_UNNECESSARY for FCOE protocol. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- Documentation/networking/checksum-offloads.txt | 7 --- include/linux/skbuff.h

[PATCH RFC net-next v2 3/4] net: more accurate checksumming in validate_xmit_skb

2017-02-28 Thread Davide Caratti
oad). Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h| 1 + net/core/dev.c| 14 -- net/netfilter/ipvs/ip_vs_proto_sctp.c | 1 + net/netfilter/nf_nat_proto_sctp.c | 1 + net/sched/act_csum.c

[PATCH RFC net-next v2 2/4] net: introduce skb_sctp_csum_help

2017-02-28 Thread Davide Caratti
to compute crc32c without sctp.ko Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 3 ++- net/core/dev.c| 40 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/i

[PATCH RFC net-next v2 1/4] skbuff: add stub to help computing crc32c on SCTP packets

2017-02-28 Thread Davide Caratti
libcrc32c) has been loaded. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 20 net/sctp/offload.c | 7 +++ 3 files changed, 2

Re: [RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-02-28 Thread Davide Caratti
On Mon, 2017-02-27 at 07:11 -0800, Tom Herbert wrote: > CHECKSUM_PARTIAL is the preferred mechanism on the transmit path this > defers defers the checksum computation as long as possible. > Unfortunately, if SCTP is encapsulated in UDP we will probably need to > run the SCTP CRC on the host which

Re: [RFC PATCH net-next 2/5] net: split skb_checksum_help

2017-02-27 Thread Davide Caratti
vid, after some (thinking + testing) time, I'm going to re-post this RFC as v2 with some feedbacks. Thank you in advance for looking at it! On Thu, 2017-02-02 at 10:08 -0800, Tom Herbert wrote: > On Thu, 2017-02-02 at 16:07 +0100, Davide Caratti wrote: > > This is exactly the cause

[iproute PATCH 2/3] man: ip.8: add missing 'macsec' item to OBJECT list

2016-08-30 Thread Davide Caratti
Signed-off-by: Davide Caratti <dcara...@redhat.com> --- man/man8/ip.8 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/man/man8/ip.8 b/man/man8/ip.8 index f11fc0b..8ecb199 100644 --- a/man/man8/ip.8 +++ b/man/man8/ip.8 @@ -21,7 +21,8 @@ ip \- show / manipulate r

[iproute PATCH 3/3] macsec: fix byte ordering on input/display of 'sci'

2016-08-30 Thread Davide Caratti
use get_be64() in place of get_u64() when parsing input 'sci' parameter, so that 'sci' can be entered using network byte order regardless the endianness of target system; use ntohll() when printing out 'sci'. While at it, improve documentation of 'sci' in ip-link.8. Signed-off-by: Davide Caratti

[iproute PATCH 1/3] macsec: fix input of 'port', improve documentation of 'address'

2016-08-30 Thread Davide Caratti
() functions as well. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- ip/ipmacsec.c | 6 +++--- man/man8/ip-link.8.in | 14 +++--- man/man8/ip-macsec.8 | 12 +--- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ip/ipmacsec.c b/ip/ipmacsec.c index 6

[iproute PATCH 0/3] macsec: fix input of 'sci' and 'port'

2016-08-30 Thread Davide Caratti
-by: Davide Caratti <dcara...@redhat.com> Davide Caratti (3): macsec: fix input of 'port', improve documentation of 'address' man: ip.8: add missing 'macsec' item to OBJECT list macsec: fix byte ordering on input/display of 'sci' ip/ipmacsec.c | 14 +++--- man/man8/ip-

[PATCH net] bridge: re-introduce 'fix parsing of MLDv2 reports'

2016-08-31 Thread Davide Caratti
ing of MLDv2 reports stops when the first group is successfully added to the MDB cache. Fixes: bc8c20acaea1 ("bridge: multicast: treat igmpv3 report with INCLUDE and no sources as a leave") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/bridge/br_multicast.c | 2 +

[iproute PATCH] macsec: fix input range of 'icvlen' parameter

2016-09-09 Thread Davide Caratti
the maximum possible ICV length in a MACsec frame is 16 octects, not 32: fix get_icvlen() accordingly, so that a proper error message is displayed in case input 'icvlen' is greater than 16. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- ip/ipmacsec.c | 4 ++-- 1 file chan

[iproute PATCH] tc: don't accept qdisc 'handle' greater than ffff

2016-09-16 Thread Davide Caratti
since get_qdisc_handle() truncates the input value to 16 bit, return an error and prompt "invalid qdisc ID" in case input 'handle' parameter needs more than 16 bit to be stored. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- tc/tc_util.c | 2 +- 1 file changed, 1

[PATCH net-next v2 0/2] net/sched: act_csum: add support for SCTP checksum

2017-01-09 Thread Davide Caratti
in tc_csum.h - avoid nested if statement in act_csum.c Davide Caratti (2): net/sched: Kconfig: select LIBCRC32C if NET_ACT_CSUM is selected net/sched: act_csum: compute crc32c on SCTP packets include/uapi/linux/tc_act/tc_csum.h | 3 ++- net/sched/Kconfig | 1 + net/sched

[PATCH net-next v2 2/2] net/sched: act_csum: compute crc32c on SCTP packets

2017-01-09 Thread Davide Caratti
modify act_csum to compute crc32c on IPv4/IPv6 packets having SCTP in their payload, and extend UAPI definitions accordingly. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/uapi/linux/tc_act/tc_csum.h | 3 ++- net/sched/act_csum.c

[PATCH net-next v2 1/2] net/sched: Kconfig: select LIBCRC32C if NET_ACT_CSUM is selected

2017-01-09 Thread Davide Caratti
LIBCRC32C is needed to compute crc32c on SCTP packets. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/Kconfig b/net/sched/Kconfig index 87956a7..a9aa38d 100644 --- a/net/sched/Kconfig +++ b/net/sched/K

Re: [PATCH net-next 2/2] net/sched: act_csum: compute crc32c on SCTP packets

2017-01-08 Thread Davide Caratti
On Fri, 2017-01-06 at 10:23 +0100, Nicolas Dichtel wrote: > Le 05/01/2017 à 17:59, Davide Caratti a écrit : > > @@ -21,7 +21,8 @@ enum { > >   TCA_CSUM_UPDATE_FLAG_IGMP= 4, > >   TCA_CSUM_UPDATE_FLAG_TCP = 8, > >   TCA_CS

[PATCH net-next 0/2] net/sched: act_csum: add support for SCTP checksum

2017-01-05 Thread Davide Caratti
This series extends current act_csum functionality to allow computation of SCTP checksums. Patch 1 ensures LIBCRC32C will be selected if NET_ACT_CSUM is selected. Patch 2 extends act_csum to handle IPPROTO_SCTP protocol in IPv4/IPv6 header, and eventually compute the CRC32c value. Davide Caratti

[PATCH net-next 1/2] net/sched: Kconfig: select LIBCRC32C if NET_ACT_CSUM is selected

2017-01-05 Thread Davide Caratti
LIBCRC32C is needed to compute crc32c on SCTP packets. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/net/sched/Kconfig b/net/sched/Kconfig index 87956a7..a9aa38d 100644 --- a/net/sched/Kconfig +++ b/net/sched/K

[PATCH net-next 2/2] net/sched: act_csum: compute crc32c on SCTP packets

2017-01-05 Thread Davide Caratti
modify act_csum to compute crc32c on IPv4/IPv6 packets having SCTP in their payload, and extend UAPI definitions accordingly. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/uapi/linux/tc_act/tc_csum.h | 3 ++- net/sched/act_csum.c

[PATCH net-next] sched: act_csum: don't mangle TCP and UDP GSO packets

2017-03-23 Thread Davide Caratti
0/0x20 Since GSO is able to compute checksum on individual segments of such skbs, we can simply skip mangling the packet. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_csum.c | 12 1 file changed, 12 insertions(+) diff --git a/net/sched/act_csum.c

Re: [PATCH RFC net-next v2 1/4] skbuff: add stub to help computing crc32c on SCTP packets

2017-03-18 Thread Davide Caratti
hello Alexander and Tom, On Tue, 2017-03-07 at 10:06 -0800, Alexander Duyck wrote: > > You might even take this one step > further. You could convert crc32_csum into a 1 bit enum for now. > Basically you would use 0 for 1's compliement csum, and 1 to represent > a crc32c csum. Then if we end

Re: Documentation error for checksum offload check ?

2017-04-07 Thread Davide Caratti
On Fri, 2017-04-07 at 10:23 +1000, Benjamin Herrenschmidt wrote: > I noticed in both Documentation/networking/checksum-offload.txt > and include/linux/skbuff.h reference to helpers > > skb_csum_off_chk* > c > Now, I can't find anything like that with grep ... :-) > > Am I missing something ? >

Re: [PATCH RFC net-next v3 4/7] net: use skb->csum_algo to identify packets needing crc32c

2017-04-13 Thread Davide Caratti
d leaves unmodified behavior of offloaded FCoE frames: please let me know if you disagree on that. On Fri, 2017-04-07 at 08:43 -0700, Tom Herbert wrote: > On Fri, Apr 7, 2017 at 10:29 AM, Davide Caratti <dcara...@redhat.com> wrote: > > In my understanding, csum_algo needs to

[PATCH RFC net-next v4 0/7] net: improve support for SCTP checksums

2017-04-20 Thread Davide Caratti
(i.e. skb->ip_summed transitions from CHECKSUM_PARTIAL to CHECKSUM_NONE). Any feedbacks are appreciated! thank you in advance, -- davide Davide Caratti (7): skbuff: add stub to help computing crc32c on SCTP packets net: introduce skb_crc32c_csum_help sk_buff: remove support for csum_bad

[PATCH RFC net-next v4 2/7] net: introduce skb_crc32c_csum_help

2017-04-20 Thread Davide Caratti
: warn_crc32c_csum_update: attempt to compute crc32c without libcrc32c.ko warn_crc32c_csum_combine: attempt to compute crc32c without libcrc32c.ko Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 3 ++- net/core/dev.c

[PATCH RFC net-next v4 1/7] skbuff: add stub to help computing crc32c on SCTP packets

2017-04-20 Thread Davide Caratti
libcrc32c) has been loaded. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 24 net/sctp/offload.c | 7 +++ 3 files

[PATCH RFC net-next v4 4/7] net: use skb->csum_not_inet to identify packets needing crc32c

2017-04-20 Thread Davide Caratti
otherwise, assume Internet Checksum is needed and thus set skb->csum_not_inet to 0. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 16 +--- net/core/dev.c | 1 + net/sched/act_c

[PATCH RFC net-next v4 5/7] net: more accurate checksumming in validate_xmit_skb()

2017-04-20 Thread Davide Caratti
ion of non-GSO SCTP packets having skb->ip_summed equal to CHECKSUM_PARTIAL. While at it, remove references to skb_csum_off_chk* functions, since they are not present anymore in Linux since commit cf53b1da73bd ('Revert "net: Add driver helper functions to determine checksum"'). Signe

[PATCH RFC net-next v4 7/7] sk_buff.h: improve description of CHECKSUM_{COMPLETE,UNNECESSARY}

2017-04-20 Thread Davide Caratti
Add FCoE to the list of protocols that can set CHECKSUM_UNNECESSARY; add a note to CHECKSUM_COMPLETE section to specify that it does not apply to SCTP and FCoE protocols. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- i

[PATCH RFC net-next v4 6/7] openvswitch: more accurate checksumming in queue_userspace_packet()

2017-04-20 Thread Davide Caratti
if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/openvswitch/data

[PATCH RFC net-next v4 3/7] sk_buff: remove support for csum_bad in sk_buff

2017-04-20 Thread Davide Caratti
v_gro_receive() is now done before the test on same_flow, to preserve behavior in case of wrong checksum. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 2 +-

Re: [PATCH RFC net-next v2 1/4] skbuff: add stub to help computing crc32c on SCTP packets

2017-03-06 Thread Davide Caratti
On Tue, 2017-02-28 at 14:46 -0800, Alexander Duyck wrote: > On Tue, Feb 28, 2017 at 2:32 AM, Davide Caratti <dcara...@redhat.com> wrote: > > > > sctp_compute_checksum requires crc32c symbol (provided by libcrc32c), so > > it can't be used in net core. Like it has been

[PATCH RFC net-next v3 6/7] openvswitch: more accurate checksumming in queue_userspace_packet()

2017-04-07 Thread Davide Caratti
if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/openvswitch/data

[PATCH RFC net-next v3 5/7] net: more accurate checksumming in validate_xmit_skb()

2017-04-07 Thread Davide Caratti
non-GSO SCTP packets having skb->ip_summed equal to CHECKSUM_PARTIAL. While at it, remove references to skb_csum_off_chk* functions, since they are not present anymore in Linux since commit cf53b1da73bd ('Revert "net: Add driver helper functions to determine checksum"'). Signed-off-by

[PATCH RFC net-next v3 7/7] sk_buff.h: improve description of CHECKSUM_{COMPLETE,UNNECESSARY}

2017-04-07 Thread Davide Caratti
Add FCoE to the list of protocols that can set CHECKSUM_UNNECESSARY; add a note to CHECKSUM_COMPLETE section to specify that it does not apply to SCTP and FCoE protocols. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- i

[PATCH RFC net-next v3 3/7] sk_buff: remove support for csum_bad in sk_buff

2017-04-07 Thread Davide Caratti
v_gro_receive() is now done before the test on same_flow, to preserve behavior in case of wrong checksum. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 2 +-

[PATCH RFC net-next v3 4/7] net: use skb->csum_algo to identify packets needing crc32c

2017-04-07 Thread Davide Caratti
M. In any other case, skb->csum_algo is set to INTERNET_CHECKSUM. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h| 28 net/core/dev.c

Re: [PATCH RFC net-next v3 4/7] net: use skb->csum_algo to identify packets needing crc32c

2017-04-07 Thread Davide Caratti
hello Tom, On Fri, 2017-04-07 at 08:43 -0700, Tom Herbert wrote: > On Fri, Apr 7, 2017 at 7:16 AM, Davide Caratti <dcara...@redhat.com> wrote: > > @@ -742,8 +744,10 @@ struct sk_buff { > > __u8csum_valid:1; > > __u8

[PATCH RFC net-next v3 2/7] net: introduce skb_crc32c_csum_help

2017-04-07 Thread Davide Caratti
: warn_crc32c_csum_update: attempt to compute crc32c without libcrc32c.ko warn_crc32c_csum_combine: attempt to compute crc32c without libcrc32c.ko Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 3 ++- net/core/dev.c

[PATCH RFC net-next v3 1/7] skbuff: add stub to help computing crc32c on SCTP packets

2017-04-07 Thread Davide Caratti
libcrc32c) has been loaded. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 24 net/sctp/offload.c | 7 +++ 3 files

[PATCH RFC net-next v3 0/7] improve CRC32c in the forwarding path

2017-04-07 Thread Davide Caratti
On Tue, 2017-03-07 at 10:06 -0800, Alexander Duyck wrote: > You might even take this one step > further. You could convert crc32_csum into a 1 bit enum for now. > Basically you would use 0 for 1's compliement csum, and 1 to represent > a crc32c csum. Then if we end up having to add another bit

[PATCH net v2] net/mlx4_en: don't set CHECKSUM_COMPLETE on SCTP packets

2017-08-03 Thread Davide Caratti
: don't test MLX4_CQE_STATUS_IPV6 if MLX4_CQE_STATUS_IPV4 is set Reported-by: Shuang Li <shu...@redhat.com> Fixes: f8c6455bb04b ("net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/ethernet/mell

[PATCH net] tcp: fix access to sk->sk_state in tcp_poll()

2017-04-26 Thread Davide Caratti
uot;). Fixes: 19f6d3f3c842 ("net/tcp-fastopen: Add new API support") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/ipv4/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 40ba424..2dc7fcf 100644 --- a/net/ip

Re: [PATCH net v2] net/mlx4_en: don't set CHECKSUM_COMPLETE on SCTP packets

2017-08-08 Thread Davide Caratti
On Tue, 2017-08-08 at 18:07 +0300, Saeed Mahameed wrote: > >   { > > __u16 length_for_csum = 0; > > __wsum csum_pseudo_header = 0; > > +   __u8 ipproto = iph->protocol; > > + > > +   if (unlikely(ipproto == IPPROTO_SCTP)) > > +   return -1; > > > > Hi Davide

[PATCH net-next v2 0/7] fix CRC32c in the forwarding path

2017-05-16 Thread Davide Caratti
d computing CRC32c on the error path. - patch 3/7: don't invert tests on the values of same_flow and NAPI_GRO_CB(skb)->flush in dev_gro_receive(), it's useless and it breaks GRO functionality as reported by kernel test robot. Davide Caratti (7): skbuff: add stub to help computing crc32c on SCTP pac

[PATCH net-next v2 3/7] sk_buff: remove support for csum_bad in sk_buff

2017-05-16 Thread Davide Caratti
m> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 2 +- include/linux/netdevice.h| 4 +--- include/linux/skbuff.h | 23 ++- net/bridge/netfilter/nft_reject

[PATCH net-next v2 1/7] skbuff: add stub to help computing crc32c on SCTP packets

2017-05-16 Thread Davide Caratti
libcrc32c) has been loaded. Reviewed-by: Marcelo Ricardo Leitner <marcelo.leit...@gmail.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 24 net/sctp/offload.c | 7 +++ 3 files

[PATCH net-next v2 6/7] openvswitch: more accurate checksumming in queue_userspace_packet()

2017-05-16 Thread Davide Caratti
if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/openvswitch/data

[PATCH net-next v2 2/7] net: introduce skb_crc32c_csum_help

2017-05-16 Thread Davide Caratti
: warn_crc32c_csum_update: attempt to compute crc32c without libcrc32c.ko warn_crc32c_csum_combine: attempt to compute crc32c without libcrc32c.ko Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 3 ++- net/core/dev.c

[PATCH net-next v2 5/7] net: more accurate checksumming in validate_xmit_skb()

2017-05-16 Thread Davide Caratti
""). Signed-off-by: Davide Caratti <dcara...@redhat.com> --- Documentation/networking/checksum-offloads.txt | 11 +++ include/linux/netdevice.h | 3 +++ include/linux/skbuff.h | 13 + net/core/dev.c

[PATCH net-next v2 4/7] net: use skb->csum_not_inet to identify packets needing crc32c

2017-05-16 Thread Davide Caratti
otherwise, assume Internet Checksum is needed and thus set skb->csum_not_inet to 0. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> Acked-by: Tom Herbert <t...@herbertland.com> --- include/linux/skbuff.h | 16 +--

[PATCH net-next v2 7/7] sk_buff.h: improve description of CHECKSUM_{COMPLETE,UNNECESSARY}

2017-05-16 Thread Davide Caratti
Add FCoE to the list of protocols that can set CHECKSUM_UNNECESSARY; add a note to CHECKSUM_COMPLETE section to specify that it does not apply to SCTP and FCoE protocols. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> Acked-by: To

Re: [PATCH net-next] net/mlx4_en: don't set CHECKSUM_COMPLETE on SCTP packets

2017-06-19 Thread Davide Caratti
hello Tariq, On Sun, 2017-06-18 at 14:10 +0300, Tariq Toukan wrote: > > @@ -624,12 +632,13 @@ static int check_csum(struct mlx4_cqe *cqe, struct > > sk_buff *skb, void *va, > >    hdr += sizeof(struct vlan_hdr); > >    } > >    > > - if (cqe->status &

[PATCH net-next v3 0/7] fix CRC32c in the forwarding path

2017-05-18 Thread Davide Caratti
reported by kernel test robot. Davide Caratti (7): skbuff: add stub to help computing crc32c on SCTP packets net: introduce skb_crc32c_csum_help sk_buff: remove support for csum_bad in sk_buff net: use skb->csum_not_inet to identify packets needing crc32c net: more accurate checksumming in

[PATCH net] sctp: fix ICMP processing if skb is non-linear

2017-05-19 Thread Davide Caratti
correctly, also when skbs are non-linear. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/net/sctp/sctp.h | 2 +- net/sctp/input.c| 29 +++-- net/sctp/ipv6.c | 2 +- 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/i

[PATCH net-next v3 7/7] sk_buff.h: improve description of CHECKSUM_{COMPLETE,UNNECESSARY}

2017-05-18 Thread Davide Caratti
Add FCoE to the list of protocols that can set CHECKSUM_UNNECESSARY; add a note to CHECKSUM_COMPLETE section to specify that it does not apply to SCTP and FCoE protocols. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> Acked-by: To

[PATCH net-next v3 3/7] sk_buff: remove support for csum_bad in sk_buff

2017-05-18 Thread Davide Caratti
m> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/ethernet/aquantia/atlantic/aq_ring.c | 2 +- include/linux/netdevice.h| 4 +--- include/linux/skbuff.h | 23 ++- net/bridge/netfilter/nft_reject

[PATCH net-next v3 4/7] net: use skb->csum_not_inet to identify packets needing crc32c

2017-05-18 Thread Davide Caratti
otherwise, assume Internet Checksum is needed and thus set skb->csum_not_inet to 0. Suggested-by: Tom Herbert <t...@herbertland.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> Acked-by: Tom Herbert <t...@herbertland.com> --- include/linux/skbuff.h | 16 +--

[PATCH net-next v3 5/7] net: more accurate checksumming in validate_xmit_skb()

2017-05-18 Thread Davide Caratti
""). Signed-off-by: Davide Caratti <dcara...@redhat.com> --- Documentation/networking/checksum-offloads.txt | 11 +++ include/linux/netdevice.h | 3 +++ include/linux/skbuff.h | 13 + net/core/dev.c

[PATCH net-next v3 2/7] net: introduce skb_crc32c_csum_help

2017-05-18 Thread Davide Caratti
: warn_crc32c_csum_update: attempt to compute crc32c without libcrc32c.ko warn_crc32c_csum_combine: attempt to compute crc32c without libcrc32c.ko Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/netdevice.h | 1 + include/linux/skbuff.h| 3 ++- net/core/dev.c

[PATCH net-next v3 6/7] openvswitch: more accurate checksumming in queue_userspace_packet()

2017-05-18 Thread Davide Caratti
if skb carries an SCTP packet and ip_summed is CHECKSUM_PARTIAL, it needs CRC32c in place of Internet Checksum: use skb_csum_hwoffload_help to avoid corrupting such packets while queueing them towards userspace. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/openvswitch/data

[PATCH net-next v3 1/7] skbuff: add stub to help computing crc32c on SCTP packets

2017-05-18 Thread Davide Caratti
libcrc32c) has been loaded. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- include/linux/skbuff.h | 2 ++ net/core/skbuff.c | 26 ++ net/sctp/offload.c | 6 ++ 3 files changed, 34 insertions(+) diff --git a/include/linux/skbuff.h b/include

Re: [PATCH net] sctp: fix ICMP processing if skb is non-linear

2017-05-22 Thread Davide Caratti
hello Xin Long, On Sat, 2017-05-20 at 02:40 +0800, Xin Long wrote: > On Fri, May 19, 2017 at 11:34 PM, Davide Caratti <dcara...@redhat.com> wrote: > > @@ -515,14 +515,23 @@ struct sock *sctp_err_lookup(struct net *net, int > > family, struct sk_buff *skb, > >

[PATCH net-next] net/mlx4_en: don't set CHECKSUM_COMPLETE on SCTP packets

2017-06-16 Thread Davide Caratti
. Reported-by: Shuang Li <shu...@redhat.com> Fixes: f8c6455bb04b ("net/mlx4_en: Extend checksum offloading by CHECKSUM COMPLETE") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 33 +++--- 1 file changed

[PATCH net v2] sctp: fix ICMP processing if skb is non-linear

2017-05-25 Thread Davide Caratti
are validated correctly. v2: - don't use skb_header_pointer() to read the transport header, since icmp_socket_deliver() already puts these 8 bytes in the linear area. - change commit message to make specific reference to INIT chunks. Signed-off-by: Davide Caratti <dcara...@redhat.com> --

[PATCH iproute2] tc: fix typo in tc-tcindex man page

2017-09-14 Thread Davide Caratti
fix mis-typed 'pass_on' keyword. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- man/man8/tc-tcindex.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/man8/tc-tcindex.8 b/man/man8/tc-tcindex.8 index 7fcf8254..9a4e5ffc 100644 --- a/man/man8/tc-tcindex.8 +++

[PATCH net] net/sched: cls_matchall: fix crash when used with classful qdisc

2017-09-16 Thread Davide Caratti
tps://bugzilla.redhat.com/show_bug.cgi?id=1460213 Reported-by: Jiri Benc <jb...@redhat.com> Fixes: b87f7936a932 ("net/sched: introduce Match-all classifier") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/cls_matchall.c | 1 + 1 file changed, 1 insertion(+

Re: [patch net-next 1/7] skbuff: Add the offload_mr_fwd_mark field

2017-09-29 Thread Davide Caratti
hello Jiri and Yotam, On Thu, 2017-09-28 at 19:34 +0200, Jiri Pirko wrote: > From: Yotam Gigi > > diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h > index 19e64bf..ada8214 100644 > --- a/include/linux/skbuff.h > +++ b/include/linux/skbuff.h > @@ -772,6 +772,7 @@

Re: [PATCH nf-next] netfilter: xt_CHECKSUM: avoid bad offload warnings on GSO packets

2017-08-24 Thread Davide Caratti
On Thu, 2017-08-24 at 13:07 +0200, Michal Kubecek wrote: > On Thu, Aug 24, 2017 at 12:51:18PM +0200, Florian Westphal wrote: > > Michal Kubecek wrote: > > > When --checksum_fill action is applied to a GSO packet, checksum_tg() > > > calls > > > skb_checksum_help() which is only

[PATCH net-next 0/2] net/sched: remove spinlock from 'csum' action

2017-12-13 Thread Davide Caratti
cs.net/lists/netdev/msg465862.html Davide Caratti (2): net/sched: act_csum: use per-core statistics net/sched: act_csum: don't use spinlock in the fast path net/sched/act_csum.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) -- 2.13.6

[PATCH net-next 2/2] net/sched: act_csum: don't use spinlock in the fast path

2017-12-13 Thread Davide Caratti
those values, to avoid lock contention among multiple readers. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_csum.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 22a555ba3985..ac8402d53cd5

[PATCH net-next 1/2] net/sched: act_csum: use per-core statistics

2017-12-13 Thread Davide Caratti
use per-CPU counters, like other TC actions do, instead of maintaining one set of stats across all cores. This allows updating act_csum stats without the need of protecting them using spin_{,un}lock_bh() invocations. Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_

[PATCH iproute2] tc: bash-completion: add missing 'classid' keyword

2017-12-12 Thread Davide Caratti
users of 'matchall' filter can specify a value for the class id: update bash-completion accordingly. Fixes: b32c0b64fa2b ("tc: bash-completion: Add support for matchall") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- bash-completion/tc | 2 +- 1 file changed, 1 insertio

[PATCH net] tc-testing: fix tdc tests for 'bpf' action

2018-05-09 Thread Davide Caratti
, causing false positive in case the BPF JIT is enabled Fixes: 440ea4ae1828 ("tc-testing: add selftests for 'bpf' action") Signed-off-by: Davide Caratti <dcara...@redhat.com> --- tools/testing/selftests/tc-testing/tc-tests/actions/bpf.json | 11 --- 1 file changed, 8 insertions

[PATCH net] net/sched: fix refcnt leak in the error path of tcf_vlan_init()

2018-05-16 Thread Davide Caratti
ing") CC: Roman Mashak <m...@mojatatu.com> Signed-off-by: Davide Caratti <dcara...@redhat.com> --- net/sched/act_vlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 853604685965..1fb39e1f9d07 100644 --- a/net/sched/act_v

Re: [PATCH 00/14] Modify action API for implementing lockless actions

2018-05-16 Thread Davide Caratti
On Wed, 2018-05-16 at 13:36 -0400, Roman Mashak wrote: > Vlad Buslov writes: > > > On Wed 16 May 2018 at 14:38, Roman Mashak wrote: > > > On Wed, May 16, 2018 at 2:43 AM, Vlad Buslov wrote: > > > > > > > > I'm trying to run tdc, but

[PATCH net-next] vrf: add CRC32c offload to device features

2018-05-24 Thread Davide Caratti
-- -m 10K the measured throughput in Mbit/s improved from 2395 ± 1% to 2720 ± 1%. [1] https://www.spinics.net/lists/netdev/msg486007.html Signed-off-by: Davide Caratti <dcara...@redhat.com> --- drivers/net/vrf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net

[PATCH net] net/sched: act_simple: fix parsing of TCA_DEFDATA

2018-06-07 Thread Davide Caratti
use nla_strlcpy() to avoid copying data beyond the length of TCA_DEFDATA netlink attribute, in case it is less than SIMP_MAX_DATA and it does not end with '\0' character. Fixes: 0eff683f737b ("net/sched: potential data corruption") Signed-off-by: Davide Caratti --- net/sched/act_sim

Re: WARNING in smc_unhash_sk

2018-06-11 Thread Davide Caratti
On Fri, 2018-06-08 at 09:53 +0200, Dmitry Vyukov wrote: > On Tue, Feb 27, 2018 at 1:23 PM, Davide Caratti wrote: > > On Fri, 2018-02-23 at 07:59 -0800, syzbot wrote: > > > Hello, > > > > > > syzbot hit the following crash on upstream commit > > >

  1   2   3   >