DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16
@ 2014-06-17 14:32 Aaro Koskinen
  2014-06-17 14:32 ` [dpdk-dev] [PATCH 2/2] kni: igb: modify rate configation to support min/max rate fields Aaro Koskinen
  2014-07-01 22:04 ` [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16 Thomas Monjalon
  0 siblings, 2 replies; 4+ messages in thread
From: Aaro Koskinen @ 2014-06-17 14:32 UTC (permalink / raw)
  To: dev

SET_ETHTOOL_OPS is gone in 3.16, so modify drivers accordingly.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h   | 4 ++++
 lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h | 5 +++++
 lib/librte_eal/linuxapp/kni/kni_ethtool.c           | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index 4c27d5d..f5e4435 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3853,4 +3853,8 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 #endif /* NETIF_F_RXHASH */
 #endif /* < 3.14.0 */
 
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) )
+#define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops))
+#endif /* >= 3.16.0 */
+
 #endif /* _KCOMPAT_H_ */
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
index 4126d14..5a6a770 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h
@@ -3136,4 +3136,9 @@ static inline int __kc_pci_vfs_assigned(struct pci_dev *dev)
 #define pci_vfs_assigned(dev) __kc_pci_vfs_assigned(dev)
 
 #endif
+
+#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) )
+#define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops))
+#endif /* >= 3.16.0 */
+
 #endif /* _KCOMPAT_H_ */
