[dpdk-dev] Port merging
Hello, I was wondering if I missed the port merging functionnality in the API. I want to correctly (with timestamp) merge all incoming packets of two or more differents ports. Otherwise what do you think is the best way to achieve this ? Any pointers to white papers, implementations... ? Thanks, Julien. -- next part -- An HTML attachment was scrubbed... URL: <http://dpdk.org/ml/archives/dev/attachments/20130729/117053ae/attachment.html>
[dpdk-dev] [PATCH 0/4] build fixes for recent distros
KNI is an out-of-tree kernel driver, so it needs some updates to follow recent API changes in Linux. There is also a patch to build with latest GCC. Needless to say, these patches are totally useless for Debian users :) --- Thomas Monjalon (4): kni: fix build with kernel 3.8 kni: fix build with kernel 3.9 kni: fix build with kernel 3.10 app: fix build with gcc 4.8 app/test/test_cmdline_string.c |2 +- lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h | 17 - lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 507 ++-- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 46 +- lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h |6 +- .../linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c | 14 +- .../linuxapp/kni/ethtool/ixgbe/ixgbe_main.c| 16 +- .../linuxapp/kni/ethtool/ixgbe/kcompat.h | 51 +- 8 files changed, 132 insertions(+), 527 deletions(-) -- 1.7.10.4
[dpdk-dev] [PATCH 1/4] kni: fix build with kernel 3.8
- timecompare has been removed. (see Linux commit 65f8f9a1c1db831e5159e3e3e50912d1f214cd0c) - annotations __devinit and __devexit have been removed. Signed-off-by: Thomas Monjalon --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h | 17 - lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 460 lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 20 + 3 files changed, 20 insertions(+), 477 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h index 3cebff5..ea120af 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb.h @@ -44,12 +44,6 @@ #include #endif -#ifdef HAVE_HW_TIME_STAMP -#include -#include -#include - -#endif struct igb_adapter; #if defined(CONFIG_DCA) || defined(CONFIG_DCA_MODULE) @@ -59,11 +53,6 @@ struct igb_adapter; #include #endif -#ifndef HAVE_HW_TIME_STAMP -#undef IGB_PER_PKT_TIMESTAMP -#endif - - #include "kcompat.h" #ifdef HAVE_SCTP @@ -505,12 +494,6 @@ struct igb_adapter { #ifndef IGB_NO_LRO struct igb_lro_stats lro_stats; #endif -#ifdef HAVE_HW_TIME_STAMP - struct cyclecounter cycles; - struct timecounter clock; - struct timecompare compare; - struct hwtstamp_config hwtstamp_config; -#endif /* structs defined in e1000_hw.h */ struct e1000_hw hw; 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 9d772fa..4462464 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -111,9 +111,6 @@ static void igb_setup_mrqc(struct igb_adapter *); void igb_update_stats(struct igb_adapter *); static int igb_probe(struct pci_dev *, const struct pci_device_id *); static void __devexit igb_remove(struct pci_dev *pdev); -#ifdef HAVE_HW_TIME_STAMP -static void igb_init_hw_timer(struct igb_adapter *adapter); -#endif static int igb_sw_init(struct igb_adapter *); static int igb_open(struct net_device *); static int igb_close(struct net_device *); @@ -301,34 +298,6 @@ static void igb_vfta_set(struct igb_adapter *adapter, u32 vid, bool add) adapter->shadow_vfta[index] = vfta; } -#ifdef HAVE_HW_TIME_STAMP -/** - * igb_read_clock - read raw cycle counter (to be used by time counter) - */ -static cycle_t igb_read_clock(const struct cyclecounter *tc) -{ - struct igb_adapter *adapter = - container_of(tc, struct igb_adapter, cycles); - struct e1000_hw *hw = &adapter->hw; - u64 stamp = 0; - int shift = 0; - - /* -* The timestamp latches on lowest register read. For the 82580 -* the lowest register is SYSTIMR instead of SYSTIML. However we never -* adjusted TIMINCA so SYSTIMR will just read as all 0s so ignore it. -*/ - if (hw->mac.type >= e1000_82580) { - stamp = E1000_READ_REG(hw, E1000_SYSTIMR) >> 8; - shift = IGB_82580_TSYNC_SHIFT; - } - - stamp |= (u64)E1000_READ_REG(hw, E1000_SYSTIML) << shift; - stamp |= (u64)E1000_READ_REG(hw, E1000_SYSTIMH) << (shift + 32); - return stamp; -} - -#endif /* SIOCSHWTSTAMP */ static int debug = NETIF_MSG_DRV | NETIF_MSG_PROBE; //module_param(debug, int, 0); //MODULE_PARM_DESC(debug, "Debug level (0=none, ..., 16=all)"); @@ -2341,11 +2310,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, } #endif -#ifdef HAVE_HW_TIME_STAMP - /* do hw tstamp init after resetting */ - igb_init_hw_timer(adapter); -#endif dev_info(pci_dev_to_dev(pdev), "Intel(R) Gigabit Ethernet Network Connection\n"); /* print bus type/speed/width info */ dev_info(pci_dev_to_dev(pdev), "%s: (PCIe:%s:%s) ", @@ -2515,113 +2480,6 @@ static void __devexit igb_remove(struct pci_dev *pdev) #endif /* IGB_SYSFS */ } -#ifdef HAVE_HW_TIME_STAMP -/** - * igb_init_hw_timer - Initialize hardware timer used with IEEE 1588 timestamp - * @adapter: board private structure to initialize - * - * igb_init_hw_timer initializes the function pointer and values for the hw - * timer found in hardware. - **/ -static void igb_init_hw_timer(struct igb_adapter *adapter) -{ - struct e1000_hw *hw = &adapter->hw; - - switch (hw->mac.type) { - case e1000_i350: - case e1000_82580: - memset(&adapter->cycles, 0, sizeof(adapter->cycles)); - adapter->cycles.read = igb_read_clock; - adapter->cycles.mask = CLOCKSOURCE_MASK(64); - adapter->cycles.mult = 1; - /* -* The 82580 timesync updates the system timer every 8ns by 8ns -* and the value cannot be shifted. Instead we need to shift -* the registers to generate a 64bit timer value. As a result -* SYSTIMR/L/H, TXSTMPL/H, RXSTMPL/H all have to be shifted by -* 24 i
[dpdk-dev] [PATCH 2/4] kni: fix build with kernel 3.9
hlist API has changes. See Linux commit b67bfe0d42cac56c512dd5da4b1b347a23f4b70a. Signed-off-by: Thomas Monjalon --- .../linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c | 12 +++--- .../linuxapp/kni/ethtool/ixgbe/kcompat.h | 39 +--- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c index 11472bd..fcff294 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c @@ -2294,13 +2294,13 @@ static int ixgbe_get_ethtool_fdir_entry(struct ixgbe_adapter *adapter, union ixgbe_atr_input *mask = &adapter->fdir_mask; struct ethtool_rx_flow_spec *fsp = (struct ethtool_rx_flow_spec *)&cmd->fs; - struct hlist_node *node, *node2; + struct hlist_node *node; struct ixgbe_fdir_filter *rule = NULL; /* report total rule count */ cmd->data = (1024 << adapter->fdir_pballoc) - 2; - hlist_for_each_entry_safe(rule, node, node2, + hlist_for_each_entry_safe(rule, node, &adapter->fdir_filter_list, fdir_node) { if (fsp->location <= rule->sw_idx) break; @@ -2361,14 +2361,14 @@ static int ixgbe_get_ethtool_fdir_all(struct ixgbe_adapter *adapter, struct ethtool_rxnfc *cmd, u32 *rule_locs) { - struct hlist_node *node, *node2; + struct hlist_node *node; struct ixgbe_fdir_filter *rule; int cnt = 0; /* report total rule count */ cmd->data = (1024 << adapter->fdir_pballoc) - 2; - hlist_for_each_entry_safe(rule, node, node2, + hlist_for_each_entry_safe(rule, node, &adapter->fdir_filter_list, fdir_node) { if (cnt == cmd->rule_cnt) return -EMSGSIZE; @@ -2464,14 +2464,14 @@ static int ixgbe_update_ethtool_fdir_entry(struct ixgbe_adapter *adapter, u16 sw_idx) { struct ixgbe_hw *hw = &adapter->hw; - struct hlist_node *node, *node2, *parent; + struct hlist_node *node, *parent; struct ixgbe_fdir_filter *rule; int err = -EINVAL; parent = NULL; rule = NULL; - hlist_for_each_entry_safe(rule, node, node2, + hlist_for_each_entry_safe(rule, node, &adapter->fdir_filter_list, fdir_node) { /* hash found, or no matching entry */ if (rule->sw_idx >= sw_idx) diff --git a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h index 6ac890a..925beeb 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h +++ b/lib/librte_eal/linuxapp/kni/ethtool/ixgbe/kcompat.h @@ -1213,19 +1213,6 @@ static inline void INIT_HLIST_NODE(struct hlist_node *h) h->next = NULL; h->pprev = NULL; } -#define hlist_entry(ptr, type, member) container_of(ptr,type,member) - -#define hlist_for_each_entry(tpos, pos, head, member)\ - for (pos = (head)->first;\ -pos && ({ prefetch(pos->next); 1;}) && \ - ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ -pos = pos->next) - -#define hlist_for_each_entry_safe(tpos, pos, n, head, member)\ - for (pos = (head)->first;\ -pos && ({ n = pos->next; 1; }) && \ - ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ -pos = n) #ifndef might_sleep #define might_sleep() @@ -3106,4 +3093,30 @@ typedef netdev_features_t kni_netdev_features_t; #else #define HAVE_FDB_OPS #endif /* < 3.5.0 */ + +/*/ +#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,9,0) ) + +#undef hlist_entry +#define hlist_entry(ptr, type, member) \ + container_of(ptr,type,member) + +#undef hlist_entry_safe +#define hlist_entry_safe(ptr, type, member) \ + (ptr) ? hlist_entry(ptr, type, member) : NULL + +#undef hlist_for_each_entry +#define hlist_for_each_entry(pos, head, member) \ + for (pos = hlist_entry_safe((head)->first, typeof(*(pos)), member); \ +pos; \ +pos = hlist_entry_safe((pos)->member.next, typeof(*(pos)), member)) + +#undef hlist_for_each_entry_safe +#define hlist_for_each_entry_safe(pos, n, head, member) \ + for (pos = hlist_entry_safe((head)->first, typeof(*pos), member); \ +pos && ({ n = pos->member.next; 1; }); \ +pos = hlist_entry_safe(n, typeof(*p
[dpdk-dev] [PATCH 3/4] kni: fix build with kernel 3.10
- The flags NETIF_F_HW_VLAN_* have been renamed to NETIF_F_HW_VLAN_CTAG_*. See Linux commit f646968f8f7c624587de729115d802372b9063dd. - The VLAN protocol must be specified. See Linux commits 86a9bad3ab6b6f858fd4443b48738cabbb6d094c and 80d5c3689b886308247da295a228a54df49a44f6. Signed-off-by: Thomas Monjalon --- lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c | 47 +--- lib/librte_eal/linuxapp/kni/ethtool/igb/kcompat.h | 26 ++- lib/librte_eal/linuxapp/kni/ethtool/ixgbe/ixgbe.h |6 +-- .../linuxapp/kni/ethtool/ixgbe/ixgbe_ethtool.c |2 +- .../linuxapp/kni/ethtool/ixgbe/ixgbe_main.c| 16 +++ .../linuxapp/kni/ethtool/ixgbe/kcompat.h | 12 - 6 files changed, 79 insertions(+), 30 deletions(-) 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 4462464..d687412 100644 --- a/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c +++ b/lib/librte_eal/linuxapp/kni/ethtool/igb/igb_main.c @@ -148,7 +148,10 @@ static void igb_reset_task(struct work_struct *); #ifdef HAVE_VLAN_RX_REGISTER static void igb_vlan_mode(struct net_device *, struct vlan_group *); #endif -#ifdef HAVE_INT_NDO_VLAN_RX_ADD_VID +#ifdef HAVE_VLAN_PROTO +static int igb_vlan_rx_add_vid(struct net_device *, __be16, u16); +static int igb_vlan_rx_kill_vid(struct net_device *, __be16, u16); +#elif defined HAVE_INT_NDO_VLAN_RX_ADD_VID static int igb_vlan_rx_add_vid(struct net_device *, u16); static int igb_vlan_rx_kill_vid(struct net_device *, u16); #else @@ -1807,8 +1810,8 @@ static kni_netdev_features_t igb_fix_features(struct net_device *netdev, * Since there is no support for separate tx vlan accel * enabled make sure tx flag is cleared if rx is. */ - if (!(features & NETIF_F_HW_VLAN_RX)) - features &= ~NETIF_F_HW_VLAN_TX; + if (!(features & NETIF_F_HW_VLAN_CTAG_RX)) + features &= ~NETIF_F_HW_VLAN_CTAG_TX; /* If Rx checksum is disabled, then LRO should also be disabled */ if (!(features & NETIF_F_RXCSUM)) @@ -1822,7 +1825,7 @@ static int igb_set_features(struct net_device *netdev, { u32 changed = netdev->features ^ features; - if (changed & NETIF_F_HW_VLAN_RX) + if (changed & NETIF_F_HW_VLAN_CTAG_RX) igb_vlan_mode(netdev, features); return 0; @@ -1898,7 +1901,7 @@ void igb_assign_vmdq_netdev_ops(struct net_device *vnetdev) #ifdef HAVE_TX_TIMEOUT dev->tx_timeout = &igb_vmdq_tx_timeout; #endif -#ifdef NETIF_F_HW_VLAN_TX +#ifdef NETIF_F_HW_VLAN_CTAG_TX dev->vlan_rx_register = &igb_vmdq_vlan_rx_register; dev->vlan_rx_add_vid = &igb_vmdq_vlan_rx_add_vid; dev->vlan_rx_kill_vid = &igb_vmdq_vlan_rx_kill_vid; @@ -2138,8 +2141,8 @@ static int __devinit igb_probe(struct pci_dev *pdev, #ifdef HAVE_NDO_SET_FEATURES NETIF_F_RXCSUM | #endif - NETIF_F_HW_VLAN_RX | - NETIF_F_HW_VLAN_TX; + NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_HW_VLAN_CTAG_TX; #ifdef HAVE_NDO_SET_FEATURES /* copy netdev features into list of user selectable features */ @@ -2158,7 +2161,7 @@ static int __devinit igb_probe(struct pci_dev *pdev, #endif /* set this bit last since it cannot be part of hw_features */ - netdev->features |= NETIF_F_HW_VLAN_FILTER; + netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; #ifdef HAVE_NETDEV_VLAN_FEATURES netdev->vlan_features |= NETIF_F_TSO | @@ -6409,7 +6412,7 @@ static void igb_rx_vlan(struct igb_ring *ring, } else { IGB_CB(skb)->vid = 0; #else - __vlan_hwaccel_put_tag(skb, vid); + __kc__vlan_hwaccel_put_tag(skb, vid); #endif } } @@ -7271,7 +7274,7 @@ void igb_vlan_mode(struct net_device *netdev, u32 features) if (!test_bit(__IGB_DOWN, &adapter->state)) igb_irq_enable(adapter); #else - bool enable = !!(features & NETIF_F_HW_VLAN_RX); + bool enable = !!(features & NETIF_F_HW_VLAN_CTAG_RX); #endif if (enable) { @@ -7311,7 +7314,7 @@ void igb_vlan_mode(struct net_device *netdev, u32 features) #else struct net_device *vnetdev; vnetdev = adapter->vmdq_netdev[i-1]; - enable = !!(vnetdev->features & NETIF_F_HW_VLAN_RX); + enable = !!(vnetdev->features & NETIF_F_HW_VLAN_CTAG_RX); #endif igb_set_vf_vlan_strip(adapter, adapter->vfs_allocated_count + i, @@ -7322,7 +7325,9 @@ void igb_vlan_mode(struct net_device *netdev, u32 features) igb_rlpml_set(adapter); } -#ifdef HAVE_INT_NDO_VLAN_RX_ADD_VID +#ifdef HAVE_VLAN_PROTO +static int igb_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid) +#elif defined HAVE_INT_NDO_VLAN_RX_ADD_VID static int
[dpdk-dev] [PATCH 4/4] app: fix build with gcc 4.8
GCC 4.8 was producing this error: argument to ?sizeof? in ?strncmp? call is the same expression as the second source; did you mean to provide an explicit length? [-Werror=sizeof-pointer-memaccess] Signed-off-by: Thomas Monjalon --- app/test/test_cmdline_string.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test_cmdline_string.c b/app/test/test_cmdline_string.c index 7b358cf..84a82ce 100644 --- a/app/test/test_cmdline_string.c +++ b/app/test/test_cmdline_string.c @@ -383,7 +383,7 @@ test_parse_string_valid(void) return -1; } if (strncmp(buf, string_elt_strs[i].result, - sizeof(string_elt_strs[i].result)) != 0) { + sizeof(buf)) != 0) { printf("Error: result mismatch!\n"); return -1; } -- 1.7.10.4
[dpdk-dev] NIC Stops Transmitting
On Fri, 26 Jul 2013, Scott Talbert wrote: >> I am wondering whether you use multiple cores accessing the same >> receive queue. I had this problem before, but after I make the same >> number of receiving queues as the number of receiving cores, the >> problem disappeared. I did not dig more since I did not care how many >> receive queues I have did not matter. > > Thanks. I have only one queue (should I be using more?) but as far as I > know, I'm only using one core to transmit as well. All, It turns out that the problem appears to have been caused by me using a signal handler to control my data rates. After switching to use RTE timers instead, I am able to transmit close to 10 Gb/sec reliably. Thanks, Scott