[dpdk-dev] [PATCH] ixgbe_vf: Fix getting link state

2014-12-18 Thread Choonho Son
DPDK pmd code should have the consistency with original network device
driver code.

Linux kernel driver---> DPDK pmd driver
---
ixgbevf_check_mac_link_vf()ixgbe_check_mac_link_vf()
 at ixgbevf/vf.cat
librte_pmd_ixgbe/ixgbe/ixgbe_vf.c

ixgbevf_get_settings()  ixgbe_dev_link_update()
 at ixgbevf/ethtool.cat librte_pmd_ixgbe/ixgbe_ethdev.c


In a original device driver, detection link status called by
ixgbevf_get_settings()

hw->mac.get_link_status = 1;
hw->mac.ops.check_link(hw, _speed, _up, false);

Changing ixgbevf_check_mac_link_vf() will break consistency with original
code.



@ {Linux kernel}/drivers/net/ethernet/intel/ixgbevf/vf.c
static s32 ixgbevf_check_mac_link_vf(struct ixgbe_hw *hw,
 ixgbe_link_speed *speed,
 bool *link_up,
 bool autoneg_wait_to_complete)
{
struct ixgbe_mbx_info *mbx = >mbx;
struct ixgbe_mac_info *mac = >mac;
s32 ret_val = 0;
u32 links_reg;
u32 in_msg = 0;

/* If we were hit with a reset drop the link */
if (!mbx->ops.check_for_rst(hw) || !mbx->timeout)
mac->get_link_status = true;

if (!mac->get_link_status)
goto out;



@ {DPDK}/lib/librte_pmd_ixgbe/ixgbe/ixgbe_vf.c
s32 ixgbe_check_mac_link_vf(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
bool *link_up, bool autoneg_wait_to_complete)
{
struct ixgbe_mbx_info *mbx = >mbx;
struct ixgbe_mac_info *mac = >mac;
s32 ret_val = IXGBE_SUCCESS;
u32 links_reg;
u32 in_msg = 0;
UNREFERENCED_1PARAMETER(autoneg_wait_to_complete);

/* If we were hit with a reset drop the link */
if (!mbx->ops.check_for_rst(hw, 0) || !mbx->timeout)
mac->get_link_status = true;

if (!mac->get_link_status)
goto out;



@ {Linux kernel}/drivers/net/ethernet/intel/ixgbevf/ethtool.c
static int ixgbevf_get_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd)
{
struct ixgbevf_adapter *adapter = netdev_priv(netdev);
struct ixgbe_hw *hw = >hw;
u32 link_speed = 0;
bool link_up;

ecmd->supported = SUPPORTED_1baseT_Full;
ecmd->autoneg = AUTONEG_DISABLE;
ecmd->transceiver = XCVR_DUMMY1;
ecmd->port = -1;

hw->mac.get_link_status = 1;
hw->mac.ops.check_link(hw, _speed, _up, false);

if (link_up) {
__u32 speed = SPEED_1;
switch (link_speed) {



@ {DPDK}/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
/* return 0 means link status changed, -1 means not changed */
static int
ixgbe_dev_link_update(struct rte_eth_dev *dev, int wait_to_complete)
{
struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
struct rte_eth_link link, old;
ixgbe_link_speed link_speed;
int link_up;
int diag;

link.link_status = 0;
link.link_speed = 0;
link.link_duplex = 0;
memset(, 0, sizeof(old));
rte_ixgbe_dev_atomic_read_link_status(dev, );

/* check if it needs to wait to complete, if lsc interrupt is enabled */
if (wait_to_complete == 0 || dev->data->dev_conf.intr_conf.lsc != 0)
diag = ixgbe_check_link(hw, _speed, _up, 0);
else
diag = ixgbe_check_link(hw, _speed, _up, 1);
if (diag != 0) {
link.link_speed = ETH_LINK_SPEED_100;
link.link_duplex = ETH_LINK_HALF_DUPLEX;





2014-12-17 22:24 GMT+09:00 Thomas Monjalon :
>
> 2014-12-17 13:22, Balazs Nemeth:
> > This patch fixes checking the link state of a virtual function. If the
> > state has already been checked, it does not need to be checked
> > again. Previously, get_link_status in the ixgbe_hw struct was
> > used to track if the information had already been updated, but this
> > field was always set to false.
> >
> > Signed-off-by: Balazs Nemeth 
>
> This is the third patch about link status fix in ixgbevf.
> Please comment the other ones in the respective mailing threads:
> http://dpdk.org/dev/patchwork/patch/1079
> http://dpdk.org/dev/patchwork/patch/1224
> Are they superseded by yours?
>
> --
> Thomas
>


[dpdk-dev] socket programming with DPDK?

2014-11-15 Thread Choonho Son
Hi,

I am making netflow collector with DPDK.
I need to export result to another server with socket programming.
But I can not include  which defines struct sockaddr_in.

How can I make application with traditional socket programming and DPDK?

Thanks.

Choonho Son


[dpdk-dev] [PATCH] ixgbe: fix link speed detection of ixgbevf

2014-11-09 Thread Choonho Son
Link speed of virtual function is detected as default speed(100Mbps, 
half-duplex).
Before checking VF link, get_link_status must be set.

Checking link status
PMD: ixgbe_check_for_rst_vf(): ixgbe_check_for_rst_vf
done
PMD: ixgbe_check_for_rst_vf(): ixgbe_check_for_rst_vf
Port 0 Link Up - speed 100 Mbps - half-duplex

Signed-off-by: Choonho Son 
---
 lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c 
b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
index 9c73a30..6eab1e8 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c
@@ -2002,6 +2002,7 @@ ixgbe_dev_link_update(struct rte_eth_dev *dev, int 
wait_to_complete)
memset(, 0, sizeof(old));
rte_ixgbe_dev_atomic_read_link_status(dev, );

+   hw->mac.get_link_status = 1;
/* check if it needs to wait to complete, if lsc interrupt is enabled */
if (wait_to_complete == 0 || dev->data->dev_conf.intr_conf.lsc != 0)
diag = ixgbe_check_link(hw, _speed, _up, 0);
-- 
1.9.1



[dpdk-dev] [PATCH] i40e: fix build of VXLAN packet identification debug

2014-11-06 Thread Choonho Son
The commit 15dbb63ef9e9f108e7dcd837b88234f27a1ec258 didn't compile,
if CONFIG_RTE_LIBRTE_I40E_DEBUG_DRIVER is enabled.

Signed-off-by: Choonho Son 
---
 lib/librte_pmd_i40e/i40e_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c 
b/lib/librte_pmd_i40e/i40e_ethdev.c
index fc78b20..4570795 100644
--- a/lib/librte_pmd_i40e/i40e_ethdev.c
+++ b/lib/librte_pmd_i40e/i40e_ethdev.c
@@ -4722,8 +4722,8 @@ i40e_add_vxlan_port(struct i40e_pf *pf, uint16_t port)
return -1;
}

-   PMD_DRV_LOG(INFO, "Added %s port %d with AQ command with index %d",
-port,  filter_index);
+   PMD_DRV_LOG(INFO, "Added port %d with AQ command with index %d",
+port,  filter_idx);

/* New port: add it and mark its index in the bitmap */
pf->vxlan_ports[idx] = port;
-- 
1.9.1



[dpdk-dev] release hugepages after application exit?

2014-10-29 Thread Choonho Son
Hi,

After terminating DPDK application, it does not release hugepages.
Is there any reason for it or to-do item?

Thanks,
Choonho Son