[BACK]Return to ixv.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / dev / pci / ixgbe

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/dev/pci/ixgbe/ixv.c between version 1.125 and 1.126

version 1.125, 2019/07/30 08:38:03 version 1.126, 2019/08/20 04:11:22
Line 120  static void ixv_configure_ivars(struct a
Line 120  static void ixv_configure_ivars(struct a
 static u8 *     ixv_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);  static u8 *     ixv_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *);
 static void     ixv_eitr_write(struct adapter *, uint32_t, uint32_t);  static void     ixv_eitr_write(struct adapter *, uint32_t, uint32_t);
   
   static void     ixv_setup_vlan_tagging(struct adapter *);
 static int      ixv_setup_vlan_support(struct adapter *);  static int      ixv_setup_vlan_support(struct adapter *);
 static int      ixv_vlan_cb(struct ethercom *, uint16_t, bool);  static int      ixv_vlan_cb(struct ethercom *, uint16_t, bool);
 static int      ixv_register_vlan(void *, struct ifnet *, u16);  static int      ixv_register_vlan(void *, struct ifnet *, u16);
Line 1935  ixv_sysctl_rdt_handler(SYSCTLFN_ARGS)
Line 1936  ixv_sysctl_rdt_handler(SYSCTLFN_ARGS)
         return sysctl_lookup(SYSCTLFN_CALL(&node));          return sysctl_lookup(SYSCTLFN_CALL(&node));
 } /* ixv_sysctl_rdt_handler */  } /* ixv_sysctl_rdt_handler */
   
 /************************************************************************  static void
  * ixv_setup_vlan_support  ixv_setup_vlan_tagging(struct adapter *adapter)
  ************************************************************************/  
 static int  
 ixv_setup_vlan_support(struct adapter *adapter)  
 {  {
         struct ethercom *ec = &adapter->osdep.ec;          struct ethercom *ec = &adapter->osdep.ec;
         struct ixgbe_hw *hw = &adapter->hw;          struct ixgbe_hw *hw = &adapter->hw;
         struct rx_ring  *rxr;          struct rx_ring  *rxr;
         u32             ctrl, vid, vfta, retry;          u32             ctrl;
         struct vlanid_list *vlanidp;          int             i;
         int rv, error = 0;  
         bool usevlan;  
         bool            hwtagging;          bool            hwtagging;
   
         /*  
          *  This function is called from both if_init and ifflags_cb()  
          * on NetBSD.  
          */  
         usevlan = VLAN_ATTACHED(ec);  
   
         /* Enable HW tagging only if any vlan is attached */          /* Enable HW tagging only if any vlan is attached */
         hwtagging = (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING)          hwtagging = (ec->ec_capenable & ETHERCAP_VLAN_HWTAGGING)
             && VLAN_ATTACHED(ec);              && VLAN_ATTACHED(ec);
   
         /* Enable the queues */          /* Enable the queues */
         for (int i = 0; i < adapter->num_queues; i++) {          for (i = 0; i < adapter->num_queues; i++) {
                 rxr = &adapter->rx_rings[i];                  rxr = &adapter->rx_rings[i];
                 ctrl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(rxr->me));                  ctrl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(rxr->me));
                 if (hwtagging)                  if (hwtagging)
Line 1975  ixv_setup_vlan_support(struct adapter *a
Line 1965  ixv_setup_vlan_support(struct adapter *a
                  */                   */
                 rxr->vtag_strip = hwtagging ? TRUE : FALSE;                  rxr->vtag_strip = hwtagging ? TRUE : FALSE;
         }          }
   } /* ixv_setup_vlan_tagging */
   
   /************************************************************************
    * ixv_setup_vlan_support
    ************************************************************************/
   static int
   ixv_setup_vlan_support(struct adapter *adapter)
   {
           struct ethercom *ec = &adapter->osdep.ec;
           struct ixgbe_hw *hw = &adapter->hw;
           u32             vid, vfta, retry;
           struct vlanid_list *vlanidp;
           int rv, error = 0;
   
         if (!usevlan)          /*
            *  This function is called from both if_init and ifflags_cb()
            * on NetBSD.
            */
   
           /*
            * Part 1:
            * Setup VLAN HW tagging
            */
           ixv_setup_vlan_tagging(adapter);
   
           if (!VLAN_ATTACHED(ec))
                 return 0;                  return 0;
   
           /*
            * Part 2:
            * Setup VLAN HW filter
            */
         /* Cleanup shadow_vfta */          /* Cleanup shadow_vfta */
         for (int i = 0; i < IXGBE_VFTA_SIZE; i++)          for (int i = 0; i < IXGBE_VFTA_SIZE; i++)
                 adapter->shadow_vfta[i] = 0;                  adapter->shadow_vfta[i] = 0;
Line 2036  static int
Line 2054  static int
 ixv_vlan_cb(struct ethercom *ec, uint16_t vid, bool set)  ixv_vlan_cb(struct ethercom *ec, uint16_t vid, bool set)
 {  {
         struct ifnet *ifp = &ec->ec_if;          struct ifnet *ifp = &ec->ec_if;
           struct adapter *adapter = ifp->if_softc;
         int rv;          int rv;
   
         if (set)          if (set)
Line 2043  ixv_vlan_cb(struct ethercom *ec, uint16_
Line 2062  ixv_vlan_cb(struct ethercom *ec, uint16_
         else          else
                 rv = ixv_unregister_vlan(ifp->if_softc, ifp, vid);                  rv = ixv_unregister_vlan(ifp->if_softc, ifp, vid);
   
           if (rv != 0)
                   return rv;
   
           /*
            * Control VLAN HW tagging when ec_nvlan is changed from 1 to 0
            * or 0 to 1.
            */
           if ((set && (ec->ec_nvlans == 1)) || (!set && (ec->ec_nvlans == 0)))
                   ixv_setup_vlan_tagging(adapter);
   
         return rv;          return rv;
 }  }
   

Legend:
Removed from v.1.125  
changed lines
  Added in v.1.126

CVSweb <webmaster@jp.NetBSD.org>