* [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW
@ 2010-05-11 1:58 Dimitris Michailidis
2010-05-11 1:58 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed Dimitris Michailidis
2010-05-13 6:32 ` [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW David Miller
0 siblings, 2 replies; 8+ messages in thread
From: Dimitris Michailidis @ 2010-05-11 1:58 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
HW VLAN extraction needs to be configured through FW to work correctly in
virtualization environments. Remove the direct register manipulation and
rely on FW.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4.h | 4 ++--
drivers/net/cxgb4/cxgb4_main.c | 9 +++++----
drivers/net/cxgb4/t4_hw.c | 31 ++++++++++---------------------
drivers/net/cxgb4/t4fw_api.h | 4 +++-
4 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4.h b/drivers/net/cxgb4/cxgb4.h
index 8856a75..d3a5c34 100644
--- a/drivers/net/cxgb4/cxgb4.h
+++ b/drivers/net/cxgb4/cxgb4.h
@@ -656,7 +656,6 @@ int t4_check_fw_version(struct adapter *adapter);
int t4_prep_adapter(struct adapter *adapter);
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf);
void t4_fatal_err(struct adapter *adapter);
-void t4_set_vlan_accel(struct adapter *adapter, unsigned int ports, int on);
int t4_set_trace_filter(struct adapter *adapter, const struct trace_params *tp,
int filter_index, int enable);
void t4_get_trace_filter(struct adapter *adapter, struct trace_params *tp,
@@ -707,7 +706,8 @@ int t4_alloc_vi(struct adapter *adap, unsigned int mbox, unsigned int port,
int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf,
unsigned int vf, unsigned int viid);
int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
- int mtu, int promisc, int all_multi, int bcast, bool sleep_ok);
+ int mtu, int promisc, int all_multi, int bcast, int vlanex,
+ bool sleep_ok);
int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox,
unsigned int viid, bool free, unsigned int naddr,
const u8 **addr, u16 *idx, u64 *hash, bool sleep_ok);
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 1bad500..a73cda9 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -290,7 +290,7 @@ static int set_rxmode(struct net_device *dev, int mtu, bool sleep_ok)
if (ret == 0)
ret = t4_set_rxmode(pi->adapter, 0, pi->viid, mtu,
(dev->flags & IFF_PROMISC) ? 1 : 0,
- (dev->flags & IFF_ALLMULTI) ? 1 : 0, 1,
+ (dev->flags & IFF_ALLMULTI) ? 1 : 0, 1, -1,
sleep_ok);
return ret;
}
@@ -311,7 +311,7 @@ static int link_start(struct net_device *dev)
* that step explicitly.
*/
ret = t4_set_rxmode(pi->adapter, 0, pi->viid, dev->mtu, -1, -1, -1,
- true);
+ pi->vlan_grp != NULL, true);
if (ret == 0) {
ret = t4_change_mac(pi->adapter, 0, pi->viid,
pi->xact_addr_filt, dev->dev_addr, true,
@@ -2614,7 +2614,7 @@ static int cxgb_change_mtu(struct net_device *dev, int new_mtu)
if (new_mtu < 81 || new_mtu > MAX_MTU) /* accommodate SACK */
return -EINVAL;
- ret = t4_set_rxmode(pi->adapter, 0, pi->viid, new_mtu, -1, -1, -1,
+ ret = t4_set_rxmode(pi->adapter, 0, pi->viid, new_mtu, -1, -1, -1, -1,
true);
if (!ret)
dev->mtu = new_mtu;
@@ -2645,7 +2645,8 @@ static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
struct port_info *pi = netdev_priv(dev);
pi->vlan_grp = grp;
- t4_set_vlan_accel(pi->adapter, 1 << pi->tx_chan, grp != NULL);
+ t4_set_rxmode(pi->adapter, 0, pi->viid, -1, -1, -1, -1, grp != NULL,
+ true);
}
#ifdef CONFIG_NET_POLL_CONTROLLER
diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c
index 2923dd4..da272a9 100644
--- a/drivers/net/cxgb4/t4_hw.c
+++ b/drivers/net/cxgb4/t4_hw.c
@@ -886,22 +886,6 @@ int t4_restart_aneg(struct adapter *adap, unsigned int mbox, unsigned int port)
return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL);
}
-/**
- * t4_set_vlan_accel - configure HW VLAN extraction
- * @adap: the adapter
- * @ports: bitmap of adapter ports to operate on
- * @on: enable (1) or disable (0) HW VLAN extraction
- *
- * Enables or disables HW extraction of VLAN tags for the ports specified
- * by @ports. @ports is a bitmap with the ith bit designating the port
- * associated with the ith adapter channel.
- */
-void t4_set_vlan_accel(struct adapter *adap, unsigned int ports, int on)
-{
- ports <<= VLANEXTENABLE_SHIFT;
- t4_set_reg_field(adap, TP_OUT_CONFIG, ports, on ? ports : 0);
-}
-
struct intr_info {
unsigned int mask; /* bits to check in interrupt status */
const char *msg; /* message to print or NULL */
@@ -2624,12 +2608,14 @@ int t4_free_vi(struct adapter *adap, unsigned int mbox, unsigned int pf,
* @promisc: 1 to enable promiscuous mode, 0 to disable it, -1 no change
* @all_multi: 1 to enable all-multi mode, 0 to disable it, -1 no change
* @bcast: 1 to enable broadcast Rx, 0 to disable it, -1 no change
+ * @vlanex: 1 to enable HW VLAN extraction, 0 to disable it, -1 no change
* @sleep_ok: if true we may sleep while awaiting command completion
*
* Sets Rx properties of a virtual interface.
*/
int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
- int mtu, int promisc, int all_multi, int bcast, bool sleep_ok)
+ int mtu, int promisc, int all_multi, int bcast, int vlanex,
+ bool sleep_ok)
{
struct fw_vi_rxmode_cmd c;
@@ -2642,15 +2628,18 @@ int t4_set_rxmode(struct adapter *adap, unsigned int mbox, unsigned int viid,
all_multi = FW_VI_RXMODE_CMD_ALLMULTIEN_MASK;
if (bcast < 0)
bcast = FW_VI_RXMODE_CMD_BROADCASTEN_MASK;
+ if (vlanex < 0)
+ vlanex = FW_VI_RXMODE_CMD_VLANEXEN_MASK;
memset(&c, 0, sizeof(c));
c.op_to_viid = htonl(FW_CMD_OP(FW_VI_RXMODE_CMD) | FW_CMD_REQUEST |
FW_CMD_WRITE | FW_VI_RXMODE_CMD_VIID(viid));
c.retval_len16 = htonl(FW_LEN16(c));
- c.mtu_to_broadcasten = htonl(FW_VI_RXMODE_CMD_MTU(mtu) |
- FW_VI_RXMODE_CMD_PROMISCEN(promisc) |
- FW_VI_RXMODE_CMD_ALLMULTIEN(all_multi) |
- FW_VI_RXMODE_CMD_BROADCASTEN(bcast));
+ c.mtu_to_vlanexen = htonl(FW_VI_RXMODE_CMD_MTU(mtu) |
+ FW_VI_RXMODE_CMD_PROMISCEN(promisc) |
+ FW_VI_RXMODE_CMD_ALLMULTIEN(all_multi) |
+ FW_VI_RXMODE_CMD_BROADCASTEN(bcast) |
+ FW_VI_RXMODE_CMD_VLANEXEN(vlanex));
return t4_wr_mbox_meat(adap, mbox, &c, sizeof(c), NULL, sleep_ok);
}
diff --git a/drivers/net/cxgb4/t4fw_api.h b/drivers/net/cxgb4/t4fw_api.h
index 3393d05..63991d6 100644
--- a/drivers/net/cxgb4/t4fw_api.h
+++ b/drivers/net/cxgb4/t4fw_api.h
@@ -876,7 +876,7 @@ struct fw_vi_mac_cmd {
struct fw_vi_rxmode_cmd {
__be32 op_to_viid;
__be32 retval_len16;
- __be32 mtu_to_broadcasten;
+ __be32 mtu_to_vlanexen;
__be32 r4_lo;
};
@@ -888,6 +888,8 @@ struct fw_vi_rxmode_cmd {
#define FW_VI_RXMODE_CMD_ALLMULTIEN(x) ((x) << 12)
#define FW_VI_RXMODE_CMD_BROADCASTEN_MASK 0x3
#define FW_VI_RXMODE_CMD_BROADCASTEN(x) ((x) << 10)
+#define FW_VI_RXMODE_CMD_VLANEXEN_MASK 0x3
+#define FW_VI_RXMODE_CMD_VLANEXEN(x) ((x) << 8)
struct fw_vi_enable_cmd {
__be32 op_to_viid;
--
1.5.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 2/3] cxgb4: report the PCIe link speed
2010-05-11 1:58 [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW Dimitris Michailidis
@ 2010-05-11 1:58 ` Dimitris Michailidis
2010-05-11 1:58 ` [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S Dimitris Michailidis
2010-05-13 6:32 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed David Miller
2010-05-13 6:32 ` [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW David Miller
1 sibling, 2 replies; 8+ messages in thread
From: Dimitris Michailidis @ 2010-05-11 1:58 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
Report the PCIe link speed (2.5 or 5 Gbps).
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4_main.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index a73cda9..80c3fc5 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -3080,6 +3080,12 @@ static void __devinit print_port_info(struct adapter *adap)
int i;
char buf[80];
+ const char *spd = "";
+
+ if (adap->params.pci.speed == PCI_EXP_LNKSTA_CLS_2_5GB)
+ spd = " 2.5 GT/s";
+ else if (adap->params.pci.speed == PCI_EXP_LNKSTA_CLS_5_0GB)
+ spd = " 5 GT/s";
for_each_port(adap, i) {
struct net_device *dev = adap->port[i];
@@ -3099,10 +3105,10 @@ static void __devinit print_port_info(struct adapter *adap)
--bufp;
sprintf(bufp, "BASE-%s", base[pi->port_type]);
- netdev_info(dev, "Chelsio %s rev %d %s %sNIC PCIe x%d%s\n",
+ netdev_info(dev, "Chelsio %s rev %d %s %sNIC PCIe x%d%s%s\n",
adap->params.vpd.id, adap->params.rev,
buf, is_offload(adap) ? "R" : "",
- adap->params.pci.width,
+ adap->params.pci.width, spd,
(adap->flags & USING_MSIX) ? " MSI-X" :
(adap->flags & USING_MSI) ? " MSI" : "");
if (adap->name == dev->name)
--
1.5.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S
2010-05-11 1:58 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed Dimitris Michailidis
@ 2010-05-11 1:58 ` Dimitris Michailidis
2010-05-11 3:02 ` Ben Greear
2010-05-13 6:32 ` David Miller
2010-05-13 6:32 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed David Miller
1 sibling, 2 replies; 8+ messages in thread
From: Dimitris Michailidis @ 2010-05-11 1:58 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4_main.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 80c3fc5..90d375b 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -859,6 +859,8 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
"RxCsumGood ",
"VLANextractions ",
"VLANinsertions ",
+ "GROpackets ",
+ "GROmerged ",
};
static int get_sset_count(struct net_device *dev, int sset)
@@ -922,6 +924,8 @@ struct queue_port_stats {
u64 rx_csum;
u64 vlan_ex;
u64 vlan_ins;
+ u64 gro_pkts;
+ u64 gro_merged;
};
static void collect_sge_port_stats(const struct adapter *adap,
@@ -938,6 +942,8 @@ static void collect_sge_port_stats(const struct adapter *adap,
s->rx_csum += rx->stats.rx_cso;
s->vlan_ex += rx->stats.vlan_ex;
s->vlan_ins += tx->vlan_ins;
+ s->gro_pkts += rx->stats.lro_pkts;
+ s->gro_merged += rx->stats.lro_merged;
}
}
--
1.5.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S
2010-05-11 1:58 ` [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S Dimitris Michailidis
@ 2010-05-11 3:02 ` Ben Greear
2010-05-11 8:45 ` Dimitris Michailidis
2010-05-13 6:32 ` David Miller
1 sibling, 1 reply; 8+ messages in thread
From: Ben Greear @ 2010-05-11 3:02 UTC (permalink / raw)
To: Dimitris Michailidis; +Cc: netdev
On 05/10/2010 06:58 PM, Dimitris Michailidis wrote:
> Signed-off-by: Dimitris Michailidis<dm@chelsio.com>
One of these is on-wire packets? If so, maybe use the same
string as Intel ixgbe uses:
rx_pkts_nic # Pkts received by NIC from wire.
rx_bytes_nic # Bytes received by NIC from wire.
tx_pkts_nic # Pkts transmitted to wire by NIC.
tx_bytes_nic # Bytes transmitted to wire by NIC.
Thanks,
Ben
> ---
> drivers/net/cxgb4/cxgb4_main.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
> index 80c3fc5..90d375b 100644
> --- a/drivers/net/cxgb4/cxgb4_main.c
> +++ b/drivers/net/cxgb4/cxgb4_main.c
> @@ -859,6 +859,8 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
> "RxCsumGood ",
> "VLANextractions ",
> "VLANinsertions ",
> + "GROpackets ",
> + "GROmerged ",
> };
>
> static int get_sset_count(struct net_device *dev, int sset)
> @@ -922,6 +924,8 @@ struct queue_port_stats {
> u64 rx_csum;
> u64 vlan_ex;
> u64 vlan_ins;
> + u64 gro_pkts;
> + u64 gro_merged;
> };
>
> static void collect_sge_port_stats(const struct adapter *adap,
> @@ -938,6 +942,8 @@ static void collect_sge_port_stats(const struct adapter *adap,
> s->rx_csum += rx->stats.rx_cso;
> s->vlan_ex += rx->stats.vlan_ex;
> s->vlan_ins += tx->vlan_ins;
> + s->gro_pkts += rx->stats.lro_pkts;
> + s->gro_merged += rx->stats.lro_merged;
> }
> }
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S
2010-05-11 3:02 ` Ben Greear
@ 2010-05-11 8:45 ` Dimitris Michailidis
0 siblings, 0 replies; 8+ messages in thread
From: Dimitris Michailidis @ 2010-05-11 8:45 UTC (permalink / raw)
To: Ben Greear; +Cc: netdev
Ben Greear wrote:
> On 05/10/2010 06:58 PM, Dimitris Michailidis wrote:
>> Signed-off-by: Dimitris Michailidis<dm@chelsio.com>
>
> One of these is on-wire packets? If so, maybe use the same
> string as Intel ixgbe uses:
>
> rx_pkts_nic # Pkts received by NIC from wire.
> rx_bytes_nic # Bytes received by NIC from wire.
> tx_pkts_nic # Pkts transmitted to wire by NIC.
> tx_bytes_nic # Bytes transmitted to wire by NIC.
The two stats I'm adding don't correspond to any of the 4 above. One is the
superpackets coming out of GRO, the other is packets merged by GRO to create
the superpackets.
>
> Thanks,
> Ben
>
>
>
>> ---
>> drivers/net/cxgb4/cxgb4_main.c | 6 ++++++
>> 1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/cxgb4/cxgb4_main.c
>> b/drivers/net/cxgb4/cxgb4_main.c
>> index 80c3fc5..90d375b 100644
>> --- a/drivers/net/cxgb4/cxgb4_main.c
>> +++ b/drivers/net/cxgb4/cxgb4_main.c
>> @@ -859,6 +859,8 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
>> "RxCsumGood ",
>> "VLANextractions ",
>> "VLANinsertions ",
>> + "GROpackets ",
>> + "GROmerged ",
>> };
>>
>> static int get_sset_count(struct net_device *dev, int sset)
>> @@ -922,6 +924,8 @@ struct queue_port_stats {
>> u64 rx_csum;
>> u64 vlan_ex;
>> u64 vlan_ins;
>> + u64 gro_pkts;
>> + u64 gro_merged;
>> };
>>
>> static void collect_sge_port_stats(const struct adapter *adap,
>> @@ -938,6 +942,8 @@ static void collect_sge_port_stats(const struct
>> adapter *adap,
>> s->rx_csum += rx->stats.rx_cso;
>> s->vlan_ex += rx->stats.vlan_ex;
>> s->vlan_ins += tx->vlan_ins;
>> + s->gro_pkts += rx->stats.lro_pkts;
>> + s->gro_merged += rx->stats.lro_merged;
>> }
>> }
>>
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW
2010-05-11 1:58 [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW Dimitris Michailidis
2010-05-11 1:58 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed Dimitris Michailidis
@ 2010-05-13 6:32 ` David Miller
1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: dm; +Cc: netdev
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:07 -0700
> HW VLAN extraction needs to be configured through FW to work correctly in
> virtualization environments. Remove the direct register manipulation and
> rely on FW.
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 2/3] cxgb4: report the PCIe link speed
2010-05-11 1:58 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed Dimitris Michailidis
2010-05-11 1:58 ` [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S Dimitris Michailidis
@ 2010-05-13 6:32 ` David Miller
1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: dm; +Cc: netdev
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:08 -0700
> Report the PCIe link speed (2.5 or 5 Gbps).
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S
2010-05-11 1:58 ` [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S Dimitris Michailidis
2010-05-11 3:02 ` Ben Greear
@ 2010-05-13 6:32 ` David Miller
1 sibling, 0 replies; 8+ messages in thread
From: David Miller @ 2010-05-13 6:32 UTC (permalink / raw)
To: dm; +Cc: netdev
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:09 -0700
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-05-13 6:32 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-11 1:58 [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW Dimitris Michailidis
2010-05-11 1:58 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed Dimitris Michailidis
2010-05-11 1:58 ` [PATCH net-next 3/3] cxgb4: report GRO stats with ethtool -S Dimitris Michailidis
2010-05-11 3:02 ` Ben Greear
2010-05-11 8:45 ` Dimitris Michailidis
2010-05-13 6:32 ` David Miller
2010-05-13 6:32 ` [PATCH net-next 2/3] cxgb4: report the PCIe link speed David Miller
2010-05-13 6:32 ` [PATCH net-next 1/3] cxgb4: configure HW VLAN extraction through FW David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).