aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorHadar Hen Zion <hadarh@mellanox.com>2012-09-05 18:50:48 -0400
committerDavid S. Miller <davem@davemloft.net>2012-09-07 12:55:59 -0400
commita8edc3bf05a3465726afdf635a820761fae0d50b (patch)
tree345e02de5037f0b36685d90717aadae4ef19ed69 /drivers/net
parentd90c92fee89ccd75ef2646f3bde0b4c0450666c3 (diff)
net/mlx4_core: Put Firmware flow steering structures in common header files
To allow for usage of the flow steering Firmware structures in more locations over the driver, such as the resource tracker, move them from mcg.c to common header files. Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mcg.c90
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/mlx4.h76
2 files changed, 83 insertions, 83 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c
index a018ea2a43de..2673f3ba935f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mcg.c
+++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c
@@ -650,13 +650,6 @@ static int find_entry(struct mlx4_dev *dev, u8 port,
650 return err; 650 return err;
651} 651}
652 652
653struct mlx4_net_trans_rule_hw_ctrl {
654 __be32 ctrl;
655 __be32 vf_vep_port;
656 __be32 qpn;
657 __be32 reserved;
658};
659
660static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl, 653static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl,
661 struct mlx4_net_trans_rule_hw_ctrl *hw) 654 struct mlx4_net_trans_rule_hw_ctrl *hw)
662{ 655{
@@ -680,87 +673,18 @@ static void trans_rule_ctrl_to_hw(struct mlx4_net_trans_rule *ctrl,
680 hw->qpn = cpu_to_be32(ctrl->qpn); 673 hw->qpn = cpu_to_be32(ctrl->qpn);
681} 674}
682 675
683struct mlx4_net_trans_rule_hw_ib { 676const u16 __sw_id_hw[] = {
684 u8 size; 677 [MLX4_NET_TRANS_RULE_ID_ETH] = 0xE001,
685 u8 rsvd1; 678 [MLX4_NET_TRANS_RULE_ID_IB] = 0xE005,
686 __be16 id; 679 [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003,
687 u32 rsvd2; 680 [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002,
688 __be32 qpn; 681 [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004,
689 __be32 qpn_mask; 682 [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006
690 u8 dst_gid[16];
691 u8 dst_gid_msk[16];
692} __packed;
693
694struct mlx4_net_trans_rule_hw_eth {
695 u8 size;
696 u8 rsvd;
697 __be16 id;
698 u8 rsvd1[6];
699 u8 dst_mac[6];
700 u16 rsvd2;
701 u8 dst_mac_msk[6];
702 u16 rsvd3;
703 u8 src_mac[6];
704 u16 rsvd4;
705 u8 src_mac_msk[6];
706 u8 rsvd5;
707 u8 ether_type_enable;
708 __be16 ether_type;
709 __be16 vlan_id_msk;
710 __be16 vlan_id;
711} __packed;
712
713struct mlx4_net_trans_rule_hw_tcp_udp {
714 u8 size;
715 u8 rsvd;
716 __be16 id;
717 __be16 rsvd1[3];
718 __be16 dst_port;
719 __be16 rsvd2;
720 __be16 dst_port_msk;
721 __be16 rsvd3;
722 __be16 src_port;
723 __be16 rsvd4;
724 __be16 src_port_msk;
725} __packed;
726
727struct mlx4_net_trans_rule_hw_ipv4 {
728 u8 size;
729 u8 rsvd;
730 __be16 id;
731 __be32 rsvd1;
732 __be32 dst_ip;
733 __be32 dst_ip_msk;
734 __be32 src_ip;
735 __be32 src_ip_msk;
736} __packed;
737
738struct _rule_hw {
739 union {
740 struct {
741 u8 size;
742 u8 rsvd;
743 __be16 id;
744 };
745 struct mlx4_net_trans_rule_hw_eth eth;
746 struct mlx4_net_trans_rule_hw_ib ib;
747 struct mlx4_net_trans_rule_hw_ipv4 ipv4;
748 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp;
749 };
750}; 683};
751 684
752static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec, 685static int parse_trans_rule(struct mlx4_dev *dev, struct mlx4_spec_list *spec,
753 struct _rule_hw *rule_hw) 686 struct _rule_hw *rule_hw)
754{ 687{
755 static const u16 __sw_id_hw[] = {
756 [MLX4_NET_TRANS_RULE_ID_ETH] = 0xE001,
757 [MLX4_NET_TRANS_RULE_ID_IB] = 0xE005,
758 [MLX4_NET_TRANS_RULE_ID_IPV6] = 0xE003,
759 [MLX4_NET_TRANS_RULE_ID_IPV4] = 0xE002,
760 [MLX4_NET_TRANS_RULE_ID_TCP] = 0xE004,
761 [MLX4_NET_TRANS_RULE_ID_UDP] = 0xE006
762 };
763
764 static const size_t __rule_hw_sz[] = { 688 static const size_t __rule_hw_sz[] = {
765 [MLX4_NET_TRANS_RULE_ID_ETH] = 689 [MLX4_NET_TRANS_RULE_ID_ETH] =
766 sizeof(struct mlx4_net_trans_rule_hw_eth), 690 sizeof(struct mlx4_net_trans_rule_hw_eth),
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4.h b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
index 4d9df8f2a126..dba69d98734a 100644
--- a/drivers/net/ethernet/mellanox/mlx4/mlx4.h
+++ b/drivers/net/ethernet/mellanox/mlx4/mlx4.h
@@ -690,6 +690,82 @@ struct mlx4_steer {
690 struct list_head steer_entries[MLX4_NUM_STEERS]; 690 struct list_head steer_entries[MLX4_NUM_STEERS];
691}; 691};
692 692
693struct mlx4_net_trans_rule_hw_ctrl {
694 __be32 ctrl;
695 __be32 vf_vep_port;
696 __be32 qpn;
697 __be32 reserved;
698};
699
700struct mlx4_net_trans_rule_hw_ib {
701 u8 size;
702 u8 rsvd1;
703 __be16 id;
704 u32 rsvd2;
705 __be32 qpn;
706 __be32 qpn_mask;
707 u8 dst_gid[16];
708 u8 dst_gid_msk[16];
709} __packed;
710
711struct mlx4_net_trans_rule_hw_eth {
712 u8 size;
713 u8 rsvd;
714 __be16 id;
715 u8 rsvd1[6];
716 u8 dst_mac[6];
717 u16 rsvd2;
718 u8 dst_mac_msk[6];
719 u16 rsvd3;
720 u8 src_mac[6];
721 u16 rsvd4;
722 u8 src_mac_msk[6];
723 u8 rsvd5;
724 u8 ether_type_enable;
725 __be16 ether_type;
726 __be16 vlan_id_msk;
727 __be16 vlan_id;
728} __packed;
729
730struct mlx4_net_trans_rule_hw_tcp_udp {
731 u8 size;
732 u8 rsvd;
733 __be16 id;
734 __be16 rsvd1[3];
735 __be16 dst_port;
736 __be16 rsvd2;
737 __be16 dst_port_msk;
738 __be16 rsvd3;
739 __be16 src_port;
740 __be16 rsvd4;
741 __be16 src_port_msk;
742} __packed;
743
744struct mlx4_net_trans_rule_hw_ipv4 {
745 u8 size;
746 u8 rsvd;
747 __be16 id;
748 __be32 rsvd1;
749 __be32 dst_ip;
750 __be32 dst_ip_msk;
751 __be32 src_ip;
752 __be32 src_ip_msk;
753} __packed;
754
755struct _rule_hw {
756 union {
757 struct {
758 u8 size;
759 u8 rsvd;
760 __be16 id;
761 };
762 struct mlx4_net_trans_rule_hw_eth eth;
763 struct mlx4_net_trans_rule_hw_ib ib;
764 struct mlx4_net_trans_rule_hw_ipv4 ipv4;
765 struct mlx4_net_trans_rule_hw_tcp_udp tcp_udp;
766 };
767};
768
693struct mlx4_priv { 769struct mlx4_priv {
694 struct mlx4_dev dev; 770 struct mlx4_dev dev;
695 771