Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F170061065
D8928.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8928.diff
View Options
Index: head/sys/dev/hyperv/netvsc/if_hn.c
===================================================================
--- head/sys/dev/hyperv/netvsc/if_hn.c
+++ head/sys/dev/hyperv/netvsc/if_hn.c
@@ -333,6 +333,7 @@
static int hn_create_rx_data(struct hn_softc *, int);
static void hn_destroy_rx_data(struct hn_softc *);
static int hn_check_iplen(const struct mbuf *, int);
+static int hn_set_rxfilter(struct hn_softc *, uint32_t);
static int hn_rxfilter_config(struct hn_softc *);
#ifndef RSS
static int hn_rss_reconfig(struct hn_softc *);
@@ -684,11 +685,25 @@
#endif /* INET6 || INET */
static int
+hn_set_rxfilter(struct hn_softc *sc, uint32_t filter)
+{
+ int error = 0;
+
+ HN_LOCK_ASSERT(sc);
+
+ if (sc->hn_rx_filter != filter) {
+ error = hn_rndis_set_rxfilter(sc, filter);
+ if (!error)
+ sc->hn_rx_filter = filter;
+ }
+ return (error);
+}
+
+static int
hn_rxfilter_config(struct hn_softc *sc)
{
struct ifnet *ifp = sc->hn_ifp;
uint32_t filter;
- int error = 0;
HN_LOCK_ASSERT(sc);
@@ -703,13 +718,7 @@
!TAILQ_EMPTY(&ifp->if_multiaddrs))
filter |= NDIS_PACKET_TYPE_ALL_MULTICAST;
}
-
- if (sc->hn_rx_filter != filter) {
- error = hn_rndis_set_rxfilter(sc, filter);
- if (!error)
- sc->hn_rx_filter = filter;
- }
- return (error);
+ return (hn_set_rxfilter(sc, filter));
}
static void
@@ -4817,8 +4826,7 @@
/*
* Disable RX by clearing RX filter.
*/
- sc->hn_rx_filter = NDIS_PACKET_TYPE_NONE;
- hn_rndis_set_rxfilter(sc, sc->hn_rx_filter);
+ hn_set_rxfilter(sc, NDIS_PACKET_TYPE_NONE);
/*
* Give RNDIS enough time to flush all pending data packets.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 4, 9:53 AM (15 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38080348
Default Alt Text
D8928.diff (1 KB)
Attached To
Mode
D8928: hyperv/hn: Factor out function to set rxfilter.
Attached
Detach File
Event Timeline
Log In to Comment