From owner-svn-src-head@freebsd.org Mon Oct 21 18:11:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7727715E0EA; Mon, 21 Oct 2019 18:11:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46xl8024LTz4d5G; Mon, 21 Oct 2019 18:11:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E98427BCD; Mon, 21 Oct 2019 18:11:25 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9LIBOSY068264; Mon, 21 Oct 2019 18:11:24 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9LIBOwE068263; Mon, 21 Oct 2019 18:11:24 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201910211811.x9LIBOwE068263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 21 Oct 2019 18:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r353844 - head/sys/dev/e1000 X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: head/sys/dev/e1000 X-SVN-Commit-Revision: 353844 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Oct 2019 18:11:28 -0000 Author: glebius Date: Mon Oct 21 18:11:24 2019 New Revision: 353844 URL: https://svnweb.freebsd.org/changeset/base/353844 Log: Convert to if_foreach_llmaddr() KPI. Modified: head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Oct 21 18:11:19 2019 (r353843) +++ head/sys/dev/e1000/if_em.c Mon Oct 21 18:11:24 2019 (r353844) @@ -1655,7 +1655,7 @@ em_disable_promisc(if_ctx_t ctx) if (if_getflags(ifp) & IFF_ALLMULTI) mcnt = MAX_NUM_MULTICAST_ADDRESSES; else - mcnt = if_multiaddr_count(ifp, MAX_NUM_MULTICAST_ADDRESSES); + mcnt = if_llmaddr_count(ifp); /* Don't disable if in MAX groups */ if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) reg_rctl &= (~E1000_RCTL_MPE); @@ -1664,6 +1664,19 @@ em_disable_promisc(if_ctx_t ctx) } +static u_int +em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) +{ + u8 *mta = arg; + + if (cnt == MAX_NUM_MULTICAST_ADDRESSES) + return (1); + + bcopy(LLADDR(sdl), &mta[cnt * ETH_ADDR_LEN], ETH_ADDR_LEN); + + return (1); +} + /********************************************************************* * Multicast Update * @@ -1695,7 +1708,7 @@ em_if_multi_set(if_ctx_t ctx) msec_delay(5); } - if_multiaddr_array(ifp, mta, &mcnt, MAX_NUM_MULTICAST_ADDRESSES); + mcnt = if_foreach_llmaddr(ifp, em_copy_maddr, mta); if (mcnt >= MAX_NUM_MULTICAST_ADDRESSES) { reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL);