diff options
-rw-r--r-- | drivers/net/niu.c | 19 | ||||
-rw-r--r-- | include/linux/ethtool.h | 21 | ||||
-rw-r--r-- | net/core/ethtool.c | 8 |
3 files changed, 11 insertions, 37 deletions
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 8e1859c801a4..e36a83845a1c 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -7462,10 +7462,12 @@ static int niu_add_ethtool_tcam_entry(struct niu *np, | |||
7462 | if (fsp->flow_type == IP_USER_FLOW) { | 7462 | if (fsp->flow_type == IP_USER_FLOW) { |
7463 | int i; | 7463 | int i; |
7464 | int add_usr_cls = 0; | 7464 | int add_usr_cls = 0; |
7465 | int ipv6 = 0; | ||
7466 | struct ethtool_usrip4_spec *uspec = &fsp->h_u.usr_ip4_spec; | 7465 | struct ethtool_usrip4_spec *uspec = &fsp->h_u.usr_ip4_spec; |
7467 | struct ethtool_usrip4_spec *umask = &fsp->m_u.usr_ip4_spec; | 7466 | struct ethtool_usrip4_spec *umask = &fsp->m_u.usr_ip4_spec; |
7468 | 7467 | ||
7468 | if (uspec->ip_ver != ETH_RX_NFC_IP4) | ||
7469 | return -EINVAL; | ||
7470 | |||
7469 | niu_lock_parent(np, flags); | 7471 | niu_lock_parent(np, flags); |
7470 | 7472 | ||
7471 | for (i = 0; i < NIU_L3_PROG_CLS; i++) { | 7473 | for (i = 0; i < NIU_L3_PROG_CLS; i++) { |
@@ -7494,9 +7496,7 @@ static int niu_add_ethtool_tcam_entry(struct niu *np, | |||
7494 | default: | 7496 | default: |
7495 | break; | 7497 | break; |
7496 | } | 7498 | } |
7497 | if (uspec->ip_ver == ETH_RX_NFC_IP6) | 7499 | ret = tcam_user_ip_class_set(np, class, 0, |
7498 | ipv6 = 1; | ||
7499 | ret = tcam_user_ip_class_set(np, class, ipv6, | ||
7500 | uspec->proto, | 7500 | uspec->proto, |
7501 | uspec->tos, | 7501 | uspec->tos, |
7502 | umask->tos); | 7502 | umask->tos); |
@@ -7553,16 +7553,7 @@ static int niu_add_ethtool_tcam_entry(struct niu *np, | |||
7553 | ret = -EINVAL; | 7553 | ret = -EINVAL; |
7554 | goto out; | 7554 | goto out; |
7555 | case IP_USER_FLOW: | 7555 | case IP_USER_FLOW: |
7556 | if (fsp->h_u.usr_ip4_spec.ip_ver == ETH_RX_NFC_IP4) { | 7556 | niu_get_tcamkey_from_ip4fs(fsp, tp, l2_rdc_table, class); |
7557 | niu_get_tcamkey_from_ip4fs(fsp, tp, l2_rdc_table, | ||
7558 | class); | ||
7559 | } else { | ||
7560 | /* Not yet implemented */ | ||
7561 | netdev_info(np->dev, "niu%d: In %s(): usr flow for IPv6 not implemented\n", | ||
7562 | parent->index, __func__); | ||
7563 | ret = -EINVAL; | ||
7564 | goto out; | ||
7565 | } | ||
7566 | break; | 7557 | break; |
7567 | default: | 7558 | default: |
7568 | netdev_info(np->dev, "niu%d: In %s(): Unknown flow type %d\n", | 7559 | netdev_info(np->dev, "niu%d: In %s(): Unknown flow type %d\n", |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 4b3ba05b11a8..d64e246a39e7 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -353,20 +353,7 @@ struct ethtool_ah_espip4_spec { | |||
353 | __u8 tos; | 353 | __u8 tos; |
354 | }; | 354 | }; |
355 | 355 | ||
356 | struct ethtool_rawip4_spec { | ||
357 | __be32 ip4src; | ||
358 | __be32 ip4dst; | ||
359 | __u8 hdata[64]; | ||
360 | }; | ||
361 | |||
362 | struct ethtool_ether_spec { | ||
363 | __be16 ether_type; | ||
364 | __u8 frame_size; | ||
365 | __u8 eframe[16]; | ||
366 | }; | ||
367 | |||
368 | #define ETH_RX_NFC_IP4 1 | 356 | #define ETH_RX_NFC_IP4 1 |
369 | #define ETH_RX_NFC_IP6 2 | ||
370 | 357 | ||
371 | /** | 358 | /** |
372 | * struct ethtool_usrip4_spec - general flow specification for IPv4 | 359 | * struct ethtool_usrip4_spec - general flow specification for IPv4 |
@@ -403,10 +390,8 @@ struct ethtool_rx_flow_spec { | |||
403 | struct ethtool_tcpip4_spec sctp_ip4_spec; | 390 | struct ethtool_tcpip4_spec sctp_ip4_spec; |
404 | struct ethtool_ah_espip4_spec ah_ip4_spec; | 391 | struct ethtool_ah_espip4_spec ah_ip4_spec; |
405 | struct ethtool_ah_espip4_spec esp_ip4_spec; | 392 | struct ethtool_ah_espip4_spec esp_ip4_spec; |
406 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
407 | struct ethtool_ether_spec ether_spec; | ||
408 | struct ethtool_usrip4_spec usr_ip4_spec; | 393 | struct ethtool_usrip4_spec usr_ip4_spec; |
409 | __u8 hdata[64]; | 394 | __u8 hdata[72]; |
410 | } h_u, m_u; | 395 | } h_u, m_u; |
411 | __u64 ring_cookie; | 396 | __u64 ring_cookie; |
412 | __u32 location; | 397 | __u32 location; |
@@ -496,10 +481,8 @@ struct ethtool_rx_ntuple_flow_spec { | |||
496 | struct ethtool_tcpip4_spec sctp_ip4_spec; | 481 | struct ethtool_tcpip4_spec sctp_ip4_spec; |
497 | struct ethtool_ah_espip4_spec ah_ip4_spec; | 482 | struct ethtool_ah_espip4_spec ah_ip4_spec; |
498 | struct ethtool_ah_espip4_spec esp_ip4_spec; | 483 | struct ethtool_ah_espip4_spec esp_ip4_spec; |
499 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
500 | struct ethtool_ether_spec ether_spec; | ||
501 | struct ethtool_usrip4_spec usr_ip4_spec; | 484 | struct ethtool_usrip4_spec usr_ip4_spec; |
502 | __u8 hdata[64]; | 485 | __u8 hdata[72]; |
503 | } h_u, m_u; | 486 | } h_u, m_u; |
504 | 487 | ||
505 | __u16 vlan_tag; | 488 | __u16 vlan_tag; |
diff --git a/net/core/ethtool.c b/net/core/ethtool.c index 970eb9817bbc..fcd62757704d 100644 --- a/net/core/ethtool.c +++ b/net/core/ethtool.c | |||
@@ -673,19 +673,19 @@ static int ethtool_get_rx_ntuple(struct net_device *dev, void __user *useraddr) | |||
673 | break; | 673 | break; |
674 | case IP_USER_FLOW: | 674 | case IP_USER_FLOW: |
675 | sprintf(p, "\tSrc IP addr: 0x%x\n", | 675 | sprintf(p, "\tSrc IP addr: 0x%x\n", |
676 | fsc->fs.h_u.raw_ip4_spec.ip4src); | 676 | fsc->fs.h_u.usr_ip4_spec.ip4src); |
677 | p += ETH_GSTRING_LEN; | 677 | p += ETH_GSTRING_LEN; |
678 | num_strings++; | 678 | num_strings++; |
679 | sprintf(p, "\tSrc IP mask: 0x%x\n", | 679 | sprintf(p, "\tSrc IP mask: 0x%x\n", |
680 | fsc->fs.m_u.raw_ip4_spec.ip4src); | 680 | fsc->fs.m_u.usr_ip4_spec.ip4src); |
681 | p += ETH_GSTRING_LEN; | 681 | p += ETH_GSTRING_LEN; |
682 | num_strings++; | 682 | num_strings++; |
683 | sprintf(p, "\tDest IP addr: 0x%x\n", | 683 | sprintf(p, "\tDest IP addr: 0x%x\n", |
684 | fsc->fs.h_u.raw_ip4_spec.ip4dst); | 684 | fsc->fs.h_u.usr_ip4_spec.ip4dst); |
685 | p += ETH_GSTRING_LEN; | 685 | p += ETH_GSTRING_LEN; |
686 | num_strings++; | 686 | num_strings++; |
687 | sprintf(p, "\tDest IP mask: 0x%x\n", | 687 | sprintf(p, "\tDest IP mask: 0x%x\n", |
688 | fsc->fs.m_u.raw_ip4_spec.ip4dst); | 688 | fsc->fs.m_u.usr_ip4_spec.ip4dst); |
689 | p += ETH_GSTRING_LEN; | 689 | p += ETH_GSTRING_LEN; |
690 | num_strings++; | 690 | num_strings++; |
691 | break; | 691 | break; |