From owner-p4-projects@FreeBSD.ORG Fri May 27 12:40:07 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E49F106566C; Fri, 27 May 2011 12:40:07 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10A6A1065675 for ; Fri, 27 May 2011 12:40:07 +0000 (UTC) (envelope-from goda@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id D43828FC13 for ; Fri, 27 May 2011 12:40:06 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p4RCe6mE012876 for ; Fri, 27 May 2011 12:40:06 GMT (envelope-from goda@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p4RCe6MI012872 for perforce@freebsd.org; Fri, 27 May 2011 12:40:06 GMT (envelope-from goda@FreeBSD.org) Date: Fri, 27 May 2011 12:40:06 GMT Message-Id: <201105271240.p4RCe6MI012872@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to goda@FreeBSD.org using -f From: Kazuya Goda To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 193792 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 May 2011 12:40:07 -0000 http://p4web.freebsd.org/@@193792?ac=10 Change 193792 by goda@hassaku on 2011/05/27 12:39:23 Implements RPS. Affected files ... .. //depot/projects/soc2011/kgoda_rpsrfs/src/sys/amd64/conf/RPS#1 add .. //depot/projects/soc2011/kgoda_rpsrfs/src/sys/conf/options#2 edit .. //depot/projects/soc2011/kgoda_rpsrfs/src/sys/net/if_ethersubr.c#2 edit Differences ... ==== //depot/projects/soc2011/kgoda_rpsrfs/src/sys/conf/options#2 (text+ko) ==== @@ -424,6 +424,7 @@ RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h RSS opt_rss.h +RPS opt_rps.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading ==== //depot/projects/soc2011/kgoda_rpsrfs/src/sys/net/if_ethersubr.c#2 (text+ko) ==== @@ -30,6 +30,7 @@ * $FreeBSD: src/sys/net/if_ethersubr.c,v 1.282 2010/11/22 19:32:54 dim Exp $ */ + #include "opt_atalk.h" #include "opt_inet.h" #include "opt_inet6.h" @@ -37,6 +38,7 @@ #include "opt_netgraph.h" #include "opt_mbuf_profiling.h" #include "opt_rss.h" +#include "opt_rps.h" #include #include @@ -71,9 +73,12 @@ #include #include #include +#include #include #include #include +#include + #include #endif #ifdef INET6 @@ -902,6 +907,28 @@ case ETHERTYPE_IP: if ((m = ip_fastforward(m)) == NULL) return; + +#ifdef RPS + { + struct ip *ip = NULL; + struct tcphdr *th = NULL; + + if ( m->m_flags & M_FLOWID ) + goto not_rps; + + ip = mtod(m, struct ip *); + if( ip->ip_p != IPPROTO_TCP ) + goto not_rps; + + th = (struct tcphdr *)((caddr_t)ip + ( ip->ip_hl << 2 ) ); + + m->m_flags |= M_FLOWID; + m->m_pkthdr.flowid = rss_hash_ip4_4tuple(ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport); + + } + +not_rps: +#endif isr = NETISR_IP; break;