Author: hselasky
Date: Mon Apr 22 19:36:19 2019
New Revision: 346581
URL: https://svnweb.freebsd.org/changeset/base/346581

Log:
  Revert r346530 until further.
  
  MFC after:            1 week
  Sponsored by:         Mellanox Technologies

Modified:
  head/sys/netinet/ip_reass.c
  head/sys/netinet6/frag6.c

Modified: head/sys/netinet/ip_reass.c
==============================================================================
--- head/sys/netinet/ip_reass.c Mon Apr 22 19:31:16 2019        (r346580)
+++ head/sys/netinet/ip_reass.c Mon Apr 22 19:36:19 2019        (r346581)
@@ -47,10 +47,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/lock.h>
 #include <sys/mutex.h>
 #include <sys/sysctl.h>
-#include <sys/socket.h>
 
-#include <net/if.h>
-#include <net/if_var.h>
 #include <net/rss_config.h>
 #include <net/netisr.h>
 #include <net/vnet.h>
@@ -609,37 +606,6 @@ ipreass_drain(void)
                IPQ_UNLOCK(i);
        }
 }
-
-/*
- * Drain off all datagram fragments belonging to
- * the given network interface.
- */
-static void
-ipreass_cleanup(void *arg __unused, struct ifnet *ifp)
-{
-       struct ipq *fp, *temp;
-       struct mbuf *m;
-       int i;
-
-       KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__));
-
-       CURVNET_SET_QUIET(ifp->if_vnet);
-       for (i = 0; i < IPREASS_NHASH; i++) {
-               IPQ_LOCK(i);
-               /* Scan fragment list. */
-               TAILQ_FOREACH_SAFE(fp, &V_ipq[i].head, ipq_list, temp) {
-                       for (m = fp->ipq_frags; m != NULL; m = m->m_nextpkt) {
-                               if (m->m_pkthdr.rcvif == ifp) {
-                                       ipq_drop(&V_ipq[i], fp);
-                                       break;
-                               }
-                       }
-               }
-               IPQ_UNLOCK(i);
-       }
-       CURVNET_RESTORE();
-}
-EVENTHANDLER_DEFINE(ifnet_departure_event, ipreass_cleanup, NULL, 0);
 
 #ifdef VIMAGE
 /*

Modified: head/sys/netinet6/frag6.c
==============================================================================
--- head/sys/netinet6/frag6.c   Mon Apr 22 19:31:16 2019        (r346580)
+++ head/sys/netinet6/frag6.c   Mon Apr 22 19:36:19 2019        (r346581)
@@ -82,7 +82,7 @@ static void frag6_deq(struct ip6asfrag *, uint32_t buc
 static void frag6_insque_head(struct ip6q *, struct ip6q *,
     uint32_t bucket);
 static void frag6_remque(struct ip6q *, uint32_t bucket);
-static void frag6_freef(struct ip6q *, uint32_t bucket, bool send_icmp);
+static void frag6_freef(struct ip6q *, uint32_t bucket);
 
 struct ip6qbucket {
        struct ip6q     ip6q;
@@ -595,7 +595,7 @@ insert:
                if (af6->ip6af_off != next) {
                        if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) {
                                IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag);
-                               frag6_freef(q6, hash, true);
+                               frag6_freef(q6, hash);
                        }
                        IP6Q_UNLOCK(hash);
                        return IPPROTO_DONE;
@@ -605,7 +605,7 @@ insert:
        if (af6->ip6af_up->ip6af_mff) {
                if (q6->ip6q_nfrag > V_ip6_maxfragsperpacket) {
                        IP6STAT_ADD(ip6s_fragdropped, q6->ip6q_nfrag);
-                       frag6_freef(q6, hash, true);
+                       frag6_freef(q6, hash);
                }
                IP6Q_UNLOCK(hash);
                return IPPROTO_DONE;
@@ -732,7 +732,7 @@ insert:
  * associated datagrams.
  */
 static void
