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
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to