update Intel copyright years to 2014
[dpdk.git] / lib / librte_pmd_ixgbe / ixgbe_pf.c
index a11a969..07202d4 100644 (file)
@@ -1,35 +1,34 @@
 /*-
  *   BSD LICENSE
  * 
- *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
+ *   Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
  *   All rights reserved.
  * 
- *   Redistribution and use in source and binary forms, with or without 
- *   modification, are permitted provided that the following conditions 
+ *   Redistribution and use in source and binary forms, with or without
+ *   modification, are permitted provided that the following conditions
  *   are met:
  * 
- *     * Redistributions of source code must retain the above copyright 
+ *     * Redistributions of source code must retain the above copyright
  *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright 
- *       notice, this list of conditions and the following disclaimer in 
- *       the documentation and/or other materials provided with the 
+ *     * Redistributions in binary form must reproduce the above copyright
+ *       notice, this list of conditions and the following disclaimer in
+ *       the documentation and/or other materials provided with the
  *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its 
- *       contributors may be used to endorse or promote products derived 
+ *     * Neither the name of Intel Corporation nor the names of its
+ *       contributors may be used to endorse or promote products derived
  *       from this software without specific prior written permission.
  * 
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
  */
 
 #include <stdio.h>
 
 #define IXGBE_MAX_VFTA     (128)
 
-static inline 
-void eth_random_addr(uint8_t *addr)
-{
-       uint64_t rand = rte_rand();
-       uint8_t *p = (uint8_t*)&rand;
-
-       rte_memcpy(addr, p, ETHER_ADDR_LEN);
-       addr[0] &= 0xfe;        /* clear multicast bit */
-       addr[0] |= 0x02;        /* set local assignment bit (IEEE802) */
-}
-
 static inline uint16_t
 dev_num_vf(struct rte_eth_dev *eth_dev)
 {
@@ -105,6 +93,10 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
 {
        struct ixgbe_vf_info **vfinfo = 
                IXGBE_DEV_PRIVATE_TO_P_VFDATA(eth_dev->data->dev_private);
+       struct ixgbe_mirror_info *mirror_info =
+        IXGBE_DEV_PRIVATE_TO_PFDATA(eth_dev->data->dev_private);
+       struct ixgbe_uta_info *uta_info =
+        IXGBE_DEV_PRIVATE_TO_UTA(eth_dev->data->dev_private);
        struct ixgbe_hw *hw = 
                IXGBE_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
        uint16_t vf_num;
@@ -120,6 +112,10 @@ void ixgbe_pf_host_init(struct rte_eth_dev *eth_dev)
        if (*vfinfo == NULL)
                rte_panic("Cannot allocate memory for private VF data\n");
 
+       memset(mirror_info,0,sizeof(struct ixgbe_mirror_info));
+       memset(uta_info,0,sizeof(struct ixgbe_uta_info));
+       hw->mac.mc_filter_type = 0;
+
        if (vf_num >= ETH_32_POOLS) {
                nb_queue = 2;
                RTE_ETH_DEV_SRIOV(eth_dev).active = ETH_64_POOLS;
@@ -267,8 +263,6 @@ set_rx_mode(struct rte_eth_dev *dev)
        if (dev_data->promiscuous) {
                fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
                vmolr |= (IXGBE_VMOLR_ROPE | IXGBE_VMOLR_MPE);
-               /* don't hardware filter vlans in promisc mode */
-               ixgbe_vlan_hw_filter_disable(dev);
        } else {
                if (dev_data->all_multicast) {
                        fctrl |= IXGBE_FCTRL_MPE;
@@ -276,7 +270,6 @@ set_rx_mode(struct rte_eth_dev *dev)
                } else {
                        vmolr |= IXGBE_VMOLR_ROMPE;
                }
-               ixgbe_vlan_hw_filter_enable(dev);
        }
 
        if (hw->mac.type != ixgbe_mac_82598EB) {