diff --git a/lib/librte_eal/linuxapp/kni/kni_ethtool.c b/lib/librte_eal/linuxapp/kni/kni_ethtool.c
index d0673e5..06b6d46 100644
--- a/lib/librte_eal/linuxapp/kni/kni_ethtool.c
+++ b/lib/librte_eal/linuxapp/kni/kni_ethtool.c
@@ -213,5 +213,5 @@ struct ethtool_ops kni_ethtool_ops = {
 void
 kni_set_ethtool_ops(struct net_device *netdev)
 {
-	SET_ETHTOOL_OPS(netdev, &kni_ethtool_ops);
+	netdev->ethtool_ops = &kni_ethtool_ops;
 }
-- 
2.0.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-dev] [PATCH 2/2] kni: igb: modify rate configation to support min/max rate fields
  2014-06-17 14:32 [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16 Aaro Koskinen
@ 2014-06-17 14:32 ` Aaro Koskinen
  2014-07-01 22:05   ` Thomas Monjalon
  2014-07-01 22:04 ` [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16 Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2014-06-17 14:32 UTC (permalink / raw)
  To: dev

This follows the mainline Linux kernel commit
ed616689a3d95eb6c9bdbb1ef74b0f50cbdf276a (Add support to configure SR-IOV
VF minimum and maximum Tx rate) by Sucheta Chakraborty, and enables to
build the driver against 3.16.

Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
---
 lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 23 ++++++++++++++++++++++
 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h  |  1 +
 2 files changed, 24 insertions(+)

diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
index 0657237..a802a02 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c
@@ -200,7 +200,11 @@ static int igb_ndo_set_vf_vlan(struct net_device *netdev,
 static int igb_ndo_set_vf_spoofchk(struct net_device *netdev, int vf,
 				bool setting);
 #endif
+#ifdef HAVE_VF_MIN_MAX_TXRATE
+static int igb_ndo_set_vf_bw(struct net_device *, int, int, int);
+#else /* HAVE_VF_MIN_MAX_TXRATE */
 static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate);
+#endif /* HAVE_VF_MIN_MAX_TXRATE */
 static int igb_ndo_get_vf_config(struct net_device *netdev, int vf,
 				 struct ifla_vf_info *ivi);
 static void igb_check_vf_rate_limit(struct igb_adapter *);
@@ -2278,7 +2282,11 @@ static const struct net_device_ops igb_netdev_ops = {
 #ifdef IFLA_VF_MAX
 	.ndo_set_vf_mac		= igb_ndo_set_vf_mac,
 	.ndo_set_vf_vlan	= igb_ndo_set_vf_vlan,
+#ifdef HAVE_VF_MIN_MAX_TXRATE
+	.ndo_set_vf_rate	= igb_ndo_set_vf_bw,
+#else /* HAVE_VF_MIN_MAX_TXRATE */
 	.ndo_set_vf_tx_rate	= igb_ndo_set_vf_bw,
+#endif /* HAVE_VF_MIN_MAX_TXRATE */
 	.ndo_get_vf_config	= igb_ndo_get_vf_config,
 #ifdef HAVE_VF_SPOOFCHK_CONFIGURE
 	.ndo_set_vf_spoofchk	= igb_ndo_set_vf_spoofchk,
@@ -9389,7 +9397,12 @@ static void igb_check_vf_rate_limit(struct igb_adapter *adapter)
 	}
 }
 
+#ifdef HAVE_VF_MIN_MAX_TXRATE
+static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int min_tx_rate,
+			     int tx_rate)
+#else /* HAVE_VF_MIN_MAX_TXRATE */
 static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate)
+#endif /* HAVE_VF_MIN_MAX_TXRATE */
 {
 	struct igb_adapter *adapter = netdev_priv(netdev);
 	struct e1000_hw *hw = &adapter->hw;
@@ -9398,6 +9411,11 @@ static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate)
 	if (hw->mac.type != e1000_82576)
 		return -EOPNOTSUPP;
 
+#ifdef HAVE_VF_MIN_MAX_TXRATE
+	if (min_tx_rate)
+		return -EINVAL;
+#endif /* HAVE_VF_MIN_MAX_TXRATE */
+
 	actual_link_speed = igb_link_mbps(adapter->link_speed);
 	if ((vf >= adapter->vfs_allocated_count) ||
 		(!(E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_LU)) ||
@@ -9419,7 +9437,12 @@ static int igb_ndo_get_vf_config(struct net_device *netdev,
 		return -EINVAL;
 	ivi->vf = vf;
 	memcpy(&ivi->mac, adapter->vf_data[vf].vf_mac_addresses, ETH_ALEN);
+#ifdef HAVE_VF_MIN_MAX_TXRATE
+	ivi->max_tx_rate = adapter->vf_data[vf].tx_rate;
+	ivi->min_tx_rate = 0;
+#else /* HAVE_VF_MIN_MAX_TXRATE */
 	ivi->tx_rate = adapter->vf_data[vf].tx_rate;
+#endif /* HAVE_VF_MIN_MAX_TXRATE */
 	ivi->vlan = adapter->vf_data[vf].pf_vlan;
 	ivi->qos = adapter->vf_data[vf].pf_qos;
 #ifdef HAVE_VF_SPOOFCHK_CONFIGURE
diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
index f5e4435..7c5d6ac 100644
--- a/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
+++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h
@@ -3855,6 +3855,7 @@ skb_set_hash(struct sk_buff *skb, __u32 hash, __always_unused int type)
 
 #if ( LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) )
 #define SET_ETHTOOL_OPS(netdev, ops) ((netdev)->ethtool_ops = (ops))
+#define HAVE_VF_MIN_MAX_TXRATE 1
 #endif /* >= 3.16.0 */
 
 #endif /* _KCOMPAT_H_ */
-- 
2.0.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16
  2014-06-17 14:32 [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16 Aaro Koskinen
  2014-06-17 14:32 ` [dpdk-dev] [PATCH 2/2] kni: igb: modify rate configation to support min/max rate fields Aaro Koskinen
@ 2014-07-01 22:04 ` Thomas Monjalon
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-07-01 22:04 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: dev

2014-06-17 17:32, Aaro Koskinen:
> SET_ETHTOOL_OPS is gone in 3.16, so modify drivers accordingly.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>

Applied for version 1.7.0.

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH 2/2] kni: igb: modify rate configation to support min/max rate fields
  2014-06-17 14:32 ` [dpdk-dev] [PATCH 2/2] kni: igb: modify rate configation to support min/max rate fields Aaro Koskinen
@ 2014-07-01 22:05   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2014-07-01 22:05 UTC (permalink / raw)
  To: Aaro Koskinen; +Cc: dev

2014-06-17 17:32, Aaro Koskinen:
> This follows the mainline Linux kernel commit
> ed616689a3d95eb6c9bdbb1ef74b0f50cbdf276a (Add support to configure SR-IOV
> VF minimum and maximum Tx rate) by Sucheta Chakraborty, and enables to
> build the driver against 3.16.
> 
> Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>

Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>

Applied for version 1.7.0.

Thanks
-- 
Thomas

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-01 22:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-17 14:32 [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16 Aaro Koskinen
2014-06-17 14:32 ` [dpdk-dev] [PATCH 2/2] kni: igb: modify rate configation to support min/max rate fields Aaro Koskinen
2014-07-01 22:05   ` Thomas Monjalon
2014-07-01 22:04 ` [dpdk-dev] [PATCH 1/2] kni: fix build with kernel 3.16 Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).