Author: mmacy
Date: Wed May 23 20:50:09 2018
New Revision: 334116
URL: https://svnweb.freebsd.org/changeset/base/334116

Log:
  udp: assign flowid to udp sockets round-robin
  
  On a 2x8x2 SKL this increases measured throughput with 64
  netperf -H $DUT -t UDP_STREAM -- -m 1
  
  from 590kpps to 1.1Mpps
  before:
  https://people.freebsd.org/~mmacy/2018.05.11/udpsender.svg
  after:
  https://people.freebsd.org/~mmacy/2018.05.11/udpsender2.svg

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c       Wed May 23 20:06:04 2018        
(r334115)
+++ head/sys/netinet/udp_usrreq.c       Wed May 23 20:50:09 2018        
(r334116)
@@ -1565,6 +1565,7 @@ udp_abort(struct socket *so)
 static int
 udp_attach(struct socket *so, int proto, struct thread *td)
 {
+       static uint32_t udp_flowid;
        struct inpcb *inp;
        struct inpcbinfo *pcbinfo;
        int error;
@@ -1585,6 +1586,8 @@ udp_attach(struct socket *so, int proto, struct thread
        inp = sotoinpcb(so);
        inp->inp_vflag |= INP_IPV4;
        inp->inp_ip_ttl = V_ip_defttl;
+       inp->inp_flowid = atomic_fetchadd_int(&udp_flowid, 1);
+       inp->inp_flowtype = M_HASHTYPE_OPAQUE;
 
        error = udp_newudpcb(inp);
        if (error) {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to