PERFORCE change 196403 for review

[ Available lists | Index of p4-projects | Month of Jul 2011 | Week of 19 Jul 2011 | Raw email | View thread | Wrap long lines | Reply | Tag ]
From
Takuya ASADA <syuu@FreeBSD.org>
Date
19 Jul 2011 13:55:08
Subject
PERFORCE change 196403 for review
Message-ID
201107191355.p6JDt7fg099822@skunkworks.freebsd.org


[ Hide this part ]
http://p4web.freebsd.org/@@196403?ac=10

Change 196403 by syuu@kikurage on 2011/07/19 13:55:06

skip genarating flowid on multiqueue if.

Affected files ...

.. //depot/projects/soc2011/mq_bpf/src/sys/net/bpf.h#7 edit
.. //depot/projects/soc2011/mq_bpf/src/sys/netinet/in_rss.c#6 edit

Differences ...

==== //depot/projects/soc2011/mq_bpf/src/sys/net/bpf.h#7 (text+ko) ====

@@ -41,7 +41,6 @@
#define _NET_BPF_H_

#include <sys/lock.h>
-#include <sys/rmlock.h>

/* BSD style release date */
#define BPF_RELEASE 199606
@@ -1113,7 +1112,7 @@
u_int bif_dlt; /* link layer type */
u_int bif_hdrlen; /* length of link header */
struct ifnet *bif_ifp; /* corresponding interface */
- struct rmlock bif_lock; /* rmlock for interface */
+ struct mtx bif_lock; /* rmlock for interface */
};

void bpf_bufheld(struct bpf_d *d);

==== //depot/projects/soc2011/mq_bpf/src/sys/netinet/in_rss.c#6 (text+ko) ====

@@ -60,6 +60,8 @@
#include <netinet/udp_var.h>
#endif

+#include <sys/syslog.h>
+
/*-
* Operating system parts of receiver-side scaling (RSS), which allows
* network cards to direct flows to particular receive queues based on hashes
@@ -420,10 +422,17 @@
struct mbuf *
rss_m2cpuid(struct mbuf *m, uintptr_t source, u_int *cpuid)
{
+#ifdef SOFTRSS
+ int softrss_pkt = 0;
+#endif
+
M_ASSERTPKTHDR(m);

#ifdef SOFTRSS
- softrss_set_flowid(m);
+ if (!(m->m_flags & M_FLOWID)) {
+ softrss_pkt = 1;
+ softrss_set_flowid(m);
+ }
#endif

switch (M_HASHTYPE_GET(m)) {
@@ -431,16 +440,20 @@
case M_HASHTYPE_RSS_TCP_IPV4:
*cpuid = rss_getcpu(rss_getbucket(m->m_pkthdr.flowid));
#ifdef SOFTRSS
- m->m_pkthdr.rxqueue = *cpuid;
- m->m_pkthdr.txqueue = (uint32_t)-1;
+ if (softrss_pkt) {
+ m->m_pkthdr.rxqueue = *cpuid;
+ m->m_pkthdr.txqueue = (uint32_t)-1;
+ }
#endif
return (m);

default:
*cpuid = NETISR_CPUID_NONE;
#ifdef SOFTRSS
- m->m_pkthdr.rxqueue = curcpu;
- m->m_pkthdr.txqueue = (uint32_t)-1;
+ if (softrss_pkt) {
+ m->m_pkthdr.rxqueue = curcpu;
+ m->m_pkthdr.txqueue = (uint32_t)-1;
+ }
#endif
return (m);
}

Elapsed time: 0.073 seconds