ixl_pf_main.c (e706512a) ixl_pf_main.c (402810d3)
1/******************************************************************************
2
3 Copyright (c) 2013-2018, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 516 unchanged lines hidden (view full) ---

525 * Filter Routines
526 *
527 * Routines for multicast and vlan filter management.
528 *
529 *********************************************************************/
530void
531ixl_add_multi(struct ixl_vsi *vsi)
532{
1/******************************************************************************
2
3 Copyright (c) 2013-2018, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 516 unchanged lines hidden (view full) ---

525 * Filter Routines
526 *
527 * Routines for multicast and vlan filter management.
528 *
529 *********************************************************************/
530void
531ixl_add_multi(struct ixl_vsi *vsi)
532{
533 struct ifnet *ifp = vsi->ifp;
533 if_t ifp = vsi->ifp;
534 struct i40e_hw *hw = vsi->hw;
535 int mcnt = 0;
536 struct ixl_add_maddr_arg cb_arg;
537
538 IOCTL_DEBUGOUT("ixl_add_multi: begin");
539
540 mcnt = if_llmaddr_count(ifp);
541 if (__predict_false(mcnt >= MAX_MULTICAST_ADDR)) {

--- 24 unchanged lines hidden (view full) ---

566 else
567 return (0);
568}
569
570void
571ixl_del_multi(struct ixl_vsi *vsi, bool all)
572{
573 struct ixl_ftl_head to_del;
534 struct i40e_hw *hw = vsi->hw;
535 int mcnt = 0;
536 struct ixl_add_maddr_arg cb_arg;
537
538 IOCTL_DEBUGOUT("ixl_add_multi: begin");
539
540 mcnt = if_llmaddr_count(ifp);
541 if (__predict_false(mcnt >= MAX_MULTICAST_ADDR)) {

--- 24 unchanged lines hidden (view full) ---

566 else
567 return (0);
568}
569
570void
571ixl_del_multi(struct ixl_vsi *vsi, bool all)
572{
573 struct ixl_ftl_head to_del;
574 struct ifnet *ifp = vsi->ifp;
574 if_t ifp = vsi->ifp;
575 struct ixl_mac_filter *f, *fn;
576 int mcnt = 0;
577
578 IOCTL_DEBUGOUT("ixl_del_multi: begin");
579
580 LIST_INIT(&to_del);
581 /* Search for removed multicast addresses */
582 LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, fn) {

--- 9 unchanged lines hidden (view full) ---

592 if (mcnt > 0)
593 ixl_del_hw_filters(vsi, &to_del, mcnt);
594}
595
596void
597ixl_link_up_msg(struct ixl_pf *pf)
598{
599 struct i40e_hw *hw = &pf->hw;
575 struct ixl_mac_filter *f, *fn;
576 int mcnt = 0;
577
578 IOCTL_DEBUGOUT("ixl_del_multi: begin");
579
580 LIST_INIT(&to_del);
581 /* Search for removed multicast addresses */
582 LIST_FOREACH_SAFE(f, &vsi->ftl, ftle, fn) {

--- 9 unchanged lines hidden (view full) ---

592 if (mcnt > 0)
593 ixl_del_hw_filters(vsi, &to_del, mcnt);
594}
595
596void
597ixl_link_up_msg(struct ixl_pf *pf)
598{
599 struct i40e_hw *hw = &pf->hw;
600 struct ifnet *ifp = pf->vsi.ifp;
600 if_t ifp = pf->vsi.ifp;
601 char *req_fec_string, *neg_fec_string;
602 u8 fec_abilities;
603
604 fec_abilities = hw->phy.link_info.req_fec_info;
605 /* If both RS and KR are requested, only show RS */
606 if (fec_abilities & I40E_AQ_REQUEST_FEC_RS)
607 req_fec_string = ixl_fec_string[0];
608 else if (fec_abilities & I40E_AQ_REQUEST_FEC_KR)

--- 4 unchanged lines hidden (view full) ---

613 if (hw->phy.link_info.fec_info & I40E_AQ_CONFIG_FEC_RS_ENA)
614 neg_fec_string = ixl_fec_string[0];
615 else if (hw->phy.link_info.fec_info & I40E_AQ_CONFIG_FEC_KR_ENA)
616 neg_fec_string = ixl_fec_string[1];
617 else
618 neg_fec_string = ixl_fec_string[2];
619
620 log(LOG_NOTICE, "%s: Link is up, %s Full Duplex, Requested FEC: %s, Negotiated FEC: %s, Autoneg: %s, Flow Control: %s\n",
601 char *req_fec_string, *neg_fec_string;
602 u8 fec_abilities;
603
604 fec_abilities = hw->phy.link_info.req_fec_info;
605 /* If both RS and KR are requested, only show RS */
606 if (fec_abilities & I40E_AQ_REQUEST_FEC_RS)
607 req_fec_string = ixl_fec_string[0];
608 else if (fec_abilities & I40E_AQ_REQUEST_FEC_KR)

--- 4 unchanged lines hidden (view full) ---

613 if (hw->phy.link_info.fec_info & I40E_AQ_CONFIG_FEC_RS_ENA)
614 neg_fec_string = ixl_fec_string[0];
615 else if (hw->phy.link_info.fec_info & I40E_AQ_CONFIG_FEC_KR_ENA)
616 neg_fec_string = ixl_fec_string[1];
617 else
618 neg_fec_string = ixl_fec_string[2];
619
620 log(LOG_NOTICE, "%s: Link is up, %s Full Duplex, Requested FEC: %s, Negotiated FEC: %s, Autoneg: %s, Flow Control: %s\n",
621 ifp->if_xname,
621 if_name(ifp),
622 ixl_link_speed_string(hw->phy.link_info.link_speed),
623 req_fec_string, neg_fec_string,
624 (hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED) ? "True" : "False",
625 (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_TX &&
626 hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_RX) ?
627 ixl_fc_string[3] : (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_TX) ?
628 ixl_fc_string[2] : (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_RX) ?
629 ixl_fc_string[1] : ixl_fc_string[0]);

--- 1284 unchanged lines hidden (view full) ---

1914 reg = IXL_ITR_NONE << I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT;
1915 wr32(hw, I40E_PFINT_DYN_CTLN(id), reg);
1916}
1917
1918void
1919ixl_handle_empr_reset(struct ixl_pf *pf)
1920{
1921 struct ixl_vsi *vsi = &pf->vsi;
622 ixl_link_speed_string(hw->phy.link_info.link_speed),
623 req_fec_string, neg_fec_string,
624 (hw->phy.link_info.an_info & I40E_AQ_AN_COMPLETED) ? "True" : "False",
625 (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_TX &&
626 hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_RX) ?
627 ixl_fc_string[3] : (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_TX) ?
628 ixl_fc_string[2] : (hw->phy.link_info.an_info & I40E_AQ_LINK_PAUSE_RX) ?
629 ixl_fc_string[1] : ixl_fc_string[0]);

--- 1284 unchanged lines hidden (view full) ---

1914 reg = IXL_ITR_NONE << I40E_PFINT_DYN_CTLN_ITR_INDX_SHIFT;
1915 wr32(hw, I40E_PFINT_DYN_CTLN(id), reg);
1916}
1917
1918void
1919ixl_handle_empr_reset(struct ixl_pf *pf)
1920{
1921 struct ixl_vsi *vsi = &pf->vsi;
1922 bool is_up = !!(vsi->ifp->if_drv_flags & IFF_DRV_RUNNING);
1922 bool is_up = !!(if_getdrvflags(vsi->ifp) & IFF_DRV_RUNNING);
1923
1924 ixl_prepare_for_reset(pf, is_up);
1925 /*
1926 * i40e_pf_reset checks the type of reset and acts
1927 * accordingly. If EMP or Core reset was performed
1928 * doing PF reset is not necessary and it sometimes
1929 * fails.
1930 */

--- 2771 unchanged lines hidden ---
1923
1924 ixl_prepare_for_reset(pf, is_up);
1925 /*
1926 * i40e_pf_reset checks the type of reset and acts
1927 * accordingly. If EMP or Core reset was performed
1928 * doing PF reset is not necessary and it sometimes
1929 * fails.
1930 */

--- 2771 unchanged lines hidden ---