1. 16 Nov, 2011 22 commits
  2. 15 Nov, 2011 2 commits
  3. 14 Nov, 2011 16 commits
    • RongQing.Li's avatar
      ipv4: fix a memory leak in ic_bootp_send_if · ad79eefc
      RongQing.Li authored
      when dev_hard_header() failed, the newly allocated skb should be freed.
      Signed-off-by: default avatarRongQing.Li <roy.qing.li@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ad79eefc
    • Dmitry Kravkov's avatar
      5219e4c9
    • Matti Vaittinen's avatar
      IPv6 routing, NLM_F_* flag support: REPLACE and EXCL flags support, warn about missing CREATE flag · 4a287eba
      Matti Vaittinen authored
      The support for NLM_F_* flags at IPv6 routing requests.
      
      If NLM_F_CREATE flag is not defined for RTM_NEWROUTE request,
      warning is printed, but no error is returned. Instead new route is
      added. Later NLM_F_CREATE may be required for
      new route creation.
      
      Exception is when NLM_F_REPLACE flag is given without NLM_F_CREATE, and
      no matching route is found. In this case it should be safe to assume
      that the request issuer is familiar with NLM_F_* flags, and does really
      not want route to be created.
      
      Specifying NLM_F_REPLACE flag will now make the kernel to search for
      matching route, and replace it with new one. If no route is found and
      NLM_F_CREATE is specified as well, then new route is created.
      
      Also, specifying NLM_F_EXCL will yield returning of error if matching
      route is found.
      
      Patch created against linux-3.2-rc1
      Signed-off-by: default avatarMatti Vaittinen <Mazziesaccount@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4a287eba
    • Matti Vaittinen's avatar
      IPv6 routing, NLM_F_* flag support: warn if new route is created without NLM_F_CREATE · d71314b4
      Matti Vaittinen authored
      The support for NLM_F_* flags at IPv6 routing requests.
      
      Warn if NLM_F_CREATE flag is not defined for RTM_NEWROUTE request,
      creating new table. Later NLM_F_CREATE may be required for
      new route creation.
      
      Patch created against linux-3.2-rc1
      Signed-off-by: default avatarMatti Vaittinen <Mazziesaccount@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      d71314b4
    • Wolfgang Grandegger's avatar
      net/can/mscan: Fix buggy listen only mode setting · abbd00b8
      Wolfgang Grandegger authored
      This patch fixes an issue introduced recently with commit
      452448f9.
      
      CC: Marc Kleine-Budde <mkl@pengutronix.de>
      Signed-off-by: default avatarWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      abbd00b8
    • Rick Jones's avatar
      Sweep the last of the active .get_drvinfo floors under ethernet/ · 612a94d6
      Rick Jones authored
      This round of floor sweeping converts strncpy calls in various .get_drvinfo
      routines to the preferred strlcpy.  It also does a modicum of other
      cleaning in those routines.
      Signed-off-by: default avatarRick Jones <rick.jones2@hp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      612a94d6
    • Eric Dumazet's avatar
      bnx2x: uses build_skb() in receive path · e52fcb24
      Eric Dumazet authored
      bnx2x uses following formula to compute its rx_buf_sz :
      
      dev->mtu + 2*L1_CACHE_BYTES + 14 + 8 + 8 + 2
      
      Then core network adds NET_SKB_PAD and SKB_DATA_ALIGN(sizeof(struct
      skb_shared_info))
      
      Final allocated size for skb head on x86_64 (L1_CACHE_BYTES = 64,
      MTU=1500) : 2112 bytes : SLUB/SLAB round this to 4096 bytes.
      
      Since skb truesize is then bigger than SK_MEM_QUANTUM, we have lot of
      false sharing because of mem_reclaim in UDP stack.
      
      One possible way to half truesize is to reduce the need by 64 bytes
      (2112 -> 2048 bytes)
      
      Instead of allocating a full cache line at the end of packet for
      alignment, we can use the fact that skb_shared_info sits at the end of
      skb->head, and we can use this room, if we convert bnx2x to new
      build_skb() infrastructure.
      
      skb_shared_info will be initialized after hardware finished its
      transfert, so we can eventually overwrite the final padding.
      
      Using build_skb() also reduces cache line misses in the driver, since we
      use cache hot skb instead of cold ones. Number of in-flight sk_buff
      structures is lower, they are recycled while still hot.
      
      Performance results :
      
      (820.000 pps on a rx UDP monothread benchmark, instead of 720.000 pps)
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Eilon Greenstein <eilong@broadcom.com>
      CC: Ben Hutchings <bhutchings@solarflare.com>
      CC: Tom Herbert <therbert@google.com>
      CC: Jamal Hadi Salim <hadi@mojatatu.com>
      CC: Stephen Hemminger <shemminger@vyatta.com>
      CC: Thomas Graf <tgraf@infradead.org>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Acked-by: default avatarEilon Greenstein <eilong@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e52fcb24
    • Eric Dumazet's avatar
      net: introduce build_skb() · b2b5ce9d
      Eric Dumazet authored
      One of the thing we discussed during netdev 2011 conference was the idea
      to change some network drivers to allocate/populate their skb at RX
      completion time, right before feeding the skb to network stack.
      
      In old days, we allocated skbs when populating the RX ring.
      
      This means bringing into cpu cache sk_buff and skb_shared_info cache
      lines (since we clear/initialize them), then 'queue' skb->data to NIC.
      
      By the time NIC fills a frame in skb->data buffer and host can process
      it, cpu probably threw away the cache lines from its caches, because lot
      of things happened between the allocation and final use.
      
      So the deal would be to allocate only the data buffer for the NIC to
      populate its RX ring buffer. And use build_skb() at RX completion to
      attach a data buffer (now filled with an ethernet frame) to a new skb,
      initialize the skb_shared_info portion, and give the hot skb to network
      stack.
      
      build_skb() is the function to allocate an skb, caller providing the
      data buffer that should be attached to it. Drivers are expected to call
      skb_reserve() right after build_skb() to adjust skb->data to the
      Ethernet frame (usually skipping NET_SKB_PAD and NET_IP_ALIGN, but some
      drivers might add a hardware provided alignment)
      
      Data provided to build_skb() MUST have been allocated by a prior
      kmalloc() call, with enough room to add SKB_DATA_ALIGN(sizeof(struct
      skb_shared_info)) bytes at the end of the data without corrupting
      incoming frame.
      
      data = kmalloc(NET_SKB_PAD + NET_IP_ALIGN + 1536 +
                     SKB_DATA_ALIGN(sizeof(struct skb_shared_info)),
      	       GFP_ATOMIC);
      ...
      skb = build_skb(data);
      if (!skb) {
      	recycle_data(data);
      } else {
      	skb_reserve(skb, NET_SKB_PAD + NET_IP_ALIGN);
      	...
      }
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      CC: Eilon Greenstein <eilong@broadcom.com>
      CC: Ben Hutchings <bhutchings@solarflare.com>
      CC: Tom Herbert <therbert@google.com>
      CC: Jamal Hadi Salim <hadi@mojatatu.com>
      CC: Stephen Hemminger <shemminger@vyatta.com>
      CC: Thomas Graf <tgraf@infradead.org>
      CC: Herbert Xu <herbert@gondor.apana.org.au>
      CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2b5ce9d
    • Baruch Siach's avatar
      net: fsl_pq_mdio: fix non tbi phy access · c3e072f8
      Baruch Siach authored
      Since 952c5ca1 (fsl_pq_mdio: Clean up tbi address configuration) .probe returns
      -EBUSY when the "tbi-phy" node is missing. Fix this.
      
      Cc: Andy Fleming <afleming@freescale.com>
      Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      c3e072f8
    • Marc Kleine-Budde's avatar
      net/can/mscan: add listen only mode · 452448f9
      Marc Kleine-Budde authored
      This patch adds listen only mode to the mscan controller.
      Signed-off-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
      Acked-by: default avatarWolfgang Grandegger <wg@grandegger.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      452448f9
    • Eric Dumazet's avatar
      neigh: new unresolved queue limits · 8b5c171b
      Eric Dumazet authored
      Le mercredi 09 novembre 2011 à 16:21 -0500, David Miller a écrit :
      > From: David Miller <davem@davemloft.net>
      > Date: Wed, 09 Nov 2011 16:16:44 -0500 (EST)
      >
      > > From: Eric Dumazet <eric.dumazet@gmail.com>
      > > Date: Wed, 09 Nov 2011 12:14:09 +0100
      > >
      > >> unres_qlen is the number of frames we are able to queue per unresolved
      > >> neighbour. Its default value (3) was never changed and is responsible
      > >> for strange drops, especially if IP fragments are used, or multiple
      > >> sessions start in parallel. Even a single tcp flow can hit this limit.
      > >  ...
      > >
      > > Ok, I've applied this, let's see what happens :-)
      >
      > Early answer, build fails.
      >
      > Please test build this patch with DECNET enabled and resubmit.  The
      > decnet neigh layer still refers to the removed ->queue_len member.
      >
      > Thanks.
      
      Ouch, this was fixed on one machine yesterday, but not the other one I
      used this morning, sorry.
      
      [PATCH V5 net-next] neigh: new unresolved queue limits
      
      unres_qlen is the number of frames we are able to queue per unresolved
      neighbour. Its default value (3) was never changed and is responsible
      for strange drops, especially if IP fragments are used, or multiple
      sessions start in parallel. Even a single tcp flow can hit this limit.
      
      $ arp -d 192.168.20.108 ; ping -c 2 -s 8000 192.168.20.108
      PING 192.168.20.108 (192.168.20.108) 8000(8028) bytes of data.
      8008 bytes from 192.168.20.108: icmp_seq=2 ttl=64 time=0.322 ms
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8b5c171b
    • stephen hemminger's avatar
      bridge: add NTF_USE support · 292d1398
      stephen hemminger authored
      More changes to the recent code to support control of forwarding
      database via netlink.
         * Support NTF_USE like neighbour table
         * Validate state bits from application
         * Only send notifications (and change bits) if new entry is
           different.
      Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      292d1398
    • Rick Jones's avatar
      Sweep additional floors of strcpy in .get_drvinfo routines · 23020ab3
      Rick Jones authored
      Perform another round of floor sweeping, converting the .get_drvinfo
      routines of additional drivers from strcpy to strlcpy along with
      some conversion of sprintf to snprintf.
      Signed-off-by: default avatarRick Jones <rick.jones2@hp.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      23020ab3
    • Andy Fleming's avatar
      fsl_pq_mdio: Clean up tbi address configuration · 952c5ca1
      Andy Fleming authored
      The code for setting the address of the internal TBI PHY was
      convoluted enough without a maze of ifdefs. Clean it up a bit
      so we allow the logic to fail down to -ENODEV at the end of
      the if/else ladder, rather than using ifdefs to repeat the same
      failure code over and over.
      
      Also, remove the support for the auto-configuration. I'm not aware of
      anyone using it, and it ends up using the bus mutex before it's been
      initialized.
      Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      952c5ca1
    • Sanjay Hortikar's avatar
      net-forcedeth: Add internal loopback support for forcedeth NICs. · e19df76a
      Sanjay Hortikar authored
      Support enabling/disabling/querying internal loopback mode for
      forcedeth NICs using ethtool.
      Signed-off-by: default avatarSanjay Hortikar <horti@google.com>
      Signed-off-by: default avatarMahesh Bandewar <maheshb@google.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e19df76a
    • alex.bluesman.smirnov@gmail.com's avatar
      6LoWPAN: update documentation · 63ce40e4
      alex.bluesman.smirnov@gmail.com authored
      This patch adds chapter to documentation which describes how to use
      6lowpan technology.
      Signed-off-by: default avatarAlexander Smirnov <alex.bluesman.smirnov@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      63ce40e4