enic: updates to version 1.4.1.6
Subsystems (2)
cover enic: updates to version 1.4.1.6
The following patch series implements enic driver updates:
1/5 - Add support for multiple hardware receive queues 2/5 - Make firmware cognizant of the user set mac address 3/5 - Replace firmware devcmd CMD_ENABLE with CMD_ENABLE_WAIT 4/5 - Change min MTU
5/5 - Fix log message
PATCH 1/5 enic: Add support for multiple hardware receive queues
From: Vasanthy Kolluri <[email protected]>
Add support for multiple hardware receive queues. The ingress traffic is hashed into one of the receive queues based on IP or TCP or both headers. The max no. of receive queues supported is 8.
--- drivers/net/enic/enic.h | 28 +-- drivers/net/enic/enic_main.c | 373 +++++++++++++++++++++++++++++++++--------- drivers/net/enic/enic_res.c | 49 +++--- drivers/net/enic/enic_res.h | 2 drivers/net/enic/vnic_rss.h | 40 +++++ 5 files changed, 368 insertions(+), 124 deletions(-) create mode 100644 drivers/net/enic/vnic_rss.h
drivers/net/enic/enic.h +5 -23
@@ -28,10 +28,11 @@#include "vnic_intr.h" #include "vnic_stats.h" #include "vnic_nic.h" +#include "vnic_rss.h" #define DRV_NAME "enic"#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver" -#define DRV_VERSION "1.4.1.2a" +#define DRV_VERSION "1.4.1.6"#define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc"#define ENIC_BARS_MAX 6
@@ -41,25 +42,6 @@#define ENIC_CQ_MAX (ENIC_WQ_MAX + ENIC_RQ_MAX)#define ENIC_INTR_MAX (ENIC_CQ_MAX + 2) -enum enic_cq_index { -ENIC_CQ_RQ , -ENIC_CQ_WQ , -}; - -enum enic_intx_intr_index { -ENIC_INTX_WQ_RQ , -ENIC_INTX_ERR , -ENIC_INTX_NOTIFY , -}; - -enum enic_msix_intr_index { -ENIC_MSIX_RQ , -ENIC_MSIX_WQ , -ENIC_MSIX_ERR , -ENIC_MSIX_NOTIFY , -ENIC_MSIX_MAX , -}; -struct enic_msix_entry {int requested;char devname[IFNAMSIZ ];
@@ -90,8 +72,8 @@ struct enic {struct vnic_dev *vdev;struct timer_list notify_timer;struct work_struct reset; -struct msix_entry msix_entry[ENIC_MSIX_MAX ]; -struct enic_msix_entry msix[ENIC_MSIX_MAX ]; +struct msix_entry msix_entry[ENIC_INTR_MAX ]; +struct enic_msix_entry msix[ENIC_INTR_MAX ];u32 msg_enable;spinlock_t devcmd_lock;u8 mac_addr[ETH_ALEN ];
@@ -118,7 +100,7 @@ struct enic {int (*rq_alloc_buf)(struct vnic_rq *rq);u64 rq_truncated_pkts;u64 rq_bad_fcs; -struct napi_struct napi; +struct napi_struct napi[ENIC_RQ_MAX ];/* interrupt resource cache line section */ ____cacheline_aligned struct vnic_intr intr[ENIC_INTR_MAX ];
drivers/net/enic/enic_main.c +291 -82
648 lines not on this page · raw message
drivers/net/enic/enic_res.c +30 -19
73 lines not on this page · raw message
drivers/net/enic/enic_res.h +2 -0
@@ -137,6 +137,8 @@ int enic_del_vlan(struct enic *enic, u16 vlanid);int enic_set_nic_cfg (struct enic *enic,u8 rss_default_cpu,u8 rss_hash_type,u8 rss_hash_bits,u8 rss_base_cpu,u8 rss_enable,u8 tso_ipid_split_en,u8 ig_vlan_strip_en); +int enic_set_rss_key (struct enic *enic,dma_addr_t key_pa,u64 len); +int enic_set_rss_cpu (struct enic *enic,dma_addr_t cpu_pa,u64 len);void enic_get_res_counts (struct enic *enic);void enic_init_vnic_resources (struct enic *enic);int enic_alloc_vnic_resources (struct enic *);
drivers/net/enic/vnic_rss.h new file +40 -0
@@ -0,0 +1,40 @@ +/* +* Copyright 2008-2010 Cisco Systems, Inc. All rights reserved. +* Copyright 2007 Nuova Systems, Inc. All rights reserved. +* +* This program is free software; you may redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; version 2 of the License. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS +* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +* SOFTWARE. +*/ + +#ifndef _VNIC_RSS_H_ +#define _VNIC_RSS_H_ + +/* RSS key array */ +union vnic_rss_key { +struct { +u8 b[10 ]; +u8 b_pad[6 ]; + } key[4 ]; +u64 raw[8 ]; +}; + +/* RSS cpu array */ +union vnic_rss_cpu { +struct { +u8 b[4 ] ; +u8 b_pad[4 ]; + } cpu[32 ]; +u64 raw[32 ]; +}; + +#endif /* _VNIC_RSS_H_ */
PATCH 2/5 enic: Make firmware cognizant of the user set mac address
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
Let the firmware know about the mac address set by the user using ndo_set_mac_address
--- drivers/net/enic/enic_main.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-)
drivers/net/enic/enic_main.c +12 -1
@@ -974,8 +974,19 @@ static int enic_set_mac_address_dynamic(struct net_device *netdev, void *p)static int enic_set_mac_address (struct net_device *netdev,void *p) {struct sockaddr *saddr = p; +char *addr = saddr->sa_data; +struct enic *enic =netdev_priv (netdev); +int err; + + err =enic_dev_del_station_addr (enic); +if (err) +return err; + + err =enic_set_mac_addr (netdev, addr); +if (err) +return err; -return enic_set_mac_addr (netdev, (char *)saddr->sa_data); +return enic_dev_add_station_addr (enic); } static int enic_dev_packet_filter(struct enic *enic, int directed,
PATCH 3/5 enic: Replace firmware devcmd CMD_ENABLE with CMD_ENABLE_WAIT
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
Replace no wait CMD_ENABLE firmware devcmd with CMD_ENABLE_WAIT
--- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/vnic_dev.c | 10 ++++++++-- drivers/net/enic/vnic_dev.h | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-)
drivers/net/enic/enic_main.c +1 -1
@@ -1787,7 +1787,7 @@ static int enic_dev_enable(struct enic *enic)int err;spin_lock (&enic->devcmd_lock); - err =vnic_dev_enable (enic->vdev); + err =vnic_dev_enable_wait (enic->vdev);spin_unlock (&enic->devcmd_lock);return err;
drivers/net/enic/vnic_dev.c +8 -2
@@ -487,11 +487,17 @@ int vnic_dev_close(struct vnic_dev *vdev)return vnic_dev_cmd (vdev,CMD_CLOSE , &a0, &a1, wait); } -int vnic_dev_enable (struct vnic_dev *vdev) +int vnic_dev_enable_wait (struct vnic_dev *vdev) {u64 a0 =0 , a1 =0 ;int wait =1000 ; -return vnic_dev_cmd (vdev,CMD_ENABLE , &a0, &a1, wait); +int err; + + err =vnic_dev_cmd (vdev,CMD_ENABLE_WAIT , &a0, &a1, wait); +if (err ==ERR_ECMDUNKNOWN ) +return vnic_dev_cmd (vdev,CMD_ENABLE , &a0, &a1, wait); + +return err; }int vnic_dev_disable (struct vnic_dev *vdev)
drivers/net/enic/vnic_dev.h +1 -1
@@ -111,7 +111,7 @@ u32 vnic_dev_port_speed(struct vnic_dev *vdev);u32 vnic_dev_msg_lvl (struct vnic_dev *vdev);u32 vnic_dev_mtu (struct vnic_dev *vdev);int vnic_dev_close (struct vnic_dev *vdev); -int vnic_dev_enable (struct vnic_dev *vdev); +int vnic_dev_enable_wait (struct vnic_dev *vdev);int vnic_dev_disable (struct vnic_dev *vdev);int vnic_dev_open (struct vnic_dev *vdev,int arg);int vnic_dev_open_done (struct vnic_dev *vdev,int *done);
PATCH 4/5 enic: Change min MTU
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
Change min MTU to 68.
--- drivers/net/enic/enic_res.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/enic/enic_res.h +1 -1
@@ -30,7 +30,7 @@#define ENIC_MIN_RQ_DESCS 64#define ENIC_MAX_RQ_DESCS 4096 -#define ENIC_MIN_MTU 576/* minimum for IPv4 */ +#define ENIC_MIN_MTU 68#define ENIC_MAX_MTU 9000#define ENIC_MULTICAST_PERFECT_FILTERS 32
PATCH 5/5 enic: Fix log message
In reply to Vasanthy KolluriFrom: Vasanthy Kolluri <[email protected]>
Fix a log message
--- drivers/net/enic/enic_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/enic/enic_main.c +1 -1
@@ -2428,7 +2428,7 @@ static int enic_dev_init(struct enic *enic) err =enic_dev_set_ig_vlan_rewrite_mode (enic);if (err) { -netdev_err (netdev, +dev_err (dev,"Failed to set ingress vlan rewrite mode, aborting.\n" ); goto err_out_free_vnic_resources; }
David Miller
maintainerFrom: Vasanthy Kolluri <[email protected]>
Date: Wed, 20 Oct 2010 13:16:53 -0700
Quoted 11 lines
The following patch series implements enic driver updates:
1/5 - Add support for multiple hardware receive queues 2/5 - Make firmware cognizant of the user set mac address 3/5 - Replace firmware devcmd
CMD_ENABLEwithCMD_ENABLE_WAIT4/5 - Change min MTU
5/5 - Fix log messageSigned-off-by Vasanthy Kolluri <[email protected]>Signed-off-by Roopa Prabhu <[email protected]>Signed-off-by David Wang <[email protected]>
All applied, thanks.