Date: Mon, 4 Jul 2011 17:18:05 GMT From: Takuya ASADA <syuu@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 195722 for review Message-ID: <201107041718.p64HI5nv057492@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@195722?ac=10 Change 195722 by syuu@kikurage on 2011/07/04 17:17:29 SOFT_MULTIQUEUE and its ioctls worked on ifconfig command Affected files ... .. //depot/projects/soc2011/mq_bpf/src/sbin/ifconfig/ifconfig.c#3 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#3 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/if.h#5 edit .. //depot/projects/soc2011/mq_bpf/src/sys/net/if_ethersubr.c#5 edit Differences ... ==== //depot/projects/soc2011/mq_bpf/src/sbin/ifconfig/ifconfig.c#3 (text+ko) ==== @@ -962,23 +962,23 @@ }else perror("ioctl"); - printf("\trxqueue len:%d affinity:", rxqlen); + printf("\trxqueue len=%d affinity=[", rxqlen); for (i = 0; i < rxqlen; i++) { - ifr.ifr_queue_affinity_idx = i; + ifr.ifr_queue_affinity_index = i; if (ioctl(s, SIOCGIFRXQAFFINITY, &ifr) == 0) - printf(" %d:%d", ifr.ifr_queue_affinity_idx, + printf(" %d:%d", ifr.ifr_queue_affinity_index, ifr.ifr_queue_affinity_cpu); } - putchar('\n'); + printf(" ]\n"); - printf("\ttxqueue len:%d affinity:", txqlen); + printf("\ttxqueue len=%d affinity=[", txqlen); for (i = 0; i < txqlen; i++) { - ifr.ifr_queue_affinity_idx = i; + ifr.ifr_queue_affinity_index = i; if (ioctl(s, SIOCGIFTXQAFFINITY, &ifr) == 0) - printf(" %d:%d", ifr.ifr_queue_affinity_idx, + printf(" %d:%d", ifr.ifr_queue_affinity_index, ifr.ifr_queue_affinity_cpu); } - putchar('\n'); + printf(" ]\n"); } tunnel_status(s); ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if.c#3 (text+ko) ==== @@ -2433,7 +2433,9 @@ !ifp->if_capabilities & IFCAP_SOFT_MULTIQUEUE) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); - ifr->ifr_affinity_cpu = ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_affinity_que); + log(LOG_DEBUG, "%s: SIOCGIFRXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); + ifr->ifr_queue_affinity_cpu = ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_queue_affinity_index); + log(LOG_DEBUG, "%s: SIOCGIFRXQAFFINITY ifr_queue_affinity_cpu:%d\n", __func__, ifr->ifr_queue_affinity_cpu); break; case SIOCGIFTXQAFFINITY: @@ -2441,7 +2443,9 @@ !ifp->if_capabilities & IFCAP_SOFT_MULTIQUEUE) return (EOPNOTSUPP); KASSERT(ifp->if_get_rxqueue_affinity, ("if_get_rxqueue_affinity not set")); - ifr->ifr_affinity_cpu = ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_affinity_que); + log(LOG_DEBUG, "%s: SIOCGIFTXQAFFINITY ifr_queue_affinity_index:%d\n", __func__, ifr->ifr_queue_affinity_index); + ifr->ifr_queue_affinity_cpu = ifp->if_get_rxqueue_affinity(ifp, ifr->ifr_queue_affinity_index); + log(LOG_DEBUG, "%s: SIOCGIFTXQAFFINITY ifr_queue_affinity_cpu:%d\n", __func__, ifr->ifr_queue_affinity_cpu); break; default: ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if.h#5 (text+ko) ==== @@ -337,8 +337,8 @@ #define ifr_index ifr_ifru.ifru_index /* interface index */ #define ifr_rxqueue_len ifr_ifru.ifru_queue_len[0] /* rxqueue len */ #define ifr_txqueue_len ifr_ifru.ifru_queue_len[1] /* txqueue len */ -#define ifr_affinity_que ifr_ifru.ifru_queue_affinity[0] /* queue id */ -#define ifr_affinity_cpu ifr_ifru.ifru_queue_affinity[1] /* cpu id */ +#define ifr_queue_affinity_index ifr_ifru.ifru_queue_affinity[0] /* queue id */ +#define ifr_queue_affinity_cpu ifr_ifru.ifru_queue_affinity[1] /* cpu id */ }; #define _SIZEOF_ADDR_IFREQ(ifr) \ ==== //depot/projects/soc2011/mq_bpf/src/sys/net/if_ethersubr.c#5 (text+ko) ==== @@ -1061,13 +1061,17 @@ if_printf(ifp, "Ethernet address: %6D\n", lla, ":"); #ifdef SOFTRSS - if (!ifp->if_capabilities & IFCAP_MULTIQUEUE) { + printf("%s: SOFTRSS if:%s\n", __func__, ifp->if_xname); + if (!(ifp->if_capabilities & IFCAP_MULTIQUEUE)) { + printf("%s: !IFCAP_MULTIQUEUE if:%s\n", __func__, ifp->if_xname); ifp->if_capabilities |= IFCAP_SOFT_MULTIQUEUE; ifp->if_capenable |= IFCAP_SOFT_MULTIQUEUE; ifp->if_get_rxqueue_len = softrss_get_rxqueue_len; ifp->if_get_txqueue_len = softrss_get_txqueue_len; ifp->if_get_rxqueue_affinity = softrss_get_rxqueue_affinity; ifp->if_get_txqueue_affinity = softrss_get_txqueue_affinity; + }else{ + printf("%s: IFCAP_MULTIQUEUE if:%s\n", __func__, ifp->if_xname); } #endif } @@ -1471,7 +1475,7 @@ static int softrss_get_rxqueue_affinity(struct ifnet *ifp, int queid) { - netisr_get_cpuid(queid); + return netisr_get_cpuid(queid); } static int
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107041718.p64HI5nv057492>