ieee8023ad_lacp.c (169739) | ieee8023ad_lacp.c (169741) |
---|---|
1/* $NetBSD: ieee8023ad_lacp.c,v 1.3 2005/12/11 12:24:54 christos Exp $ */ 2 3/*- 4 * Copyright (c)2005 YAMAMOTO Takashi, 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/* $NetBSD: ieee8023ad_lacp.c,v 1.3 2005/12/11 12:24:54 christos Exp $ */ 2 3/*- 4 * Copyright (c)2005 YAMAMOTO Takashi, 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/net/ieee8023ad_lacp.c 169739 2007-05-19 07:47:04Z thompsa $"); | 30__FBSDID("$FreeBSD: head/sys/net/ieee8023ad_lacp.c 169741 2007-05-19 09:37:04Z thompsa $"); |
31 32#include <sys/param.h> 33#include <sys/callout.h> 34#include <sys/mbuf.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> 37#include <sys/kernel.h> /* hz */ 38#include <sys/socket.h> /* for net/if.h */ --- 891 unchanged lines hidden (view full) --- 930 if (la->la_nports == 0) { 931 continue; 932 } 933 934 speed = lacp_aggregator_bandwidth(la); 935 LACP_DPRINTF((NULL, "%s, speed=%jd, nports=%d\n", 936 lacp_format_lagid_aggregator(la, buf, sizeof(buf)), 937 speed, la->la_nports)); | 31 32#include <sys/param.h> 33#include <sys/callout.h> 34#include <sys/mbuf.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> 37#include <sys/kernel.h> /* hz */ 38#include <sys/socket.h> /* for net/if.h */ --- 891 unchanged lines hidden (view full) --- 930 if (la->la_nports == 0) { 931 continue; 932 } 933 934 speed = lacp_aggregator_bandwidth(la); 935 LACP_DPRINTF((NULL, "%s, speed=%jd, nports=%d\n", 936 lacp_format_lagid_aggregator(la, buf, sizeof(buf)), 937 speed, la->la_nports)); |
938 if (speed > best_speed || | 938 939 /* This aggregator is chosen if 940 * the partner has a better system priority 941 * or, the total aggregated speed is higher 942 * or, it is already the chosen aggregator 943 */ 944 if ((best_la != NULL && LACP_SYS_PRI(la->la_partner) < 945 LACP_SYS_PRI(best_la->la_partner)) || 946 speed > best_speed || |
939 (speed == best_speed && 940 la == lsc->lsc_active_aggregator)) { 941 best_la = la; 942 best_speed = speed; 943 } 944 } 945 946 KASSERT(best_la == NULL || best_la->la_nports > 0, --- 980 unchanged lines hidden --- | 947 (speed == best_speed && 948 la == lsc->lsc_active_aggregator)) { 949 best_la = la; 950 best_speed = speed; 951 } 952 } 953 954 KASSERT(best_la == NULL || best_la->la_nports > 0, --- 980 unchanged lines hidden --- |