]> git.openfabrics.org - ~tnikolova/compat-rdma/.git/commitdiff
cxgb4: RHEL7.2 backports
authorPotnuri Bharat Teja <bharat@chelsio.com>
Thu, 3 Mar 2016 22:25:45 +0000 (14:25 -0800)
committerroot <root@stevo1.asicdesigners.com>
Thu, 3 Mar 2016 22:44:03 +0000 (14:44 -0800)
Signed-off-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Steve Wise <swise@opengridcomputing.com>
patches/0038_BACKPORT_cxgb4_RHEL7_2.patch [new file with mode: 0755]

diff --git a/patches/0038_BACKPORT_cxgb4_RHEL7_2.patch b/patches/0038_BACKPORT_cxgb4_RHEL7_2.patch
new file mode 100755 (executable)
index 0000000..77d3a1c
--- /dev/null
@@ -0,0 +1,80 @@
+diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+index 279873c..670f7dd 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"
+
+-#include <../drivers/net/bonding/bonding.h>
++#ifdef HAVE_BONDING_H
++#include <net/bonding.h>
++#endif
+
+ #ifdef DRV_VERSION
+ #undef DRV_VERSION
+@@ -3014,26 +3016,58 @@ static u32 get_rss_table_size(struct net_device *dev)
+       return pi->rss_size;
+ }
+
+-static int get_rss_table(struct net_device *dev, u32 *p, u8 *key)
++static int get_rss_table(struct net_device *dev, u32 *p,
++#ifdef HAVE_ETH_SS_RSS_HASH_FUNCS
++      u8 *key, u8 *hfunc)
++#else
++      u8 *key)
++#endif
+ {
+       const struct port_info *pi = netdev_priv(dev);
+       unsigned int n = pi->rss_size;
+
++#ifdef HAVE_ETH_SS_RSS_HASH_FUNCS
++      if (hfunc)
++              *hfunc = ETH_RSS_HASH_TOP;
++#endif
++      if (!p)
++              return 0;
++
+       while (n--)
+               p[n] = pi->rss[n];
+       return 0;
+ }
+
+-static int set_rss_table(struct net_device *dev, const u32 *p, const u8 *key)
++static int set_rss_table(struct net_device *dev, const u32 *p,
++#ifdef HAVE_ETH_SS_RSS_HASH_FUNCS
++      const u8 *key, const u8 hfunc)
++#else
++      const u8 *key)
++#endif
+ {
+       unsigned int i;
+       struct port_info *pi = netdev_priv(dev);
+
+-      for (i = 0; i < pi->rss_size; i++)
+-              pi->rss[i] = p[i];
+-      if (pi->adapter->flags & FULL_INIT_DONE)
++#ifdef HAVE_ETH_SS_RSS_HASH_FUNCS
++      /* We require at least one supported parameter to be changed and no
++       * change in any of the unsupported parameters
++       */
++      if (key ||
++              (hfunc != ETH_RSS_HASH_NO_CHANGE && hfunc != ETH_RSS_HASH_TOP))
++              return -EOPNOTSUPP;
++#endif
++      if (!p)
++              return 0;
++
++      /* Interface must be brought up atleast once */
++      if (pi->adapter->flags & FULL_INIT_DONE) {
++              for (i = 0; i < pi->rss_size; i++)
++                      pi->rss[i] = p[i];
++
+               return write_rss(pi, pi->rss);
+-      return 0;
++      }
++
++      return -EPERM;
+ }
+
+ static int get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *info,