Date: Wed, 18 Jun 2008 15:20:04 GMT From: 4pr@legis.krsn.ru To: freebsd-net@FreeBSD.org Subject: Re: kern/122839: [multicast] FreeBSD 7 multicast routing problem Message-ID: <200806181520.m5IFK4B9066850@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/122839; it has been noted by GNATS. From: 4pr@legis.krsn.ru To: bug-followup@FreeBSD.org, bms@FreeBSD.org, tomas@tutus.se, 4pr@legis.krsn.ru Cc: Subject: Re: kern/122839: [multicast] FreeBSD 7 multicast routing problem Date: Wed, 18 Jun 2008 22:47:37 +0800 --=_mixed 0051374DC725746C_= Content-Type: text/plain; charset="US-ASCII" Hello! Thanks for given ideas and your help! Using patch suggested by Tomas Svensson we have made our version of it: --- if_em.c.orig 2007-11-29 06:24:38.000000000 +0700 +++ if_em.c 2008-04-24 16:49:04.000000000 +0800 @@ -1080,7 +1080,7 @@ if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING)) { if ((ifp->if_flags ^ adapter->if_flags) & - IFF_PROMISC) { + (IFF_PROMISC | IFF_ALLMULTI)) { em_disable_promisc(adapter); em_set_promisc(adapter); } @@ -2379,12 +2379,14 @@ static void em_disable_promisc(struct adapter *adapter) { + struct ifnet *ifp = adapter->ifp; uint32_t reg_rctl; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); reg_rctl &= (~E1000_RCTL_UPE); - reg_rctl &= (~E1000_RCTL_MPE); + if (!(ifp->if_flags & IFF_ALLMULTI)) + reg_rctl &= (~E1000_RCTL_MPE); E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); } Also we have made a patch for if_msk.c : --- if_msk.c.orig 2007-12-08 19:16:14.000000000 +0700 +++ if_msk.c 2008-04-24 17:51:02.000000000 +0800 @@ -558,11 +558,11 @@ bzero(mchash, sizeof(mchash)); mode = GMAC_READ_2(sc, sc_if->msk_port, GM_RX_CTRL); - mode |= GM_RXCR_UCF_ENA; if ((ifp->if_flags & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { if ((ifp->if_flags & IFF_PROMISC) != 0) mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); else if ((ifp->if_flags & IFF_ALLMULTI) != 0) { + mode &= ~(GM_RXCR_MCF_ENA); mchash[0] = 0xffff; mchash[1] = 0xffff; } @@ -627,8 +627,12 @@ mode = GMAC_READ_2(sc, sc_if->msk_port, GM_RX_CTRL); if (ifp->if_flags & IFF_PROMISC) mode &= ~(GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); - else + else { mode |= (GM_RXCR_UCF_ENA | GM_RXCR_MCF_ENA); + // ALLMULTI handling + if (ifp->if_flags & IFF_ALLMULTI) + mode &= ~(GM_RXCR_MCF_ENA); + } GMAC_WRITE_2(sc, sc_if->msk_port, GM_RX_CTRL, mode); } @@ -934,7 +938,7 @@ if ((ifp->if_flags & IFF_UP) != 0) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { if (((ifp->if_flags ^ sc_if->msk_if_flags) - & IFF_PROMISC) != 0) { + & (IFF_PROMISC | IFF_ALLMULTI)) != 0) { msk_setpromisc(sc_if); msk_setmulti(sc_if); } Both patches solves for us described problem with multicast routing on FreeBSD7.0 But, if it is possible, as we are not too good with FreeBSD patching, cold somebody review and do a sanity check for our patches, just in case we have made a serios/simple mistekes? :) Thank you --=_mixed 0051374DC725746C_= Content-Type: application/octet-stream; name="if_em.c.diff" Content-Disposition: attachment; filename="if_em.c.diff" Content-Transfer-Encoding: base64 LS0tIGlmX2VtLmMub3JpZwkyMDA3LTExLTI5IDA2OjI0OjM4LjAwMDAwMDAwMCArMDcwMAorKysg aWZfZW0uYwkyMDA4LTA0LTI0IDE2OjQ5OjA0LjAwMDAwMDAwMCArMDgwMApAQCAtMTA4MCw3ICsx MDgwLDcgQEAKIAkJaWYgKGlmcC0+aWZfZmxhZ3MgJiBJRkZfVVApIHsKIAkJCWlmICgoaWZwLT5p Zl9kcnZfZmxhZ3MgJiBJRkZfRFJWX1JVTk5JTkcpKSB7CiAJCQkJaWYgKChpZnAtPmlmX2ZsYWdz IF4gYWRhcHRlci0+aWZfZmxhZ3MpICYKLQkJCQkgICAgSUZGX1BST01JU0MpIHsKKwkJCQkgICAg KElGRl9QUk9NSVNDIHwgSUZGX0FMTE1VTFRJKSkgewogCQkJCQllbV9kaXNhYmxlX3Byb21pc2Mo YWRhcHRlcik7CiAJCQkJCWVtX3NldF9wcm9taXNjKGFkYXB0ZXIpOwogCQkJCX0KQEAgLTIzNzks MTIgKzIzNzksMTQgQEAKIHN0YXRpYyB2b2lkCiBlbV9kaXNhYmxlX3Byb21pc2Moc3RydWN0IGFk YXB0ZXIgKmFkYXB0ZXIpCiB7CisJc3RydWN0IGlmbmV0CSppZnAgPSBhZGFwdGVyLT5pZnA7CiAJ dWludDMyX3QJcmVnX3JjdGw7CiAKIAlyZWdfcmN0bCA9IEUxMDAwX1JFQURfUkVHKCZhZGFwdGVy LT5odywgRTEwMDBfUkNUTCk7CiAKIAlyZWdfcmN0bCAmPSAgKH5FMTAwMF9SQ1RMX1VQRSk7Ci0J cmVnX3JjdGwgJj0gICh+RTEwMDBfUkNUTF9NUEUpOworCWlmICghKGlmcC0+aWZfZmxhZ3MgJiBJ RkZfQUxMTVVMVEkpKQorICAgIAkJcmVnX3JjdGwgJj0gICh+RTEwMDBfUkNUTF9NUEUpOwogCUUx MDAwX1dSSVRFX1JFRygmYWRhcHRlci0+aHcsIEUxMDAwX1JDVEwsIHJlZ19yY3RsKTsKIH0KIAo= --=_mixed 0051374DC725746C_= Content-Type: application/octet-stream; name="if_msk.c.diff" Content-Disposition: attachment; filename="if_msk.c.diff" Content-Transfer-Encoding: base64 LS0tIGlmX21zay5jLm9yaWcJMjAwNy0xMi0wOCAxOToxNjoxNC4wMDAwMDAwMDAgKzA3MDAKKysr IGlmX21zay5jCTIwMDgtMDQtMjQgMTc6NTE6MDIuMDAwMDAwMDAwICswODAwCkBAIC01NTgsMTEg KzU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AIC05MzQsNyArOTM4LDcgQEAKIAkJaWYgKChpZnAtPmlmX2ZsYWdzICYgSUZGX1VQKSAhPSAw KSB7CiAJCQlpZiAoKGlmcC0+aWZfZHJ2X2ZsYWdzICYgSUZGX0RSVl9SVU5OSU5HKSAhPSAwKSB7 CiAJCQkJaWYgKCgoaWZwLT5pZl9mbGFncyBeIHNjX2lmLT5tc2tfaWZfZmxhZ3MpCi0JCQkJICAg ICYgSUZGX1BST01JU0MpICE9IDApIHsKKwkJCQkgICAgJiAoSUZGX1BST01JU0MgfCBJRkZfQUxM TVVMVEkpKSAhPSAwKSB7CiAJCQkJCW1za19zZXRwcm9taXNjKHNjX2lmKTsKIAkJCQkJbXNrX3Nl dG11bHRpKHNjX2lmKTsKIAkJCQl9Cg== --=_mixed 0051374DC725746C_=--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200806181520.m5IFK4B9066850>