diff options
26 files changed, 190 insertions, 115 deletions
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k.h b/drivers/net/ethernet/intel/fm10k/fm10k.h index 42eb4344a9dc..59edfd4446cd 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k.h +++ b/drivers/net/ethernet/intel/fm10k/fm10k.h | |||
@@ -439,6 +439,7 @@ extern char fm10k_driver_name[]; | |||
439 | extern const char fm10k_driver_version[]; | 439 | extern const char fm10k_driver_version[]; |
440 | int fm10k_init_queueing_scheme(struct fm10k_intfc *interface); | 440 | int fm10k_init_queueing_scheme(struct fm10k_intfc *interface); |
441 | void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface); | 441 | void fm10k_clear_queueing_scheme(struct fm10k_intfc *interface); |
442 | __be16 fm10k_tx_encap_offload(struct sk_buff *skb); | ||
442 | netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb, | 443 | netdev_tx_t fm10k_xmit_frame_ring(struct sk_buff *skb, |
443 | struct fm10k_ring *tx_ring); | 444 | struct fm10k_ring *tx_ring); |
444 | void fm10k_tx_timeout_reset(struct fm10k_intfc *interface); | 445 | void fm10k_tx_timeout_reset(struct fm10k_intfc *interface); |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_common.c b/drivers/net/ethernet/intel/fm10k/fm10k_common.c index bf19dccd4288..6cfae6ac04ea 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_common.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_common.c | |||
@@ -398,7 +398,7 @@ static void fm10k_update_hw_stats_rx_q(struct fm10k_hw *hw, | |||
398 | /* Retrieve RX Owner Data */ | 398 | /* Retrieve RX Owner Data */ |
399 | id_rx = fm10k_read_reg(hw, FM10K_RXQCTL(idx)); | 399 | id_rx = fm10k_read_reg(hw, FM10K_RXQCTL(idx)); |
400 | 400 | ||
401 | /* Process RX Ring*/ | 401 | /* Process RX Ring */ |
402 | do { | 402 | do { |
403 | rx_drops = fm10k_read_hw_stats_32b(hw, FM10K_QPRDC(idx), | 403 | rx_drops = fm10k_read_hw_stats_32b(hw, FM10K_QPRDC(idx), |
404 | &q->rx_drops); | 404 | &q->rx_drops); |
@@ -466,7 +466,6 @@ void fm10k_update_hw_stats_q(struct fm10k_hw *hw, struct fm10k_hw_stats_q *q, | |||
466 | * Function invalidates the index values for the queues so any updates that | 466 | * Function invalidates the index values for the queues so any updates that |
467 | * may have happened are ignored and the base for the queue stats is reset. | 467 | * may have happened are ignored and the base for the queue stats is reset. |
468 | **/ | 468 | **/ |
469 | |||
470 | void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, u32 count) | 469 | void fm10k_unbind_hw_stats_q(struct fm10k_hw_stats_q *q, u32 idx, u32 count) |
471 | { | 470 | { |
472 | u32 i; | 471 | u32 i; |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c index 651f53bc7376..33b6106c764b 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | |||
@@ -1019,7 +1019,7 @@ static int fm10k_set_channels(struct net_device *dev, | |||
1019 | } | 1019 | } |
1020 | 1020 | ||
1021 | static int fm10k_get_ts_info(struct net_device *dev, | 1021 | static int fm10k_get_ts_info(struct net_device *dev, |
1022 | struct ethtool_ts_info *info) | 1022 | struct ethtool_ts_info *info) |
1023 | { | 1023 | { |
1024 | struct fm10k_intfc *interface = netdev_priv(dev); | 1024 | struct fm10k_intfc *interface = netdev_priv(dev); |
1025 | 1025 | ||
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_iov.c b/drivers/net/ethernet/intel/fm10k/fm10k_iov.c index 060190864238..a02308f5048f 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_iov.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_iov.c | |||
@@ -275,7 +275,7 @@ s32 fm10k_iov_update_pvid(struct fm10k_intfc *interface, u16 glort, u16 pvid) | |||
275 | if (vf_idx >= iov_data->num_vfs) | 275 | if (vf_idx >= iov_data->num_vfs) |
276 | return FM10K_ERR_PARAM; | 276 | return FM10K_ERR_PARAM; |
277 | 277 | ||
278 | /* determine if an update has occured and if so notify the VF */ | 278 | /* determine if an update has occurred and if so notify the VF */ |
279 | vf_info = &iov_data->vf_info[vf_idx]; | 279 | vf_info = &iov_data->vf_info[vf_idx]; |
280 | if (vf_info->sw_vid != pvid) { | 280 | if (vf_info->sw_vid != pvid) { |
281 | vf_info->sw_vid = pvid; | 281 | vf_info->sw_vid = pvid; |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_main.c b/drivers/net/ethernet/intel/fm10k/fm10k_main.c index 84ab9eea2768..c325bc0c8338 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_main.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_main.c | |||
@@ -711,10 +711,6 @@ static struct ethhdr *fm10k_gre_is_nvgre(struct sk_buff *skb) | |||
711 | if (nvgre_hdr->flags & FM10K_NVGRE_RESERVED0_FLAGS) | 711 | if (nvgre_hdr->flags & FM10K_NVGRE_RESERVED0_FLAGS) |
712 | return NULL; | 712 | return NULL; |
713 | 713 | ||
714 | /* verify protocol is transparent Ethernet bridging */ | ||
715 | if (nvgre_hdr->proto != htons(ETH_P_TEB)) | ||
716 | return NULL; | ||
717 | |||
718 | /* report start of ethernet header */ | 714 | /* report start of ethernet header */ |
719 | if (nvgre_hdr->flags & NVGRE_TNI) | 715 | if (nvgre_hdr->flags & NVGRE_TNI) |
720 | return (struct ethhdr *)(nvgre_hdr + 1); | 716 | return (struct ethhdr *)(nvgre_hdr + 1); |
@@ -722,15 +718,13 @@ static struct ethhdr *fm10k_gre_is_nvgre(struct sk_buff *skb) | |||
722 | return (struct ethhdr *)(&nvgre_hdr->tni); | 718 | return (struct ethhdr *)(&nvgre_hdr->tni); |
723 | } | 719 | } |
724 | 720 | ||
725 | static __be16 fm10k_tx_encap_offload(struct sk_buff *skb) | 721 | __be16 fm10k_tx_encap_offload(struct sk_buff *skb) |
726 | { | 722 | { |
723 | u8 l4_hdr = 0, inner_l4_hdr = 0, inner_l4_hlen; | ||
727 | struct ethhdr *eth_hdr; | 724 | struct ethhdr *eth_hdr; |
728 | u8 l4_hdr = 0; | ||
729 | 725 | ||
730 | /* fm10k supports 184 octets of outer+inner headers. Minus 20 for inner L4. */ | 726 | if (skb->inner_protocol_type != ENCAP_TYPE_ETHER || |
731 | #define FM10K_MAX_ENCAP_TRANSPORT_OFFSET 164 | 727 | skb->inner_protocol != htons(ETH_P_TEB)) |
732 | if (skb_inner_transport_header(skb) - skb_mac_header(skb) > | ||
733 | FM10K_MAX_ENCAP_TRANSPORT_OFFSET) | ||
734 | return 0; | 728 | return 0; |
735 | 729 | ||
736 | switch (vlan_get_protocol(skb)) { | 730 | switch (vlan_get_protocol(skb)) { |
@@ -760,12 +754,33 @@ static __be16 fm10k_tx_encap_offload(struct sk_buff *skb) | |||
760 | 754 | ||
761 | switch (eth_hdr->h_proto) { | 755 | switch (eth_hdr->h_proto) { |
762 | case htons(ETH_P_IP): | 756 | case htons(ETH_P_IP): |
757 | inner_l4_hdr = inner_ip_hdr(skb)->protocol; | ||
758 | break; | ||
763 | case htons(ETH_P_IPV6): | 759 | case htons(ETH_P_IPV6): |
760 | inner_l4_hdr = inner_ipv6_hdr(skb)->nexthdr; | ||
764 | break; | 761 | break; |
765 | default: | 762 | default: |
766 | return 0; | 763 | return 0; |
767 | } | 764 | } |
768 | 765 | ||
766 | switch (inner_l4_hdr) { | ||
767 | case IPPROTO_TCP: | ||
768 | inner_l4_hlen = inner_tcp_hdrlen(skb); | ||
769 | break; | ||
770 | case IPPROTO_UDP: | ||
771 | inner_l4_hlen = 8; | ||
772 | break; | ||
773 | default: | ||
774 | return 0; | ||
775 | } | ||
776 | |||
777 | /* The hardware allows tunnel offloads only if the combined inner and | ||
778 | * outer header is 184 bytes or less | ||
779 | */ | ||
780 | if (skb_inner_transport_header(skb) + inner_l4_hlen - | ||
781 | skb_mac_header(skb) > FM10K_TUNNEL_HEADER_LENGTH) | ||
782 | return 0; | ||
783 | |||
769 | return eth_hdr->h_proto; | 784 | return eth_hdr->h_proto; |
770 | } | 785 | } |
771 | 786 | ||
@@ -934,10 +949,10 @@ static int __fm10k_maybe_stop_tx(struct fm10k_ring *tx_ring, u16 size) | |||
934 | { | 949 | { |
935 | netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index); | 950 | netif_stop_subqueue(tx_ring->netdev, tx_ring->queue_index); |
936 | 951 | ||
952 | /* Memory barrier before checking head and tail */ | ||
937 | smp_mb(); | 953 | smp_mb(); |
938 | 954 | ||
939 | /* We need to check again in a case another CPU has just | 955 | /* Check again in a case another CPU has just made room available */ |
940 | * made room available. */ | ||
941 | if (likely(fm10k_desc_unused(tx_ring) < size)) | 956 | if (likely(fm10k_desc_unused(tx_ring) < size)) |
942 | return -EBUSY; | 957 | return -EBUSY; |
943 | 958 | ||
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c index 9f5457c9e627..14ee696e9830 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c | |||
@@ -72,7 +72,7 @@ static bool fm10k_fifo_empty(struct fm10k_mbx_fifo *fifo) | |||
72 | * @fifo: pointer to FIFO | 72 | * @fifo: pointer to FIFO |
73 | * @offset: offset to add to head | 73 | * @offset: offset to add to head |
74 | * | 74 | * |
75 | * This function returns the indicies into the fifo based on head + offset | 75 | * This function returns the indices into the fifo based on head + offset |
76 | **/ | 76 | **/ |
77 | static u16 fm10k_fifo_head_offset(struct fm10k_mbx_fifo *fifo, u16 offset) | 77 | static u16 fm10k_fifo_head_offset(struct fm10k_mbx_fifo *fifo, u16 offset) |
78 | { | 78 | { |
@@ -84,7 +84,7 @@ static u16 fm10k_fifo_head_offset(struct fm10k_mbx_fifo *fifo, u16 offset) | |||
84 | * @fifo: pointer to FIFO | 84 | * @fifo: pointer to FIFO |
85 | * @offset: offset to add to tail | 85 | * @offset: offset to add to tail |
86 | * | 86 | * |
87 | * This function returns the indicies into the fifo based on tail + offset | 87 | * This function returns the indices into the fifo based on tail + offset |
88 | **/ | 88 | **/ |
89 | static u16 fm10k_fifo_tail_offset(struct fm10k_mbx_fifo *fifo, u16 offset) | 89 | static u16 fm10k_fifo_tail_offset(struct fm10k_mbx_fifo *fifo, u16 offset) |
90 | { | 90 | { |
@@ -326,7 +326,7 @@ static u16 fm10k_mbx_validate_msg_size(struct fm10k_mbx_info *mbx, u16 len) | |||
326 | * fm10k_mbx_write_copy - pulls data off of Tx FIFO and places it in mbmem | 326 | * fm10k_mbx_write_copy - pulls data off of Tx FIFO and places it in mbmem |
327 | * @mbx: pointer to mailbox | 327 | * @mbx: pointer to mailbox |
328 | * | 328 | * |
329 | * This function will take a seciton of the Rx FIFO and copy it into the | 329 | * This function will take a section of the Rx FIFO and copy it into the |
330 | mbx->tail--; | 330 | mbx->tail--; |
331 | * mailbox memory. The offset in mbmem is based on the lower bits of the | 331 | * mailbox memory. The offset in mbmem is based on the lower bits of the |
332 | * tail and len determines the length to copy. | 332 | * tail and len determines the length to copy. |
@@ -418,7 +418,7 @@ static void fm10k_mbx_pull_head(struct fm10k_hw *hw, | |||
418 | * @hw: pointer to hardware structure | 418 | * @hw: pointer to hardware structure |
419 | * @mbx: pointer to mailbox | 419 | * @mbx: pointer to mailbox |
420 | * | 420 | * |
421 | * This function will take a seciton of the mailbox memory and copy it | 421 | * This function will take a section of the mailbox memory and copy it |
422 | * into the Rx FIFO. The offset is based on the lower bits of the | 422 | * into the Rx FIFO. The offset is based on the lower bits of the |
423 | * head and len determines the length to copy. | 423 | * head and len determines the length to copy. |
424 | **/ | 424 | **/ |
@@ -464,7 +464,7 @@ static void fm10k_mbx_read_copy(struct fm10k_hw *hw, | |||
464 | * @tail: tail index of message | 464 | * @tail: tail index of message |
465 | * | 465 | * |
466 | * This function will first validate the tail index and size for the | 466 | * This function will first validate the tail index and size for the |
467 | * incoming message. It then updates the acknowlegment number and | 467 | * incoming message. It then updates the acknowledgment number and |
468 | * copies the data into the FIFO. It will return the number of messages | 468 | * copies the data into the FIFO. It will return the number of messages |
469 | * dequeued on success and a negative value on error. | 469 | * dequeued on success and a negative value on error. |
470 | **/ | 470 | **/ |
@@ -761,7 +761,7 @@ static s32 fm10k_mbx_enqueue_tx(struct fm10k_hw *hw, | |||
761 | err = fm10k_fifo_enqueue(&mbx->tx, msg); | 761 | err = fm10k_fifo_enqueue(&mbx->tx, msg); |
762 | } | 762 | } |
763 | 763 | ||
764 | /* if we failed trhead the error */ | 764 | /* if we failed treat the error */ |
765 | if (err) { | 765 | if (err) { |
766 | mbx->timeout = 0; | 766 | mbx->timeout = 0; |
767 | mbx->tx_busy++; | 767 | mbx->tx_busy++; |
@@ -815,7 +815,7 @@ static void fm10k_mbx_write(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx) | |||
815 | { | 815 | { |
816 | u32 mbmem = mbx->mbmem_reg; | 816 | u32 mbmem = mbx->mbmem_reg; |
817 | 817 | ||
818 | /* write new msg header to notify recepient of change */ | 818 | /* write new msg header to notify recipient of change */ |
819 | fm10k_write_reg(hw, mbmem, mbx->mbx_hdr); | 819 | fm10k_write_reg(hw, mbmem, mbx->mbx_hdr); |
820 | 820 | ||
821 | /* write mailbox to sent interrupt */ | 821 | /* write mailbox to sent interrupt */ |
@@ -1251,7 +1251,7 @@ static s32 fm10k_mbx_process_error(struct fm10k_hw *hw, | |||
1251 | /* we will need to pull all of the fields for verification */ | 1251 | /* we will need to pull all of the fields for verification */ |
1252 | head = FM10K_MSG_HDR_FIELD_GET(*hdr, HEAD); | 1252 | head = FM10K_MSG_HDR_FIELD_GET(*hdr, HEAD); |
1253 | 1253 | ||
1254 | /* we only have lower 10 bits of error number os add upper bits */ | 1254 | /* we only have lower 10 bits of error number so add upper bits */ |
1255 | err_no = FM10K_MSG_HDR_FIELD_GET(*hdr, ERR_NO); | 1255 | err_no = FM10K_MSG_HDR_FIELD_GET(*hdr, ERR_NO); |
1256 | err_no |= ~FM10K_MSG_HDR_MASK(ERR_NO); | 1256 | err_no |= ~FM10K_MSG_HDR_MASK(ERR_NO); |
1257 | 1257 | ||
@@ -1548,7 +1548,7 @@ s32 fm10k_pfvf_mbx_init(struct fm10k_hw *hw, struct fm10k_mbx_info *mbx, | |||
1548 | mbx->timeout = 0; | 1548 | mbx->timeout = 0; |
1549 | mbx->udelay = FM10K_MBX_INIT_DELAY; | 1549 | mbx->udelay = FM10K_MBX_INIT_DELAY; |
1550 | 1550 | ||
1551 | /* initalize tail and head */ | 1551 | /* initialize tail and head */ |
1552 | mbx->tail = 1; | 1552 | mbx->tail = 1; |
1553 | mbx->head = 1; | 1553 | mbx->head = 1; |
1554 | 1554 | ||
@@ -1627,7 +1627,7 @@ static void fm10k_sm_mbx_connect_reset(struct fm10k_mbx_info *mbx) | |||
1627 | mbx->local = FM10K_SM_MBX_VERSION; | 1627 | mbx->local = FM10K_SM_MBX_VERSION; |
1628 | mbx->remote = 0; | 1628 | mbx->remote = 0; |
1629 | 1629 | ||
1630 | /* initalize tail and head */ | 1630 | /* initialize tail and head */ |
1631 | mbx->tail = 1; | 1631 | mbx->tail = 1; |
1632 | mbx->head = 1; | 1632 | mbx->head = 1; |
1633 | 1633 | ||
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c index cfde8bac1aeb..d5b303dad95e 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | |||
@@ -356,7 +356,7 @@ static void fm10k_free_all_rx_resources(struct fm10k_intfc *interface) | |||
356 | * fm10k_request_glort_range - Request GLORTs for use in configuring rules | 356 | * fm10k_request_glort_range - Request GLORTs for use in configuring rules |
357 | * @interface: board private structure | 357 | * @interface: board private structure |
358 | * | 358 | * |
359 | * This function allocates a range of glorts for this inteface to use. | 359 | * This function allocates a range of glorts for this interface to use. |
360 | **/ | 360 | **/ |
361 | static void fm10k_request_glort_range(struct fm10k_intfc *interface) | 361 | static void fm10k_request_glort_range(struct fm10k_intfc *interface) |
362 | { | 362 | { |
@@ -781,7 +781,7 @@ static int fm10k_update_vid(struct net_device *netdev, u16 vid, bool set) | |||
781 | 781 | ||
782 | fm10k_mbx_lock(interface); | 782 | fm10k_mbx_lock(interface); |
783 | 783 | ||
784 | /* only need to update the VLAN if not in promiscous mode */ | 784 | /* only need to update the VLAN if not in promiscuous mode */ |
785 | if (!(netdev->flags & IFF_PROMISC)) { | 785 | if (!(netdev->flags & IFF_PROMISC)) { |
786 | err = hw->mac.ops.update_vlan(hw, vid, 0, set); | 786 | err = hw->mac.ops.update_vlan(hw, vid, 0, set); |
787 | if (err) | 787 | if (err) |
@@ -970,7 +970,7 @@ static void fm10k_set_rx_mode(struct net_device *dev) | |||
970 | 970 | ||
971 | fm10k_mbx_lock(interface); | 971 | fm10k_mbx_lock(interface); |
972 | 972 | ||
973 | /* syncronize all of the addresses */ | 973 | /* synchronize all of the addresses */ |
974 | if (xcast_mode != FM10K_XCAST_MODE_PROMISC) { | 974 | if (xcast_mode != FM10K_XCAST_MODE_PROMISC) { |
975 | __dev_uc_sync(dev, fm10k_uc_sync, fm10k_uc_unsync); | 975 | __dev_uc_sync(dev, fm10k_uc_sync, fm10k_uc_unsync); |
976 | if (xcast_mode != FM10K_XCAST_MODE_ALLMULTI) | 976 | if (xcast_mode != FM10K_XCAST_MODE_ALLMULTI) |
@@ -1051,7 +1051,7 @@ void fm10k_restore_rx_state(struct fm10k_intfc *interface) | |||
1051 | vid, true, 0); | 1051 | vid, true, 0); |
1052 | } | 1052 | } |
1053 | 1053 | ||
1054 | /* syncronize all of the addresses */ | 1054 | /* synchronize all of the addresses */ |
1055 | if (xcast_mode != FM10K_XCAST_MODE_PROMISC) { | 1055 | if (xcast_mode != FM10K_XCAST_MODE_PROMISC) { |
1056 | __dev_uc_sync(netdev, fm10k_uc_sync, fm10k_uc_unsync); | 1056 | __dev_uc_sync(netdev, fm10k_uc_sync, fm10k_uc_unsync); |
1057 | if (xcast_mode != FM10K_XCAST_MODE_ALLMULTI) | 1057 | if (xcast_mode != FM10K_XCAST_MODE_ALLMULTI) |
@@ -1350,6 +1350,16 @@ static void fm10k_dfwd_del_station(struct net_device *dev, void *priv) | |||
1350 | } | 1350 | } |
1351 | } | 1351 | } |
1352 | 1352 | ||
1353 | static netdev_features_t fm10k_features_check(struct sk_buff *skb, | ||
1354 | struct net_device *dev, | ||
1355 | netdev_features_t features) | ||
1356 | { | ||
1357 | if (!skb->encapsulation || fm10k_tx_encap_offload(skb)) | ||
1358 | return features; | ||
1359 | |||
1360 | return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | ||
1361 | } | ||
1362 | |||
1353 | static const struct net_device_ops fm10k_netdev_ops = { | 1363 | static const struct net_device_ops fm10k_netdev_ops = { |
1354 | .ndo_open = fm10k_open, | 1364 | .ndo_open = fm10k_open, |
1355 | .ndo_stop = fm10k_close, | 1365 | .ndo_stop = fm10k_close, |
@@ -1372,6 +1382,7 @@ static const struct net_device_ops fm10k_netdev_ops = { | |||
1372 | .ndo_do_ioctl = fm10k_ioctl, | 1382 | .ndo_do_ioctl = fm10k_ioctl, |
1373 | .ndo_dfwd_add_station = fm10k_dfwd_add_station, | 1383 | .ndo_dfwd_add_station = fm10k_dfwd_add_station, |
1374 | .ndo_dfwd_del_station = fm10k_dfwd_del_station, | 1384 | .ndo_dfwd_del_station = fm10k_dfwd_del_station, |
1385 | .ndo_features_check = fm10k_features_check, | ||
1375 | }; | 1386 | }; |
1376 | 1387 | ||
1377 | #define DEFAULT_DEBUG_LEVEL_SHIFT 3 | 1388 | #define DEFAULT_DEBUG_LEVEL_SHIFT 3 |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c index 4f5892cc32d7..8978d55a1c51 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c | |||
@@ -648,7 +648,7 @@ static void fm10k_configure_rx_ring(struct fm10k_intfc *interface, | |||
648 | /* Configure the Rx buffer size for one buff without split */ | 648 | /* Configure the Rx buffer size for one buff without split */ |
649 | srrctl |= FM10K_RX_BUFSZ >> FM10K_SRRCTL_BSIZEPKT_SHIFT; | 649 | srrctl |= FM10K_RX_BUFSZ >> FM10K_SRRCTL_BSIZEPKT_SHIFT; |
650 | 650 | ||
651 | /* Configure the Rx ring to supress loopback packets */ | 651 | /* Configure the Rx ring to suppress loopback packets */ |
652 | srrctl |= FM10K_SRRCTL_LOOPBACK_SUPPRESS; | 652 | srrctl |= FM10K_SRRCTL_LOOPBACK_SUPPRESS; |
653 | fm10k_write_reg(hw, FM10K_SRRCTL(reg_idx), srrctl); | 653 | fm10k_write_reg(hw, FM10K_SRRCTL(reg_idx), srrctl); |
654 | 654 | ||
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c index 7e4711958e46..159cd8463800 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_pf.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pf.c | |||
@@ -234,8 +234,7 @@ static s32 fm10k_update_vlan_pf(struct fm10k_hw *hw, u32 vid, u8 vsi, bool set) | |||
234 | vid = (vid << 17) >> 17; | 234 | vid = (vid << 17) >> 17; |
235 | 235 | ||
236 | /* verify the reserved 0 fields are 0 */ | 236 | /* verify the reserved 0 fields are 0 */ |
237 | if (len >= FM10K_VLAN_TABLE_VID_MAX || | 237 | if (len >= FM10K_VLAN_TABLE_VID_MAX || vid >= FM10K_VLAN_TABLE_VID_MAX) |
238 | vid >= FM10K_VLAN_TABLE_VID_MAX) | ||
239 | return FM10K_ERR_PARAM; | 238 | return FM10K_ERR_PARAM; |
240 | 239 | ||
241 | /* Loop through the table updating all required VLANs */ | 240 | /* Loop through the table updating all required VLANs */ |
@@ -312,7 +311,7 @@ bool fm10k_glort_valid_pf(struct fm10k_hw *hw, u16 glort) | |||
312 | } | 311 | } |
313 | 312 | ||
314 | /** | 313 | /** |
315 | * fm10k_update_uc_addr_pf - Update device unicast addresss | 314 | * fm10k_update_xc_addr_pf - Update device addresses |
316 | * @hw: pointer to the HW structure | 315 | * @hw: pointer to the HW structure |
317 | * @glort: base resource tag for this request | 316 | * @glort: base resource tag for this request |
318 | * @mac: MAC address to add/remove from table | 317 | * @mac: MAC address to add/remove from table |
@@ -356,7 +355,7 @@ static s32 fm10k_update_xc_addr_pf(struct fm10k_hw *hw, u16 glort, | |||
356 | } | 355 | } |
357 | 356 | ||
358 | /** | 357 | /** |
359 | * fm10k_update_uc_addr_pf - Update device unicast addresss | 358 | * fm10k_update_uc_addr_pf - Update device unicast addresses |
360 | * @hw: pointer to the HW structure | 359 | * @hw: pointer to the HW structure |
361 | * @glort: base resource tag for this request | 360 | * @glort: base resource tag for this request |
362 | * @mac: MAC address to add/remove from table | 361 | * @mac: MAC address to add/remove from table |
@@ -454,7 +453,7 @@ static void fm10k_update_int_moderator_pf(struct fm10k_hw *hw) | |||
454 | break; | 453 | break; |
455 | } | 454 | } |
456 | 455 | ||
457 | /* always reset VFITR2[0] to point to last enabled PF vector*/ | 456 | /* always reset VFITR2[0] to point to last enabled PF vector */ |
458 | fm10k_write_reg(hw, FM10K_ITR2(FM10K_ITR_REG_COUNT_PF), i); | 457 | fm10k_write_reg(hw, FM10K_ITR2(FM10K_ITR_REG_COUNT_PF), i); |
459 | 458 | ||
460 | /* reset ITR2[0] to point to last enabled PF vector */ | 459 | /* reset ITR2[0] to point to last enabled PF vector */ |
@@ -812,7 +811,7 @@ static s32 fm10k_iov_assign_int_moderator_pf(struct fm10k_hw *hw, u16 vf_idx) | |||
812 | if (vf_idx >= hw->iov.num_vfs) | 811 | if (vf_idx >= hw->iov.num_vfs) |
813 | return FM10K_ERR_PARAM; | 812 | return FM10K_ERR_PARAM; |
814 | 813 | ||
815 | /* determine vector offset and count*/ | 814 | /* determine vector offset and count */ |
816 | vf_v_idx = fm10k_vf_vector_index(hw, vf_idx); | 815 | vf_v_idx = fm10k_vf_vector_index(hw, vf_idx); |
817 | vf_v_limit = vf_v_idx + fm10k_vectors_per_pool(hw); | 816 | vf_v_limit = vf_v_idx + fm10k_vectors_per_pool(hw); |
818 | 817 | ||
@@ -951,7 +950,7 @@ static s32 fm10k_iov_reset_resources_pf(struct fm10k_hw *hw, | |||
951 | if (vf_info->mbx.ops.disconnect) | 950 | if (vf_info->mbx.ops.disconnect) |
952 | vf_info->mbx.ops.disconnect(hw, &vf_info->mbx); | 951 | vf_info->mbx.ops.disconnect(hw, &vf_info->mbx); |
953 | 952 | ||
954 | /* determine vector offset and count*/ | 953 | /* determine vector offset and count */ |
955 | vf_v_idx = fm10k_vf_vector_index(hw, vf_idx); | 954 | vf_v_idx = fm10k_vf_vector_index(hw, vf_idx); |
956 | vf_v_limit = vf_v_idx + fm10k_vectors_per_pool(hw); | 955 | vf_v_limit = vf_v_idx + fm10k_vectors_per_pool(hw); |
957 | 956 | ||
@@ -1035,7 +1034,7 @@ static s32 fm10k_iov_reset_resources_pf(struct fm10k_hw *hw, | |||
1035 | ((u32)vf_info->mac[2]); | 1034 | ((u32)vf_info->mac[2]); |
1036 | } | 1035 | } |
1037 | 1036 | ||
1038 | /* map queue pairs back to VF from last to first*/ | 1037 | /* map queue pairs back to VF from last to first */ |
1039 | for (i = queues_per_pool; i--;) { | 1038 | for (i = queues_per_pool; i--;) { |
1040 | fm10k_write_reg(hw, FM10K_TDBAL(vf_q_idx + i), tdbal); | 1039 | fm10k_write_reg(hw, FM10K_TDBAL(vf_q_idx + i), tdbal); |
1041 | fm10k_write_reg(hw, FM10K_TDBAH(vf_q_idx + i), tdbah); | 1040 | fm10k_write_reg(hw, FM10K_TDBAH(vf_q_idx + i), tdbah); |
@@ -1141,7 +1140,7 @@ static s32 fm10k_iov_report_timestamp_pf(struct fm10k_hw *hw, | |||
1141 | * | 1140 | * |
1142 | * This function is a default handler for MSI-X requests from the VF. The | 1141 | * This function is a default handler for MSI-X requests from the VF. The |
1143 | * assumption is that in this case it is acceptable to just directly | 1142 | * assumption is that in this case it is acceptable to just directly |
1144 | * hand off the message form the VF to the underlying shared code. | 1143 | * hand off the message from the VF to the underlying shared code. |
1145 | **/ | 1144 | **/ |
1146 | s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *hw, u32 **results, | 1145 | s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *hw, u32 **results, |
1147 | struct fm10k_mbx_info *mbx) | 1146 | struct fm10k_mbx_info *mbx) |
@@ -1160,7 +1159,7 @@ s32 fm10k_iov_msg_msix_pf(struct fm10k_hw *hw, u32 **results, | |||
1160 | * | 1159 | * |
1161 | * This function is a default handler for MAC/VLAN requests from the VF. | 1160 | * This function is a default handler for MAC/VLAN requests from the VF. |
1162 | * The assumption is that in this case it is acceptable to just directly | 1161 | * The assumption is that in this case it is acceptable to just directly |
1163 | * hand off the message form the VF to the underlying shared code. | 1162 | * hand off the message from the VF to the underlying shared code. |
1164 | **/ | 1163 | **/ |
1165 | s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results, | 1164 | s32 fm10k_iov_msg_mac_vlan_pf(struct fm10k_hw *hw, u32 **results, |
1166 | struct fm10k_mbx_info *mbx) | 1165 | struct fm10k_mbx_info *mbx) |
@@ -1404,7 +1403,7 @@ static void fm10k_update_hw_stats_pf(struct fm10k_hw *hw, | |||
1404 | &stats->vlan_drop); | 1403 | &stats->vlan_drop); |
1405 | loopback_drop = fm10k_read_hw_stats_32b(hw, | 1404 | loopback_drop = fm10k_read_hw_stats_32b(hw, |
1406 | FM10K_STATS_LOOPBACK_DROP, | 1405 | FM10K_STATS_LOOPBACK_DROP, |
1407 | &stats->loopback_drop); | 1406 | &stats->loopback_drop); |
1408 | nodesc_drop = fm10k_read_hw_stats_32b(hw, | 1407 | nodesc_drop = fm10k_read_hw_stats_32b(hw, |
1409 | FM10K_STATS_NODESC_DROP, | 1408 | FM10K_STATS_NODESC_DROP, |
1410 | &stats->nodesc_drop); | 1409 | &stats->nodesc_drop); |
@@ -1573,7 +1572,7 @@ static s32 fm10k_get_host_state_pf(struct fm10k_hw *hw, bool *switch_ready) | |||
1573 | s32 ret_val = 0; | 1572 | s32 ret_val = 0; |
1574 | u32 dma_ctrl2; | 1573 | u32 dma_ctrl2; |
1575 | 1574 | ||
1576 | /* verify the switch is ready for interraction */ | 1575 | /* verify the switch is ready for interaction */ |
1577 | dma_ctrl2 = fm10k_read_reg(hw, FM10K_DMA_CTRL2); | 1576 | dma_ctrl2 = fm10k_read_reg(hw, FM10K_DMA_CTRL2); |
1578 | if (!(dma_ctrl2 & FM10K_DMA_CTRL2_SWITCH_READY)) | 1577 | if (!(dma_ctrl2 & FM10K_DMA_CTRL2_SWITCH_READY)) |
1579 | goto out; | 1578 | goto out; |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_tlv.c b/drivers/net/ethernet/intel/fm10k/fm10k_tlv.c index fd0a05f011a8..9b29d7b0377a 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_tlv.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_tlv.c | |||
@@ -710,7 +710,7 @@ void fm10k_tlv_msg_test_create(u32 *msg, u32 attr_flags) | |||
710 | /** | 710 | /** |
711 | * fm10k_tlv_msg_test - Validate all results on test message receive | 711 | * fm10k_tlv_msg_test - Validate all results on test message receive |
712 | * @hw: Pointer to hardware structure | 712 | * @hw: Pointer to hardware structure |
713 | * @results: Pointer array to attributes in the mesage | 713 | * @results: Pointer array to attributes in the message |
714 | * @mbx: Pointer to mailbox information structure | 714 | * @mbx: Pointer to mailbox information structure |
715 | * | 715 | * |
716 | * This function does a check to verify all attributes match what the test | 716 | * This function does a check to verify all attributes match what the test |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_type.h b/drivers/net/ethernet/intel/fm10k/fm10k_type.h index 7c6d9d5a8ae5..4af96686c584 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_type.h +++ b/drivers/net/ethernet/intel/fm10k/fm10k_type.h | |||
@@ -356,6 +356,9 @@ struct fm10k_hw; | |||
356 | #define FM10K_QUEUE_DISABLE_TIMEOUT 100 | 356 | #define FM10K_QUEUE_DISABLE_TIMEOUT 100 |
357 | #define FM10K_RESET_TIMEOUT 150 | 357 | #define FM10K_RESET_TIMEOUT 150 |
358 | 358 | ||
359 | /* Maximum supported combined inner and outer header length for encapsulation */ | ||
360 | #define FM10K_TUNNEL_HEADER_LENGTH 184 | ||
361 | |||
359 | /* VF registers */ | 362 | /* VF registers */ |
360 | #define FM10K_VFCTRL 0x00000 | 363 | #define FM10K_VFCTRL 0x00000 |
361 | #define FM10K_VFCTRL_RST 0x00000008 | 364 | #define FM10K_VFCTRL_RST 0x00000008 |
@@ -593,7 +596,7 @@ struct fm10k_vf_info { | |||
593 | u16 sw_vid; /* Switch API assigned VLAN */ | 596 | u16 sw_vid; /* Switch API assigned VLAN */ |
594 | u16 pf_vid; /* PF assigned Default VLAN */ | 597 | u16 pf_vid; /* PF assigned Default VLAN */ |
595 | u8 mac[ETH_ALEN]; /* PF Default MAC address */ | 598 | u8 mac[ETH_ALEN]; /* PF Default MAC address */ |
596 | u8 vsi; /* VSI idenfifier */ | 599 | u8 vsi; /* VSI identifier */ |
597 | u8 vf_idx; /* which VF this is */ | 600 | u8 vf_idx; /* which VF this is */ |
598 | u8 vf_flags; /* flags indicating what modes | 601 | u8 vf_flags; /* flags indicating what modes |
599 | * are supported for the port | 602 | * are supported for the port |
diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_vf.c b/drivers/net/ethernet/intel/fm10k/fm10k_vf.c index f0aa0f97b4a9..17219678439a 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_vf.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_vf.c | |||
@@ -37,7 +37,7 @@ static s32 fm10k_stop_hw_vf(struct fm10k_hw *hw) | |||
37 | if (err) | 37 | if (err) |
38 | return err; | 38 | return err; |
39 | 39 | ||
40 | /* If permenant address is set then we need to restore it */ | 40 | /* If permanent address is set then we need to restore it */ |
41 | if (is_valid_ether_addr(perm_addr)) { | 41 | if (is_valid_ether_addr(perm_addr)) { |
42 | bal = (((u32)perm_addr[3]) << 24) | | 42 | bal = (((u32)perm_addr[3]) << 24) | |
43 | (((u32)perm_addr[4]) << 16) | | 43 | (((u32)perm_addr[4]) << 16) | |
@@ -65,7 +65,7 @@ static s32 fm10k_stop_hw_vf(struct fm10k_hw *hw) | |||
65 | * fm10k_reset_hw_vf - VF hardware reset | 65 | * fm10k_reset_hw_vf - VF hardware reset |
66 | * @hw: pointer to hardware structure | 66 | * @hw: pointer to hardware structure |
67 | * | 67 | * |
68 | * This function should return the hardare to a state similar to the | 68 | * This function should return the hardware to a state similar to the |
69 | * one it is in after just being initialized. | 69 | * one it is in after just being initialized. |
70 | **/ | 70 | **/ |
71 | static s32 fm10k_reset_hw_vf(struct fm10k_hw *hw) | 71 | static s32 fm10k_reset_hw_vf(struct fm10k_hw *hw) |
@@ -252,7 +252,7 @@ static s32 fm10k_read_mac_addr_vf(struct fm10k_hw *hw) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | /** | 254 | /** |
255 | * fm10k_update_uc_addr_vf - Update device unicast address | 255 | * fm10k_update_uc_addr_vf - Update device unicast addresses |
256 | * @hw: pointer to the HW structure | 256 | * @hw: pointer to the HW structure |
257 | * @glort: unused | 257 | * @glort: unused |
258 | * @mac: MAC address to add/remove from table | 258 | * @mac: MAC address to add/remove from table |
@@ -282,7 +282,7 @@ static s32 fm10k_update_uc_addr_vf(struct fm10k_hw *hw, u16 glort, | |||
282 | memcmp(hw->mac.perm_addr, mac, ETH_ALEN)) | 282 | memcmp(hw->mac.perm_addr, mac, ETH_ALEN)) |
283 | return FM10K_ERR_PARAM; | 283 | return FM10K_ERR_PARAM; |
284 | 284 | ||
285 | /* add bit to notify us if this is a set of clear operation */ | 285 | /* add bit to notify us if this is a set or clear operation */ |
286 | if (!add) | 286 | if (!add) |
287 | vid |= FM10K_VLAN_CLEAR; | 287 | vid |= FM10K_VLAN_CLEAR; |
288 | 288 | ||
@@ -295,7 +295,7 @@ static s32 fm10k_update_uc_addr_vf(struct fm10k_hw *hw, u16 glort, | |||
295 | } | 295 | } |
296 | 296 | ||
297 | /** | 297 | /** |
298 | * fm10k_update_mc_addr_vf - Update device multicast address | 298 | * fm10k_update_mc_addr_vf - Update device multicast addresses |
299 | * @hw: pointer to the HW structure | 299 | * @hw: pointer to the HW structure |
300 | * @glort: unused | 300 | * @glort: unused |
301 | * @mac: MAC address to add/remove from table | 301 | * @mac: MAC address to add/remove from table |
@@ -319,7 +319,7 @@ static s32 fm10k_update_mc_addr_vf(struct fm10k_hw *hw, u16 glort, | |||
319 | if (!is_multicast_ether_addr(mac)) | 319 | if (!is_multicast_ether_addr(mac)) |
320 | return FM10K_ERR_PARAM; | 320 | return FM10K_ERR_PARAM; |
321 | 321 | ||
322 | /* add bit to notify us if this is a set of clear operation */ | 322 | /* add bit to notify us if this is a set or clear operation */ |
323 | if (!add) | 323 | if (!add) |
324 | vid |= FM10K_VLAN_CLEAR; | 324 | vid |= FM10K_VLAN_CLEAR; |
325 | 325 | ||
@@ -515,7 +515,7 @@ static s32 fm10k_adjust_systime_vf(struct fm10k_hw *hw, s32 ppb) | |||
515 | * @hw: pointer to the hardware structure | 515 | * @hw: pointer to the hardware structure |
516 | * | 516 | * |
517 | * Function reads the content of 2 registers, combined to represent a 64 bit | 517 | * Function reads the content of 2 registers, combined to represent a 64 bit |
518 | * value measured in nanosecods. In order to guarantee the value is accurate | 518 | * value measured in nanoseconds. In order to guarantee the value is accurate |
519 | * we check the 32 most significant bits both before and after reading the | 519 | * we check the 32 most significant bits both before and after reading the |
520 | * 32 least significant bits to verify they didn't change as we were reading | 520 | * 32 least significant bits to verify they didn't change as we were reading |
521 | * the registers. | 521 | * the registers. |
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 5761917734dc..c5137313b62a 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -471,6 +471,9 @@ struct i40e_vsi { | |||
471 | u16 rx_itr_setting; | 471 | u16 rx_itr_setting; |
472 | u16 tx_itr_setting; | 472 | u16 tx_itr_setting; |
473 | 473 | ||
474 | u16 rss_table_size; | ||
475 | u16 rss_size; | ||
476 | |||
474 | u16 max_frame; | 477 | u16 max_frame; |
475 | u16 rx_hdr_len; | 478 | u16 rx_hdr_len; |
476 | u16 rx_buf_len; | 479 | u16 rx_buf_len; |
@@ -488,6 +491,7 @@ struct i40e_vsi { | |||
488 | 491 | ||
489 | u16 base_queue; /* vsi's first queue in hw array */ | 492 | u16 base_queue; /* vsi's first queue in hw array */ |
490 | u16 alloc_queue_pairs; /* Allocated Tx/Rx queues */ | 493 | u16 alloc_queue_pairs; /* Allocated Tx/Rx queues */ |
494 | u16 req_queue_pairs; /* User requested queue pairs */ | ||
491 | u16 num_queue_pairs; /* Used tx and rx pairs */ | 495 | u16 num_queue_pairs; /* Used tx and rx pairs */ |
492 | u16 num_desc; | 496 | u16 num_desc; |
493 | enum i40e_vsi_type type; /* VSI type, e.g., LAN, FCoE, etc */ | 497 | enum i40e_vsi_type type; /* VSI type, e.g., LAN, FCoE, etc */ |
@@ -557,14 +561,14 @@ static inline char *i40e_fw_version_str(struct i40e_hw *hw) | |||
557 | static char buf[32]; | 561 | static char buf[32]; |
558 | 562 | ||
559 | snprintf(buf, sizeof(buf), | 563 | snprintf(buf, sizeof(buf), |
560 | "f%d.%d a%d.%d n%02x.%02x e%08x", | 564 | "f%d.%d.%05d a%d.%d n%x.%02x e%x", |
561 | hw->aq.fw_maj_ver, hw->aq.fw_min_ver, | 565 | hw->aq.fw_maj_ver, hw->aq.fw_min_ver, hw->aq.fw_build, |
562 | hw->aq.api_maj_ver, hw->aq.api_min_ver, | 566 | hw->aq.api_maj_ver, hw->aq.api_min_ver, |
563 | (hw->nvm.version & I40E_NVM_VERSION_HI_MASK) >> | 567 | (hw->nvm.version & I40E_NVM_VERSION_HI_MASK) >> |
564 | I40E_NVM_VERSION_HI_SHIFT, | 568 | I40E_NVM_VERSION_HI_SHIFT, |
565 | (hw->nvm.version & I40E_NVM_VERSION_LO_MASK) >> | 569 | (hw->nvm.version & I40E_NVM_VERSION_LO_MASK) >> |
566 | I40E_NVM_VERSION_LO_SHIFT, | 570 | I40E_NVM_VERSION_LO_SHIFT, |
567 | hw->nvm.eetrack); | 571 | (hw->nvm.eetrack & 0xffffff)); |
568 | 572 | ||
569 | return buf; | 573 | return buf; |
570 | } | 574 | } |
@@ -725,6 +729,7 @@ void i40e_fcoe_handle_status(struct i40e_ring *rx_ring, | |||
725 | void i40e_vlan_stripping_enable(struct i40e_vsi *vsi); | 729 | void i40e_vlan_stripping_enable(struct i40e_vsi *vsi); |
726 | #ifdef CONFIG_I40E_DCB | 730 | #ifdef CONFIG_I40E_DCB |
727 | void i40e_dcbnl_flush_apps(struct i40e_pf *pf, | 731 | void i40e_dcbnl_flush_apps(struct i40e_pf *pf, |
732 | struct i40e_dcbx_config *old_cfg, | ||
728 | struct i40e_dcbx_config *new_cfg); | 733 | struct i40e_dcbx_config *new_cfg); |
729 | void i40e_dcbnl_set_all(struct i40e_vsi *vsi); | 734 | void i40e_dcbnl_set_all(struct i40e_vsi *vsi); |
730 | void i40e_dcbnl_setup(struct i40e_vsi *vsi); | 735 | void i40e_dcbnl_setup(struct i40e_vsi *vsi); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.c b/drivers/net/ethernet/intel/i40e/i40e_adminq.c index 77f6254a89ac..dc2ed359e945 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.c +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.c | |||
@@ -592,6 +592,7 @@ i40e_status i40e_init_adminq(struct i40e_hw *hw) | |||
592 | ret_code = i40e_aq_get_firmware_version(hw, | 592 | ret_code = i40e_aq_get_firmware_version(hw, |
593 | &hw->aq.fw_maj_ver, | 593 | &hw->aq.fw_maj_ver, |
594 | &hw->aq.fw_min_ver, | 594 | &hw->aq.fw_min_ver, |
595 | &hw->aq.fw_build, | ||
595 | &hw->aq.api_maj_ver, | 596 | &hw->aq.api_maj_ver, |
596 | &hw->aq.api_min_ver, | 597 | &hw->aq.api_min_ver, |
597 | NULL); | 598 | NULL); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_adminq.h b/drivers/net/ethernet/intel/i40e/i40e_adminq.h index de17b6fbcc4e..28e519a50de4 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_adminq.h +++ b/drivers/net/ethernet/intel/i40e/i40e_adminq.h | |||
@@ -93,6 +93,7 @@ struct i40e_adminq_info { | |||
93 | u16 asq_buf_size; /* send queue buffer size */ | 93 | u16 asq_buf_size; /* send queue buffer size */ |
94 | u16 fw_maj_ver; /* firmware major version */ | 94 | u16 fw_maj_ver; /* firmware major version */ |
95 | u16 fw_min_ver; /* firmware minor version */ | 95 | u16 fw_min_ver; /* firmware minor version */ |
96 | u32 fw_build; /* firmware build number */ | ||
96 | u16 api_maj_ver; /* api major version */ | 97 | u16 api_maj_ver; /* api major version */ |
97 | u16 api_min_ver; /* api minor version */ | 98 | u16 api_min_ver; /* api minor version */ |
98 | bool nvm_release_on_done; | 99 | bool nvm_release_on_done; |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 88b2d45578dd..cb19c377e0cc 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -1737,6 +1737,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw, | |||
1737 | * @hw: pointer to the hw struct | 1737 | * @hw: pointer to the hw struct |
1738 | * @fw_major_version: firmware major version | 1738 | * @fw_major_version: firmware major version |
1739 | * @fw_minor_version: firmware minor version | 1739 | * @fw_minor_version: firmware minor version |
1740 | * @fw_build: firmware build number | ||
1740 | * @api_major_version: major queue version | 1741 | * @api_major_version: major queue version |
1741 | * @api_minor_version: minor queue version | 1742 | * @api_minor_version: minor queue version |
1742 | * @cmd_details: pointer to command details structure or NULL | 1743 | * @cmd_details: pointer to command details structure or NULL |
@@ -1745,6 +1746,7 @@ i40e_status i40e_aq_get_switch_config(struct i40e_hw *hw, | |||
1745 | **/ | 1746 | **/ |
1746 | i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, | 1747 | i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, |
1747 | u16 *fw_major_version, u16 *fw_minor_version, | 1748 | u16 *fw_major_version, u16 *fw_minor_version, |
1749 | u32 *fw_build, | ||
1748 | u16 *api_major_version, u16 *api_minor_version, | 1750 | u16 *api_major_version, u16 *api_minor_version, |
1749 | struct i40e_asq_cmd_details *cmd_details) | 1751 | struct i40e_asq_cmd_details *cmd_details) |
1750 | { | 1752 | { |
@@ -1758,13 +1760,15 @@ i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, | |||
1758 | status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); | 1760 | status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); |
1759 | 1761 | ||
1760 | if (!status) { | 1762 | if (!status) { |
1761 | if (fw_major_version != NULL) | 1763 | if (fw_major_version) |
1762 | *fw_major_version = le16_to_cpu(resp->fw_major); | 1764 | *fw_major_version = le16_to_cpu(resp->fw_major); |
1763 | if (fw_minor_version != NULL) | 1765 | if (fw_minor_version) |
1764 | *fw_minor_version = le16_to_cpu(resp->fw_minor); | 1766 | *fw_minor_version = le16_to_cpu(resp->fw_minor); |
1765 | if (api_major_version != NULL) | 1767 | if (fw_build) |
1768 | *fw_build = le32_to_cpu(resp->fw_build); | ||
1769 | if (api_major_version) | ||
1766 | *api_major_version = le16_to_cpu(resp->api_major); | 1770 | *api_major_version = le16_to_cpu(resp->api_major); |
1767 | if (api_minor_version != NULL) | 1771 | if (api_minor_version) |
1768 | *api_minor_version = le16_to_cpu(resp->api_minor); | 1772 | *api_minor_version = le16_to_cpu(resp->api_minor); |
1769 | } | 1773 | } |
1770 | 1774 | ||
diff --git a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c index 183dcb63ce98..b0665509eae6 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c +++ b/drivers/net/ethernet/intel/i40e/i40e_dcb_nl.c | |||
@@ -269,22 +269,21 @@ static bool i40e_dcbnl_find_app(struct i40e_dcbx_config *cfg, | |||
269 | /** | 269 | /** |
270 | * i40e_dcbnl_flush_apps - Delete all removed APPs | 270 | * i40e_dcbnl_flush_apps - Delete all removed APPs |
271 | * @pf: the corresponding pf | 271 | * @pf: the corresponding pf |
272 | * @old_cfg: old DCBX configuration data | ||
272 | * @new_cfg: new DCBX configuration data | 273 | * @new_cfg: new DCBX configuration data |
273 | * | 274 | * |
274 | * Find and delete all APPs that are not present in the passed | 275 | * Find and delete all APPs that are not present in the passed |
275 | * DCB configuration | 276 | * DCB configuration |
276 | **/ | 277 | **/ |
277 | void i40e_dcbnl_flush_apps(struct i40e_pf *pf, | 278 | void i40e_dcbnl_flush_apps(struct i40e_pf *pf, |
279 | struct i40e_dcbx_config *old_cfg, | ||
278 | struct i40e_dcbx_config *new_cfg) | 280 | struct i40e_dcbx_config *new_cfg) |
279 | { | 281 | { |
280 | struct i40e_dcb_app_priority_table app; | 282 | struct i40e_dcb_app_priority_table app; |
281 | struct i40e_dcbx_config *dcbxcfg; | ||
282 | struct i40e_hw *hw = &pf->hw; | ||
283 | int i; | 283 | int i; |
284 | 284 | ||
285 | dcbxcfg = &hw->local_dcbx_config; | 285 | for (i = 0; i < old_cfg->numapps; i++) { |
286 | for (i = 0; i < dcbxcfg->numapps; i++) { | 286 | app = old_cfg->app[i]; |
287 | app = dcbxcfg->app[i]; | ||
288 | /* The APP is not available anymore delete it */ | 287 | /* The APP is not available anymore delete it */ |
289 | if (!i40e_dcbnl_find_app(new_cfg, &app)) | 288 | if (!i40e_dcbnl_find_app(new_cfg, &app)) |
290 | i40e_dcbnl_del_app(pf, &app); | 289 | i40e_dcbnl_del_app(pf, &app); |
@@ -306,9 +305,7 @@ void i40e_dcbnl_setup(struct i40e_vsi *vsi) | |||
306 | if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) | 305 | if (!(pf->flags & I40E_FLAG_DCB_CAPABLE)) |
307 | return; | 306 | return; |
308 | 307 | ||
309 | /* Do not setup DCB NL ops for MFP mode */ | 308 | dev->dcbnl_ops = &dcbnl_ops; |
310 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) | ||
311 | dev->dcbnl_ops = &dcbnl_ops; | ||
312 | 309 | ||
313 | /* Set initial IEEE DCB settings */ | 310 | /* Set initial IEEE DCB settings */ |
314 | i40e_dcbnl_set_all(vsi); | 311 | i40e_dcbnl_set_all(vsi); |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c index 309bd1cf13e2..7413b0e429c8 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c +++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c | |||
@@ -1413,6 +1413,8 @@ static void i40e_get_strings(struct net_device *netdev, u32 stringset, | |||
1413 | data += ETH_GSTRING_LEN; | 1413 | data += ETH_GSTRING_LEN; |
1414 | } | 1414 | } |
1415 | break; | 1415 | break; |
1416 | default: | ||
1417 | break; | ||
1416 | } | 1418 | } |
1417 | } | 1419 | } |
1418 | 1420 | ||
@@ -1654,6 +1656,8 @@ static int i40e_set_phys_id(struct net_device *netdev, | |||
1654 | case ETHTOOL_ID_INACTIVE: | 1656 | case ETHTOOL_ID_INACTIVE: |
1655 | i40e_led_set(hw, pf->led_status, false); | 1657 | i40e_led_set(hw, pf->led_status, false); |
1656 | break; | 1658 | break; |
1659 | default: | ||
1660 | break; | ||
1657 | } | 1661 | } |
1658 | 1662 | ||
1659 | return 0; | 1663 | return 0; |
@@ -2344,10 +2348,6 @@ static int i40e_set_channels(struct net_device *dev, | |||
2344 | /* update feature limits from largest to smallest supported values */ | 2348 | /* update feature limits from largest to smallest supported values */ |
2345 | /* TODO: Flow director limit, DCB etc */ | 2349 | /* TODO: Flow director limit, DCB etc */ |
2346 | 2350 | ||
2347 | /* cap RSS limit */ | ||
2348 | if (count > pf->rss_size_max) | ||
2349 | count = pf->rss_size_max; | ||
2350 | |||
2351 | /* use rss_reconfig to rebuild with new queue count and update traffic | 2351 | /* use rss_reconfig to rebuild with new queue count and update traffic |
2352 | * class queue mapping | 2352 | * class queue mapping |
2353 | */ | 2353 | */ |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index aadc60432980..c3858e7f0e66 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -39,7 +39,7 @@ static const char i40e_driver_string[] = | |||
39 | 39 | ||
40 | #define DRV_VERSION_MAJOR 1 | 40 | #define DRV_VERSION_MAJOR 1 |
41 | #define DRV_VERSION_MINOR 2 | 41 | #define DRV_VERSION_MINOR 2 |
42 | #define DRV_VERSION_BUILD 9 | 42 | #define DRV_VERSION_BUILD 10 |
43 | #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ | 43 | #define DRV_VERSION __stringify(DRV_VERSION_MAJOR) "." \ |
44 | __stringify(DRV_VERSION_MINOR) "." \ | 44 | __stringify(DRV_VERSION_MINOR) "." \ |
45 | __stringify(DRV_VERSION_BUILD) DRV_KERN | 45 | __stringify(DRV_VERSION_BUILD) DRV_KERN |
@@ -1566,6 +1566,12 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi, | |||
1566 | 1566 | ||
1567 | /* Set actual Tx/Rx queue pairs */ | 1567 | /* Set actual Tx/Rx queue pairs */ |
1568 | vsi->num_queue_pairs = offset; | 1568 | vsi->num_queue_pairs = offset; |
1569 | if ((vsi->type == I40E_VSI_MAIN) && (numtc == 1)) { | ||
1570 | if (vsi->req_queue_pairs > 0) | ||
1571 | vsi->num_queue_pairs = vsi->req_queue_pairs; | ||
1572 | else | ||
1573 | vsi->num_queue_pairs = pf->num_lan_msix; | ||
1574 | } | ||
1569 | 1575 | ||
1570 | /* Scheduler section valid can only be set for ADD VSI */ | 1576 | /* Scheduler section valid can only be set for ADD VSI */ |
1571 | if (is_add) { | 1577 | if (is_add) { |
@@ -4101,7 +4107,7 @@ static u8 i40e_pf_get_num_tc(struct i40e_pf *pf) | |||
4101 | if (pf->hw.func_caps.iscsi) | 4107 | if (pf->hw.func_caps.iscsi) |
4102 | enabled_tc = i40e_get_iscsi_tc_map(pf); | 4108 | enabled_tc = i40e_get_iscsi_tc_map(pf); |
4103 | else | 4109 | else |
4104 | enabled_tc = pf->hw.func_caps.enabled_tcmap; | 4110 | return 1; /* Only TC0 */ |
4105 | 4111 | ||
4106 | /* At least have TC0 */ | 4112 | /* At least have TC0 */ |
4107 | enabled_tc = (enabled_tc ? enabled_tc : 0x1); | 4113 | enabled_tc = (enabled_tc ? enabled_tc : 0x1); |
@@ -4151,11 +4157,11 @@ static u8 i40e_pf_get_tc_map(struct i40e_pf *pf) | |||
4151 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) | 4157 | if (!(pf->flags & I40E_FLAG_MFP_ENABLED)) |
4152 | return i40e_dcb_get_enabled_tc(&pf->hw.local_dcbx_config); | 4158 | return i40e_dcb_get_enabled_tc(&pf->hw.local_dcbx_config); |
4153 | 4159 | ||
4154 | /* MPF enabled and iSCSI PF type */ | 4160 | /* MFP enabled and iSCSI PF type */ |
4155 | if (pf->hw.func_caps.iscsi) | 4161 | if (pf->hw.func_caps.iscsi) |
4156 | return i40e_get_iscsi_tc_map(pf); | 4162 | return i40e_get_iscsi_tc_map(pf); |
4157 | else | 4163 | else |
4158 | return pf->hw.func_caps.enabled_tcmap; | 4164 | return i40e_pf_get_default_tc(pf); |
4159 | } | 4165 | } |
4160 | 4166 | ||
4161 | /** | 4167 | /** |
@@ -4545,6 +4551,11 @@ static int i40e_init_pf_dcb(struct i40e_pf *pf) | |||
4545 | struct i40e_hw *hw = &pf->hw; | 4551 | struct i40e_hw *hw = &pf->hw; |
4546 | int err = 0; | 4552 | int err = 0; |
4547 | 4553 | ||
4554 | /* Do not enable DCB for SW1 and SW2 images even if the FW is capable */ | ||
4555 | if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) || | ||
4556 | (pf->hw.aq.fw_maj_ver < 4)) | ||
4557 | goto out; | ||
4558 | |||
4548 | /* Get the initial DCB configuration */ | 4559 | /* Get the initial DCB configuration */ |
4549 | err = i40e_init_dcb(hw); | 4560 | err = i40e_init_dcb(hw); |
4550 | if (!err) { | 4561 | if (!err) { |
@@ -5155,7 +5166,6 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, | |||
5155 | struct i40e_aqc_lldp_get_mib *mib = | 5166 | struct i40e_aqc_lldp_get_mib *mib = |
5156 | (struct i40e_aqc_lldp_get_mib *)&e->desc.params.raw; | 5167 | (struct i40e_aqc_lldp_get_mib *)&e->desc.params.raw; |
5157 | struct i40e_hw *hw = &pf->hw; | 5168 | struct i40e_hw *hw = &pf->hw; |
5158 | struct i40e_dcbx_config *dcbx_cfg = &hw->local_dcbx_config; | ||
5159 | struct i40e_dcbx_config tmp_dcbx_cfg; | 5169 | struct i40e_dcbx_config tmp_dcbx_cfg; |
5160 | bool need_reconfig = false; | 5170 | bool need_reconfig = false; |
5161 | int ret = 0; | 5171 | int ret = 0; |
@@ -5188,8 +5198,10 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, | |||
5188 | 5198 | ||
5189 | memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg)); | 5199 | memset(&tmp_dcbx_cfg, 0, sizeof(tmp_dcbx_cfg)); |
5190 | /* Store the old configuration */ | 5200 | /* Store the old configuration */ |
5191 | tmp_dcbx_cfg = *dcbx_cfg; | 5201 | memcpy(&tmp_dcbx_cfg, &hw->local_dcbx_config, sizeof(tmp_dcbx_cfg)); |
5192 | 5202 | ||
5203 | /* Reset the old DCBx configuration data */ | ||
5204 | memset(&hw->local_dcbx_config, 0, sizeof(hw->local_dcbx_config)); | ||
5193 | /* Get updated DCBX data from firmware */ | 5205 | /* Get updated DCBX data from firmware */ |
5194 | ret = i40e_get_dcb_config(&pf->hw); | 5206 | ret = i40e_get_dcb_config(&pf->hw); |
5195 | if (ret) { | 5207 | if (ret) { |
@@ -5198,20 +5210,22 @@ static int i40e_handle_lldp_event(struct i40e_pf *pf, | |||
5198 | } | 5210 | } |
5199 | 5211 | ||
5200 | /* No change detected in DCBX configs */ | 5212 | /* No change detected in DCBX configs */ |
5201 | if (!memcmp(&tmp_dcbx_cfg, dcbx_cfg, sizeof(tmp_dcbx_cfg))) { | 5213 | if (!memcmp(&tmp_dcbx_cfg, &hw->local_dcbx_config, |
5214 | sizeof(tmp_dcbx_cfg))) { | ||
5202 | dev_dbg(&pf->pdev->dev, "No change detected in DCBX configuration.\n"); | 5215 | dev_dbg(&pf->pdev->dev, "No change detected in DCBX configuration.\n"); |
5203 | goto exit; | 5216 | goto exit; |
5204 | } | 5217 | } |
5205 | 5218 | ||
5206 | need_reconfig = i40e_dcb_need_reconfig(pf, &tmp_dcbx_cfg, dcbx_cfg); | 5219 | need_reconfig = i40e_dcb_need_reconfig(pf, &tmp_dcbx_cfg, |
5220 | &hw->local_dcbx_config); | ||
5207 | 5221 | ||
5208 | i40e_dcbnl_flush_apps(pf, dcbx_cfg); | 5222 | i40e_dcbnl_flush_apps(pf, &tmp_dcbx_cfg, &hw->local_dcbx_config); |
5209 | 5223 | ||
5210 | if (!need_reconfig) | 5224 | if (!need_reconfig) |
5211 | goto exit; | 5225 | goto exit; |
5212 | 5226 | ||
5213 | /* Enable DCB tagging only when more than one TC */ | 5227 | /* Enable DCB tagging only when more than one TC */ |
5214 | if (i40e_dcb_get_num_tc(dcbx_cfg) > 1) | 5228 | if (i40e_dcb_get_num_tc(&hw->local_dcbx_config) > 1) |
5215 | pf->flags |= I40E_FLAG_DCB_ENABLED; | 5229 | pf->flags |= I40E_FLAG_DCB_ENABLED; |
5216 | else | 5230 | else |
5217 | pf->flags &= ~I40E_FLAG_DCB_ENABLED; | 5231 | pf->flags &= ~I40E_FLAG_DCB_ENABLED; |
@@ -6305,13 +6319,14 @@ static void i40e_reset_and_rebuild(struct i40e_pf *pf, bool reinit) | |||
6305 | } | 6319 | } |
6306 | } | 6320 | } |
6307 | 6321 | ||
6308 | msleep(75); | 6322 | if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) || |
6309 | ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); | 6323 | (pf->hw.aq.fw_maj_ver < 4)) { |
6310 | if (ret) { | 6324 | msleep(75); |
6311 | dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", | 6325 | ret = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); |
6312 | pf->hw.aq.asq_last_status); | 6326 | if (ret) |
6327 | dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", | ||
6328 | pf->hw.aq.asq_last_status); | ||
6313 | } | 6329 | } |
6314 | |||
6315 | /* reinit the misc interrupt */ | 6330 | /* reinit the misc interrupt */ |
6316 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) | 6331 | if (pf->flags & I40E_FLAG_MSIX_ENABLED) |
6317 | ret = i40e_setup_misc_vector(pf); | 6332 | ret = i40e_setup_misc_vector(pf); |
@@ -6698,6 +6713,8 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type) | |||
6698 | vsi->idx = vsi_idx; | 6713 | vsi->idx = vsi_idx; |
6699 | vsi->rx_itr_setting = pf->rx_itr_default; | 6714 | vsi->rx_itr_setting = pf->rx_itr_default; |
6700 | vsi->tx_itr_setting = pf->tx_itr_default; | 6715 | vsi->tx_itr_setting = pf->tx_itr_default; |
6716 | vsi->rss_table_size = (vsi->type == I40E_VSI_MAIN) ? | ||
6717 | pf->rss_table_size : 64; | ||
6701 | vsi->netdev_registered = false; | 6718 | vsi->netdev_registered = false; |
6702 | vsi->work_limit = I40E_DEFAULT_IRQ_WORK; | 6719 | vsi->work_limit = I40E_DEFAULT_IRQ_WORK; |
6703 | INIT_LIST_HEAD(&vsi->mac_filter_list); | 6720 | INIT_LIST_HEAD(&vsi->mac_filter_list); |
@@ -6921,7 +6938,8 @@ static int i40e_init_msix(struct i40e_pf *pf) | |||
6921 | * If we can't get what we want, we'll simplify to nearly nothing | 6938 | * If we can't get what we want, we'll simplify to nearly nothing |
6922 | * and try again. If that still fails, we punt. | 6939 | * and try again. If that still fails, we punt. |
6923 | */ | 6940 | */ |
6924 | pf->num_lan_msix = pf->num_lan_qps - (pf->rss_size_max - pf->rss_size); | 6941 | pf->num_lan_msix = min_t(int, num_online_cpus(), |
6942 | hw->func_caps.num_msix_vectors); | ||
6925 | pf->num_vmdq_msix = pf->num_vmdq_qps; | 6943 | pf->num_vmdq_msix = pf->num_vmdq_qps; |
6926 | other_vecs = 1; | 6944 | other_vecs = 1; |
6927 | other_vecs += (pf->num_vmdq_vsis * pf->num_vmdq_msix); | 6945 | other_vecs += (pf->num_vmdq_vsis * pf->num_vmdq_msix); |
@@ -7189,6 +7207,7 @@ static int i40e_setup_misc_vector(struct i40e_pf *pf) | |||
7189 | static int i40e_config_rss(struct i40e_pf *pf) | 7207 | static int i40e_config_rss(struct i40e_pf *pf) |
7190 | { | 7208 | { |
7191 | u32 rss_key[I40E_PFQF_HKEY_MAX_INDEX + 1]; | 7209 | u32 rss_key[I40E_PFQF_HKEY_MAX_INDEX + 1]; |
7210 | struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; | ||
7192 | struct i40e_hw *hw = &pf->hw; | 7211 | struct i40e_hw *hw = &pf->hw; |
7193 | u32 lut = 0; | 7212 | u32 lut = 0; |
7194 | int i, j; | 7213 | int i, j; |
@@ -7206,6 +7225,8 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
7206 | wr32(hw, I40E_PFQF_HENA(0), (u32)hena); | 7225 | wr32(hw, I40E_PFQF_HENA(0), (u32)hena); |
7207 | wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); | 7226 | wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); |
7208 | 7227 | ||
7228 | vsi->rss_size = min_t(int, pf->rss_size, vsi->num_queue_pairs); | ||
7229 | |||
7209 | /* Check capability and Set table size and register per hw expectation*/ | 7230 | /* Check capability and Set table size and register per hw expectation*/ |
7210 | reg_val = rd32(hw, I40E_PFQF_CTL_0); | 7231 | reg_val = rd32(hw, I40E_PFQF_CTL_0); |
7211 | if (hw->func_caps.rss_table_size == 512) { | 7232 | if (hw->func_caps.rss_table_size == 512) { |
@@ -7227,7 +7248,7 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
7227 | * If LAN VSI is the only consumer for RSS then this requirement | 7248 | * If LAN VSI is the only consumer for RSS then this requirement |
7228 | * is not necessary. | 7249 | * is not necessary. |
7229 | */ | 7250 | */ |
7230 | if (j == pf->rss_size) | 7251 | if (j == vsi->rss_size) |
7231 | j = 0; | 7252 | j = 0; |
7232 | /* lut = 4-byte sliding window of 4 lut entries */ | 7253 | /* lut = 4-byte sliding window of 4 lut entries */ |
7233 | lut = (lut << 8) | (j & | 7254 | lut = (lut << 8) | (j & |
@@ -7251,15 +7272,19 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
7251 | **/ | 7272 | **/ |
7252 | int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count) | 7273 | int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count) |
7253 | { | 7274 | { |
7275 | struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi]; | ||
7276 | int new_rss_size; | ||
7277 | |||
7254 | if (!(pf->flags & I40E_FLAG_RSS_ENABLED)) | 7278 | if (!(pf->flags & I40E_FLAG_RSS_ENABLED)) |
7255 | return 0; | 7279 | return 0; |
7256 | 7280 | ||
7257 | queue_count = min_t(int, queue_count, pf->rss_size_max); | 7281 | new_rss_size = min_t(int, queue_count, pf->rss_size_max); |
7258 | 7282 | ||
7259 | if (queue_count != pf->rss_size) { | 7283 | if (queue_count != vsi->num_queue_pairs) { |
7284 | vsi->req_queue_pairs = queue_count; | ||
7260 | i40e_prep_for_reset(pf); | 7285 | i40e_prep_for_reset(pf); |
7261 | 7286 | ||
7262 | pf->rss_size = queue_count; | 7287 | pf->rss_size = new_rss_size; |
7263 | 7288 | ||
7264 | i40e_reset_and_rebuild(pf, true); | 7289 | i40e_reset_and_rebuild(pf, true); |
7265 | i40e_config_rss(pf); | 7290 | i40e_config_rss(pf); |
@@ -7432,6 +7457,7 @@ static int i40e_sw_init(struct i40e_pf *pf) | |||
7432 | */ | 7457 | */ |
7433 | pf->rss_size_max = 0x1 << pf->hw.func_caps.rss_table_entry_width; | 7458 | pf->rss_size_max = 0x1 << pf->hw.func_caps.rss_table_entry_width; |
7434 | pf->rss_size = 1; | 7459 | pf->rss_size = 1; |
7460 | pf->rss_table_size = pf->hw.func_caps.rss_table_size; | ||
7435 | pf->rss_size_max = min_t(int, pf->rss_size_max, | 7461 | pf->rss_size_max = min_t(int, pf->rss_size_max, |
7436 | pf->hw.func_caps.num_tx_qp); | 7462 | pf->hw.func_caps.num_tx_qp); |
7437 | if (pf->hw.func_caps.rss) { | 7463 | if (pf->hw.func_caps.rss) { |
@@ -9258,7 +9284,11 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf) | |||
9258 | pf->flags &= ~I40E_FLAG_DCB_CAPABLE; | 9284 | pf->flags &= ~I40E_FLAG_DCB_CAPABLE; |
9259 | dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n"); | 9285 | dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n"); |
9260 | } | 9286 | } |
9261 | pf->num_lan_qps = pf->rss_size_max; | 9287 | pf->num_lan_qps = max_t(int, pf->rss_size_max, |
9288 | num_online_cpus()); | ||
9289 | pf->num_lan_qps = min_t(int, pf->num_lan_qps, | ||
9290 | pf->hw.func_caps.num_tx_qp); | ||
9291 | |||
9262 | queues_left -= pf->num_lan_qps; | 9292 | queues_left -= pf->num_lan_qps; |
9263 | } | 9293 | } |
9264 | 9294 | ||
@@ -9662,13 +9692,14 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
9662 | if (err) | 9692 | if (err) |
9663 | dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err); | 9693 | dev_info(&pf->pdev->dev, "set phy mask fail, aq_err %d\n", err); |
9664 | 9694 | ||
9665 | msleep(75); | 9695 | if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 33)) || |
9666 | err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); | 9696 | (pf->hw.aq.fw_maj_ver < 4)) { |
9667 | if (err) { | 9697 | msleep(75); |
9668 | dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", | 9698 | err = i40e_aq_set_link_restart_an(&pf->hw, true, NULL); |
9669 | pf->hw.aq.asq_last_status); | 9699 | if (err) |
9700 | dev_info(&pf->pdev->dev, "link restart failed, aq_err=%d\n", | ||
9701 | pf->hw.aq.asq_last_status); | ||
9670 | } | 9702 | } |
9671 | |||
9672 | /* The main driver is (mostly) up and happy. We need to set this state | 9703 | /* The main driver is (mostly) up and happy. We need to set this state |
9673 | * before setting up the misc vector or we get a race and the vector | 9704 | * before setting up the misc vector or we get a race and the vector |
9674 | * ends up disabled forever. | 9705 | * ends up disabled forever. |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_prototype.h b/drivers/net/ethernet/intel/i40e/i40e_prototype.h index 8cab460865f5..fea0d37ecc72 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_prototype.h +++ b/drivers/net/ethernet/intel/i40e/i40e_prototype.h | |||
@@ -66,6 +66,7 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink); | |||
66 | 66 | ||
67 | i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, | 67 | i40e_status i40e_aq_get_firmware_version(struct i40e_hw *hw, |
68 | u16 *fw_major_version, u16 *fw_minor_version, | 68 | u16 *fw_major_version, u16 *fw_minor_version, |
69 | u32 *fw_build, | ||
69 | u16 *api_major_version, u16 *api_minor_version, | 70 | u16 *api_major_version, u16 *api_minor_version, |
70 | struct i40e_asq_cmd_details *cmd_details); | 71 | struct i40e_asq_cmd_details *cmd_details); |
71 | i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw, | 72 | i40e_status i40e_aq_debug_write_register(struct i40e_hw *hw, |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c index f8c863bfa6f7..af350626843e 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c | |||
@@ -1354,10 +1354,10 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
1354 | struct iphdr *iph; | 1354 | struct iphdr *iph; |
1355 | __sum16 csum; | 1355 | __sum16 csum; |
1356 | 1356 | ||
1357 | ipv4_tunnel = (rx_ptype > I40E_RX_PTYPE_GRENAT4_MAC_PAY3) && | 1357 | ipv4_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT4_MAC_PAY3) && |
1358 | (rx_ptype < I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4); | 1358 | (rx_ptype <= I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4); |
1359 | ipv6_tunnel = (rx_ptype > I40E_RX_PTYPE_GRENAT6_MAC_PAY3) && | 1359 | ipv6_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT6_MAC_PAY3) && |
1360 | (rx_ptype < I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4); | 1360 | (rx_ptype <= I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4); |
1361 | 1361 | ||
1362 | skb->ip_summed = CHECKSUM_NONE; | 1362 | skb->ip_summed = CHECKSUM_NONE; |
1363 | 1363 | ||
@@ -2043,6 +2043,9 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | |||
2043 | tx_flags |= I40E_TX_FLAGS_SW_VLAN; | 2043 | tx_flags |= I40E_TX_FLAGS_SW_VLAN; |
2044 | } | 2044 | } |
2045 | 2045 | ||
2046 | if (!(tx_ring->vsi->back->flags & I40E_FLAG_DCB_ENABLED)) | ||
2047 | goto out; | ||
2048 | |||
2046 | /* Insert 802.1p priority into VLAN header */ | 2049 | /* Insert 802.1p priority into VLAN header */ |
2047 | if ((tx_flags & (I40E_TX_FLAGS_HW_VLAN | I40E_TX_FLAGS_SW_VLAN)) || | 2050 | if ((tx_flags & (I40E_TX_FLAGS_HW_VLAN | I40E_TX_FLAGS_SW_VLAN)) || |
2048 | (skb->priority != TC_PRIO_CONTROL)) { | 2051 | (skb->priority != TC_PRIO_CONTROL)) { |
@@ -2063,6 +2066,8 @@ static int i40e_tx_prepare_vlan_flags(struct sk_buff *skb, | |||
2063 | tx_flags |= I40E_TX_FLAGS_HW_VLAN; | 2066 | tx_flags |= I40E_TX_FLAGS_HW_VLAN; |
2064 | } | 2067 | } |
2065 | } | 2068 | } |
2069 | |||
2070 | out: | ||
2066 | *flags = tx_flags; | 2071 | *flags = tx_flags; |
2067 | return 0; | 2072 | return 0; |
2068 | } | 2073 | } |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index 493335caa276..910c45e83fdd 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | |||
@@ -832,7 +832,6 @@ void i40e_free_vfs(struct i40e_pf *pf) | |||
832 | bit_idx = (hw->func_caps.vf_base_id + vf_id) % 32; | 832 | bit_idx = (hw->func_caps.vf_base_id + vf_id) % 32; |
833 | wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), (1 << bit_idx)); | 833 | wr32(hw, I40E_GLGEN_VFLRSTAT(reg_idx), (1 << bit_idx)); |
834 | } | 834 | } |
835 | i40e_disable_pf_switch_lb(pf); | ||
836 | } else { | 835 | } else { |
837 | dev_warn(&pf->pdev->dev, | 836 | dev_warn(&pf->pdev->dev, |
838 | "unable to disable SR-IOV because VFs are assigned.\n"); | 837 | "unable to disable SR-IOV because VFs are assigned.\n"); |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_adminq.h b/drivers/net/ethernet/intel/i40evf/i40e_adminq.h index 60f04e96a80e..ef43d68f67b3 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_adminq.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_adminq.h | |||
@@ -93,6 +93,7 @@ struct i40e_adminq_info { | |||
93 | u16 asq_buf_size; /* send queue buffer size */ | 93 | u16 asq_buf_size; /* send queue buffer size */ |
94 | u16 fw_maj_ver; /* firmware major version */ | 94 | u16 fw_maj_ver; /* firmware major version */ |
95 | u16 fw_min_ver; /* firmware minor version */ | 95 | u16 fw_min_ver; /* firmware minor version */ |
96 | u32 fw_build; /* firmware build number */ | ||
96 | u16 api_maj_ver; /* api major version */ | 97 | u16 api_maj_ver; /* api major version */ |
97 | u16 api_min_ver; /* api minor version */ | 98 | u16 api_min_ver; /* api minor version */ |
98 | bool nvm_release_on_done; | 99 | bool nvm_release_on_done; |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c index fc7e2d0b755c..d2ff862f0726 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_txrx.c +++ b/drivers/net/ethernet/intel/i40evf/i40e_txrx.c | |||
@@ -852,10 +852,10 @@ static inline void i40e_rx_checksum(struct i40e_vsi *vsi, | |||
852 | struct iphdr *iph; | 852 | struct iphdr *iph; |
853 | __sum16 csum; | 853 | __sum16 csum; |
854 | 854 | ||
855 | ipv4_tunnel = (rx_ptype > I40E_RX_PTYPE_GRENAT4_MAC_PAY3) && | 855 | ipv4_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT4_MAC_PAY3) && |
856 | (rx_ptype < I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4); | 856 | (rx_ptype <= I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4); |
857 | ipv6_tunnel = (rx_ptype > I40E_RX_PTYPE_GRENAT6_MAC_PAY3) && | 857 | ipv6_tunnel = (rx_ptype >= I40E_RX_PTYPE_GRENAT6_MAC_PAY3) && |
858 | (rx_ptype < I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4); | 858 | (rx_ptype <= I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4); |
859 | 859 | ||
860 | skb->ip_summed = CHECKSUM_NONE; | 860 | skb->ip_summed = CHECKSUM_NONE; |
861 | 861 | ||
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c index c5ffaccb59d3..681a5d4b4f6a 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c | |||
@@ -642,12 +642,14 @@ static int i40evf_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, | |||
642 | if (!indir) | 642 | if (!indir) |
643 | return 0; | 643 | return 0; |
644 | 644 | ||
645 | for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { | 645 | if (indir) { |
646 | hlut_val = rd32(hw, I40E_VFQF_HLUT(i)); | 646 | for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++) { |
647 | indir[j++] = hlut_val & 0xff; | 647 | hlut_val = rd32(hw, I40E_VFQF_HLUT(i)); |
648 | indir[j++] = (hlut_val >> 8) & 0xff; | 648 | indir[j++] = hlut_val & 0xff; |
649 | indir[j++] = (hlut_val >> 16) & 0xff; | 649 | indir[j++] = (hlut_val >> 8) & 0xff; |
650 | indir[j++] = (hlut_val >> 24) & 0xff; | 650 | indir[j++] = (hlut_val >> 16) & 0xff; |
651 | indir[j++] = (hlut_val >> 24) & 0xff; | ||
652 | } | ||
651 | } | 653 | } |
652 | return 0; | 654 | return 0; |
653 | } | 655 | } |
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c index 31d35e200f04..a95135846ea9 100644 --- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c +++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c | |||
@@ -36,7 +36,7 @@ char i40evf_driver_name[] = "i40evf"; | |||
36 | static const char i40evf_driver_string[] = | 36 | static const char i40evf_driver_string[] = |
37 | "Intel(R) XL710/X710 Virtual Function Network Driver"; | 37 | "Intel(R) XL710/X710 Virtual Function Network Driver"; |
38 | 38 | ||
39 | #define DRV_VERSION "1.2.3" | 39 | #define DRV_VERSION "1.2.4" |
40 | const char i40evf_driver_version[] = DRV_VERSION; | 40 | const char i40evf_driver_version[] = DRV_VERSION; |
41 | static const char i40evf_copyright[] = | 41 | static const char i40evf_copyright[] = |
42 | "Copyright (c) 2013 - 2014 Intel Corporation."; | 42 | "Copyright (c) 2013 - 2014 Intel Corporation."; |