From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from s3.sipsolutions.net ([5.9.151.49]:36282 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030333AbbKDVgB (ORCPT ); Wed, 4 Nov 2015 16:36:01 -0500 Message-ID: <1446672958.13649.4.camel@sipsolutions.net> (sfid-20151104_223610_516002_DC4D9628) Subject: Re: [PATCH v2 1/4] ipv4: add option to drop unicast encapsulated in L2 multicast From: Johannes Berg To: Julian Anastasov Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org Date: Wed, 04 Nov 2015 22:35:58 +0100 In-Reply-To: References: <1446654127-26826-1-git-send-email-johannes@sipsolutions.net> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Wed, 2015-11-04 at 22:59 +0200, Julian Anastasov wrote: >  >         Patches 1 and 3 look correct to me, > > Reviewed-by: Julian Anastasov Thanks for checking! >         If the patches are lost in the merge window you > can also consider one minor optimization, see below... Oh, yeah, they probably are - sorry Dave. > > -     } else if (rt->rt_type == RTN_BROADCAST) > > +     } else if (rt->rt_type == RTN_BROADCAST) { > >               IP_UPD_PO_STATS_BH(net, IPSTATS_MIB_INBCAST, skb- > >len); > > +     } else { > >         } else if (unlikely(skb->pkt_type != PACKET_HOST)) { > >         May be such check can save some cycles because > it is more common to see PACKET_HOST packets... I had thought about that based on your earlier comments, but then I didn't quite see the point. However, perhaps we could invert the check below to check the pkt_type first, hoping it'll have some kind of cache effect? johannes From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Berg Subject: Re: [PATCH v2 1/4] ipv4: add option to drop unicast encapsulated in L2 multicast Date: Wed, 04 Nov 2015 22:35:58 +0100 Message-ID: <1446672958.13649.4.camel@sipsolutions.net> References: <1446654127-26826-1-git-send-email-johannes@sipsolutions.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Julian Anastasov Return-path: In-Reply-To: Sender: linux-wireless-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org On Wed, 2015-11-04 at 22:59 +0200, Julian Anastasov wrote: >=C2=A0 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Patches 1 and 3 look = correct to me, >=20 > Reviewed-by: Julian Anastasov Thanks for checking! > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0If the patches are lo= st in the merge window you > can also consider one minor optimization, see below... Oh, yeah, they probably are - sorry Dave. > > -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else if (rt->rt_type =3D=3D RTN_BR= OADCAST) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else if (rt->rt_type =3D=3D RTN_BR= OADCAST) { > >=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0IP_UPD_PO_STATS_BH(net, IPSTATS_MIB_INBCAST, skb- > >len); > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else { >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} else if (unlikely(s= kb->pkt_type !=3D PACKET_HOST)) { >=20 > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0May be such check can= save some cycles because > it is more common to see PACKET_HOST packets... I had thought about that based on your earlier comments, but then I didn't quite see the point. However, perhaps we could invert the check below to check the pkt_type first, hoping it'll have some kind of cache effect? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html