Author: np
Date: Sat Sep 17 22:13:03 2016
New Revision: 305906
URL: https://svnweb.freebsd.org/changeset/base/305906

Log:
  cxgbe/t4_tom: The SMAC entry for a VI is at a different location in the T6.
  
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/adapter.h
  head/sys/dev/cxgbe/common/t4_hw.c
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/cxgbe/tom/t4_tom.c

Modified: head/sys/dev/cxgbe/adapter.h
==============================================================================
--- head/sys/dev/cxgbe/adapter.h        Sat Sep 17 21:49:11 2016        
(r305905)
+++ head/sys/dev/cxgbe/adapter.h        Sat Sep 17 22:13:03 2016        
(r305906)
@@ -231,6 +231,7 @@ struct vi_info {
        int if_flags;
 
        uint16_t *rss, *nm_rss;
+       int smt_idx;            /* for convenience */
        uint16_t viid;
        int16_t  xact_addr_filt;/* index of exact MAC address filter */
        uint16_t rss_size;      /* size of VI's RSS table slice */

Modified: head/sys/dev/cxgbe/common/t4_hw.c
==============================================================================
--- head/sys/dev/cxgbe/common/t4_hw.c   Sat Sep 17 21:49:11 2016        
(r305905)
+++ head/sys/dev/cxgbe/common/t4_hw.c   Sat Sep 17 22:13:03 2016        
(r305906)
@@ -8100,6 +8100,10 @@ int t4_port_init(struct adapter *adap, i
                return ret;
 
        p->vi[0].viid = ret;
+       if (chip_id(adap) <= CHELSIO_T5)
+               p->vi[0].smt_idx = (ret & 0x7f) << 1;
+       else
+               p->vi[0].smt_idx = (ret & 0x7f);
        p->tx_chan = j;
        p->rx_chan_map = t4_get_mps_bg_map(adap, j);
        p->lport = j;

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c        Sat Sep 17 21:49:11 2016        
(r305905)
+++ head/sys/dev/cxgbe/t4_main.c        Sat Sep 17 22:13:03 2016        
(r305906)
@@ -2030,6 +2030,10 @@ vcxgbe_attach(device_t dev)
                return (-rc);
        }
        vi->viid = rc;
+       if (chip_id(sc) <= CHELSIO_T5)
+               vi->smt_idx = (rc & 0x7f) << 1;
+       else
+               vi->smt_idx = (rc & 0x7f);
 
        param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
            V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) |

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.c     Sat Sep 17 21:49:11 2016        
(r305905)
+++ head/sys/dev/cxgbe/tom/t4_tom.c     Sat Sep 17 22:13:03 2016        
(r305906)
@@ -538,7 +538,6 @@ select_rcv_wscale(void)
 }
 
 extern int always_keepalive;
-#define VIID_SMACIDX(v)        (((unsigned int)(v) & 0x7f) << 1)
 
 /*
  * socket so could be a listening socket too.
@@ -569,7 +568,7 @@ calc_opt0(struct socket *so, struct vi_i
                opt0 |= V_L2T_IDX(e->idx);
 
        if (vi != NULL) {
-               opt0 |= V_SMAC_SEL(VIID_SMACIDX(vi->viid));
+               opt0 |= V_SMAC_SEL(vi->smt_idx);
                opt0 |= V_TX_CHAN(vi->pi->tx_chan);
        }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to