1. 16 2月, 2013 5 次提交
  2. 15 2月, 2013 11 次提交
    • D
      net: Don't write to current task flags on every packet received. · 9754e293
      David S. Miller 提交于
      Even for non-pfmalloc SKBs, __netif_receive_skb() will do a
      tsk_restore_flags() on current unconditionally.
      
      Make __netif_receive_skb() a shim around the existing code, renamed to
      __netif_receive_skb_core().  Let __netif_receive_skb() wrap the
      __netif_receive_skb_core() call with the task flag modifications, if
      necessary.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9754e293
    • C
      gianfar: Fix and cleanup Rx FCB indication · ba779711
      Claudiu Manoil 提交于
      This fixes a less obvious error on one hand, and prevents futher
      similar errors by disambiguating and optimizing RxFCB indication,
      on the other hand.
      
      The error consists in NETIF_F_HW_VLAN_TX flag being used as an
      indication of Rx FCB insertion. This happened as soon gfar_uses_fcb(),
      which despite its name indicates Rx FCB insertion, started
      incorporating is_vlan_on().
      is_vlan_on(), on the other hand, is also a misleading construct because
      we need to differentiate b/w hw VLAN extraction/VLEX (marked by VLAN_RX
      flag) and hw VLAN insertion/VLINS (VLAN_TX flag), which are different
      mechanisms using different types of FCBs.
      
      The hw spec for the RxFCB feature is as follows:
      In the case of RxBD rings, FCBs (Frame Control Block) are inserted by
      the eTSEC whenever RCTRL[PRSDEP] is set to a non-zero value. Only one
      FCB is inserted per frame (in the buffer pointed to by the RxBD with
      bit F set). TOE acceleration for receive is enabled for all rx frames
      in this case.
      
      This patch introduces priv->uses_rxfcb field to quickly signal RxFCB
      insertion in accordance with the specification above.
      
      The dependency on FSL_GIANFAR_DEV_HAS_TIMER was also eliminated as
      another source of confusion. The actual dependency is to priv->hwts_rx_en.
      Upon changing priv->hwts_rx_en via IOCTL, the gfar device is being
      restarted and on init_mac() the priv->hwts_rx_en flag determines RxFCB
      insertion, and rctrl is programmed accordingly. The patch takes care
      of this case too.
      
      Though maybe not as self documenting as the inlining version uses_fcb(),
      priv->uses_rxfcb has the main purpose to quickly signal, on the hot path,
      that the incoming frame has a *Rx* FCB block inserted which needs to be
      pulled out before passing the skb to the stack. This is a performance
      critical operation, it needs to happen fast, that's why uses_rxfcb is
      placed in the first cacheline of gfar_private.
      This is also why a cached rctrl cannot be used instead: 1) because
      we don't have 32 bits available in the first cacheline of gfar_priv
      (but only 16); 2) bit operations are expensive on the hot path.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ba779711
    • C
      gianfar: Remove wrong buffer size conditioning to VLAN h/w offload · 13f228da
      Claudiu Manoil 提交于
      The controller's ref manual states clearly that when the hw Rx vlan
      offload feature is enabled, meaning that the VLEX bit from RCTRL is
      correctly enabled, then the hw performs automatic VLAN tag extraction
      and deletion from the ethernet frames. So there's no point in trying to
      increase the rx buff size when rxvlan is on, as the frame is actually
      smaller.
      And the Tx vlan hw accel feature (VLINS) has nothing to do with rx buff
      size computation.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      13f228da
    • C
      gianfar: gfar_process_frame returns void · 61db26c6
      Claudiu Manoil 提交于
      No return code is expected from gfar_process_frame(), hence
      change it to return void.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      61db26c6
    • C
      gianfar: GRO_DROP is unlikely · bd9e89f2
      Claudiu Manoil 提交于
      The change is significant since it affects the rx hot path.
      Paul observed and documented the effects at asm level, see
      below:
      
      "It turns out that it does make a difference, since gfar_process_frame
      gets inlined, and so the increment code gets moved out of line (I have
      marked the if statment with * and the increment code within "-----"):
      
        ------------------------- as is currently ------------------
           4d14:       80 61 00 18     lwz     r3,24(r1)
           4d18:       7f c4 f3 78     mr      r4,r30
           4d1c:       48 00 00 01     bl      4d1c <gfar_clean_rx_ring+0x10c>
        *  4d20:       2f 83 00 04     cmpwi   cr7,r3,4
           4d24:       40 9e 00 1c     bne-    cr7,4d40
      <gfar_clean_rx_ring+0x130>
              ----------------------------
           4d28:       81 3c 01 f8     lwz     r9,504(r28)
           4d2c:       81 5c 01 fc     lwz     r10,508(r28)
           4d30:       31 4a 00 01     addic   r10,r10,1
           4d34:       7d 29 01 94     addze   r9,r9
           4d38:       91 3c 01 f8     stw     r9,504(r28)
           4d3c:       91 5c 01 fc     stw     r10,508(r28)
              ----------------------------
           4d40:       a0 1f 00 24     lhz     r0,36(r31)
           4d44:       81 3f 00 00     lwz     r9,0(r31)
           4d48:       7f a4 eb 78     mr      r4,r29
           4d4c:       7f e3 fb 78     mr      r3,r31
      
        -------------------------- unlikely ------------------------
           4d14:       80 61 00 18     lwz     r3,24(r1)
           4d18:       7f c4 f3 78     mr      r4,r30
           4d1c:       48 00 00 01     bl      4d1c <gfar_clean_rx_ring+0x10c>
        *  4d20:       2f 83 00 04     cmpwi   cr7,r3,4
           4d24:       41 9e 03 94     beq-    cr7,50b8
      <gfar_clean_rx_ring+0x4a8>
           4d28:       a0 1f 00 24     lhz     r0,36(r31)
           4d2c:       81 3f 00 00     lwz     r9,0(r31)
           4d30:       7f a4 eb 78     mr      r4,r29
           4d34:       7f e3 fb 78     mr      r3,r31
      [...]
           50b8:       81 3c 01 f8     lwz     r9,504(r28)
           50bc:       81 5c 01 fc     lwz     r10,508(r28)
           50c0:       31 4a 00 01     addic   r10,r10,1
           50c4:       7d 29 01 94     addze   r9,r9
           50c8:       91 3c 01 f8     stw     r9,504(r28)
           50cc:       91 5c 01 fc     stw     r10,508(r28)
           50d0:       4b ff fc 58     b       4d28 <gfar_clean_rx_ring+0x118>
      
      So, the increment does actually get moved ~1k away."
      
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bd9e89f2
    • C
      gianfar: Cleanup and optimize struct gfar_private · b597d20d
      Claudiu Manoil 提交于
      Group run-time critical fields within the 1st cacheline (32B)
      followed by the tx|rx_queue reference arrays and the interrupt
      group instances (gfargrp), all cacheline aligned.
      
      This has several benefits. Firstly comes the performance benefit
      by having the members required by the driver's hot path re-grouped
      in the structure's first cache lines, whereas the unimportant
      members were pushed towards the end of the struct.
      Another benefit comes from eliminating a 24 byte memory hole that
      was rendering gfar_priv's 2nd cacheline useless. The default gcc
      layout of gfar_private leaves an implicit 24 byte hole after the
      errata (enum) member. This patch fixes it.
      
      The uchar bitfields were pushed towards the end of the struct
      as these are not run-time performance critical (used for init
      time operations). Because there is no other 2 byte member
      around to couple the uchar bitfields memeber with, we will
      have an addititnal 2 byte hole after the bitfields. This is
      unsignificant however, and it doesn't influence gfar_priv's
      size, because the whole structure is padded to be a 32B multiple.
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b597d20d
    • C
      gianfar: Add device ref (dev) in gfar_private · 369ec162
      Claudiu Manoil 提交于
      Use device pointer (dev) to simplify the code and to
      avoid double indirections, especially on the hot path.
      
      Basically, instead of accessing priv to get the ofdev
      reference and then accessing the ofdev structure to
      dereference the needed dev pointer, we will get the
      dev pointer directly from priv.
      
      The dev pointer is required on the hot path, see gfar_new_rxbdp
      or gfar_clean_rx_ring (or xmit), and this patch makes
      it available directly from priv's 1st cacheline.
      
      This change is reflected at asm level too, taking (the hot)
      gfar_new_rxbdp():
      initial version -
          18c0:	7c 7e 1b 78 	mr      r30,r3
      
          18d0:	81 69 04 3c 	lwz     r11,1084(r9)
      
          18d8:	34 6b 00 10 	addic.  r3,r11,16
          18dc:	41 82 00 08 	beq-    18e4
      
      patched version -
          18d0:	80 69 04 38 	lwz     r3,1080(r9)
      
          18d8:	2f 83 00 00 	cmpwi   cr7,r3,0
          18dc:	41 9e 00 08 	beq-    cr7,18e4
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      369ec162
    • C
      gianfar: Remove unused device_node ref in gfar_private · 41a20609
      Claudiu Manoil 提交于
      Remove unused device node pointer.
      Remove duplicated SET_NETDEV_DEV().
      Signed-off-by: NClaudiu Manoil <claudiu.manoil@freescale.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      41a20609
    • D
      Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next · e0376d00
      David S. Miller 提交于
      Steffen Klassert says:
      
      ====================
      1) Remove a duplicated call to skb_orphan() in pf_key, from Cong Wang.
      
      2) Prepare xfrm and pf_key for algorithms without pf_key support,
         from Jussi Kivilinna.
      
      3) Fix an unbalanced lock in xfrm_output_one(), from Li RongQing.
      
      4) Add an IPsec state resolution packet queue to handle
         packets that are send before the states are resolved.
      
      5) xfrm4_policy_fini() is unused since 2.6.11, time to remove it.
         From Michal Kubecek.
      
      6) The xfrm gc threshold was configurable just in the initial
         namespace, make it configurable in all namespaces. From
         Michal Kubecek.
      
      7) We currently can not insert policies with mark and mask
         such that some flows would be matched from both policies.
         Allow this if the priorities of these policies are different,
         the one with the higher priority is used in this case.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e0376d00
    • C
      bridge: make ifla_br_policy and br_af_ops static · 15004cab
      Cong Wang 提交于
      They are only used within this file.
      
      Cc: Vlad Yasevich <vyasevic@redhat.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15004cab
    • N
      bgmac: add read of interrupt mask after disabling interrupts · 4160815f
      Nathan Hintz 提交于
      The specs prescribe an immediate read of the interrupt mask after
      disabling interrupts.  This patch updates the driver to match the
      specs.
      Signed-off-by: NNathan Hintz <nlhintz@hotmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4160815f
  3. 14 2月, 2013 24 次提交
    • C
      bridge: use __u16 in if_bridge.h · 9f89ec82
      Cong Wang 提交于
      We should use "__u16" instead of "u16" in the user-space visable
      header.
      
      Cc: Vlad Yasevich <vyasevic@redhat.com>
      Cc: Stephen Hemminger <stephen@networkplumber.org>
      Cc: David S. Miller <davem@davemloft.net>
      Signed-off-by: NCong Wang <amwang@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9f89ec82
    • D
      Merge branch 'bridge_vlan' · 93197b13
      David S. Miller 提交于
      Vlad Yasevich says:
      
      ====================
      VLAN filtering/VLAN aware bridge
      
      Changes since v10
      * Updated implemenation of ndo_fdb_del in emulex and qlogic drivers.
      
      Changes since v9:
      * series re-ordering so make functionality more distinct.  Basic vlan
        filtering is patches 1-4.  Support for PVID/untagged vlans is patches
        5 and 6.  VLAN support for FDB/MDB is patches 7-11.  Patch 12 is
        still additional egress policy.
      * Slight simplification to code that extracts the VID from skb.  Since we
        now depend on the vlan module, at the time of input skb_tci is guaranteed
        to be set if the packet had 8021q header.  We can simply refere to it.
      * Changed the opaque 'parent' pointer from prior patches to a union so we
        can be much more explicit in our assignments.
      * Lots of additional testing with STP turned on.  No issues were observed.
      
      Changes since v8:
      * Unified vlans_to_* calls into a single interface
      * Fixed the rest of the issues report by Michal Miroslaw
      * Fixed a bug where fdb entries were not created for all added vlans.
      
      Changes since v7:
      * Rebases on the latest net-next and removed the vlan wrapper patch from
      the series.
      * Fixed a crash in br_fdb_add/br_fdb_delete.
      
      Changes since v6:
      * VLANs are now stored in a VLAN bitmap per port.  This allows for O(1)
      lookup at ingress and egress.  We simply check to see if the bit associated
      with the vlan id is set in the map.  The drawback to this approach is that
      it wastes some space when there is only a small number of VLANs.
      * In addition to the build time configuration option, VLAN filtering also has
      a configuration paramter in sysfs.  By default the filtering is turned off
      and all traffic is permitted.  When the filtring is turned on, we do strict
      matching to the filter configured.  Thus, if there is no configuration, all
      packets are rejected.  This was done to make the behavior more streight
      forward.  Without this (and if egress policy patch is rejected), the
      decision for how to forward untagged traffic that was not filtered at ingress
      is almost impossible to make.  It would not be right to deliver to every
      port that has PVID set as, each port may have a different PVID.
      * Separate egress policy bitmap patch has been isolated and is provided last
      in the series.  This has been a more contentious piece of functionality and I
      wanted to isolate it so that it could easily be dropped and not block the whole
      series.
      
      Changes since v5:
       - Pulled VLAN filtering into its own file and made it a configuration options.
       - Made new vlan filtering option dependent on VLAN_8021Q.
       - Got rid of HW filter inlines and moved then vlan_core.c.
         (All of the above suggested by Stephen Hemminger)
      
      Changes since v4:
       - Pull per-port vlan data into its own structures and give it to the bridge
         device thus making bridge device behave like a regular port for vlan
         configuration.
       - Add a per-vlan 'untagged' bitmap that determins egress policy.  If a port
         is part of this bitmap, traffic egresses untagged.
       - PVID is now used for ingress policy only.  Incomming frames without VLAN tag
         are assigned to the PVID vlan.  Egress is determined via bitmap memberships.
       - Allow for incremental config of a vlan.  Now, PVID and untagged memberships
         may be set on existing vlans.  They however can NOT be cleared separately.
       - VLAN deletion is now done via RTM_DELLINK command for PF_BRIDGE family.
         This cleans up the netlink interface.
      
      Changes since v3:
       - Re-integrated compiler problems that got left out last time.  Appologies.
       - checkpatches.pl errors fixed
      
      Changes since v2:
       - Added inline functiosn to manimulate vlan hw filters and re-use in 8021q
         and bridge code.
       - Use rtnl_dereference (Michael Tsirkin)
       - Remove synchronize_net() call (Eric Dumazet)
       - Fix NULL ptr deref bug I introduced in br_ifinfo_notify.
      
      Changes since v1:
       - Fixed some forwarding bugs.
       - Add vlan to local fdb entries.  New local entries are created per vlan
         to facilite correct forwarding to bridge interface.
       - Allow configuration of vlans directly on the bridge master device
         in addition to ports.
      
      Changes since rfc v2:
       - Per-port vlan bitmap is gone and is replaced with a vlan list.
       - Added bridge vlan list, which is referenced by each port.  Entries in
         the birdge vlan list have port bitmap that shows which port are parts
         of which vlan.
       - Netlink API changes.
       - Dropped sysfs support for now.  If people think this is really usefull,
         can add it back.
       - Support for native/untagged vlans.
      
      Changes since rfc v1:
       - Comments addressed regarding formatting and RCU usage
       - iocts have been removed and changed over the netlink interface.
       - Added support of user added ndb entries.
       - changed sysfs interface to export a bitmap.  Also added a write interface.
         I am not sure how much I like it, but it made my testing easier/faster.  I
         might change the write interface to take text instead of binary.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93197b13
    • V
      bridge: Separate egress policy bitmap · 35e03f3a
      Vlad Yasevich 提交于
      Add an ability to configure a separate "untagged" egress
      policy to the VLAN information of the bridge.  This superseeds PVID
      policy and makes PVID ingress-only.  The policy is configured with a
      new flag and is represented as a port bitmap per vlan.  Egress frames
      with a VLAN id in "untagged" policy bitmap would egress
      the port without VLAN header.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      35e03f3a
    • V
      bridge: Add vlan support for local fdb entries · bc9a25d2
      Vlad Yasevich 提交于
      When VLAN is added to the port, a local fdb entry for that port
      (the entry with the mac address of the port) is added for that
      VLAN.  This way we can correctly determine if the traffic
      is for the bridge itself.  If the address of the port changes,
      we try to change all the local fdb entries we have for that port.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      bc9a25d2
    • V
      bridge: Add vlan support to static neighbors · 1690be63
      Vlad Yasevich 提交于
      When a user adds bridge neighbors, allow him to specify VLAN id.
      If the VLAN id is not specified, the neighbor will be added
      for VLANs currently in the ports filter list.  If no VLANs are
      configured on the port, we use vlan 0 and only add 1 entry.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Acked-by: NJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1690be63
    • V
      bridge: Add vlan id to multicast groups · b0e9a30d
      Vlad Yasevich 提交于
      Add vlan_id to multicasts groups so that we know which vlan
      each group belongs to and can correctly forward to appropriate vlan.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b0e9a30d
    • V
      bridge: Add vlan to unicast fdb entries · 2ba071ec
      Vlad Yasevich 提交于
      This patch adds vlan to unicast fdb entries that are created for
      learned addresses (not the manually configured ones).  It adds
      vlan id into the hash mix and uses vlan as an addditional parameter
      for an entry match.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      2ba071ec
    • V
      bridge: Add the ability to configure pvid · 552406c4
      Vlad Yasevich 提交于
      A user may designate a certain vlan as PVID.  This means that
      any ingress frame that does not contain a vlan tag is assigned to
      this vlan and any forwarding decisions are made with this vlan in mind.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      552406c4
    • V
      bridge: Implement vlan ingress/egress policy with PVID. · 78851988
      Vlad Yasevich 提交于
      At ingress, any untagged traffic is assigned to the PVID.
      Any tagged traffic is filtered according to membership bitmap.
      
      At egress, if the vlan matches the PVID, the frame is sent
      untagged.  Otherwise the frame is sent tagged.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      78851988
    • V
      bridge: Dump vlan information from a bridge port · 6cbdceeb
      Vlad Yasevich 提交于
      Using the RTM_GETLINK dump the vlan filter list of a given
      bridge port.  The information depends on setting the filter
      flag similar to how nic VF info is dumped.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6cbdceeb
    • V
      bridge: Add netlink interface to configure vlans on bridge ports · 407af329
      Vlad Yasevich 提交于
      Add a netlink interface to add and remove vlan configuration on bridge port.
      The interface uses the RTM_SETLINK message and encodes the vlan
      configuration inside the IFLA_AF_SPEC.  It is possble to include multiple
      vlans to either add or remove in a single message.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      407af329
    • V
      bridge: Verify that a vlan is allowed to egress on given port · 85f46c6b
      Vlad Yasevich 提交于
      When bridge forwards a frame, make sure that a frame is allowed
      to egress on that port.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85f46c6b
    • V
      bridge: Validate that vlan is permitted on ingress · a37b85c9
      Vlad Yasevich 提交于
      When a frame arrives on a port or transmitted by the bridge,
      if we have VLANs configured, validate that a given VLAN is allowed
      to enter the bridge.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a37b85c9
    • V
      bridge: Add vlan filtering infrastructure · 243a2e63
      Vlad Yasevich 提交于
      Adds an optional infrustructure component to bridge that would allow
      native vlan filtering in the bridge.  Each bridge port (as well
      as the bridge device) now get a VLAN bitmap.  Each bit in the bitmap
      is associated with a vlan id.  This way if the bit corresponding to
      the vid is set in the bitmap that the packet with vid is allowed to
      enter and exit the port.
      
      Write access the bitmap is protected by RTNL and read access
      protected by RCU.
      
      Vlan functionality is disabled by default.
      Signed-off-by: NVlad Yasevich <vyasevic@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      243a2e63
    • D
      net: sctp: add build check for sctp_sf_eat_sack_6_2/jsctp_sf_eat_sack · 22222997
      Daniel Borkmann 提交于
      In order to avoid any future surprises of kernel panics due to jprobes
      function mismatches (as e.g. fixed in 4cb9d6ea: sctp: jsctp_sf_eat_sack:
      fix jprobes function signature mismatch), we should check both function
      types during build and scream loudly if they do not match. __same_type
      resolves to __builtin_types_compatible_p, which is 1 in case both types
      are the same and 0 otherwise, qualifiers are ignored. Tested by myself.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22222997
    • D
      net: sctp: minor: make jsctp_sf_eat_sack static · 1e558174
      Daniel Borkmann 提交于
      The function jsctp_sf_eat_sack can be made static, no need to extend
      its visibility.
      Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1e558174
    • R
      bgmac: return error on failed PHY write · 217a55a3
      Rafał Miłecki 提交于
      Some callers may want to know if PHY write succeed. Also make PHY
      functions static, they are not exported anywhere.
      Signed-off-by: NRafał Miłecki <zajec5@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      217a55a3
    • S
      be2net: remove BUG_ON() in be_mcc_compl_is_new() · 9e9ff4b7
      Sathya Perla 提交于
      The current code expects that the last word (with valid bit)
      of an MCC compl is DMAed in one shot. This may not be the case.
      Remove this assertion.
      Signed-off-by: NSathya Perla <sathya.perla@emulex.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9e9ff4b7
    • C
      net: ethernet: ti: remove redundant NULL check. · 79876e03
      Cyril Roelandt 提交于
      cpdma_chan_destroy() on a NULL pointer is a no-op, so the NULL check in
      cpdma_ctlr_destroy() can safely be removed.
      Signed-off-by: NCyril Roelandt <tipecaml@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79876e03
    • P
      net: Fix possible wrong checksum generation. · c9af6db4
      Pravin B Shelar 提交于
      Patch cef401de (net: fix possible wrong checksum
      generation) fixed wrong checksum calculation but it broke TSO by
      defining new GSO type but not a netdev feature for that type.
      net_gso_ok() would not allow hardware checksum/segmentation
      offload of such packets without the feature.
      
      Following patch fixes TSO and wrong checksum. This patch uses
      same logic that Eric Dumazet used. Patch introduces new flag
      SKBTX_SHARED_FRAG if at least one frag can be modified by
      the user. but SKBTX_SHARED_FRAG flag is kept in skb shared
      info tx_flags rather than gso_type.
      
      tx_flags is better compared to gso_type since we can have skb with
      shared frag without gso packet. It does not link SHARED_FRAG to
      GSO, So there is no need to define netdev feature for this.
      Signed-off-by: NPravin B Shelar <pshelar@nicira.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c9af6db4
    • D
      Merge branch 'tcp_tsoffset' · b8fa4100
      David S. Miller 提交于
      Andrey Vagin says:
      
      ====================
      If a TCP socket will get live-migrated from one box to another the
      timestamps (which are typically ON) will get screwed up -- the new
      kernel will generate TS values that has nothing to do with what they
      were on dump. The solution is to yet again fix the kernel and put a
      "timestamp offset" on a socket.
      
      A socket offset is added in places where externally visible tcp
      timestamp option is parsed/initialized.
      
      Connections in the SYN_RECV state are not supported, global
      tcp_time_stamp is used for them, because repair mode doesn't support
      this state. In a future it can be implemented by the similar way as for
      TIME_WAIT sockets.
      
      For time-wait sockets offset is inhereted by a proper tcp_sock.
      
      A per-socket offset can be set only for sockets in repair mode.
      ====================
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b8fa4100
    • A
      tcp: send packets with a socket timestamp · ee684b6f
      Andrey Vagin 提交于
      A socket timestamp is a sum of the global tcp_time_stamp and
      a per-socket offset.
      
      A socket offset is added in places where externally visible
      tcp timestamp option is parsed/initialized.
      
      Connections in the SYN_RECV state are not supported, global
      tcp_time_stamp is used for them, because repair mode doesn't support
      this state. In a future it can be implemented by the similar way
      as for TIME_WAIT sockets.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Signed-off-by: NAndrey Vagin <avagin@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ee684b6f
    • A
      tcp: set and get per-socket timestamp · 93be6ce0
      Andrey Vagin 提交于
      A timestamp can be set, only if a socket is in the repair mode.
      
      This patch adds a new socket option TCP_TIMESTAMP, which allows to
      get and set current tcp times stamp.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Signed-off-by: NAndrey Vagin <avagin@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      93be6ce0
    • A
      tcp: adding a per-socket timestamp offset · ceaa1fef
      Andrey Vagin 提交于
      This functionality is used for restoring tcp sockets. A tcp timestamp
      depends on how long a system has been running, so it's differ for each
      host. The solution is to set a per-socket offset.
      
      A per-socket offset for a TIME_WAIT socket is inherited from a proper
      tcp socket.
      
      tcp_request_sock doesn't have a timestamp offset, because the repair
      mode for them are not implemented.
      
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Cc: James Morris <jmorris@namei.org>
      Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>
      Cc: Patrick McHardy <kaber@trash.net>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Pavel Emelyanov <xemul@parallels.com>
      Signed-off-by: NAndrey Vagin <avagin@openvz.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ceaa1fef