-frag6_freef(struct ip6q *q6, uint32_t bucket, bool send_icmp)
+frag6_freef(struct ip6q *q6, uint32_t bucket)
 {
        struct ip6asfrag *af6, *down6;
 
@@ -749,7 +749,7 @@ frag6_freef(struct ip6q *q6, uint32_t bucket, bool sen
                 * Return ICMP time exceeded error for the 1st fragment.
                 * Just free other fragments.
                 */
-               if (af6->ip6af_off == 0 && send_icmp != false) {
+               if (af6->ip6af_off == 0) {
                        struct ip6_hdr *ip6;
 
                        /* adjust pointer */
@@ -865,7 +865,7 @@ frag6_slowtimo(void)
                                        IP6STAT_ADD(ip6s_fragtimeout,
                                                q6->ip6q_prev->ip6q_nfrag);
                                        /* XXX in6_ifstat_inc(ifp, 
ifs6_reass_fail) */
-                                       frag6_freef(q6->ip6q_prev, i, true);
+                                       frag6_freef(q6->ip6q_prev, i);
                                }
                        }
                        /*
@@ -884,7 +884,7 @@ frag6_slowtimo(void)
                                IP6STAT_ADD(ip6s_fragoverflow,
                                        q6->ip6q_prev->ip6q_nfrag);
                                /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
-                               frag6_freef(head->ip6q_prev, i, true);
+                               frag6_freef(head->ip6q_prev, i);
                        }
                        IP6Q_UNLOCK(i);
                }
@@ -902,7 +902,7 @@ frag6_slowtimo(void)
                                IP6STAT_ADD(ip6s_fragoverflow,
                                        q6->ip6q_prev->ip6q_nfrag);
                                /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
-                               frag6_freef(head->ip6q_prev, i, true);
+                               frag6_freef(head->ip6q_prev, i);
                        }
                        IP6Q_UNLOCK(i);
                        i = (i + 1) % IP6REASS_NHASH;
@@ -932,7 +932,7 @@ frag6_drain(void)
                        while (head->ip6q_next != head) {
                                IP6STAT_INC(ip6s_fragdropped);
                                /* XXX in6_ifstat_inc(ifp, ifs6_reass_fail) */
-                               frag6_freef(head->ip6q_next, i, true);
+                               frag6_freef(head->ip6q_next, i);
                        }
                        IP6Q_UNLOCK(i);
                }
@@ -940,45 +940,6 @@ frag6_drain(void)
        }
        VNET_LIST_RUNLOCK_NOSLEEP();
 }
-
-/*
- * Drain off all datagram fragments belonging to
- * the given network interface.
- */
-static void
-frag6_cleanup(void *arg __unused, struct ifnet *ifp)
-{
-       struct ip6q *q6, *q6n, *head;
-       struct ip6asfrag *af6;
-       struct mbuf *m;
-       int i;
-
-       KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__));
-
-       CURVNET_SET_QUIET(ifp->if_vnet);
-       for (i = 0; i < IP6REASS_NHASH; i++) {
-               IP6Q_LOCK(i);
-               head = IP6Q_HEAD(i);
-               /* Scan fragment list. */
-               for (q6 = head->ip6q_next; q6 != head; q6 = q6n) {
-                       q6n = q6->ip6q_next;
-
-                       for (af6 = q6->ip6q_down; af6 != (struct ip6asfrag *)q6;
-                            af6 = af6->ip6af_down) {
-                               m = IP6_REASS_MBUF(af6);
-
-                               if (m->m_pkthdr.rcvif == ifp) {
-                                       IP6STAT_INC(ip6s_fragdropped);
-                                       frag6_freef(q6, i, false);
-                                       break;
-                               }
-                       }
-               }
-               IP6Q_UNLOCK(i);
-       }
-       CURVNET_RESTORE();
-}
-EVENTHANDLER_DEFINE(ifnet_departure_event, frag6_cleanup, NULL, 0);
 
 int
 ip6_deletefraghdr(struct mbuf *m, int offset, int wait)


_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to