From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) by dpdk.org (Postfix) with ESMTP id 5B858AFD0 for ; Fri, 13 Jun 2014 15:37:40 +0200 (CEST) Received: by mail-we0-f181.google.com with SMTP id q59so2840624wes.12 for ; Fri, 13 Jun 2014 06:37:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hhgckVyyUrHBuSJJgsuEeUp5bMwzIaIqWmB7Jl4KBM8=; b=ev9CHXcW6UEIZhJUvEaCI2niloW394VP1ztNyYMQUErDfq6BxBD9C8dNhoKTu2WTyl GLNUvKsha2yMw46VCmdjpuxbkStGyPpOwxe/GUIqUSWK5pwkjnQli63/6jIvhgX5uLQS UjEXg6o9eX1rGXVgGGe5bhFqJBDfP0LqhUR2Lx1FphtRTAktsi3DWI62t1OU+i0tPa9k JRUdKuuU+lfnsWIux7ul6nq9tu+MbZ7P0Wwm/ncArtjfPKoElHP3YCs7PfGuGqgDJMf2 RbU0bCLomtJNEogF4omHdzhjvucJHX8GuHiCr8y1E1z6JSCPeAsKviXq7Xn7oF6jD3IW t1gg== X-Gm-Message-State: ALoCoQnqWm5m6f1hUTl8oOBlgiF72/lhaKR5gu0iMjc5Qu97Hrf5noMCDOlkFk+jnO9l8AcRdCdf X-Received: by 10.194.222.197 with SMTP id qo5mr4539679wjc.78.1402666675629; Fri, 13 Jun 2014 06:37:55 -0700 (PDT) Received: from alcyon.dev.6wind.com (guy78-3-82-239-227-177.fbx.proxad.net. [82.239.227.177]) by mx.google.com with ESMTPSA id s9sm2568157wix.13.2014.06.13.06.37.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Jun 2014 06:37:55 -0700 (PDT) From: David Marchand To: dev@dpdk.org Date: Fri, 13 Jun 2014 15:37:40 +0200 Message-Id: <1402666663-10260-5-git-send-email-david.marchand@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1402666663-10260-1-git-send-email-david.marchand@6wind.com> References: <1402666663-10260-1-git-send-email-david.marchand@6wind.com> Subject: [dpdk-dev] [PATCH v2 4/7] ethdev: introduce enable_scatter rx mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jun 2014 13:37:40 -0000 We might want to be sure the scatter packets reception handler is selected in a pmd. This makes it possible to then change mtu later, without the need of restarting a port. It is then the pmd duty to tell it enabled the scatter reception handler by setting dev->data->scattered_rx to 1. Signed-off-by: David Marchand --- lib/librte_ether/rte_ethdev.h | 3 ++- lib/librte_pmd_e1000/em_rxtx.c | 5 +++++ lib/librte_pmd_e1000/igb_rxtx.c | 10 ++++++++++ lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 10 ++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 3701023..54646bb 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -301,7 +301,8 @@ struct rte_eth_rxmode { hw_vlan_strip : 1, /**< VLAN strip enable. */ hw_vlan_extend : 1, /**< Extended VLAN enable. */ jumbo_frame : 1, /**< Jumbo Frame Receipt enable. */ - hw_strip_crc : 1; /**< Enable CRC stripping by hardware. */ + hw_strip_crc : 1, /**< Enable CRC stripping by hardware. */ + enable_scatter : 1; /**< Enable scatter packets rx handler */ }; /** diff --git a/lib/librte_pmd_e1000/em_rxtx.c b/lib/librte_pmd_e1000/em_rxtx.c index 1575e79..e5f1933 100644 --- a/lib/librte_pmd_e1000/em_rxtx.c +++ b/lib/librte_pmd_e1000/em_rxtx.c @@ -1714,6 +1714,11 @@ eth_em_rx_init(struct rte_eth_dev *dev) } } + if (dev->data->dev_conf.rxmode.enable_scatter) { + dev->rx_pkt_burst = eth_em_recv_scattered_pkts; + dev->data->scattered_rx = 1; + } + /* * Setup the Checksum Register. * Receive Full-Packet Checksum Offload is mutually exclusive with RSS. diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index c11931f..1cee40c 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -1997,6 +1997,11 @@ eth_igb_rx_init(struct rte_eth_dev *dev) E1000_WRITE_REG(hw, E1000_RXDCTL(rxq->reg_idx), rxdctl); } + if (dev->data->dev_conf.rxmode.enable_scatter) { + dev->rx_pkt_burst = eth_igb_recv_scattered_pkts; + dev->data->scattered_rx = 1; + } + /* * Setup BSIZE field of RCTL register, if needed. * Buffer sizes >= 1024 are not [supposed to be] setup in the RCTL @@ -2266,6 +2271,11 @@ eth_igbvf_rx_init(struct rte_eth_dev *dev) E1000_WRITE_REG(hw, E1000_RXDCTL(i), rxdctl); } + if (dev->data->dev_conf.rxmode.enable_scatter) { + dev->rx_pkt_burst = eth_igb_recv_scattered_pkts; + dev->data->scattered_rx = 1; + } + /* * Setup the HW Rx Head and Tail Descriptor Pointers. * This needs to be done after enable. diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 67afd5a..a2f6413 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -3478,6 +3478,11 @@ ixgbe_dev_rx_init(struct rte_eth_dev *dev) } } + if (dev->data->dev_conf.rxmode.enable_scatter) { + dev->rx_pkt_burst = ixgbe_recv_scattered_pkts; + dev->data->scattered_rx = 1; + } + /* * Device configured with multiple RX queues. */ @@ -3953,6 +3958,11 @@ ixgbevf_dev_rx_init(struct rte_eth_dev *dev) } } + if (dev->data->dev_conf.rxmode.enable_scatter) { + dev->rx_pkt_burst = ixgbe_recv_scattered_pkts; + dev->data->scattered_rx = 1; + } + return 0; } -- 1.7.10.4