From owner-svn-src-stable-12@freebsd.org Thu Nov 7 12:58:16 2019 Return-Path: Delivered-To: svn-src-stable-12@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2EF891B3412; Thu, 7 Nov 2019 12:58:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4783Nm0FgHz4c2K; Thu, 7 Nov 2019 12:58:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFDF2E028; Thu, 7 Nov 2019 12:58:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xA7CwFRs071655; Thu, 7 Nov 2019 12:58:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xA7CwFRW071651; Thu, 7 Nov 2019 12:58:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201911071258.xA7CwFRW071651@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 7 Nov 2019 12:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r354438 - in stable/12/sys: amd64/conf netinet netinet6 sys X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/12/sys: amd64/conf netinet netinet6 sys X-SVN-Commit-Revision: 354438 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-12@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 12-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Nov 2019 12:58:16 -0000 Author: hselasky Date: Thu Nov 7 12:58:14 2019 New Revision: 354438 URL: https://svnweb.freebsd.org/changeset/base/354438 Log: Partial MFC of CSUM_SND_TAG flag from r348254. Add CSUM_SND_TAG flag and set this flag for outgoing ratelimited mbufs. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/12/sys/amd64/conf/GENERIC stable/12/sys/netinet/ip_output.c stable/12/sys/netinet6/ip6_output.c stable/12/sys/sys/mbuf.h Modified: stable/12/sys/amd64/conf/GENERIC ============================================================================== --- stable/12/sys/amd64/conf/GENERIC Thu Nov 7 11:50:53 2019 (r354437) +++ stable/12/sys/amd64/conf/GENERIC Thu Nov 7 12:58:14 2019 (r354438) @@ -366,3 +366,5 @@ device netmap # netmap(4) support options EVDEV_SUPPORT # evdev support in legacy drivers device evdev # input event device support device uinput # install /dev/uinput cdev + +options RATELIMIT Modified: stable/12/sys/netinet/ip_output.c ============================================================================== --- stable/12/sys/netinet/ip_output.c Thu Nov 7 11:50:53 2019 (r354437) +++ stable/12/sys/netinet/ip_output.c Thu Nov 7 12:58:14 2019 (r354438) @@ -653,6 +653,7 @@ sendit: in_pcboutput_txrtlmt(inp, ifp, m); /* stamp send tag on mbuf */ m->m_pkthdr.snd_tag = inp->inp_snd_tag; + m->m_pkthdr.csum_flags |= CSUM_SND_TAG; } else { m->m_pkthdr.snd_tag = NULL; } @@ -705,6 +706,7 @@ sendit: in_pcboutput_txrtlmt(inp, ifp, m); /* stamp send tag on mbuf */ m->m_pkthdr.snd_tag = inp->inp_snd_tag; + m->m_pkthdr.csum_flags |= CSUM_SND_TAG; } else { m->m_pkthdr.snd_tag = NULL; } Modified: stable/12/sys/netinet6/ip6_output.c ============================================================================== --- stable/12/sys/netinet6/ip6_output.c Thu Nov 7 11:50:53 2019 (r354437) +++ stable/12/sys/netinet6/ip6_output.c Thu Nov 7 12:58:14 2019 (r354438) @@ -966,6 +966,7 @@ passout: in_pcboutput_txrtlmt(inp, ifp, m); /* stamp send tag on mbuf */ m->m_pkthdr.snd_tag = inp->inp_snd_tag; + m->m_pkthdr.csum_flags |= CSUM_SND_TAG; } else { m->m_pkthdr.snd_tag = NULL; } @@ -1081,6 +1082,7 @@ sendorfree: in_pcboutput_txrtlmt(inp, ifp, m); /* stamp send tag on mbuf */ m->m_pkthdr.snd_tag = inp->inp_snd_tag; + m->m_pkthdr.csum_flags |= CSUM_SND_TAG; } else { m->m_pkthdr.snd_tag = NULL; } Modified: stable/12/sys/sys/mbuf.h ============================================================================== --- stable/12/sys/sys/mbuf.h Thu Nov 7 11:50:53 2019 (r354437) +++ stable/12/sys/sys/mbuf.h Thu Nov 7 12:58:14 2019 (r354438) @@ -519,6 +519,8 @@ struct mbuf { #define CSUM_L5_VALID 0x20000000 /* checksum is correct */ #define CSUM_COALESCED 0x40000000 /* contains merged segments */ +#define CSUM_SND_TAG 0x80000000 /* Packet header has send tag */ + /* * CSUM flag description for use with printf(9) %b identifier. */ @@ -528,7 +530,7 @@ struct mbuf { "\12CSUM_IP6_UDP\13CSUM_IP6_TCP\14CSUM_IP6_SCTP\15CSUM_IP6_TSO" \ "\16CSUM_IP6_ISCSI" \ "\31CSUM_L3_CALC\32CSUM_L3_VALID\33CSUM_L4_CALC\34CSUM_L4_VALID" \ - "\35CSUM_L5_CALC\36CSUM_L5_VALID\37CSUM_COALESCED" + "\35CSUM_L5_CALC\36CSUM_L5_VALID\37CSUM_COALESCED\40CSUM_SND_TAG" /* CSUM flags compatibility mappings. */ #define CSUM_IP_CHECKED CSUM_L3_CALC