* Re: net: xfrm: Deletion of an unnecessary check before the function call "ipcomp_free_tfms"
From: David Miller @ 2014-11-19 18:19 UTC (permalink / raw)
To: dan.carpenter
Cc: elfring, herbert, steffen.klassert, netdev, linux-kernel,
kernel-janitors, julia.lawall
In-Reply-To: <20141119101003.GL4905@mwanda>
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Wed, 19 Nov 2014 13:10:03 +0300
> I have come to view you as a very clever troll.
+1
^ permalink raw reply
* Re: [PATCH] net: team: expose sysfs attributes for each team option
From: David Miller @ 2014-11-19 18:24 UTC (permalink / raw)
To: hkadmany; +Cc: jiri, netdev
In-Reply-To: <03067d01f18e264b30f86d0307d11b07.squirrel@www.codeaurora.org>
From: "Hamad Kadmany" <hkadmany@codeaurora.org>
Date: Wed, 19 Nov 2014 12:28:19 -0000
> Using team driver requires using libnl3. In Android based platforms,
> libnl3 is not supported, and libnl3 license poses constraints in
> Android's user-space.
>
> This is the reason for the this change, to have at least the team
> options exposed through sysfs.
That's a completely and utterly bogus argument for duplicating
functionality in the kernel. You could more easily write a license
compatible version of whatever userland component you need.
Seriously, this is not our problem.
^ permalink raw reply
* Re: [net-next 07/15] ixgbevf: Change receive model to use double buffered page based receives
From: Alexander Duyck @ 2014-11-19 18:24 UTC (permalink / raw)
To: Jeff Kirsher, davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene
In-Reply-To: <1416370256-16834-8-git-send-email-jeffrey.t.kirsher@intel.com>
There were a few things in this patch that should be addressed.
Comments inline below.
- Alex
On 11/18/2014 08:10 PM, Jeff Kirsher wrote:
> From: Emil Tantilov <emil.s.tantilov@intel.com>
>
> This patch changes the basic receive path for ixgbevf so that instead of
> receiving the data into an skb it is received into a double buffered page.
> The main change is that the receives will be done in pages only and then
> pull the header out of the page and copy it into the sk_buff data.
>
> This has the advantages of reduced cache misses and improved performance on
> IOMMU enabled systems.
>
> CC: Alexander Duyck <alexander.h.duyck@redhat.com>
> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbevf/ixgbevf.h | 24 +-
> drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 452 +++++++++++++++-------
> 2 files changed, 331 insertions(+), 145 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
> index 72a354b..2362001 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
> @@ -58,8 +58,9 @@ struct ixgbevf_tx_buffer {
> };
>
> struct ixgbevf_rx_buffer {
> - struct sk_buff *skb;
> dma_addr_t dma;
> + struct page *page;
> + unsigned int page_offset;
> };
>
> struct ixgbevf_stats {
> @@ -91,9 +92,10 @@ struct ixgbevf_ring {
> void *desc; /* descriptor ring memory */
> dma_addr_t dma; /* phys. address of descriptor ring */
> unsigned int size; /* length in bytes */
> - unsigned int count; /* amount of descriptors */
> - unsigned int next_to_use;
> - unsigned int next_to_clean;
> + u16 count; /* amount of descriptors */
> + u16 next_to_use;
> + u16 next_to_clean;
> + u16 next_to_alloc;
>
> union {
> struct ixgbevf_tx_buffer *tx_buffer_info;
> @@ -109,12 +111,11 @@ struct ixgbevf_ring {
>
> u64 hw_csum_rx_error;
> u8 __iomem *tail;
> + struct sk_buff *skb;
>
> u16 reg_idx; /* holds the special value that gets the hardware register
> * offset associated with this ring, which is different
> * for DCB and RSS modes */
> -
> - u16 rx_buf_len;
> int queue_index; /* needed for multiqueue queue management */
> };
>
> @@ -133,12 +134,10 @@ struct ixgbevf_ring {
>
> /* Supported Rx Buffer Sizes */
> #define IXGBEVF_RXBUFFER_256 256 /* Used for packet split */
> -#define IXGBEVF_RXBUFFER_2K 2048
> -#define IXGBEVF_RXBUFFER_4K 4096
> -#define IXGBEVF_RXBUFFER_8K 8192
> -#define IXGBEVF_RXBUFFER_10K 10240
> +#define IXGBEVF_RXBUFFER_2048 2048
>
> #define IXGBEVF_RX_HDR_SIZE IXGBEVF_RXBUFFER_256
> +#define IXGBEVF_RX_BUFSZ IXGBEVF_RXBUFFER_2048
>
> #define MAXIMUM_ETHERNET_VLAN_SIZE (VLAN_ETH_FRAME_LEN + ETH_FCS_LEN)
>
> @@ -430,11 +429,6 @@ enum ixbgevf_state_t {
> __IXGBEVF_WORK_INIT,
> };
>
> -struct ixgbevf_cb {
> - struct sk_buff *prev;
> -};
> -#define IXGBE_CB(skb) ((struct ixgbevf_cb *)(skb)->cb)
> -
> enum ixgbevf_boards {
> board_82599_vf,
> board_X540_vf,
> diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> index 20bebd2..2ca7c96 100644
> --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
> @@ -422,8 +422,7 @@ static void ixgbevf_process_skb_fields(struct ixgbevf_ring *rx_ring,
> * that this is in fact a non-EOP buffer.
> **/
> static bool ixgbevf_is_non_eop(struct ixgbevf_ring *rx_ring,
> - union ixgbe_adv_rx_desc *rx_desc,
> - struct sk_buff *skb)
> + union ixgbe_adv_rx_desc *rx_desc)
> {
> u32 ntc = rx_ring->next_to_clean + 1;
>
> @@ -439,37 +438,40 @@ static bool ixgbevf_is_non_eop(struct ixgbevf_ring *rx_ring,
> return true;
> }
>
> -static bool ixgbevf_alloc_mapped_skb(struct ixgbevf_ring *rx_ring,
> - struct ixgbevf_rx_buffer *bi)
> +static bool ixgbevf_alloc_mapped_page(struct ixgbevf_ring *rx_ring,
> + struct ixgbevf_rx_buffer *bi)
> {
> - struct sk_buff *skb = bi->skb;
> + struct page *page = bi->page;
> dma_addr_t dma = bi->dma;
>
> - if (unlikely(skb))
> + /* since we are recycling buffers we should seldom need to alloc */
> + if (likely(page))
> return true;
>
> - skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
> - rx_ring->rx_buf_len);
> - if (unlikely(!skb)) {
> - rx_ring->rx_stats.alloc_rx_buff_failed++;
> + /* alloc new page for storage */
> + page = dev_alloc_page();
> + if (unlikely(!page)) {
> + rx_ring->rx_stats.alloc_rx_page_failed++;
> return false;
> }
>
> - dma = dma_map_single(rx_ring->dev, skb->data,
> - rx_ring->rx_buf_len, DMA_FROM_DEVICE);
> + /* map page for use */
> + dma = dma_map_page(rx_ring->dev, page, 0,
> + PAGE_SIZE, DMA_FROM_DEVICE);
>
> /* if mapping failed free memory back to system since
> * there isn't much point in holding memory we can't use
> */
> if (dma_mapping_error(rx_ring->dev, dma)) {
> - dev_kfree_skb_any(skb);
> + __free_page(page);
>
> rx_ring->rx_stats.alloc_rx_buff_failed++;
> return false;
> }
>
> - bi->skb = skb;
> bi->dma = dma;
> + bi->page = page;
> + bi->page_offset = 0;
>
> return true;
> }
> @@ -495,13 +497,13 @@ static void ixgbevf_alloc_rx_buffers(struct ixgbevf_ring *rx_ring,
> i -= rx_ring->count;
>
> do {
> - if (!ixgbevf_alloc_mapped_skb(rx_ring, bi))
> + if (!ixgbevf_alloc_mapped_page(rx_ring, bi))
> break;
>
> /* Refresh the desc even if pkt_addr didn't change
> * because each write-back erases this info.
> */
> - rx_desc->read.pkt_addr = cpu_to_le64(bi->dma);
> + rx_desc->read.pkt_addr = cpu_to_le64(bi->dma + bi->page_offset);
>
> rx_desc++;
> bi++;
> @@ -524,6 +526,9 @@ static void ixgbevf_alloc_rx_buffers(struct ixgbevf_ring *rx_ring,
> /* record the next descriptor to use */
> rx_ring->next_to_use = i;
>
> + /* update next to alloc since we have filled the ring */
> + rx_ring->next_to_alloc = i;
> +
> /* Force memory writes to complete before letting h/w
> * know there are new descriptors to fetch. (Only
> * applicable for weak-ordered memory model archs,
> @@ -534,6 +539,257 @@ static void ixgbevf_alloc_rx_buffers(struct ixgbevf_ring *rx_ring,
> }
> }
>
> +/* ixgbevf_pull_tail - ixgbevf specific version of skb_pull_tail
> + * @rx_ring: Rx descriptor ring packet is being transacted on
> + * @skb: pointer to current skb being adjusted
> + *
> + * This function is an ixgbevf specific version of __pskb_pull_tail. The
> + * main difference between this version and the original function is that
> + * this function can make several assumptions about the state of things
> + * that allow for significant optimizations versus the standard function.
> + * As a result we can do things like drop a frag and maintain an accurate
> + * truesize for the skb.
> + */
> +static void ixgbevf_pull_tail(struct ixgbevf_ring *rx_ring,
> + struct sk_buff *skb)
> +{
> + struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[0];
> + unsigned char *va;
> + unsigned int pull_len;
> +
> + /* it is valid to use page_address instead of kmap since we are
> + * working with pages allocated out of the lomem pool per
> + * alloc_page(GFP_ATOMIC)
> + */
> + va = skb_frag_address(frag);
> +
> + /* we need the header to contain the greater of either ETH_HLEN or
> + * 60 bytes if the skb->len is less than 60 for skb_pad.
> + */
> + pull_len = eth_get_headlen(va, IXGBEVF_RX_HDR_SIZE);
> +
> + /* align pull length to size of long to optimize memcpy performance */
> + skb_copy_to_linear_data(skb, va, ALIGN(pull_len, sizeof(long)));
> +
> + /* update all of the pointers */
> + skb_frag_size_sub(frag, pull_len);
> + frag->page_offset += pull_len;
> + skb->data_len -= pull_len;
> + skb->tail += pull_len;
> +}
I really think we should look at making this into a generic function.
Maybe I will submit something later today to get a common function
placed in the code. Maybe something like eth_pull_tail.
> +/* ixgbevf_cleanup_headers - Correct corrupted or empty headers
> + * @rx_ring: Rx descriptor ring packet is being transacted on
> + * @rx_desc: pointer to the EOP Rx descriptor
> + * @skb: pointer to current skb being fixed
> + *
> + * Check for corrupted packet headers caused by senders on the local L2
> + * embedded NIC switch not setting up their Tx Descriptors right. These
> + * should be very rare.
> + *
> + * Also address the case where we are pulling data in on pages only
> + * and as such no data is present in the skb header.
> + *
> + * In addition if skb is not at least 60 bytes we need to pad it so that
> + * it is large enough to qualify as a valid Ethernet frame.
> + *
> + * Returns true if an error was encountered and skb was freed.
> + */
> +static bool ixgbevf_cleanup_headers(struct ixgbevf_ring *rx_ring,
> + union ixgbe_adv_rx_desc *rx_desc,
> + struct sk_buff *skb)
> +{
> + /* verify that the packet does not have any known errors */
> + if (unlikely(ixgbevf_test_staterr(rx_desc,
> + IXGBE_RXDADV_ERR_FRAME_ERR_MASK))) {
> + struct net_device *netdev = rx_ring->netdev;
> +
> + if (!(netdev->features & NETIF_F_RXALL)) {
> + dev_kfree_skb_any(skb);
> + return true;
> + }
> + }
> +
> + /* place header in linear portion of buffer */
> + if (skb_is_nonlinear(skb))
> + ixgbevf_pull_tail(rx_ring, skb);
> +
> + /* if skb_pad returns an error the skb was freed */
> + if (unlikely(skb->len < 60)) {
> + int pad_len = 60 - skb->len;
> +
> + if (skb_pad(skb, pad_len))
> + return true;
> + __skb_put(skb, pad_len);
> + }
> +
> + return false;
> +}
The same goes for the padding bit here. Maybe something like eth_skb_pad.
> +/* ixgbevf_reuse_rx_page - page flip buffer and store it back on the ring
> + * @rx_ring: Rx descriptor ring to store buffers on
> + * @old_buff: donor buffer to have page reused
> + *
> + * Synchronizes page for reuse by the adapter
> + */
> +static void ixgbevf_reuse_rx_page(struct ixgbevf_ring *rx_ring,
> + struct ixgbevf_rx_buffer *old_buff)
> +{
> + struct ixgbevf_rx_buffer *new_buff;
> + u16 nta = rx_ring->next_to_alloc;
> +
> + new_buff = &rx_ring->rx_buffer_info[nta];
> +
> + /* update, and store next to alloc */
> + nta++;
> + rx_ring->next_to_alloc = (nta < rx_ring->count) ? nta : 0;
> +
> + /* transfer page from old buffer to new buffer */
> + new_buff->page = old_buff->page;
> + new_buff->dma = old_buff->dma;
> + new_buff->page_offset = old_buff->page_offset;
> +
> + /* sync the buffer for use by the device */
> + dma_sync_single_range_for_device(rx_ring->dev, new_buff->dma,
> + new_buff->page_offset,
> + IXGBEVF_RX_BUFSZ,
> + DMA_FROM_DEVICE);
> +}
> +
> +/* ixgbevf_add_rx_frag - Add contents of Rx buffer to sk_buff
> + * @rx_ring: Rx descriptor ring to transact packets on
> + * @rx_buffer: buffer containing page to add
> + * @rx_desc: descriptor containing length of buffer written by hardware
> + * @skb: sk_buff to place the data into
> + *
> + * This function will add the data contained in rx_buffer->page to the skb.
> + * This is done either through a direct copy if the data in the buffer is
> + * less than the skb header size, otherwise it will just attach the page as
> + * a frag to the skb.
> + *
> + * The function will then update the page offset if necessary and return
> + * true if the buffer can be reused by the adapter.
> + */
> +static bool ixgbevf_add_rx_frag(struct ixgbevf_ring *rx_ring,
> + struct ixgbevf_rx_buffer *rx_buffer,
> + union ixgbe_adv_rx_desc *rx_desc,
> + struct sk_buff *skb)
> +{
> + struct page *page = rx_buffer->page;
> + unsigned int size = le16_to_cpu(rx_desc->wb.upper.length);
> +#if (PAGE_SIZE < 8192)
> + unsigned int truesize = IXGBEVF_RX_BUFSZ;
> +#else
> + unsigned int truesize = ALIGN(size, L1_CACHE_BYTES);
> +#endif
> +
> + if ((size <= IXGBEVF_RX_HDR_SIZE) && !skb_is_nonlinear(skb)) {
> + unsigned char *va = page_address(page) + rx_buffer->page_offset;
> +
> + memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
> +
> + /* we can reuse buffer as-is, just make sure it is local */
> + if (likely(page_to_nid(page) == numa_node_id()))
> + return true;
> +
> + /* this page cannot be reused so discard it */
> + put_page(page);
> + return false;
> + }
> +
> + skb_add_rx_frag(skb, skb_shinfo(skb)->nr_frags, page,
> + rx_buffer->page_offset, size, truesize);
> +
> + /* avoid re-using remote pages */
> + if (unlikely(page_to_nid(page) != numa_node_id()))
> + return false;
> +
This is missing the pfmemalloc fix that is already in igb, and that I
submitted for ixgbe and fm10k.
> +#if (PAGE_SIZE < 8192)
> + /* if we are only owner of page we can reuse it */
> + if (unlikely(page_count(page) != 1))
> + return false;
> +
> + /* flip page offset to other buffer */
> + rx_buffer->page_offset ^= IXGBEVF_RX_BUFSZ;
> +
> + /* since we are the only owner of the page and we need to
> + * increment it.
> + */
> + atomic_inc(&page->_count);
> +#else
> + /* move offset up to the next cache line */
> + rx_buffer->page_offset += truesize;
> +
> + if (rx_buffer->page_offset > (PAGE_SIZE - IXGBEVF_RX_BUFSZ))
> + return false;
> +
> + /* bump ref count on page before it is given to the stack */
> + get_page(page);
> +#endif
> +
> + return true;
> +}
The get_page and atomic_inc calls can be pulled out and placed after if
#if/else logic. The preference is to use atomic_inc since you are using
an order 0 page and don't need to check for PageTail().
> +static struct sk_buff *ixgbevf_fetch_rx_buffer(struct ixgbevf_ring *rx_ring,
> + union ixgbe_adv_rx_desc *rx_desc,
> + struct sk_buff *skb)
> +{
> + struct ixgbevf_rx_buffer *rx_buffer;
> + struct page *page;
> +
> + rx_buffer = &rx_ring->rx_buffer_info[rx_ring->next_to_clean];
> + page = rx_buffer->page;
> + prefetchw(page);
> +
> + if (likely(!skb)) {
> + void *page_addr = page_address(page) +
> + rx_buffer->page_offset;
> +
> + /* prefetch first cache line of first page */
> + prefetch(page_addr);
> +#if L1_CACHE_BYTES < 128
> + prefetch(page_addr + L1_CACHE_BYTES);
> +#endif
> +
> + /* allocate a skb to store the frags */
> + skb = netdev_alloc_skb_ip_align(rx_ring->netdev,
> + IXGBEVF_RX_HDR_SIZE);
> + if (unlikely(!skb)) {
> + rx_ring->rx_stats.alloc_rx_buff_failed++;
> + return NULL;
> + }
> +
> + /* we will be copying header into skb->data in
> + * pskb_may_pull so it is in our interest to prefetch
> + * it now to avoid a possible cache miss
> + */
> + prefetchw(skb->data);
> + }
> +
> + /* we are reusing so sync this buffer for CPU use */
> + dma_sync_single_range_for_cpu(rx_ring->dev,
> + rx_buffer->dma,
> + rx_buffer->page_offset,
> + IXGBEVF_RX_BUFSZ,
> + DMA_FROM_DEVICE);
> +
> + /* pull page into skb */
> + if (ixgbevf_add_rx_frag(rx_ring, rx_buffer, rx_desc, skb)) {
> + /* hand second half of page back to the ring */
> + ixgbevf_reuse_rx_page(rx_ring, rx_buffer);
> + } else {
> + /* we are not reusing the buffer so unmap it */
> + dma_unmap_page(rx_ring->dev, rx_buffer->dma,
> + PAGE_SIZE, DMA_FROM_DEVICE);
> + }
> +
> + /* clear contents of buffer_info */
> + rx_buffer->dma = 0;
> + rx_buffer->page = NULL;
> +
> + return skb;
> +}
> +
> static inline void ixgbevf_irq_enable_queues(struct ixgbevf_adapter *adapter,
> u32 qmask)
> {
<snip>
> @@ -3320,21 +3522,11 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p)
> static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
> {
> struct ixgbevf_adapter *adapter = netdev_priv(netdev);
> + struct ixgbe_hw *hw = &adapter->hw;
> int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
> - int max_possible_frame = MAXIMUM_ETHERNET_VLAN_SIZE;
> -
> - switch (adapter->hw.api_version) {
> - case ixgbe_mbox_api_11:
> - max_possible_frame = IXGBE_MAX_JUMBO_FRAME_SIZE;
> - break;
> - default:
> - if (adapter->hw.mac.type == ixgbe_mac_X540_vf)
> - max_possible_frame = IXGBE_MAX_JUMBO_FRAME_SIZE;
> - break;
> - }
>
> /* MTU < 68 is an error and causes problems on some kernels */
> - if ((new_mtu < 68) || (max_frame > max_possible_frame))
> + if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE))
> return -EINVAL;
>
> hw_dbg(&adapter->hw, "changing MTU from %d to %d\n",
This is wrong. You are still limited by the PF so if it is a version
1.0 mailbox on an 82599 you cannot enable jumbo frames. Yes you can
support it but the PF won't let you do it.
> @@ -3342,8 +3534,8 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
> /* must set new MTU before calling down or up */
> netdev->mtu = new_mtu;
>
> - if (netif_running(netdev))
> - ixgbevf_reinit_locked(adapter);
> + /* notify the PF of our intent to use this size of frame */
> + ixgbevf_rlpml_set_vf(hw, max_frame);
>
> return 0;
> }
>
This is the reason why the change is wrong. If the mailbox api is
version 1.0 you cannot support jumbo frames so ixgbevf_rlmpl_set_vf will
return an error via the mailbox indicating that the message is not
supported.
^ permalink raw reply
* Re: [PATCH net-next v2] packet: make packet_snd fail on len smaller than l2 header
From: Eric Dumazet @ 2014-11-19 18:25 UTC (permalink / raw)
To: Willem de Bruijn; +Cc: netdev, davem, dborkman
In-Reply-To: <1416420616-5029-1-git-send-email-willemb@google.com>
On Wed, 2014-11-19 at 13:10 -0500, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
>
> When sending packets out with PF_PACKET, SOCK_RAW, ensure that the
> packet is at least as long as the device's expected link layer header.
> This check already exists in tpacket_snd, but not in packet_snd.
> Also rate limit the warning in tpacket_snd.
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> ---
Acked-by: Eric Dumazet <edumazet@google.com>
Thanks Willem
^ permalink raw reply
* Re: [PATCH] net: team: expose sysfs attributes for each team option
From: David Miller @ 2014-11-19 18:26 UTC (permalink / raw)
To: jiri; +Cc: hkadmany, netdev
In-Reply-To: <20141119124043.GC1926@nanopsycho.orion>
From: Jiri Pirko <jiri@resnulli.us>
Date: Wed, 19 Nov 2014 13:40:43 +0100
> No, that is certainly not the reason. If libnl3 does not suit you, use a
> different lib. It is in my opinion unacceptaptable to work around
> certain licence issues by adding parallel sysfs api (not to mention that
> sysfs is totally unsuitable for that).
>
> You should use existing Netlink API. That's it.
+1, these arguments for adding sysfs attributes are unacceptable.
^ permalink raw reply
* [PATCH net-next 0/2] net: systemport & bcmgenet instrumenting
From: Florian Fainelli @ 2014-11-19 18:29 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
Hi David,
These two patches add similar instrumenting in the driver by logging RX SKB
allocation failures as well as RX & TX DMA mapping failures in order to help
troubleshoot heavy memory pressure conditions.
Thanks!
Florian Fainelli (2):
net: systemport: log RX buffer allocation and RX/TX DMA failures
net: bcmgenet: log RX buffer allocation and RX/TX dma failures
drivers/net/ethernet/broadcom/bcmsysport.c | 10 +++++++++-
drivers/net/ethernet/broadcom/bcmsysport.h | 3 +++
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 +++++++++-
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 +++
4 files changed, 24 insertions(+), 2 deletions(-)
--
1.9.1
^ permalink raw reply
* [PATCH net-next 1/2] net: systemport: log RX buffer allocation and RX/TX DMA failures
From: Florian Fainelli @ 2014-11-19 18:29 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1416421796-27657-1-git-send-email-f.fainelli@gmail.com>
To help troubleshoot heavy memory pressure conditions, add a bunch of
statistics counter to log RX buffer allocation and RX/TX DMA mapping
failures. These are reported like any other counters through the ethtool
stats interface.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/bcmsysport.c | 10 +++++++++-
drivers/net/ethernet/broadcom/bcmsysport.h | 3 +++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index 3cb241155dac..c1d255972dae 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -274,6 +274,9 @@ static const struct bcm_sysport_stats bcm_sysport_gstrings_stats[] = {
/* RBUF misc statistics */
STAT_RBUF("rbuf_ovflow_cnt", mib.rbuf_ovflow_cnt, RBUF_OVFL_DISC_CNTR),
STAT_RBUF("rbuf_err_cnt", mib.rbuf_err_cnt, RBUF_ERR_PKT_CNTR),
+ STAT_MIB_RX("alloc_rx_buff_failed", mib.alloc_rx_buff_failed),
+ STAT_MIB_RX("rx_dma_failed", mib.rx_dma_failed),
+ STAT_MIB_TX("tx_dma_failed", mib.tx_dma_failed),
};
#define BCM_SYSPORT_STATS_LEN ARRAY_SIZE(bcm_sysport_gstrings_stats)
@@ -477,6 +480,7 @@ static int bcm_sysport_rx_refill(struct bcm_sysport_priv *priv,
RX_BUF_LENGTH, DMA_FROM_DEVICE);
ret = dma_mapping_error(kdev, mapping);
if (ret) {
+ priv->mib.rx_dma_failed++;
bcm_sysport_free_cb(cb);
netif_err(priv, rx_err, ndev, "DMA mapping failure\n");
return ret;
@@ -526,6 +530,7 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv,
unsigned int p_index;
u16 len, status;
struct bcm_rsb *rsb;
+ int ret;
/* Determine how much we should process since last call */
p_index = rdma_readl(priv, RDMA_PROD_INDEX);
@@ -620,7 +625,9 @@ static unsigned int bcm_sysport_desc_rx(struct bcm_sysport_priv *priv,
napi_gro_receive(&priv->napi, skb);
refill:
- bcm_sysport_rx_refill(priv, cb);
+ ret = bcm_sysport_rx_refill(priv, cb);
+ if (ret)
+ priv->mib.alloc_rx_buff_failed++;
}
return processed;
@@ -973,6 +980,7 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE);
if (dma_mapping_error(kdev, mapping)) {
+ priv->mib.tx_dma_failed++;
netif_err(priv, tx_err, dev, "DMA map failed at %p (len=%d)\n",
skb->data, skb_len);
ret = NETDEV_TX_OK;
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h
index b08dab828101..fc19417d82a5 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.h
+++ b/drivers/net/ethernet/broadcom/bcmsysport.h
@@ -557,6 +557,9 @@ struct bcm_sysport_mib {
u32 rxchk_other_pkt_disc;
u32 rbuf_ovflow_cnt;
u32 rbuf_err_cnt;
+ u32 alloc_rx_buff_failed;
+ u32 rx_dma_failed;
+ u32 tx_dma_failed;
};
/* HW maintains a large list of counters */
--
1.9.1
^ permalink raw reply related
* [PATCH net-next 2/2] net: bcmgenet: log RX buffer allocation and RX/TX dma failures
From: Florian Fainelli @ 2014-11-19 18:29 UTC (permalink / raw)
To: netdev; +Cc: davem, Florian Fainelli
In-Reply-To: <1416421796-27657-1-git-send-email-f.fainelli@gmail.com>
To help troubleshoot heavy memory pressure conditions, add a bunch of
statistics counter to log RX buffer allocation and RX/TX DMA mapping
failures. These are reported like any other counters through the ethtool
stats interface.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 10 +++++++++-
drivers/net/ethernet/broadcom/genet/bcmgenet.h | 3 +++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index da1a2500c91c..fcbf1255ae5a 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -613,6 +613,9 @@ static const struct bcmgenet_stats bcmgenet_gstrings_stats[] = {
UMAC_RBUF_OVFL_CNT),
STAT_GENET_MISC("rbuf_err_cnt", mib.rbuf_err_cnt, UMAC_RBUF_ERR_CNT),
STAT_GENET_MISC("mdf_err_cnt", mib.mdf_err_cnt, UMAC_MDF_ERR_CNT),
+ STAT_GENET_MIB_RX("alloc_rx_buff_failed", mib.alloc_rx_buff_failed),
+ STAT_GENET_MIB_RX("rx_dma_failed", mib.rx_dma_failed),
+ STAT_GENET_MIB_TX("tx_dma_failed", mib.tx_dma_failed),
};
#define BCMGENET_STATS_LEN ARRAY_SIZE(bcmgenet_gstrings_stats)
@@ -989,6 +992,7 @@ static int bcmgenet_xmit_single(struct net_device *dev,
mapping = dma_map_single(kdev, skb->data, skb_len, DMA_TO_DEVICE);
ret = dma_mapping_error(kdev, mapping);
if (ret) {
+ priv->mib.tx_dma_failed++;
netif_err(priv, tx_err, dev, "Tx DMA map failed\n");
dev_kfree_skb(skb);
return ret;
@@ -1035,6 +1039,7 @@ static int bcmgenet_xmit_frag(struct net_device *dev,
skb_frag_size(frag), DMA_TO_DEVICE);
ret = dma_mapping_error(kdev, mapping);
if (ret) {
+ priv->mib.tx_dma_failed++;
netif_err(priv, tx_err, dev, "%s: Tx DMA map failed\n",
__func__);
return ret;
@@ -1231,6 +1236,7 @@ static int bcmgenet_rx_refill(struct bcmgenet_priv *priv, struct enet_cb *cb)
priv->rx_buf_len, DMA_FROM_DEVICE);
ret = dma_mapping_error(kdev, mapping);
if (ret) {
+ priv->mib.rx_dma_failed++;
bcmgenet_free_cb(cb);
netif_err(priv, rx_err, priv->dev,
"%s DMA map failed\n", __func__);
@@ -1397,8 +1403,10 @@ static unsigned int bcmgenet_desc_rx(struct bcmgenet_priv *priv,
/* refill RX path on the current control block */
refill:
err = bcmgenet_rx_refill(priv, cb);
- if (err)
+ if (err) {
+ priv->mib.alloc_rx_buff_failed++;
netif_err(priv, rx_err, dev, "Rx refill failed\n");
+ }
rxpktprocessed++;
priv->rx_read_ptr++;
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.h b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
index 31b2da5f9b82..c4ca7282a601 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.h
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.h
@@ -143,6 +143,9 @@ struct bcmgenet_mib_counters {
u32 rbuf_ovflow_cnt;
u32 rbuf_err_cnt;
u32 mdf_err_cnt;
+ u32 alloc_rx_buff_failed;
+ u32 rx_dma_failed;
+ u32 tx_dma_failed;
};
#define UMAC_HD_BKP_CTRL 0x004
--
1.9.1
^ permalink raw reply related
* Re: [PATCH net-next v2] packet: make packet_snd fail on len smaller than l2 header
From: Daniel Borkmann @ 2014-11-19 18:31 UTC (permalink / raw)
To: Willem de Bruijn; +Cc: netdev, davem, eric.dumazet
In-Reply-To: <1416420616-5029-1-git-send-email-willemb@google.com>
On 11/19/2014 07:10 PM, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
>
> When sending packets out with PF_PACKET, SOCK_RAW, ensure that the
> packet is at least as long as the device's expected link layer header.
> This check already exists in tpacket_snd, but not in packet_snd.
> Also rate limit the warning in tpacket_snd.
>
> Signed-off-by: Willem de Bruijn <willemb@google.com>
Looks good to me, thanks!
Acked-by: Daniel Borkmann <dborkman@redhat.com>
^ permalink raw reply
* Re: [PATCH] net: team: expose sysfs attributes for each team option
From: Cong Wang @ 2014-11-19 18:45 UTC (permalink / raw)
To: Hamad Kadmany; +Cc: Jiri Pirko, netdev
In-Reply-To: <03067d01f18e264b30f86d0307d11b07.squirrel@www.codeaurora.org>
On Wed, Nov 19, 2014 at 4:28 AM, Hamad Kadmany <hkadmany@codeaurora.org> wrote:
> On Mon, November 17, 2014 1:02 pm, Jiri Pirko wrote:
>>
>> Nak.
>>
>> I don't like this patch. The plan for team was keep things simple and to
>> have single userspace api using netlink, as that is the correct way to
>> deal with things. Sysfs for this use-case is not. Please, use netlink api.
>
> Using team driver requires using libnl3. In Android based platforms, libnl3 is not supported, and libnl3 license poses constraints in Android's user-space.
>
Check if libmnl fits your license:
http://www.netfilter.org/projects/libmnl/
^ permalink raw reply
* Re: net: sched: Deletion of an unnecessary check before the function call "kfree"
From: SF Markus Elfring @ 2014-11-19 18:49 UTC (permalink / raw)
To: John Fastabend
Cc: David S. Miller, Jamal Hadi Salim, netdev, LKML, kernel-janitors
In-Reply-To: <546CC9B3.5060405@gmail.com>
> Marcus, what tree are you looking at?
I dared to base this update suggestion on the source files
for Linux 3.17.3. Are newer software developments relevant here?
https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/net/sched/
Regards,
Markus
^ permalink raw reply
* Re: [ovs-dev] [PATCH net] openvswitch: Fix mask generation for IPv6 labels.
From: Pravin Shelar @ 2014-11-19 19:08 UTC (permalink / raw)
To: Joe Stringer; +Cc: dev@openvswitch.org, netdev, LKML
In-Reply-To: <201411190948.11857.joestringer@nicira.com>
On Wed, Nov 19, 2014 at 9:48 AM, Joe Stringer <joestringer@nicira.com> wrote:
> On Wednesday, November 19, 2014 00:11:01 Pravin Shelar wrote:
>> On Tue, Nov 18, 2014 at 11:25 PM, Joe Stringer <joestringer@nicira.com>
> wrote:
>> > On 18 November 2014 22:09, Pravin Shelar <pshelar@nicira.com> wrote:
>> >> On Tue, Nov 18, 2014 at 10:54 AM, Joe Stringer <joestringer@nicira.com>
>> >>
>> >> wrote:
>> >> > When userspace doesn't provide a mask, OVS datapath generates a fully
>> >> > unwildcarded mask for the flow. This is done by taking a copy of the
>> >> > flow key, then iterating across its attributes, setting all values to
>> >> > 0xff. This works for most attributes, as the length of the netlink
>> >> > attribute typically matches the length of the value. However, IPv6
>> >> > labels only use the lower 20 bits of the field. This patch makes a
>> >> > special case to handle this.
>> >> >
>> >> > This fixes the following error seen when installing IPv6 flows without
>> >> > a mask:
>> >> >
>> >> > openvswitch: netlink: Invalid IPv6 flow label value (value=ffffffff,
>> >> > max=fffff)
>> >>
>> >> We should allow exact match mask here rather than generating
>> >> wildcarded mask. So that ovs can catch invalid ipv6.label.
>> >
>> > I don't quite follow, I thought this was exact-match? (The existing
>> > function sets all bits to 1)
>>
>> With 0xffffffff value we can exact match on all ipv6.lable bits.
>
> The label field is only 20 bits. The other bits in the same word of the IPv6
> header are for version (fixed) and traffic class (handled separately). We don't
> do anything with the other bits.
This is just to make sure that we do not use those field for any thing
else. Masking those extra bits can hide incorrect ipv6 key extraction.
^ permalink raw reply
* Re: net: sched: Deletion of an unnecessary check before the function call "kfree"
From: Daniel Borkmann @ 2014-11-19 19:09 UTC (permalink / raw)
To: SF Markus Elfring
Cc: John Fastabend, David S. Miller, Jamal Hadi Salim, netdev, LKML,
kernel-janitors
In-Reply-To: <546CE650.6080205@users.sourceforge.net>
On 11/19/2014 07:49 PM, SF Markus Elfring wrote:
>> Marcus, what tree are you looking at?
>
> I dared to base this update suggestion on the source files
> for Linux 3.17.3. Are newer software developments relevant here?
>
> https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/log/net/sched/
Pointing to linux-next and saying you based your changes on 3.17.3
is confusing, please look correctly when you provide a link ...
Again, John's commit 1f947bf151e90ec0b removed the relevant part in
cls_bpf_modify_existing() that you're trying to modify:
$ git grep -n bpf_old net/sched/cls_bpf.c
$
Therefore, this patch is not needed.
Thanks !
^ permalink raw reply
* Re: [PATCH] net: team: expose sysfs attributes for each team option
From: Daniel Borkmann @ 2014-11-19 19:17 UTC (permalink / raw)
To: Cong Wang; +Cc: Hamad Kadmany, Jiri Pirko, netdev, tgraf
In-Reply-To: <CAHA+R7OOnSfSP1uHrg=osH=+=sb-0Zj-=yYx8HXmpO95v+Dhyg@mail.gmail.com>
On 11/19/2014 07:45 PM, Cong Wang wrote:
> On Wed, Nov 19, 2014 at 4:28 AM, Hamad Kadmany <hkadmany@codeaurora.org> wrote:
>> On Mon, November 17, 2014 1:02 pm, Jiri Pirko wrote:
>>>
>>> Nak.
>>>
>>> I don't like this patch. The plan for team was keep things simple and to
>>> have single userspace api using netlink, as that is the correct way to
>>> deal with things. Sysfs for this use-case is not. Please, use netlink api.
+1
>> Using team driver requires using libnl3. In Android based platforms, libnl3
>> is not supported, and libnl3 license poses constraints in Android's user-space.
Constraints?! libnl3 is LGPL ...
> Check if libmnl fits your license:
> http://www.netfilter.org/projects/libmnl/
... and this one, too.
^ permalink raw reply
* Re: [PATCH net-next 3/4] igb: enable internal PPS for the i210.
From: Keller, Jacob E @ 2014-11-19 19:32 UTC (permalink / raw)
To: richardcochran@gmail.com
Cc: netdev@vger.kernel.org, davem@davemloft.net, Allan, Bruce W,
Ronciak, John, Kirsher, Jeffrey T, Vick, Matthew
In-Reply-To: <20141119063724.GB4109@localhost.localdomain>
On Wed, 2014-11-19 at 07:37 +0100, Richard Cochran wrote:
> On Tue, Nov 18, 2014 at 12:06:24AM +0100, Richard Cochran wrote:
> > --- a/drivers/net/ethernet/intel/igb/igb_main.c
> > +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> > @@ -5386,8 +5386,14 @@ void igb_update_stats(struct igb_adapter *adapter,
> > static void igb_tsync_interrupt(struct igb_adapter *adapter)
> > {
> > struct e1000_hw *hw = &adapter->hw;
> > + struct ptp_clock_event event;
> > u32 tsicr = rd32(E1000_TSICR);
> >
> > + if (tsicr & TSINTR_SYS_WRAP) {
> > + event.type = PTP_CLOCK_PPS;
> > + ptp_clock_event(adapter->ptp_clock, &event);
>
> This causes a BUG for the 82580. When you enable E1000_TSICR_TXTS, it
> seems that TSINTR_SYS_WRAP is also automatically enabled. Because the
> 82580 variant has no pps device enabled, the driver then dereferences
> a null pointer.
>
> So we need to make the call to ptp_clock_event() conditional based on
> whether pps is enabled. I'll fix this in V2.
>
> > + }
> > +
>
> Thanks,
> Richard
Good catch :)
Did you see my concern about the reset path needing to fully restore the
state since it is called after a hardware MAC reset which has cleared
all these registers?
Regards,
Jake
^ permalink raw reply
* Re: [PATCH] ixgbe: Correctly disable vlan filter in promiscuous mode
From: Vlad Yasevich @ 2014-11-19 19:41 UTC (permalink / raw)
To: Tantilov, Emil S, netdev@vger.kernel.org
Cc: Kirsher, Jeffrey T, Keller, Jacob E, Skidmore, Donald C
In-Reply-To: <87618083B2453E4A8714035B62D679925019F38A@FMSMSX105.amr.corp.intel.com>
On 11/18/2014 03:24 PM, Tantilov, Emil S wrote:
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-
>> owner@vger.kernel.org] On Behalf Of Vladislav Yasevich
>> Sent: Tuesday, November 18, 2014 11:28 AM
>> To: netdev@vger.kernel.org
>> Cc: Vladislav Yasevich; Kirsher, Jeffrey T; Keller, Jacob E
>> Subject: [PATCH] ixgbe: Correctly disable vlan filter in promiscuous mode
>>
>> IXGBE adapater seems to require that vlan filtering be enabled if VMDQ
>> or SRIOV are enabled. When those functions are disabled,
>> vlan filtering may be disabled in promiscuous mode.
>>
>> Prior to commit a9b8943ee129e11045862d6d6e25c5b63c95403c
>> ixgbe: remove vlan_filter_disable and enable functions
>>
>> the logic was correct. However, after the commit the logic
>> got reversed and vlan filtered in now turned on when VMDQ/SRIOV
>> is disabled.
>>
>> This patch changes the condition to enable hw vlan filtered
>> when VMDQ or SRIOV is enabled.
>>
>> Fixes: a9b8943ee129e11045862d6d6e25c5b63c95403c (ixgbe:
>> remove
>> vlan_filter_disable and enable functions)
>> CC: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
>> CC: Jacob Keller <jacob.e.keller@intel.com>
>> Signed-off-by: Vladislav Yasevich <vyasevic@redhat.com>
>> ---
>> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> index d2df4e3..3f81c7a 100644
>> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
>> @@ -3936,8 +3936,8 @@ void ixgbe_set_rx_mode(struct
>> net_device *netdev)
>> * if SR-IOV and VMDQ are disabled - otherwise ensure
>> * that hardware VLAN filters remain enabled.
>> */
>> - if (!(adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |
>> - IXGBE_FLAG_SRIOV_ENABLED)))
>> + if (adapter->flags & (IXGBE_FLAG_VMDQ_ENABLED |
>> + IXGBE_FLAG_SRIOV_ENABLED))
>> vlnctrl |= (IXGBE_VLNCTRL_VFE |
>> IXGBE_VLNCTRL_CFIEN);
>> } else {
>> if (netdev->flags & IFF_ALLMULTI) {
>
> The current logic is correct and it's like this on purpose as it should be obvious by the comment preceding this check.
Actually the comment right now does not match what the code is doing.
The comment states:
/* Only disable hardware filter vlans in promiscuous mode
* if SR-IOV and VMDQ are disabled - otherwise ensure
* that hardware VLAN filters remain enabled.
*/
However, the code currently will _enable_ vlan filtering if VMDQ/SRIOV
is _disabled_ in promiscuous mode.
> The reason for not disabling the vlan filters in promisc mode is because this can break VLAN isolation between VMs which is considered a security risk.
But VLAN isolation between VMs isn't enforced if you have a simple bridged
setup without VMDQs or SRIOV enabled. Bridge makes all devices promiscuous
and should receive all VLANs.
-vlad
>
> There is another patch that was proposed:
> http://marc.info/?l=linux-netdev&m=141586938625969
>
> which should do what you want using an ethtool toggle.
>
> Thanks,
> Emil
>
>
^ permalink raw reply
* Re: [PATCH net-next] tun: return NET_XMIT_DROP for dropped packets
From: David Miller @ 2014-11-19 19:46 UTC (permalink / raw)
To: jasowang; +Cc: cwang, netdev, linux-kernel, mst
In-Reply-To: <546C0B58.5030402@redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Wed, 19 Nov 2014 11:15:36 +0800
> On 11/19/2014 03:53 AM, Cong Wang wrote:
>> On Mon, Nov 17, 2014 at 9:20 PM, Jason Wang <jasowang@redhat.com> wrote:
>>> > After commit 5d097109257c03a71845729f8db6b5770c4bbedc
>>> > ("tun: only queue packets on device"), NETDEV_TX_OK was returned for
>>> > dropped packets. This will confuse pktgen since dropped packets were
>>> > counted as sent ones.
>>> >
>>> > Fixing this by returning NET_XMIT_DROP to let pktgen count it as error
>>> > packet.
>> pktgen is suspicious, it sends out packets directly without going through
>> qdisc, so it should not care about NET_XMIT_* qdisc error code?
>
> Well, NET_XMIT_DROP has been used by some devices. I don't see any side
> effect of using this especially consider that pktgen can recognize them.
>> Looks like NETDEV_TX_OK doesn't have to mean TX is successful,
>> the comment says driver takes care of the packet, can be either dropped
>> or sent out. We might need a new code to distinguish success or failure.
>
> Most drivers only drop bad packets when they return NETDEV_TX_OK and
> they will stop the txq before tx ring is full. This is not the case of
> tun, it never stop txq and keep accepting packets and dropping them when
> socket receive queue is full.
Agreed.
Often the issue with TX return values is lack of clear documentation
and use cases.
I've applied this patch, thanks Jason.
^ permalink raw reply
* Re: [PATCH v2] ipv6: delete protocol and unregister rtnetlink when cleanup
From: Cong Wang @ 2014-11-19 19:46 UTC (permalink / raw)
To: Duan Jiong; +Cc: David Miller, netdev, Eric Dumazet
In-Reply-To: <546BF3EB.1080603@cn.fujitsu.com>
On Tue, Nov 18, 2014 at 5:35 PM, Duan Jiong <duanj.fnst@cn.fujitsu.com> wrote:
>
>
> pim6_protocol was added when initiation, but it not deleted.
> Similarly, unregister RTNL_FAMILY_IP6MR rtnetlink.
>
> Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
> ---
> v2: add missing rtnl_unregister()
Reviewed-by: Cong Wang <cwang@twopensource.com>
^ permalink raw reply
* Re: [ovs-dev] [PATCH net] openvswitch: Fix mask generation for IPv6 labels.
From: Joe Stringer @ 2014-11-19 19:51 UTC (permalink / raw)
To: Pravin Shelar; +Cc: dev@openvswitch.org, netdev, LKML
In-Reply-To: <CALnjE+pQnUGiiuWPGt7fNnBetwdn7SQReDqCHDforX7ykQQR8Q@mail.gmail.com>
On Wednesday, November 19, 2014 11:08:35 Pravin Shelar wrote:
> On Wed, Nov 19, 2014 at 9:48 AM, Joe Stringer <joestringer@nicira.com>
wrote:
> > On Wednesday, November 19, 2014 00:11:01 Pravin Shelar wrote:
> >> On Tue, Nov 18, 2014 at 11:25 PM, Joe Stringer <joestringer@nicira.com>
> >
> > wrote:
> >> > On 18 November 2014 22:09, Pravin Shelar <pshelar@nicira.com> wrote:
> >> >> On Tue, Nov 18, 2014 at 10:54 AM, Joe Stringer
> >> >> <joestringer@nicira.com>
> >> >>
> >> >> wrote:
> >> >> > When userspace doesn't provide a mask, OVS datapath generates a
> >> >> > fully unwildcarded mask for the flow. This is done by taking a
> >> >> > copy of the flow key, then iterating across its attributes,
> >> >> > setting all values to 0xff. This works for most attributes, as the
> >> >> > length of the netlink attribute typically matches the length of
> >> >> > the value. However, IPv6 labels only use the lower 20 bits of the
> >> >> > field. This patch makes a special case to handle this.
> >> >> >
> >> >> > This fixes the following error seen when installing IPv6 flows
> >> >> > without a mask:
> >> >> >
> >> >> > openvswitch: netlink: Invalid IPv6 flow label value
> >> >> > (value=ffffffff, max=fffff)
> >> >>
> >> >> We should allow exact match mask here rather than generating
> >> >> wildcarded mask. So that ovs can catch invalid ipv6.label.
> >> >
> >> > I don't quite follow, I thought this was exact-match? (The existing
> >> > function sets all bits to 1)
> >>
> >> With 0xffffffff value we can exact match on all ipv6.lable bits.
> >
> > The label field is only 20 bits. The other bits in the same word of the
> > IPv6 header are for version (fixed) and traffic class (handled
> > separately). We don't do anything with the other bits.
>
> This is just to make sure that we do not use those field for any thing
> else. Masking those extra bits can hide incorrect ipv6 key extraction.
Oh, I see. I meant something more like:
ipv6_key->ipv6_label &= htonl(0xFFF00000);
ipv6_key->ipv6_label |= htonl(0x000FFFFF);
(Which would propagate the invalid bits from the flow key, but actually produce
an exact match).
^ permalink raw reply
* Re: [PATCH net-next] tun: return NET_XMIT_DROP for dropped packets
From: Cong Wang @ 2014-11-19 19:53 UTC (permalink / raw)
To: David Miller
Cc: Jason Wang, netdev, linux-kernel@vger.kernel.org,
Michael S. Tsirkin
In-Reply-To: <20141119.144604.269852847904624488.davem@davemloft.net>
On Wed, Nov 19, 2014 at 11:46 AM, David Miller <davem@davemloft.net> wrote:
>
> Often the issue with TX return values is lack of clear documentation
> and use cases.
>
NET_XMIT_* are marked as qdisc ->enqueue() return codes
in include/linux/netdevice.h, and are indeed used mostly by
qdisc:
$ git grep NET_XMIT_ -- net/sched/ | wc -l
88
$ git grep NET_XMIT_ -- drivers/net/ | wc -l
15
It is a mess. Not to mention we have __NET_XMIT_ code too.
^ permalink raw reply
* [PATCH 1/1] mISDN: Deletion of unnecessary checks before the function call "vfree"
From: SF Markus Elfring @ 2014-11-19 19:55 UTC (permalink / raw)
To: Karsten Keil, netdev; +Cc: LKML, kernel-janitors, Julia Lawall
In-Reply-To: <5317A59D.4@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Nov 2014 20:48:26 +0100
The vfree() function performs also input parameter validation. Thus the test
around the call is not needed.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/isdn/mISDN/l1oip_codec.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/isdn/mISDN/l1oip_codec.c b/drivers/isdn/mISDN/l1oip_codec.c
index a601c84..9b033be 100644
--- a/drivers/isdn/mISDN/l1oip_codec.c
+++ b/drivers/isdn/mISDN/l1oip_codec.c
@@ -312,10 +312,8 @@ l1oip_ulaw_to_alaw(u8 *data, int len, u8 *result)
void
l1oip_4bit_free(void)
{
- if (table_dec)
- vfree(table_dec);
- if (table_com)
- vfree(table_com);
+ vfree(table_dec);
+ vfree(table_com);
table_com = NULL;
table_dec = NULL;
}
--
2.1.3
^ permalink raw reply related
* Re: [PATCH v2 net-next] tcp: make connect() mem charging friendly
From: David Miller @ 2014-11-19 19:57 UTC (permalink / raw)
To: ycheng; +Cc: eric.dumazet, nuclearcat, netdev, ncardwell
In-Reply-To: <CAK6E8=dUvde2s7VuUS9rHiA2fU0ZT2bS=ronjM+9BOA=0u-rVw@mail.gmail.com>
From: Yuchung Cheng <ycheng@google.com>
Date: Wed, 19 Nov 2014 14:10:42 +0800
> On Tue, Nov 18, 2014 at 3:06 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> From: Eric Dumazet <edumazet@google.com>
>>
>> While working on sk_forward_alloc problems reported by Denys
>> Fedoryshchenko, we found that tcp connect() (and fastopen) do not call
>> sk_wmem_schedule() for SYN packet (and/or SYN/DATA packet), so
>> sk_forward_alloc is negative while connect is in progress.
>>
>> We can fix this by calling regular sk_stream_alloc_skb() both for the
>> SYN packet (in tcp_connect()) and the syn_data packet in
>> tcp_send_syn_data()
>>
>> Then, tcp_send_syn_data() can avoid copying syn_data as we simply
>> can manipulate syn_data->cb[] to remove SYN flag (and increment seq)
>>
>> Instead of open coding memcpy_fromiovecend(), simply use this helper.
>>
>> This leaves in socket write queue clean fast clone skbs.
>>
>> This was tested against our fastopen packetdrill tests.
>>
>> Reported-by: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
>> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Yuchung Cheng <ycheng@google.com>
>
> Thanks! this simplifies the code a lot.
Agreed, applied, thanks everyone!
^ permalink raw reply
* Re: BCM4313 & brcmsmac & 3.12: only semi-working?
From: Michael Tokarev @ 2014-11-19 19:58 UTC (permalink / raw)
To: Arend van Spriel
Cc: Maximilian Engelhardt, Rafał Miłecki, Seth Forshee,
brcm80211 development, linux-wireless@vger.kernel.org,
Network Development
In-Reply-To: <546CD94D.9060509@broadcom.com>
19.11.2014 20:54, Arend van Spriel wrote:
[]
> In our last email exchange I got the impression you switch to Intel board and did not want to keep replacing cards for testing.
I especially wrote that I have several days to try things out and
if you'll be quick it will be possible for me to test things.
You never replied before now (which is some more months later).
> Nice to hear you have an alternative setup for this and I assume are willing to do some testing.
>
> I submitted two patches upstream and additionally I have attached two other that are still under review. Could you try these patches and sent me the content of the two debugfs files 'macstat' and 'hardware' after a stall has occurred.
You didn't tell which kernel it is based on. So I tried it on 3.16,
ofcourse the patches didn't apply so I hand-edited the debug
printf in drivers/net/wireless/brcm80211/brcmsmac/debug.c (in
3.16 it didn't use seq_printf yet). So now I have a `hardware'
file (in brcmsmac/bcma0:0/ subdir in debugfs), but not
macstat. Here's the contents `hardware' one:
chipnum 0x4313
chiprev 0x1
chippackage 0x8
corerev 0x18
boardid 0x1795
boardvendor 0x103c
boardrev P107
boardflags 0x402201
boardflags2 0x884
ucoderev 0x262032c
radiorev 0x1
phytype 0x8
phyrev 0x1
anarev 0xa
nvramrev 8
Since there's no macstats, I guess it is not very useful,
so before digging for too deep, I ask which kernel do you
want me to try here.
Thanks,
/mjt
^ permalink raw reply
* Kernel BUG?: IPv6 neighbor discovery fails in network namespace with TAP interface
From: Spike Curtis @ 2014-11-19 19:59 UTC (permalink / raw)
To: netdev@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 7987 bytes --]
One line summary of the problem:
IPv6 neighbor discovery fails in network namespace with TAP interface
Full description of the problem/report:
I'm working in a network namespace (netns), and have several TAP devices as virtual network interfaces, which another process outside the namespace reads and writes.
The problem is that IPv6 neighbor discovery times out over these interfaces. I have a TCP6 session from a loopback assigned address to a remote peer, which is directly connected over the tap interface.
I've monitored the connection with Wireshark: when the TCP6 session is activated, I see Neighbor Solicitation packets sent to the solicited node multicast address for the peer, a response from the peer, and then traffic over TCP6. I don't see any later unicast Neighbor Solicitation probes to the peer address. Instead, I see another multicast probe to the solicited node address. I also see repeated Neighbor Solicitations for the link local address auto-assigned to the TAP interface, but I'm not sure if this is because duplicate address detection is failing, or if Linux periodically probes, or if the TAP interface is cyclically failing at the IPv6 layer (I also run IPv4 traffic over the TAP and there are no interruptions).
When I monitor the IPv6 neighbor cache using 'ip -6 neigh show', I can see the peer address moving to FAILED or INCOMPLETE state (after several iterations of multicast probes seeming to work correctly).
What's odd to me is that
a) The established TCP6 connection doesn't keep the neighbor cache entry fresh
b) I only ever see multicast probes, never a unicast probe for unreachability detection
Anyway, the consequence of all this is that my running TCP6 session fails.
IPv6 forwarding is disabled, and all other IPv6 parameters are at their Ubuntu 14.04 defaults. In particular, ucast_solicit = 3, so it *should* be sending unicast probes.
Nothing related to networking is logged to syslog while all of this is happening.
I've attached a pcap: 2001:400::1:0:0/128 is the local loopback, 2001:400::16:0/127 is the local address, 2001:400::16:1 is the remote IPv6 speaker.
Keywords:
IPv6, ndp, network namespace, TAP
Kernel version (from /proc/version):
Linux version 3.13.0-39-generic (buildd@toyol) (gcc version 4.8.2 (Ubuntu 4.8.2-19ubuntu1) ) #66-Ubuntu SMP Tue Oct 28 13:30:27 UTC 2014
Environment
Ubuntu 14.04 LTS, running virtualized on Virtual Box 4.3.15 (Windows 7)
$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i7-3687U CPU @ 2.10GHz
stepping : 9
microcode : 0x19
cpu MHz : 2484.699
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl pni ssse3 lahf_lm
bogomips : 4969.39
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 58
model name : Intel(R) Core(TM) i7-3687U CPU @ 2.10GHz
stepping : 9
microcode : 0x19
cpu MHz : 2484.699
cache size : 6144 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl pni ssse3 lahf_lm
bogomips : 4969.39
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:
$ cat /proc/modules
xt_recent 18498 0 - Live 0x0000000000000000
nfnetlink_queue 22329 0 - Live 0x0000000000000000
nfnetlink_log 17926 0 - Live 0x0000000000000000
nfnetlink 14606 2 nfnetlink_queue,nfnetlink_log, Live 0x0000000000000000
veth 13331 0 - Live 0x0000000000000000
vboxsf 39690 0 - Live 0x0000000000000000 (OX)
bridge 110833 0 - Live 0x0000000000000000
stp 12976 1 bridge, Live 0x0000000000000000
llc 14552 2 bridge,stp, Live 0x0000000000000000
rfcomm 69160 0 - Live 0x0000000000000000
bnep 19624 2 - Live 0x0000000000000000
bluetooth 391136 10 rfcomm,bnep, Live 0x0000000000000000
binfmt_misc 17468 1 - Live 0x0000000000000000
hid_generic 12548 0 - Live 0x0000000000000000
joydev 17381 0 - Live 0x0000000000000000
snd_intel8x0 38153 2 - Live 0x0000000000000000
snd_ac97_codec 130285 1 snd_intel8x0, Live 0x0000000000000000
ac97_bus 12730 1 snd_ac97_codec, Live 0x0000000000000000
snd_pcm 102099 2 snd_intel8x0,snd_ac97_codec, Live 0x0000000000000000
ip6t_REJECT 12939 1 - Live 0x0000000000000000
snd_page_alloc 18710 2 snd_intel8x0,snd_pcm, Live 0x0000000000000000
snd_seq_midi 13324 0 - Live 0x0000000000000000
snd_seq_midi_event 14899 1 snd_seq_midi, Live 0x0000000000000000
xt_hl 12521 6 - Live 0x0000000000000000
ip6t_rt 13537 3 - Live 0x0000000000000000
snd_rawmidi 30144 1 snd_seq_midi, Live 0x0000000000000000
nf_conntrack_ipv6 18894 8 - Live 0x0000000000000000
nf_defrag_ipv6 34768 1 nf_conntrack_ipv6, Live 0x0000000000000000
ipt_REJECT 12541 1 - Live 0x0000000000000000
xt_LOG 17717 10 - Live 0x0000000000000000
snd_seq 61560 2 snd_seq_midi,snd_seq_midi_event, Live 0x0000000000000000
xt_limit 12711 13 - Live 0x0000000000000000
xt_tcpudp 12884 28 - Live 0x0000000000000000
xt_addrtype 12635 4 - Live 0x0000000000000000
snd_seq_device 14497 3 snd_seq_midi,snd_rawmidi,snd_seq, Live 0x0000000000000000
nf_conntrack_ipv4 15012 8 - Live 0x0000000000000000
nf_defrag_ipv4 12758 1 nf_conntrack_ipv4, Live 0x0000000000000000
snd_timer 29482 2 snd_pcm,snd_seq, Live 0x0000000000000000
usbhid 52659 0 - Live 0x0000000000000000
xt_conntrack 12760 16 - Live 0x0000000000000000
hid 106148 2 hid_generic,usbhid, Live 0x0000000000000000
vboxvideo 12658 1 - Live 0x0000000000000000 (OX)
ip6table_filter 12815 1 - Live 0x0000000000000000
drm 303102 2 vboxvideo, Live 0x0000000000000000
ip6_tables 27025 1 ip6table_filter, Live 0x0000000000000000
nf_conntrack_netbios_ns 12665 0 - Live 0x0000000000000000
nf_conntrack_broadcast 12589 1 nf_conntrack_netbios_ns, Live 0x0000000000000000
nf_nat_ftp 12770 0 - Live 0x0000000000000000
nf_nat 21841 1 nf_nat_ftp, Live 0x0000000000000000
nf_conntrack_ftp 18638 1 nf_nat_ftp, Live 0x0000000000000000
nf_conntrack 96976 8 nf_conntrack_ipv6,nf_conntrack_ipv4,xt_conntrack,nf_conntrack_netbios_ns,nf_conntrack_broadcast,nf_nat_ftp,nf_nat,nf_conntrack_ftp, Live 0x0000000000000000
snd 69322 12 snd_intel8x0,snd_ac97_codec,snd_pcm,snd_seq_midi,snd_rawmidi,snd_seq,snd_seq_device,snd_timer, Live 0x0000000000000000
iptable_filter 12810 1 - Live 0x0000000000000000
ip_tables 27239 1 iptable_filter, Live 0x0000000000000000
x_tables 34059 14 xt_recent,ip6t_REJECT,xt_hl,ip6t_rt,ipt_REJECT,xt_LOG,xt_limit,xt_tcpudp,xt_addrtype,xt_conntrack,ip6table_filter,ip6_tables,iptable_filter,ip_tables, Live 0x0000000000000000
serio_raw 13462 0 - Live 0x0000000000000000
i2c_piix4 22155 0 - Live 0x0000000000000000
soundcore 12680 1 snd, Live 0x0000000000000000
vboxguest 248675 7 vboxsf, Live 0x0000000000000000 (OX)
parport_pc 32701 0 - Live 0x0000000000000000
ppdev 17671 0 - Live 0x0000000000000000
mac_hid 13205 0 - Live 0x0000000000000000
lp 17759 0 - Live 0x0000000000000000
parport 42348 3 parport_pc,ppdev,lp, Live 0x0000000000000000
psmouse 106714 0 - Live 0x0000000000000000
ahci 25819 2 - Live 0x0000000000000000
libahci 32716 1 ahci, Live 0x0000000000000000
e1000 145174 0 - Live 0x0000000000000000
[-- Attachment #2: ipv6ndp.pcap --]
[-- Type: application/octet-stream, Size: 38786 bytes --]
^ permalink raw reply
* Re: [net-next.git 0/3] stmmac: update driver documentation
From: David Miller @ 2014-11-19 20:06 UTC (permalink / raw)
To: peppe.cavallaro; +Cc: netdev
In-Reply-To: <1416300421-25500-1-git-send-email-peppe.cavallaro@st.com>
From: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Date: Tue, 18 Nov 2014 09:46:58 +0100
> Recently many changes have been done inside the driver
> so this patch updates the driver's doc for example reviewing
> information for the rx and tx processes that are managed
> by napi method, adding new information for missing glue-logic files
> etc.
> Also this reviews and fixes what is reported when run kernel-doc script.
Series applied, thanks.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox