Lines Matching +full:ip +full:- +full:76

1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright(c) 2013 - 2018 Intel Corporation. */
10 * iavf_set_mac_type - Sets MAC type
20 if (hw->vendor_id == PCI_VENDOR_ID_INTEL) { in iavf_set_mac_type()
21 switch (hw->device_id) { in iavf_set_mac_type()
23 hw->mac.type = IAVF_MAC_X722_VF; in iavf_set_mac_type()
28 hw->mac.type = IAVF_MAC_VF; in iavf_set_mac_type()
31 hw->mac.type = IAVF_MAC_GENERIC; in iavf_set_mac_type()
38 hw_dbg(hw, "found mac: %d, returns: %d\n", hw->mac.type, status); in iavf_set_mac_type()
43 * iavf_aq_str - convert AQ err code to a string
98 snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err); in iavf_aq_str()
99 return hw->err_str; in iavf_aq_str()
103 * iavf_stat_str - convert status err code to a string
246 snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err); in iavf_stat_str()
247 return hw->err_str; in iavf_stat_str()
266 if ((!(mask & hw->debug_mask)) || !desc) in iavf_debug_aq()
271 le16_to_cpu(aq_desc->opcode), in iavf_debug_aq()
272 le16_to_cpu(aq_desc->flags), in iavf_debug_aq()
273 le16_to_cpu(aq_desc->datalen), in iavf_debug_aq()
274 le16_to_cpu(aq_desc->retval)); in iavf_debug_aq()
276 le32_to_cpu(aq_desc->cookie_high), in iavf_debug_aq()
277 le32_to_cpu(aq_desc->cookie_low)); in iavf_debug_aq()
279 le32_to_cpu(aq_desc->params.internal.param0), in iavf_debug_aq()
280 le32_to_cpu(aq_desc->params.internal.param1)); in iavf_debug_aq()
282 le32_to_cpu(aq_desc->params.external.addr_high), in iavf_debug_aq()
283 le32_to_cpu(aq_desc->params.external.addr_low)); in iavf_debug_aq()
285 if (buffer && aq_desc->datalen) { in iavf_debug_aq()
286 u16 len = le16_to_cpu(aq_desc->datalen); in iavf_debug_aq()
291 /* write the full 16-byte chunks */ in iavf_debug_aq()
292 if (hw->debug_mask & mask) { in iavf_debug_aq()
297 hw->bus.bus_id, in iavf_debug_aq()
298 hw->bus.device, in iavf_debug_aq()
299 hw->bus.func); in iavf_debug_aq()
315 if (hw->aq.asq.len) in iavf_check_asq_alive()
316 return !!(rd32(hw, hw->aq.asq.len) & in iavf_check_asq_alive()
340 cmd->driver_unloading = cpu_to_le32(IAVF_AQ_DRIVER_UNLOADING); in iavf_aq_queue_shutdown()
378 cmd_resp->vsi_id = in iavf_aq_get_set_rss_lut()
382 cmd_resp->vsi_id |= cpu_to_le16((u16)IAVF_AQC_SET_RSS_LUT_VSI_VALID); in iavf_aq_get_set_rss_lut()
385 cmd_resp->flags |= cpu_to_le16((u16) in iavf_aq_get_set_rss_lut()
390 cmd_resp->flags |= cpu_to_le16((u16) in iavf_aq_get_set_rss_lut()
464 cmd_resp->vsi_id = in iavf_aq_get_set_rss_key()
468 cmd_resp->vsi_id |= cpu_to_le16((u16)IAVF_AQC_SET_RSS_KEY_VSI_VALID); in iavf_aq_get_set_rss_key()
502 /* The iavf_ptype_lookup table is used to convert from the 8-bit ptype in the
503 * hardware to a bit-field that can be used by SW to more easily determine the
509 * We store the PTYPE in the top byte of the bit field - this is just so that
545 /* Lookup table mapping the 8-bit HW PTYPE to the bit field for decoding */
572 IAVF_PTT(22, IP, IPV4, FRG, NONE, NONE, NOF, NONE, PAY3),
573 IAVF_PTT(23, IP, IPV4, NOF, NONE, NONE, NOF, NONE, PAY3),
574 IAVF_PTT(24, IP, IPV4, NOF, NONE, NONE, NOF, UDP, PAY4),
576 IAVF_PTT(26, IP, IPV4, NOF, NONE, NONE, NOF, TCP, PAY4),
577 IAVF_PTT(27, IP, IPV4, NOF, NONE, NONE, NOF, SCTP, PAY4),
578 IAVF_PTT(28, IP, IPV4, NOF, NONE, NONE, NOF, ICMP, PAY4),
580 /* IPv4 --> IPv4 */
581 IAVF_PTT(29, IP, IPV4, NOF, IP_IP, IPV4, FRG, NONE, PAY3),
582 IAVF_PTT(30, IP, IPV4, NOF, IP_IP, IPV4, NOF, NONE, PAY3),
583 IAVF_PTT(31, IP, IPV4, NOF, IP_IP, IPV4, NOF, UDP, PAY4),
585 IAVF_PTT(33, IP, IPV4, NOF, IP_IP, IPV4, NOF, TCP, PAY4),
586 IAVF_PTT(34, IP, IPV4, NOF, IP_IP, IPV4, NOF, SCTP, PAY4),
587 IAVF_PTT(35, IP, IPV4, NOF, IP_IP, IPV4, NOF, ICMP, PAY4),
589 /* IPv4 --> IPv6 */
590 IAVF_PTT(36, IP, IPV4, NOF, IP_IP, IPV6, FRG, NONE, PAY3),
591 IAVF_PTT(37, IP, IPV4, NOF, IP_IP, IPV6, NOF, NONE, PAY3),
592 IAVF_PTT(38, IP, IPV4, NOF, IP_IP, IPV6, NOF, UDP, PAY4),
594 IAVF_PTT(40, IP, IPV4, NOF, IP_IP, IPV6, NOF, TCP, PAY4),
595 IAVF_PTT(41, IP, IPV4, NOF, IP_IP, IPV6, NOF, SCTP, PAY4),
596 IAVF_PTT(42, IP, IPV4, NOF, IP_IP, IPV6, NOF, ICMP, PAY4),
598 /* IPv4 --> GRE/NAT */
599 IAVF_PTT(43, IP, IPV4, NOF, IP_GRENAT, NONE, NOF, NONE, PAY3),
601 /* IPv4 --> GRE/NAT --> IPv4 */
602 IAVF_PTT(44, IP, IPV4, NOF, IP_GRENAT, IPV4, FRG, NONE, PAY3),
603 IAVF_PTT(45, IP, IPV4, NOF, IP_GRENAT, IPV4, NOF, NONE, PAY3),
604 IAVF_PTT(46, IP, IPV4, NOF, IP_GRENAT, IPV4, NOF, UDP, PAY4),
606 IAVF_PTT(48, IP, IPV4, NOF, IP_GRENAT, IPV4, NOF, TCP, PAY4),
607 IAVF_PTT(49, IP, IPV4, NOF, IP_GRENAT, IPV4, NOF, SCTP, PAY4),
608 IAVF_PTT(50, IP, IPV4, NOF, IP_GRENAT, IPV4, NOF, ICMP, PAY4),
610 /* IPv4 --> GRE/NAT --> IPv6 */
611 IAVF_PTT(51, IP, IPV4, NOF, IP_GRENAT, IPV6, FRG, NONE, PAY3),
612 IAVF_PTT(52, IP, IPV4, NOF, IP_GRENAT, IPV6, NOF, NONE, PAY3),
613 IAVF_PTT(53, IP, IPV4, NOF, IP_GRENAT, IPV6, NOF, UDP, PAY4),
615 IAVF_PTT(55, IP, IPV4, NOF, IP_GRENAT, IPV6, NOF, TCP, PAY4),
616 IAVF_PTT(56, IP, IPV4, NOF, IP_GRENAT, IPV6, NOF, SCTP, PAY4),
617 IAVF_PTT(57, IP, IPV4, NOF, IP_GRENAT, IPV6, NOF, ICMP, PAY4),
619 /* IPv4 --> GRE/NAT --> MAC */
620 IAVF_PTT(58, IP, IPV4, NOF, IP_GRENAT_MAC, NONE, NOF, NONE, PAY3),
622 /* IPv4 --> GRE/NAT --> MAC --> IPv4 */
623 IAVF_PTT(59, IP, IPV4, NOF, IP_GRENAT_MAC, IPV4, FRG, NONE, PAY3),
624 IAVF_PTT(60, IP, IPV4, NOF, IP_GRENAT_MAC, IPV4, NOF, NONE, PAY3),
625 IAVF_PTT(61, IP, IPV4, NOF, IP_GRENAT_MAC, IPV4, NOF, UDP, PAY4),
627 IAVF_PTT(63, IP, IPV4, NOF, IP_GRENAT_MAC, IPV4, NOF, TCP, PAY4),
628 IAVF_PTT(64, IP, IPV4, NOF, IP_GRENAT_MAC, IPV4, NOF, SCTP, PAY4),
629 IAVF_PTT(65, IP, IPV4, NOF, IP_GRENAT_MAC, IPV4, NOF, ICMP, PAY4),
631 /* IPv4 --> GRE/NAT -> MAC --> IPv6 */
632 IAVF_PTT(66, IP, IPV4, NOF, IP_GRENAT_MAC, IPV6, FRG, NONE, PAY3),
633 IAVF_PTT(67, IP, IPV4, NOF, IP_GRENAT_MAC, IPV6, NOF, NONE, PAY3),
634 IAVF_PTT(68, IP, IPV4, NOF, IP_GRENAT_MAC, IPV6, NOF, UDP, PAY4),
636 IAVF_PTT(70, IP, IPV4, NOF, IP_GRENAT_MAC, IPV6, NOF, TCP, PAY4),
637 IAVF_PTT(71, IP, IPV4, NOF, IP_GRENAT_MAC, IPV6, NOF, SCTP, PAY4),
638 IAVF_PTT(72, IP, IPV4, NOF, IP_GRENAT_MAC, IPV6, NOF, ICMP, PAY4),
640 /* IPv4 --> GRE/NAT --> MAC/VLAN */
641 IAVF_PTT(73, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, NONE, NOF, NONE, PAY3),
643 /* IPv4 ---> GRE/NAT -> MAC/VLAN --> IPv4 */
644 IAVF_PTT(74, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV4, FRG, NONE, PAY3),
645 IAVF_PTT(75, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, NONE, PAY3),
646 IAVF_PTT(76, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, UDP, PAY4),
648 IAVF_PTT(78, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, TCP, PAY4),
649 IAVF_PTT(79, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, SCTP, PAY4),
650 IAVF_PTT(80, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, ICMP, PAY4),
652 /* IPv4 -> GRE/NAT -> MAC/VLAN --> IPv6 */
653 IAVF_PTT(81, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV6, FRG, NONE, PAY3),
654 IAVF_PTT(82, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, NONE, PAY3),
655 IAVF_PTT(83, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, UDP, PAY4),
657 IAVF_PTT(85, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, TCP, PAY4),
658 IAVF_PTT(86, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, SCTP, PAY4),
659 IAVF_PTT(87, IP, IPV4, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, ICMP, PAY4),
662 IAVF_PTT(88, IP, IPV6, FRG, NONE, NONE, NOF, NONE, PAY3),
663 IAVF_PTT(89, IP, IPV6, NOF, NONE, NONE, NOF, NONE, PAY3),
664 IAVF_PTT(90, IP, IPV6, NOF, NONE, NONE, NOF, UDP, PAY3),
666 IAVF_PTT(92, IP, IPV6, NOF, NONE, NONE, NOF, TCP, PAY4),
667 IAVF_PTT(93, IP, IPV6, NOF, NONE, NONE, NOF, SCTP, PAY4),
668 IAVF_PTT(94, IP, IPV6, NOF, NONE, NONE, NOF, ICMP, PAY4),
670 /* IPv6 --> IPv4 */
671 IAVF_PTT(95, IP, IPV6, NOF, IP_IP, IPV4, FRG, NONE, PAY3),
672 IAVF_PTT(96, IP, IPV6, NOF, IP_IP, IPV4, NOF, NONE, PAY3),
673 IAVF_PTT(97, IP, IPV6, NOF, IP_IP, IPV4, NOF, UDP, PAY4),
675 IAVF_PTT(99, IP, IPV6, NOF, IP_IP, IPV4, NOF, TCP, PAY4),
676 IAVF_PTT(100, IP, IPV6, NOF, IP_IP, IPV4, NOF, SCTP, PAY4),
677 IAVF_PTT(101, IP, IPV6, NOF, IP_IP, IPV4, NOF, ICMP, PAY4),
679 /* IPv6 --> IPv6 */
680 IAVF_PTT(102, IP, IPV6, NOF, IP_IP, IPV6, FRG, NONE, PAY3),
681 IAVF_PTT(103, IP, IPV6, NOF, IP_IP, IPV6, NOF, NONE, PAY3),
682 IAVF_PTT(104, IP, IPV6, NOF, IP_IP, IPV6, NOF, UDP, PAY4),
684 IAVF_PTT(106, IP, IPV6, NOF, IP_IP, IPV6, NOF, TCP, PAY4),
685 IAVF_PTT(107, IP, IPV6, NOF, IP_IP, IPV6, NOF, SCTP, PAY4),
686 IAVF_PTT(108, IP, IPV6, NOF, IP_IP, IPV6, NOF, ICMP, PAY4),
688 /* IPv6 --> GRE/NAT */
689 IAVF_PTT(109, IP, IPV6, NOF, IP_GRENAT, NONE, NOF, NONE, PAY3),
691 /* IPv6 --> GRE/NAT -> IPv4 */
692 IAVF_PTT(110, IP, IPV6, NOF, IP_GRENAT, IPV4, FRG, NONE, PAY3),
693 IAVF_PTT(111, IP, IPV6, NOF, IP_GRENAT, IPV4, NOF, NONE, PAY3),
694 IAVF_PTT(112, IP, IPV6, NOF, IP_GRENAT, IPV4, NOF, UDP, PAY4),
696 IAVF_PTT(114, IP, IPV6, NOF, IP_GRENAT, IPV4, NOF, TCP, PAY4),
697 IAVF_PTT(115, IP, IPV6, NOF, IP_GRENAT, IPV4, NOF, SCTP, PAY4),
698 IAVF_PTT(116, IP, IPV6, NOF, IP_GRENAT, IPV4, NOF, ICMP, PAY4),
700 /* IPv6 --> GRE/NAT -> IPv6 */
701 IAVF_PTT(117, IP, IPV6, NOF, IP_GRENAT, IPV6, FRG, NONE, PAY3),
702 IAVF_PTT(118, IP, IPV6, NOF, IP_GRENAT, IPV6, NOF, NONE, PAY3),
703 IAVF_PTT(119, IP, IPV6, NOF, IP_GRENAT, IPV6, NOF, UDP, PAY4),
705 IAVF_PTT(121, IP, IPV6, NOF, IP_GRENAT, IPV6, NOF, TCP, PAY4),
706 IAVF_PTT(122, IP, IPV6, NOF, IP_GRENAT, IPV6, NOF, SCTP, PAY4),
707 IAVF_PTT(123, IP, IPV6, NOF, IP_GRENAT, IPV6, NOF, ICMP, PAY4),
709 /* IPv6 --> GRE/NAT -> MAC */
710 IAVF_PTT(124, IP, IPV6, NOF, IP_GRENAT_MAC, NONE, NOF, NONE, PAY3),
712 /* IPv6 --> GRE/NAT -> MAC -> IPv4 */
713 IAVF_PTT(125, IP, IPV6, NOF, IP_GRENAT_MAC, IPV4, FRG, NONE, PAY3),
714 IAVF_PTT(126, IP, IPV6, NOF, IP_GRENAT_MAC, IPV4, NOF, NONE, PAY3),
715 IAVF_PTT(127, IP, IPV6, NOF, IP_GRENAT_MAC, IPV4, NOF, UDP, PAY4),
717 IAVF_PTT(129, IP, IPV6, NOF, IP_GRENAT_MAC, IPV4, NOF, TCP, PAY4),
718 IAVF_PTT(130, IP, IPV6, NOF, IP_GRENAT_MAC, IPV4, NOF, SCTP, PAY4),
719 IAVF_PTT(131, IP, IPV6, NOF, IP_GRENAT_MAC, IPV4, NOF, ICMP, PAY4),
721 /* IPv6 --> GRE/NAT -> MAC -> IPv6 */
722 IAVF_PTT(132, IP, IPV6, NOF, IP_GRENAT_MAC, IPV6, FRG, NONE, PAY3),
723 IAVF_PTT(133, IP, IPV6, NOF, IP_GRENAT_MAC, IPV6, NOF, NONE, PAY3),
724 IAVF_PTT(134, IP, IPV6, NOF, IP_GRENAT_MAC, IPV6, NOF, UDP, PAY4),
726 IAVF_PTT(136, IP, IPV6, NOF, IP_GRENAT_MAC, IPV6, NOF, TCP, PAY4),
727 IAVF_PTT(137, IP, IPV6, NOF, IP_GRENAT_MAC, IPV6, NOF, SCTP, PAY4),
728 IAVF_PTT(138, IP, IPV6, NOF, IP_GRENAT_MAC, IPV6, NOF, ICMP, PAY4),
730 /* IPv6 --> GRE/NAT -> MAC/VLAN */
731 IAVF_PTT(139, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, NONE, NOF, NONE, PAY3),
733 /* IPv6 --> GRE/NAT -> MAC/VLAN --> IPv4 */
734 IAVF_PTT(140, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV4, FRG, NONE, PAY3),
735 IAVF_PTT(141, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, NONE, PAY3),
736 IAVF_PTT(142, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, UDP, PAY4),
738 IAVF_PTT(144, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, TCP, PAY4),
739 IAVF_PTT(145, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, SCTP, PAY4),
740 IAVF_PTT(146, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV4, NOF, ICMP, PAY4),
742 /* IPv6 --> GRE/NAT -> MAC/VLAN --> IPv6 */
743 IAVF_PTT(147, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV6, FRG, NONE, PAY3),
744 IAVF_PTT(148, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, NONE, PAY3),
745 IAVF_PTT(149, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, UDP, PAY4),
747 IAVF_PTT(151, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, TCP, PAY4),
748 IAVF_PTT(152, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, SCTP, PAY4),
749 IAVF_PTT(153, IP, IPV6, NOF, IP_GRENAT_MAC_VLAN, IPV6, NOF, ICMP, PAY4),
758 * @v_opcode: opcodes for VF-PF communication
812 vsi_res = &msg->vsi_res[0]; in iavf_vf_parse_hw_config()
814 hw->dev_caps.num_vsis = msg->num_vsis; in iavf_vf_parse_hw_config()
815 hw->dev_caps.num_rx_qp = msg->num_queue_pairs; in iavf_vf_parse_hw_config()
816 hw->dev_caps.num_tx_qp = msg->num_queue_pairs; in iavf_vf_parse_hw_config()
817 hw->dev_caps.num_msix_vectors_vf = msg->max_vectors; in iavf_vf_parse_hw_config()
818 hw->dev_caps.dcb = msg->vf_cap_flags & in iavf_vf_parse_hw_config()
820 hw->dev_caps.fcoe = 0; in iavf_vf_parse_hw_config()
821 for (i = 0; i < msg->num_vsis; i++) { in iavf_vf_parse_hw_config()
822 if (vsi_res->vsi_type == VIRTCHNL_VSI_SRIOV) { in iavf_vf_parse_hw_config()
823 ether_addr_copy(hw->mac.perm_addr, in iavf_vf_parse_hw_config()
824 vsi_res->default_mac_addr); in iavf_vf_parse_hw_config()
825 ether_addr_copy(hw->mac.addr, in iavf_vf_parse_hw_config()
826 vsi_res->default_mac_addr); in iavf_vf_parse_hw_config()