From: Steve Wise Date: Tue, 18 Nov 2014 14:01:44 +0000 (-0600) Subject: Add cxgb4 backport patch for RHEL7 X-Git-Tag: vofed-3.18~83 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=ec378b16b49d648a09bac374ac594c699c7ee337;p=~emulex%2Ffor-vlad%2Fcompat-rdma.git Add cxgb4 backport patch for RHEL7 Signed-off-by: Steve Wise --- diff --git a/patches/0016-BACKPORT-cxgb4.patch b/patches/0016-BACKPORT-cxgb4.patch new file mode 100644 index 0000000..169d7a1 --- /dev/null +++ b/patches/0016-BACKPORT-cxgb4.patch @@ -0,0 +1,191 @@ +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +index 3f60070..578f7cd 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +@@ -70,7 +70,9 @@ + #include "cxgb4_dcb.h" + #include "l2t.h" + ++#ifdef HAVE_BONDING_H + #include <../drivers/net/bonding/bonding.h> ++#endif + + #ifdef DRV_VERSION + #undef DRV_VERSION +@@ -1433,8 +1435,17 @@ static int del_filter_wr(struct adapter *adapter, int fidx) + return 0; + } + ++#ifdef HAVE_SELECT_QUEUE_FALLBACK_T + static u16 cxgb_select_queue(struct net_device *dev, struct sk_buff *skb, + void *accel_priv, select_queue_fallback_t fallback) ++#else ++#ifdef NDO_SELECT_QUEUE_HAS_ACCEL_PRIV ++static u16 cxgb_select_queue(struct net_device *dev, struct sk_buff *skb, ++ void *accel_priv) ++#else ++#endif ++static u16 cxgb_select_queue(struct net_device *dev, struct sk_buff *skb) ++#endif + { + int txq; + +@@ -1472,7 +1483,11 @@ static u16 cxgb_select_queue(struct net_device *dev, struct sk_buff *skb, + return txq; + } + ++#ifdef HAVE_SELECT_QUEUE_FALLBACK_T + return fallback(dev, skb) % dev->real_num_tx_queues; ++#else ++ return __netdev_pick_tx(dev, skb) % dev->real_num_tx_queues; ++#endif + } + + static inline int is_offload(const struct adapter *adap) +@@ -2999,6 +3014,7 @@ static int cxgb_set_features(struct net_device *dev, netdev_features_t features) + return err; + } + ++#ifdef HAVE_GET_SET_RXFH + static u32 get_rss_table_size(struct net_device *dev) + { + const struct port_info *pi = netdev_priv(dev); +@@ -3027,6 +3043,7 @@ static int set_rss_table(struct net_device *dev, const u32 *p, const u8 *key) + return write_rss(pi, pi->rss); + return 0; + } ++#endif + + static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info, + u32 *rules) +@@ -3117,9 +3134,11 @@ static const struct ethtool_ops cxgb_ethtool_ops = { + .get_wol = get_wol, + .set_wol = set_wol, + .get_rxnfc = get_rxnfc, ++#ifdef HAVE_GET_SET_RXFH + .get_rxfh_indir_size = get_rss_table_size, + .get_rxfh = get_rss_table, + .set_rxfh = set_rss_table, ++#endif + .flash_device = set_flash, + }; + +@@ -4418,15 +4437,19 @@ static int cxgb4_inet6addr_handler(struct notifier_block *this, + struct inet6_ifaddr *ifa = data; + struct net_device *event_dev; + int ret = NOTIFY_DONE; ++#ifdef HAVE_BONDING_H + struct bonding *bond = netdev_priv(ifa->idev->dev); + struct list_head *iter; + struct slave *slave; + struct pci_dev *first_pdev = NULL; ++#endif + + if (ifa->idev->dev->priv_flags & IFF_802_1Q_VLAN) { + event_dev = vlan_dev_real_dev(ifa->idev->dev); + ret = clip_add(event_dev, ifa, event); + } else if (ifa->idev->dev->flags & IFF_MASTER) { ++ ++#ifdef HAVE_BONDING_H + /* It is possible that two different adapters are bonded in one + * bond. We need to find such different adapters and add clip + * in all of them only once. +@@ -4444,6 +4467,10 @@ static int cxgb4_inet6addr_handler(struct notifier_block *this, + to_pci_dev(slave->dev->dev.parent)) + ret = clip_add(slave->dev, ifa, event); + } ++#else ++ netdev_warn(ifa->idev->dev, "offloaded IPv6 and bonding not " ++ "supported on this kernel\n"); ++#endif + } else + ret = clip_add(ifa->idev->dev, ifa, event); + +@@ -4454,6 +4481,7 @@ static struct notifier_block cxgb4_inet6addr_notifier = { + .notifier_call = cxgb4_inet6addr_handler + }; + ++ + /* Retrieves IPv6 addresses from a root device (bond, vlan) associated with + * a physical device. + * The physical device reference is needed to send the actul CLIP command. +@@ -4499,7 +4527,11 @@ static int update_root_dev_clip(struct net_device *dev) + } + + for (i = 0; i < VLAN_N_VID; i++) { ++#ifdef HAVE___VLAN_FIND_DEV_DEEP_RCU + root_dev = __vlan_find_dev_deep_rcu(dev, htons(ETH_P_8021Q), i); ++#else ++ root_dev = __vlan_find_dev_deep(dev, htons(ETH_P_8021Q), i); ++#endif + if (!root_dev) + continue; + +@@ -6406,9 +6438,25 @@ static int enable_msix(struct adapter *adap) + #else + need = adap->params.nports + EXTRA_VECS + ofld_need; + #endif ++#ifdef HAVE_PCI_ENABLE_MSIX_RANGE + want = pci_enable_msix_range(adap->pdev, entries, need, want); + if (want < 0) + return want; ++#else ++{ ++ int err; ++ ++ while ((err = pci_enable_msix(adap->pdev, entries, want)) >= need) ++ want = err; ++ ++ if (err) { ++ if (err > 0) ++ dev_info(adap->pdev_dev, "only %d MSI-X vectors left, " ++ "not using MSI-X\n", err); ++ return err; ++ } ++} ++#endif + + /* + * Distribute available vectors to the various queue groups. +diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c +index 5e1b314..ebffcb4 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c +@@ -386,7 +386,11 @@ static void free_tx_desc(struct adapter *adap, struct sge_txq *q, + if (d->skb) { /* an SGL is present */ + if (unmap) + unmap_sgl(dev, d->skb, d->sgl, q); ++#ifdef HAVE_DEV_CONSUME_SKB_ANY + dev_consume_skb_any(d->skb); ++#else ++ dev_kfree_skb_any(d->skb); ++#endif + d->skb = NULL; + } + ++d; +@@ -1158,7 +1162,11 @@ out_free: dev_kfree_skb_any(skb); + + if (immediate) { + inline_tx_skb(skb, &q->q, cpl + 1); ++#ifdef HAVE_DEV_CONSUME_SKB_ANY + dev_consume_skb_any(skb); ++#else ++ dev_kfree_skb_any(skb); ++#endif + } else { + int last_desc; + +diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +index a9d9d74..ce51c80 100644 +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +@@ -4101,7 +4101,9 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf) + p->lport = j; + p->rss_size = rss_size; + memcpy(adap->port[i]->dev_addr, addr, ETH_ALEN); ++#ifdef HAVE_NET_DEVICE_DEV_PORT + adap->port[i]->dev_port = j; ++#endif + + ret = ntohl(c.u.info.lstatus_to_modtype); + p->mdio_addr = (ret & FW_PORT_CMD_MDIOCAP) ?