* Re: [PATCH net-next 0/9] cxgb4 updates
From: David Miller @ 2010-08-02 23:27 UTC (permalink / raw)
To: dm; +Cc: netdev
In-Reply-To: <1280791164-14181-1-git-send-email-dm@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 2 Aug 2010 16:19:15 -0700
>
> Following are 9 patches for cxgb4. A few small fixes, new PCI ids, and a
> couple features.
All applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/4] net: check for reference outside of skb
From: Changli Gao @ 2010-08-02 23:25 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <20100802162158.0b0c6e70@nehalam>
On Tue, Aug 3, 2010 at 7:21 AM, Stephen Hemminger <shemminger@vyatta.com> wrote:
>
> It should be headroom. It is okay if the request is looking at PAD
> area, that is the callers problem. Just don't want wander off into
> into unallocated space.
>
> Anyway, I'll fix it in cls_u32.
>
FYI: act_pedit may have the same issue. Thanks.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* LOAN OFFER
From: P.M.L @ 2010-08-02 23:21 UTC (permalink / raw)
To: pmlender.com
We offer loan at cheap rate, they say opprtunity does not knock twice.But with our loan firm, you can get the cheapest loan at a low
percentage rate of 2% yearly from $5,000.00 Min. To $10 000 000.00 Max.Contact us via email if you are interested with the following details
NAME:
PHONE:
LOAN DURATION:
ADDRESS:
AMOUNT:
Private Fund Loan Inc
Mrs.Hannah Stone
^ permalink raw reply
* Re: [PATCH 1/4] net: check for reference outside of skb
From: Stephen Hemminger @ 2010-08-02 23:21 UTC (permalink / raw)
To: Changli Gao; +Cc: David Miller, netdev
In-Reply-To: <AANLkTi=8+xRJn_26740uKuWdgA=XvyB7-hgGT9dxjOXr@mail.gmail.com>
On Tue, 3 Aug 2010 07:11:14 +0800
Changli Gao <xiaosuo@gmail.com> wrote:
> On Tue, Aug 3, 2010 at 6:00 AM, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > It is legitimate for callers of skb_header_pointer to pass a negative
> > offset, but the resulting pointer should not go outside the valid
> > range of data in the skb.
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > --- a/include/linux/skbuff.h 2010-08-01 09:23:01.635121262 -0700
> > +++ b/include/linux/skbuff.h 2010-08-01 09:25:27.453901530 -0700
> > @@ -1853,6 +1853,9 @@ static inline void *skb_header_pointer(c
> > {
> > int hlen = skb_headlen(skb);
> >
> > + if (hlen + offset < 0)
> > + return NULL;
> > +
>
> It seems wrong. do you mean
>
> if (skb_headroom(hlen) + offset < 0)
>
> Nevertheless it is also wrong. skb_header_pointer doesn't know if the
> headroom is filled with valid data or not.
>
It should be headroom. It is okay if the request is looking at PAD
area, that is the callers problem. Just don't want wander off into
into unallocated space.
Anyway, I'll fix it in cls_u32.
^ permalink raw reply
* [PATCH net-next 7/9] cxgb4: fix wrong shift direction
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-7-git-send-email-dm@chelsio.com>
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/t4_hw.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/cxgb4/t4_hw.h b/drivers/net/cxgb4/t4_hw.h
index e875d09..10a0555 100644
--- a/drivers/net/cxgb4/t4_hw.h
+++ b/drivers/net/cxgb4/t4_hw.h
@@ -135,5 +135,5 @@ struct rsp_ctrl {
#define QINTR_CNT_EN 0x1
#define QINTR_TIMER_IDX(x) ((x) << 1)
-#define QINTR_TIMER_IDX_GET(x) (((x) << 1) & 0x7)
+#define QINTR_TIMER_IDX_GET(x) (((x) >> 1) & 0x7)
#endif /* __T4_HW_H */
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 9/9] cxgb4: update driver version
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-9-git-send-email-dm@chelsio.com>
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4_main.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index a4c4f52..c327527 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -67,7 +67,7 @@
#include "t4fw_api.h"
#include "l2t.h"
-#define DRV_VERSION "1.0.0-ko"
+#define DRV_VERSION "1.3.0-ko"
#define DRV_DESC "Chelsio T4 Network Driver"
/*
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 8/9] cxgb4: add new PCI IDs
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-8-git-send-email-dm@chelsio.com>
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4_main.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 5d5ea82..a4c4f52 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -175,6 +175,16 @@ enum {
static DEFINE_PCI_DEVICE_TABLE(cxgb4_pci_tbl) = {
CH_DEVICE(0xa000, 0), /* PE10K */
+ CH_DEVICE(0x4001, 0),
+ CH_DEVICE(0x4002, 0),
+ CH_DEVICE(0x4003, 0),
+ CH_DEVICE(0x4004, 0),
+ CH_DEVICE(0x4005, 0),
+ CH_DEVICE(0x4006, 0),
+ CH_DEVICE(0x4007, 0),
+ CH_DEVICE(0x4008, 0),
+ CH_DEVICE(0x4009, 0),
+ CH_DEVICE(0x400a, 0),
{ 0, }
};
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 6/9] cxgb4: support running the driver on PCI functions besides 0
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-6-git-send-email-dm@chelsio.com>
Add support for running the driver on any PCI function. Mostly this
entails replacing a constant 0 in a number of calls with the variable
function number.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4.h | 3 +-
drivers/net/cxgb4/cxgb4_main.c | 128 ++++++++++++++++++++++-----------------
drivers/net/cxgb4/sge.c | 38 +++++++-----
3 files changed, 97 insertions(+), 72 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4.h b/drivers/net/cxgb4/cxgb4.h
index 4769c1c..6e562c0 100644
--- a/drivers/net/cxgb4/cxgb4.h
+++ b/drivers/net/cxgb4/cxgb4.h
@@ -482,7 +482,8 @@ struct adapter {
struct pci_dev *pdev;
struct device *pdev_dev;
unsigned long registered_device_map;
- unsigned long flags;
+ unsigned int fn;
+ unsigned int flags;
const char *name;
int msg_enable;
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index e80d4a5..5d5ea82 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -171,10 +171,10 @@ enum {
NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP |\
NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
-#define CH_DEVICE(devid) { PCI_VDEVICE(CHELSIO, devid), 0 }
+#define CH_DEVICE(devid, data) { PCI_VDEVICE(CHELSIO, devid), (data) }
static DEFINE_PCI_DEVICE_TABLE(cxgb4_pci_tbl) = {
- CH_DEVICE(0xa000), /* PE10K */
+ CH_DEVICE(0xa000, 0), /* PE10K */
{ 0, }
};
@@ -314,12 +314,13 @@ static int set_addr_filters(const struct net_device *dev, bool sleep)
int uc_cnt = netdev_uc_count(dev);
int mc_cnt = netdev_mc_count(dev);
const struct port_info *pi = netdev_priv(dev);
+ unsigned int mb = pi->adapter->fn;
/* first do the secondary unicast addresses */
netdev_for_each_uc_addr(ha, dev) {
addr[naddr++] = ha->addr;
if (--uc_cnt == 0 || naddr >= ARRAY_SIZE(addr)) {
- ret = t4_alloc_mac_filt(pi->adapter, 0, pi->viid, free,
+ ret = t4_alloc_mac_filt(pi->adapter, mb, pi->viid, free,
naddr, addr, filt_idx, &uhash, sleep);
if (ret < 0)
return ret;
@@ -333,7 +334,7 @@ static int set_addr_filters(const struct net_device *dev, bool sleep)
netdev_for_each_mc_addr(ha, dev) {
addr[naddr++] = ha->addr;
if (--mc_cnt == 0 || naddr >= ARRAY_SIZE(addr)) {
- ret = t4_alloc_mac_filt(pi->adapter, 0, pi->viid, free,
+ ret = t4_alloc_mac_filt(pi->adapter, mb, pi->viid, free,
naddr, addr, filt_idx, &mhash, sleep);
if (ret < 0)
return ret;
@@ -343,7 +344,7 @@ static int set_addr_filters(const struct net_device *dev, bool sleep)
}
}
- return t4_set_addr_hash(pi->adapter, 0, pi->viid, uhash != 0,
+ return t4_set_addr_hash(pi->adapter, mb, pi->viid, uhash != 0,
uhash | mhash, sleep);
}
@@ -358,7 +359,7 @@ static int set_rxmode(struct net_device *dev, int mtu, bool sleep_ok)
ret = set_addr_filters(dev, sleep_ok);
if (ret == 0)
- ret = t4_set_rxmode(pi->adapter, 0, pi->viid, mtu,
+ ret = t4_set_rxmode(pi->adapter, pi->adapter->fn, pi->viid, mtu,
(dev->flags & IFF_PROMISC) ? 1 : 0,
(dev->flags & IFF_ALLMULTI) ? 1 : 0, 1, -1,
sleep_ok);
@@ -375,15 +376,16 @@ static int link_start(struct net_device *dev)
{
int ret;
struct port_info *pi = netdev_priv(dev);
+ unsigned int mb = pi->adapter->fn;
/*
* We do not set address filters and promiscuity here, the stack does
* that step explicitly.
*/
- ret = t4_set_rxmode(pi->adapter, 0, pi->viid, dev->mtu, -1, -1, -1,
+ ret = t4_set_rxmode(pi->adapter, mb, pi->viid, dev->mtu, -1, -1, -1,
pi->vlan_grp != NULL, true);
if (ret == 0) {
- ret = t4_change_mac(pi->adapter, 0, pi->viid,
+ ret = t4_change_mac(pi->adapter, mb, pi->viid,
pi->xact_addr_filt, dev->dev_addr, true,
true);
if (ret >= 0) {
@@ -392,9 +394,10 @@ static int link_start(struct net_device *dev)
}
}
if (ret == 0)
- ret = t4_link_start(pi->adapter, 0, pi->tx_chan, &pi->link_cfg);
+ ret = t4_link_start(pi->adapter, mb, pi->tx_chan,
+ &pi->link_cfg);
if (ret == 0)
- ret = t4_enable_vi(pi->adapter, 0, pi->viid, true, true);
+ ret = t4_enable_vi(pi->adapter, mb, pi->viid, true, true);
return ret;
}
@@ -618,8 +621,8 @@ static int write_rss(const struct port_info *pi, const u16 *queues)
for (i = 0; i < pi->rss_size; i++, queues++)
rss[i] = q[*queues].rspq.abs_id;
- err = t4_config_rss_range(pi->adapter, 0, pi->viid, 0, pi->rss_size,
- rss, pi->rss_size);
+ err = t4_config_rss_range(pi->adapter, pi->adapter->fn, pi->viid, 0,
+ pi->rss_size, rss, pi->rss_size);
kfree(rss);
return err;
}
@@ -1307,16 +1310,18 @@ static int restart_autoneg(struct net_device *dev)
return -EAGAIN;
if (p->link_cfg.autoneg != AUTONEG_ENABLE)
return -EINVAL;
- t4_restart_aneg(p->adapter, 0, p->tx_chan);
+ t4_restart_aneg(p->adapter, p->adapter->fn, p->tx_chan);
return 0;
}
static int identify_port(struct net_device *dev, u32 data)
{
+ struct adapter *adap = netdev2adap(dev);
+
if (data == 0)
data = 2; /* default to 2 seconds */
- return t4_identify_port(netdev2adap(dev), 0, netdev2pinfo(dev)->viid,
+ return t4_identify_port(adap, adap->fn, netdev2pinfo(dev)->viid,
data * 5);
}
@@ -1456,7 +1461,8 @@ static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
lc->autoneg = cmd->autoneg;
if (netif_running(dev))
- return t4_link_start(p->adapter, 0, p->tx_chan, lc);
+ return t4_link_start(p->adapter, p->adapter->fn, p->tx_chan,
+ lc);
return 0;
}
@@ -1488,7 +1494,8 @@ static int set_pauseparam(struct net_device *dev,
if (epause->tx_pause)
lc->requested_fc |= PAUSE_TX;
if (netif_running(dev))
- return t4_link_start(p->adapter, 0, p->tx_chan, lc);
+ return t4_link_start(p->adapter, p->adapter->fn, p->tx_chan,
+ lc);
return 0;
}
@@ -1620,7 +1627,8 @@ static int set_rxq_intr_params(struct adapter *adap, struct sge_rspq *q,
v = FW_PARAMS_MNEM(FW_PARAMS_MNEM_DMAQ) |
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DMAQ_IQ_INTCNTTHRESH) |
FW_PARAMS_PARAM_YZ(q->cntxt_id);
- err = t4_set_params(adap, 0, 0, 0, 1, &v, &new_idx);
+ err = t4_set_params(adap, adap->fn, adap->fn, 0, 1, &v,
+ &new_idx);
if (err)
return err;
}
@@ -2496,9 +2504,11 @@ static void uld_attach(struct adapter *adap, unsigned int uld)
lli.adapter_type = adap->params.rev;
lli.iscsi_iolen = MAXRXDATA_GET(t4_read_reg(adap, TP_PARA_REG2));
lli.udb_density = 1 << QUEUESPERPAGEPF0_GET(
- t4_read_reg(adap, SGE_EGRESS_QUEUES_PER_PAGE_PF));
+ t4_read_reg(adap, SGE_EGRESS_QUEUES_PER_PAGE_PF) >>
+ (adap->fn * 4));
lli.ucq_density = 1 << QUEUESPERPAGEPF0_GET(
- t4_read_reg(adap, SGE_INGRESS_QUEUES_PER_PAGE_PF));
+ t4_read_reg(adap, SGE_INGRESS_QUEUES_PER_PAGE_PF) >>
+ (adap->fn * 4));
lli.gts_reg = adap->regs + MYPF_REG(SGE_PF_GTS);
lli.db_reg = adap->regs + MYPF_REG(SGE_PF_KDOORBELL);
lli.fw_vers = adap->params.fw_vers;
@@ -2715,7 +2725,7 @@ static int cxgb_close(struct net_device *dev)
netif_tx_stop_all_queues(dev);
netif_carrier_off(dev);
- return t4_enable_vi(adapter, 0, pi->viid, false, false);
+ return t4_enable_vi(adapter, adapter->fn, pi->viid, false, false);
}
static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev,
@@ -2762,6 +2772,7 @@ static struct rtnl_link_stats64 *cxgb_get_stats(struct net_device *dev,
static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
{
+ unsigned int mbox;
int ret = 0, prtad, devad;
struct port_info *pi = netdev_priv(dev);
struct mii_ioctl_data *data = (struct mii_ioctl_data *)&req->ifr_data;
@@ -2784,11 +2795,12 @@ static int cxgb_ioctl(struct net_device *dev, struct ifreq *req, int cmd)
} else
return -EINVAL;
+ mbox = pi->adapter->fn;
if (cmd == SIOCGMIIREG)
- ret = t4_mdio_rd(pi->adapter, 0, prtad, devad,
+ ret = t4_mdio_rd(pi->adapter, mbox, prtad, devad,
data->reg_num, &data->val_out);
else
- ret = t4_mdio_wr(pi->adapter, 0, prtad, devad,
+ ret = t4_mdio_wr(pi->adapter, mbox, prtad, devad,
data->reg_num, data->val_in);
break;
default:
@@ -2810,8 +2822,8 @@ 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, -1,
- true);
+ ret = t4_set_rxmode(pi->adapter, pi->adapter->fn, pi->viid, new_mtu, -1,
+ -1, -1, -1, true);
if (!ret)
dev->mtu = new_mtu;
return ret;
@@ -2826,8 +2838,8 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
if (!is_valid_ether_addr(addr->sa_data))
return -EINVAL;
- ret = t4_change_mac(pi->adapter, 0, pi->viid, pi->xact_addr_filt,
- addr->sa_data, true, true);
+ ret = t4_change_mac(pi->adapter, pi->adapter->fn, pi->viid,
+ pi->xact_addr_filt, addr->sa_data, true, true);
if (ret < 0)
return ret;
@@ -2841,8 +2853,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_rxmode(pi->adapter, 0, pi->viid, -1, -1, -1, -1, grp != NULL,
- true);
+ t4_set_rxmode(pi->adapter, pi->adapter->fn, pi->viid, -1, -1, -1, -1,
+ grp != NULL, true);
}
#ifdef CONFIG_NET_POLL_CONTROLLER
@@ -2926,7 +2938,7 @@ static int adap_init1(struct adapter *adap, struct fw_caps_config_cmd *c)
c->op_to_write = htonl(FW_CMD_OP(FW_CAPS_CONFIG_CMD) |
FW_CMD_REQUEST | FW_CMD_READ);
c->retval_len16 = htonl(FW_LEN16(*c));
- ret = t4_wr_mbox(adap, 0, c, sizeof(*c), c);
+ ret = t4_wr_mbox(adap, adap->fn, c, sizeof(*c), c);
if (ret < 0)
return ret;
@@ -2942,36 +2954,33 @@ static int adap_init1(struct adapter *adap, struct fw_caps_config_cmd *c)
}
c->op_to_write = htonl(FW_CMD_OP(FW_CAPS_CONFIG_CMD) |
FW_CMD_REQUEST | FW_CMD_WRITE);
- ret = t4_wr_mbox(adap, 0, c, sizeof(*c), NULL);
+ ret = t4_wr_mbox(adap, adap->fn, c, sizeof(*c), NULL);
if (ret < 0)
return ret;
- ret = t4_config_glbl_rss(adap, 0,
+ ret = t4_config_glbl_rss(adap, adap->fn,
FW_RSS_GLB_CONFIG_CMD_MODE_BASICVIRTUAL,
FW_RSS_GLB_CONFIG_CMD_TNLMAPEN |
FW_RSS_GLB_CONFIG_CMD_TNLALLLKP);
if (ret < 0)
return ret;
- ret = t4_cfg_pfvf(adap, 0, 0, 0, MAX_EGRQ, 64, MAX_INGQ, 0, 0, 4,
- 0xf, 0xf, 16, FW_CMD_CAP_PF, FW_CMD_CAP_PF);
+ ret = t4_cfg_pfvf(adap, adap->fn, adap->fn, 0, MAX_EGRQ, 64, MAX_INGQ,
+ 0, 0, 4, 0xf, 0xf, 16, FW_CMD_CAP_PF, FW_CMD_CAP_PF);
if (ret < 0)
return ret;
t4_sge_init(adap);
- /* get basic stuff going */
- ret = t4_early_init(adap, 0);
- if (ret < 0)
- return ret;
-
/* tweak some settings */
t4_write_reg(adap, TP_SHIFT_CNT, 0x64f8849);
t4_write_reg(adap, ULP_RX_TDDP_PSZ, HPZ0(PAGE_SHIFT - 12));
t4_write_reg(adap, TP_PIO_ADDR, TP_INGRESS_CONFIG);
v = t4_read_reg(adap, TP_PIO_DATA);
t4_write_reg(adap, TP_PIO_DATA, v & ~CSUM_HAS_PSEUDO_HDR);
- return 0;
+
+ /* get basic stuff going */
+ return t4_early_init(adap, adap->fn);
}
/*
@@ -2999,7 +3008,7 @@ static int adap_init0(struct adapter *adap)
return ret;
/* contact FW, request master */
- ret = t4_fw_hello(adap, 0, 0, MASTER_MUST, &state);
+ ret = t4_fw_hello(adap, adap->fn, adap->fn, MASTER_MUST, &state);
if (ret < 0) {
dev_err(adap->pdev_dev, "could not connect to FW, error %d\n",
ret);
@@ -3007,7 +3016,7 @@ static int adap_init0(struct adapter *adap)
}
/* reset device */
- ret = t4_fw_reset(adap, 0, PIORSTMODE | PIORST);
+ ret = t4_fw_reset(adap, adap->fn, PIORSTMODE | PIORST);
if (ret < 0)
goto bye;
@@ -3023,7 +3032,7 @@ static int adap_init0(struct adapter *adap)
FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_##param))
params[0] = FW_PARAM_DEV(CCLK);
- ret = t4_query_params(adap, 0, 0, 0, 1, params, val);
+ ret = t4_query_params(adap, adap->fn, adap->fn, 0, 1, params, val);
if (ret < 0)
goto bye;
adap->params.vpd.cclk = val[0];
@@ -3034,14 +3043,15 @@ static int adap_init0(struct adapter *adap)
#define FW_PARAM_PFVF(param) \
(FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) | \
- FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param))
+ FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_##param) | \
+ FW_PARAMS_PARAM_Y(adap->fn))
params[0] = FW_PARAM_DEV(PORTVEC);
params[1] = FW_PARAM_PFVF(L2T_START);
params[2] = FW_PARAM_PFVF(L2T_END);
params[3] = FW_PARAM_PFVF(FILTER_START);
params[4] = FW_PARAM_PFVF(FILTER_END);
- ret = t4_query_params(adap, 0, 0, 0, 5, params, val);
+ ret = t4_query_params(adap, adap->fn, adap->fn, 0, 5, params, val);
if (ret < 0)
goto bye;
port_vec = val[0];
@@ -3056,7 +3066,8 @@ static int adap_init0(struct adapter *adap)
params[3] = FW_PARAM_PFVF(TDDP_START);
params[4] = FW_PARAM_PFVF(TDDP_END);
params[5] = FW_PARAM_DEV(FLOWC_BUFFIFO_SZ);
- ret = t4_query_params(adap, 0, 0, 0, 6, params, val);
+ ret = t4_query_params(adap, adap->fn, adap->fn, 0, 6, params,
+ val);
if (ret < 0)
goto bye;
adap->tids.ntids = val[0];
@@ -3075,7 +3086,8 @@ static int adap_init0(struct adapter *adap)
params[3] = FW_PARAM_PFVF(RQ_END);
params[4] = FW_PARAM_PFVF(PBL_START);
params[5] = FW_PARAM_PFVF(PBL_END);
- ret = t4_query_params(adap, 0, 0, 0, 6, params, val);
+ ret = t4_query_params(adap, adap->fn, adap->fn, 0, 6, params,
+ val);
if (ret < 0)
goto bye;
adap->vres.stag.start = val[0];
@@ -3091,7 +3103,8 @@ static int adap_init0(struct adapter *adap)
params[3] = FW_PARAM_PFVF(CQ_END);
params[4] = FW_PARAM_PFVF(OCQ_START);
params[5] = FW_PARAM_PFVF(OCQ_END);
- ret = t4_query_params(adap, 0, 0, 0, 6, params, val);
+ ret = t4_query_params(adap, adap->fn, adap->fn, 0, 6, params,
+ val);
if (ret < 0)
goto bye;
adap->vres.qp.start = val[0];
@@ -3104,7 +3117,8 @@ static int adap_init0(struct adapter *adap)
if (c.iscsicaps) {
params[0] = FW_PARAM_PFVF(ISCSI_START);
params[1] = FW_PARAM_PFVF(ISCSI_END);
- ret = t4_query_params(adap, 0, 0, 0, 2, params, val);
+ ret = t4_query_params(adap, adap->fn, adap->fn, 0, 2, params,
+ val);
if (ret < 0)
goto bye;
adap->vres.iscsi.start = val[0];
@@ -3142,7 +3156,7 @@ static int adap_init0(struct adapter *adap)
/* VF numbering starts at 1! */
for (vf = 1; vf <= num_vf[pf]; vf++) {
- ret = t4_cfg_pfvf(adap, 0, pf, vf,
+ ret = t4_cfg_pfvf(adap, adap->fn, pf, vf,
VFRES_NEQ, VFRES_NETHCTRL,
VFRES_NIQFLINT, VFRES_NIQ,
VFRES_TC, VFRES_NVI,
@@ -3168,7 +3182,7 @@ static int adap_init0(struct adapter *adap)
* commands.
*/
bye: if (ret != -ETIMEDOUT && ret != -EIO)
- t4_fw_bye(adap, 0);
+ t4_fw_bye(adap, adap->fn);
return ret;
}
@@ -3224,7 +3238,7 @@ static pci_ers_result_t eeh_slot_reset(struct pci_dev *pdev)
if (t4_wait_dev_ready(adap) < 0)
return PCI_ERS_RESULT_DISCONNECT;
- if (t4_fw_hello(adap, 0, 0, MASTER_MUST, NULL))
+ if (t4_fw_hello(adap, adap->fn, adap->fn, MASTER_MUST, NULL))
return PCI_ERS_RESULT_DISCONNECT;
adap->flags |= FW_OK;
if (adap_init1(adap, &c))
@@ -3233,7 +3247,8 @@ static pci_ers_result_t eeh_slot_reset(struct pci_dev *pdev)
for_each_port(adap, i) {
struct port_info *p = adap2pinfo(adap, i);
- ret = t4_alloc_vi(adap, 0, p->tx_chan, 0, 0, 1, NULL, NULL);
+ ret = t4_alloc_vi(adap, adap->fn, p->tx_chan, adap->fn, 0, 1,
+ NULL, NULL);
if (ret < 0)
return PCI_ERS_RESULT_DISCONNECT;
p->viid = ret;
@@ -3538,7 +3553,7 @@ static void free_some_resources(struct adapter *adapter)
free_netdev(adapter->port[i]);
}
if (adapter->flags & FW_OK)
- t4_fw_bye(adapter, 0);
+ t4_fw_bye(adapter, adapter->fn);
}
#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
@@ -3561,9 +3576,9 @@ static int __devinit init_one(struct pci_dev *pdev,
return err;
}
- /* We control everything through PF 0 */
+ /* We control everything through one PF */
func = PCI_FUNC(pdev->devfn);
- if (func > 0) {
+ if (func != ent->driver_data) {
pci_save_state(pdev); /* to restore SR-IOV later */
goto sriov;
}
@@ -3609,6 +3624,7 @@ static int __devinit init_one(struct pci_dev *pdev,
adapter->pdev = pdev;
adapter->pdev_dev = &pdev->dev;
+ adapter->fn = func;
adapter->name = pci_name(pdev);
adapter->msg_enable = dflt_msg_enable;
memset(adapter->chan_map, 0xff, sizeof(adapter->chan_map));
@@ -3660,7 +3676,7 @@ static int __devinit init_one(struct pci_dev *pdev,
pci_set_drvdata(pdev, adapter);
if (adapter->flags & FW_OK) {
- err = t4_port_init(adapter, 0, 0, 0);
+ err = t4_port_init(adapter, func, func, 0);
if (err)
goto out_free_dev;
}
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 5cacfc7..bf38cfc 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -1999,7 +1999,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
memset(&c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP(FW_IQ_CMD) | FW_CMD_REQUEST |
FW_CMD_WRITE | FW_CMD_EXEC |
- FW_IQ_CMD_PFN(0) | FW_IQ_CMD_VFN(0));
+ FW_IQ_CMD_PFN(adap->fn) | FW_IQ_CMD_VFN(0));
c.alloc_to_len16 = htonl(FW_IQ_CMD_ALLOC | FW_IQ_CMD_IQSTART(1) |
FW_LEN16(c));
c.type_to_iqandstindex = htonl(FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) |
@@ -2031,7 +2031,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq,
c.fl0addr = cpu_to_be64(fl->addr);
}
- ret = t4_wr_mbox(adap, 0, &c, sizeof(c), &c);
+ ret = t4_wr_mbox(adap, adap->fn, &c, sizeof(c), &c);
if (ret)
goto err;
@@ -2110,7 +2110,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
memset(&c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP(FW_EQ_ETH_CMD) | FW_CMD_REQUEST |
FW_CMD_WRITE | FW_CMD_EXEC |
- FW_EQ_ETH_CMD_PFN(0) | FW_EQ_ETH_CMD_VFN(0));
+ FW_EQ_ETH_CMD_PFN(adap->fn) | FW_EQ_ETH_CMD_VFN(0));
c.alloc_to_len16 = htonl(FW_EQ_ETH_CMD_ALLOC |
FW_EQ_ETH_CMD_EQSTART | FW_LEN16(c));
c.viid_pkd = htonl(FW_EQ_ETH_CMD_VIID(pi->viid));
@@ -2123,7 +2123,7 @@ int t4_sge_alloc_eth_txq(struct adapter *adap, struct sge_eth_txq *txq,
FW_EQ_ETH_CMD_EQSIZE(nentries));
c.eqaddr = cpu_to_be64(txq->q.phys_addr);
- ret = t4_wr_mbox(adap, 0, &c, sizeof(c), &c);
+ ret = t4_wr_mbox(adap, adap->fn, &c, sizeof(c), &c);
if (ret) {
kfree(txq->q.sdesc);
txq->q.sdesc = NULL;
@@ -2160,7 +2160,8 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
c.op_to_vfn = htonl(FW_CMD_OP(FW_EQ_CTRL_CMD) | FW_CMD_REQUEST |
FW_CMD_WRITE | FW_CMD_EXEC |
- FW_EQ_CTRL_CMD_PFN(0) | FW_EQ_CTRL_CMD_VFN(0));
+ FW_EQ_CTRL_CMD_PFN(adap->fn) |
+ FW_EQ_CTRL_CMD_VFN(0));
c.alloc_to_len16 = htonl(FW_EQ_CTRL_CMD_ALLOC |
FW_EQ_CTRL_CMD_EQSTART | FW_LEN16(c));
c.cmpliqid_eqid = htonl(FW_EQ_CTRL_CMD_CMPLIQID(cmplqid));
@@ -2174,7 +2175,7 @@ int t4_sge_alloc_ctrl_txq(struct adapter *adap, struct sge_ctrl_txq *txq,
FW_EQ_CTRL_CMD_EQSIZE(nentries));
c.eqaddr = cpu_to_be64(txq->q.phys_addr);
- ret = t4_wr_mbox(adap, 0, &c, sizeof(c), &c);
+ ret = t4_wr_mbox(adap, adap->fn, &c, sizeof(c), &c);
if (ret) {
dma_free_coherent(adap->pdev_dev,
nentries * sizeof(struct tx_desc),
@@ -2210,7 +2211,8 @@ int t4_sge_alloc_ofld_txq(struct adapter *adap, struct sge_ofld_txq *txq,
memset(&c, 0, sizeof(c));
c.op_to_vfn = htonl(FW_CMD_OP(FW_EQ_OFLD_CMD) | FW_CMD_REQUEST |
FW_CMD_WRITE | FW_CMD_EXEC |
- FW_EQ_OFLD_CMD_PFN(0) | FW_EQ_OFLD_CMD_VFN(0));
+ FW_EQ_OFLD_CMD_PFN(adap->fn) |
+ FW_EQ_OFLD_CMD_VFN(0));
c.alloc_to_len16 = htonl(FW_EQ_OFLD_CMD_ALLOC |
FW_EQ_OFLD_CMD_EQSTART | FW_LEN16(c));
c.fetchszm_to_iqid = htonl(FW_EQ_OFLD_CMD_HOSTFCMODE(2) |
@@ -2222,7 +2224,7 @@ int t4_sge_alloc_ofld_txq(struct adapter *adap, struct sge_ofld_txq *txq,
FW_EQ_OFLD_CMD_EQSIZE(nentries));
c.eqaddr = cpu_to_be64(txq->q.phys_addr);
- ret = t4_wr_mbox(adap, 0, &c, sizeof(c), &c);
+ ret = t4_wr_mbox(adap, adap->fn, &c, sizeof(c), &c);
if (ret) {
kfree(txq->q.sdesc);
txq->q.sdesc = NULL;
@@ -2258,8 +2260,8 @@ static void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq,
unsigned int fl_id = fl ? fl->cntxt_id : 0xffff;
adap->sge.ingr_map[rq->cntxt_id] = NULL;
- t4_iq_free(adap, 0, 0, 0, FW_IQ_TYPE_FL_INT_CAP, rq->cntxt_id, fl_id,
- 0xffff);
+ t4_iq_free(adap, adap->fn, adap->fn, 0, FW_IQ_TYPE_FL_INT_CAP,
+ rq->cntxt_id, fl_id, 0xffff);
dma_free_coherent(adap->pdev_dev, (rq->size + 1) * rq->iqe_len,
rq->desc, rq->phys_addr);
netif_napi_del(&rq->napi);
@@ -2296,7 +2298,8 @@ void t4_free_sge_resources(struct adapter *adap)
if (eq->rspq.desc)
free_rspq_fl(adap, &eq->rspq, &eq->fl);
if (etq->q.desc) {
- t4_eth_eq_free(adap, 0, 0, 0, etq->q.cntxt_id);
+ t4_eth_eq_free(adap, adap->fn, adap->fn, 0,
+ etq->q.cntxt_id);
free_tx_desc(adap, &etq->q, etq->q.in_use, true);
kfree(etq->q.sdesc);
free_txq(adap, &etq->q);
@@ -2319,7 +2322,8 @@ void t4_free_sge_resources(struct adapter *adap)
if (q->q.desc) {
tasklet_kill(&q->qresume_tsk);
- t4_ofld_eq_free(adap, 0, 0, 0, q->q.cntxt_id);
+ t4_ofld_eq_free(adap, adap->fn, adap->fn, 0,
+ q->q.cntxt_id);
free_tx_desc(adap, &q->q, q->q.in_use, false);
kfree(q->q.sdesc);
__skb_queue_purge(&q->sendq);
@@ -2333,7 +2337,8 @@ void t4_free_sge_resources(struct adapter *adap)
if (cq->q.desc) {
tasklet_kill(&cq->qresume_tsk);
- t4_ctrl_eq_free(adap, 0, 0, 0, cq->q.cntxt_id);
+ t4_ctrl_eq_free(adap, adap->fn, adap->fn, 0,
+ cq->q.cntxt_id);
__skb_queue_purge(&cq->sendq);
free_txq(adap, &cq->q);
}
@@ -2401,6 +2406,7 @@ void t4_sge_stop(struct adapter *adap)
*/
void t4_sge_init(struct adapter *adap)
{
+ unsigned int i, v;
struct sge *s = &adap->sge;
unsigned int fl_align_log = ilog2(FL_ALIGN);
@@ -2409,8 +2415,10 @@ void t4_sge_init(struct adapter *adap)
INGPADBOUNDARY(fl_align_log - 5) | PKTSHIFT(2) |
RXPKTCPLMODE |
(STAT_LEN == 128 ? EGRSTATUSPAGESIZE : 0));
- t4_set_reg_field(adap, SGE_HOST_PAGE_SIZE, HOSTPAGESIZEPF0_MASK,
- HOSTPAGESIZEPF0(PAGE_SHIFT - 10));
+
+ for (i = v = 0; i < 32; i += 4)
+ v |= (PAGE_SHIFT - 10) << i;
+ t4_write_reg(adap, SGE_HOST_PAGE_SIZE, v);
t4_write_reg(adap, SGE_FL_BUFFER_SIZE0, PAGE_SIZE);
#if FL_PG_ORDER > 0
t4_write_reg(adap, SGE_FL_BUFFER_SIZE1, PAGE_SIZE << FL_PG_ORDER);
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 5/9] cxgb4: advertise NETIF_F_TSO_ECN
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-5-git-send-email-dm@chelsio.com>
The device supports TSO+ECN.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4_main.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 47e8936..e80d4a5 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -1808,12 +1808,14 @@ static int set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
return err;
}
+#define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
+
static int set_tso(struct net_device *dev, u32 value)
{
if (value)
- dev->features |= NETIF_F_TSO | NETIF_F_TSO6;
+ dev->features |= TSO_FLAGS;
else
- dev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
+ dev->features &= ~TSO_FLAGS;
return 0;
}
@@ -3539,7 +3541,7 @@ static void free_some_resources(struct adapter *adapter)
t4_fw_bye(adapter, 0);
}
-#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO | NETIF_F_TSO6 |\
+#define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
static int __devinit init_one(struct pci_dev *pdev,
@@ -3645,7 +3647,7 @@ static int __devinit init_one(struct pci_dev *pdev,
netif_tx_stop_all_queues(netdev);
netdev->irq = pdev->irq;
- netdev->features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6;
+ netdev->features |= NETIF_F_SG | TSO_FLAGS;
netdev->features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
netdev->features |= NETIF_F_GRO | NETIF_F_RXHASH | highdma;
netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 1/9] cxgb4: disable an interrupt that is neither used nor serviced
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-1-git-send-email-dm@chelsio.com>
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/t4_hw.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c
index ab46797..9e1a4b4 100644
--- a/drivers/net/cxgb4/t4_hw.c
+++ b/drivers/net/cxgb4/t4_hw.c
@@ -1444,7 +1444,7 @@ static void pl_intr_handler(struct adapter *adap)
t4_fatal_err(adap);
}
-#define PF_INTR_MASK (PFSW | PFCIM)
+#define PF_INTR_MASK (PFSW)
#define GLBL_INTR_MASK (CIM | MPS | PL | PCIE | MC | EDC0 | \
EDC1 | LE | TP | MA | PM_TX | PM_RX | ULP_RX | \
CPL_SWITCH | SGE | ULP_TX)
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 2/9] cxgb4: don't offload Rx checksums for IPv6 fragments
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-2-git-send-email-dm@chelsio.com>
The checksum provided by the device doesn't include the L3 headers,
as IPv6 expects.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/sge.c | 7 ++++---
drivers/net/cxgb4/t4_msg.h | 2 ++
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 4388f72..304302a 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -1593,14 +1593,15 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp,
if (csum_ok && (pi->rx_offload & RX_CSO) &&
(pkt->l2info & htonl(RXF_UDP | RXF_TCP))) {
- if (!pkt->ip_frag)
+ if (!pkt->ip_frag) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
- else {
+ rxq->stats.rx_cso++;
+ } else if (pkt->l2info & htonl(RXF_IP)) {
__sum16 c = (__force __sum16)pkt->csum;
skb->csum = csum_unfold(c);
skb->ip_summed = CHECKSUM_COMPLETE;
+ rxq->stats.rx_cso++;
}
- rxq->stats.rx_cso++;
} else
skb->ip_summed = CHECKSUM_NONE;
diff --git a/drivers/net/cxgb4/t4_msg.h b/drivers/net/cxgb4/t4_msg.h
index 623932b..a550d0c 100644
--- a/drivers/net/cxgb4/t4_msg.h
+++ b/drivers/net/cxgb4/t4_msg.h
@@ -529,6 +529,8 @@ struct cpl_rx_pkt {
__be32 l2info;
#define RXF_UDP (1 << 22)
#define RXF_TCP (1 << 23)
+#define RXF_IP (1 << 24)
+#define RXF_IP6 (1 << 25)
__be16 hdr_len;
__be16 err_vec;
};
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 4/9] cxgb4: get on-chip queue info from FW and create a memory window for them
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-4-git-send-email-dm@chelsio.com>
Get info about the availability of Tx on-chip queues from FW and if they
are supported set up a memory window for them. iw_cxgb4 will be using them.
Move the existing window setup later in the init sequence, after we have
collected the new info.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/cxgb4_main.c | 24 ++++++++++++++++++++++--
drivers/net/cxgb4/cxgb4_uld.h | 4 ++++
drivers/net/cxgb4/t4_regs.h | 1 +
drivers/net/cxgb4/t4fw_api.h | 2 ++
4 files changed, 29 insertions(+), 2 deletions(-)
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 0af6d67..47e8936 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -2897,6 +2897,21 @@ static void setup_memwin(struct adapter *adap)
t4_write_reg(adap, PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, 2),
(bar0 + MEMWIN2_BASE) | BIR(0) |
WINDOW(ilog2(MEMWIN2_APERTURE) - 10));
+ if (adap->vres.ocq.size) {
+ unsigned int start, sz_kb;
+
+ start = pci_resource_start(adap->pdev, 2) +
+ OCQ_WIN_OFFSET(adap->pdev, &adap->vres);
+ sz_kb = roundup_pow_of_two(adap->vres.ocq.size) >> 10;
+ t4_write_reg(adap,
+ PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, 3),
+ start | BIR(1) | WINDOW(ilog2(sz_kb)));
+ t4_write_reg(adap,
+ PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_OFFSET, 3),
+ adap->vres.ocq.start);
+ t4_read_reg(adap,
+ PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_OFFSET, 3));
+ }
}
static int adap_init1(struct adapter *adap, struct fw_caps_config_cmd *c)
@@ -2954,7 +2969,6 @@ static int adap_init1(struct adapter *adap, struct fw_caps_config_cmd *c)
t4_write_reg(adap, TP_PIO_ADDR, TP_INGRESS_CONFIG);
v = t4_read_reg(adap, TP_PIO_DATA);
t4_write_reg(adap, TP_PIO_DATA, v & ~CSUM_HAS_PSEUDO_HDR);
- setup_memwin(adap);
return 0;
}
@@ -3073,13 +3087,17 @@ static int adap_init0(struct adapter *adap)
params[1] = FW_PARAM_PFVF(SQRQ_END);
params[2] = FW_PARAM_PFVF(CQ_START);
params[3] = FW_PARAM_PFVF(CQ_END);
- ret = t4_query_params(adap, 0, 0, 0, 4, params, val);
+ params[4] = FW_PARAM_PFVF(OCQ_START);
+ params[5] = FW_PARAM_PFVF(OCQ_END);
+ ret = t4_query_params(adap, 0, 0, 0, 6, params, val);
if (ret < 0)
goto bye;
adap->vres.qp.start = val[0];
adap->vres.qp.size = val[1] - val[0] + 1;
adap->vres.cq.start = val[2];
adap->vres.cq.size = val[3] - val[2] + 1;
+ adap->vres.ocq.start = val[4];
+ adap->vres.ocq.size = val[5] - val[4] + 1;
}
if (c.iscsicaps) {
params[0] = FW_PARAM_PFVF(ISCSI_START);
@@ -3139,6 +3157,7 @@ static int adap_init0(struct adapter *adap)
}
#endif
+ setup_memwin(adap);
return 0;
/*
@@ -3221,6 +3240,7 @@ static pci_ers_result_t eeh_slot_reset(struct pci_dev *pdev)
t4_load_mtus(adap, adap->params.mtus, adap->params.a_wnd,
adap->params.b_wnd);
+ setup_memwin(adap);
if (cxgb_up(adap))
return PCI_ERS_RESULT_DISCONNECT;
return PCI_ERS_RESULT_RECOVERED;
diff --git a/drivers/net/cxgb4/cxgb4_uld.h b/drivers/net/cxgb4/cxgb4_uld.h
index 0dc0866..85d74e7 100644
--- a/drivers/net/cxgb4/cxgb4_uld.h
+++ b/drivers/net/cxgb4/cxgb4_uld.h
@@ -187,8 +187,12 @@ struct cxgb4_virt_res { /* virtualized HW resources */
struct cxgb4_range pbl;
struct cxgb4_range qp;
struct cxgb4_range cq;
+ struct cxgb4_range ocq;
};
+#define OCQ_WIN_OFFSET(pdev, vres) \
+ (pci_resource_len((pdev), 2) - roundup_pow_of_two((vres)->ocq.size))
+
/*
* Block of information the LLD provides to ULDs attaching to a device.
*/
diff --git a/drivers/net/cxgb4/t4_regs.h b/drivers/net/cxgb4/t4_regs.h
index bf21c14..0adc5bc 100644
--- a/drivers/net/cxgb4/t4_regs.h
+++ b/drivers/net/cxgb4/t4_regs.h
@@ -232,6 +232,7 @@
#define WINDOW_MASK 0x000000ffU
#define WINDOW_SHIFT 0
#define WINDOW(x) ((x) << WINDOW_SHIFT)
+#define PCIE_MEM_ACCESS_OFFSET 0x306c
#define PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS 0x5908
#define RNPP 0x80000000U
diff --git a/drivers/net/cxgb4/t4fw_api.h b/drivers/net/cxgb4/t4fw_api.h
index ca45df8..0969f2f 100644
--- a/drivers/net/cxgb4/t4fw_api.h
+++ b/drivers/net/cxgb4/t4fw_api.h
@@ -485,6 +485,8 @@ enum fw_params_param_pfvf {
FW_PARAMS_PARAM_PFVF_SCHEDCLASS_ETH = 0x20,
FW_PARAMS_PARAM_PFVF_VIID = 0x24,
FW_PARAMS_PARAM_PFVF_CPMASK = 0x25,
+ FW_PARAMS_PARAM_PFVF_OCQ_START = 0x26,
+ FW_PARAMS_PARAM_PFVF_OCQ_END = 0x27,
};
/*
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 3/9] cxgb4: fix TSO descriptors
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev; +Cc: Dimitris Michailidis
In-Reply-To: <1280791164-14181-3-git-send-email-dm@chelsio.com>
Commit 1704d74894912b8ecc3e95cecd7bde336a0b1bf2 ("cxgb4vf: small changes
to message processing structures/macros") was incomplete and causes cxgb4
to write bad TSO descriptors. Fix that up by reverting the offending part
of that commit and adjusting field accesses now that they are one level
deeper.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
drivers/net/cxgb4/sge.c | 22 +++++++++++-----------
1 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/net/cxgb4/sge.c b/drivers/net/cxgb4/sge.c
index 304302a..5cacfc7 100644
--- a/drivers/net/cxgb4/sge.c
+++ b/drivers/net/cxgb4/sge.c
@@ -931,23 +931,23 @@ out_free: dev_kfree_skb(skb);
ssi = skb_shinfo(skb);
if (ssi->gso_size) {
- struct cpl_tx_pkt_lso_core *lso = (void *)(wr + 1);
+ struct cpl_tx_pkt_lso *lso = (void *)wr;
bool v6 = (ssi->gso_type & SKB_GSO_TCPV6) != 0;
int l3hdr_len = skb_network_header_len(skb);
int eth_xtra_len = skb_network_offset(skb) - ETH_HLEN;
wr->op_immdlen = htonl(FW_WR_OP(FW_ETH_TX_PKT_WR) |
FW_WR_IMMDLEN(sizeof(*lso)));
- lso->lso_ctrl = htonl(LSO_OPCODE(CPL_TX_PKT_LSO) |
- LSO_FIRST_SLICE | LSO_LAST_SLICE |
- LSO_IPV6(v6) |
- LSO_ETHHDR_LEN(eth_xtra_len / 4) |
- LSO_IPHDR_LEN(l3hdr_len / 4) |
- LSO_TCPHDR_LEN(tcp_hdr(skb)->doff));
- lso->ipid_ofst = htons(0);
- lso->mss = htons(ssi->gso_size);
- lso->seqno_offset = htonl(0);
- lso->len = htonl(skb->len);
+ lso->c.lso_ctrl = htonl(LSO_OPCODE(CPL_TX_PKT_LSO) |
+ LSO_FIRST_SLICE | LSO_LAST_SLICE |
+ LSO_IPV6(v6) |
+ LSO_ETHHDR_LEN(eth_xtra_len / 4) |
+ LSO_IPHDR_LEN(l3hdr_len / 4) |
+ LSO_TCPHDR_LEN(tcp_hdr(skb)->doff));
+ lso->c.ipid_ofst = htons(0);
+ lso->c.mss = htons(ssi->gso_size);
+ lso->c.seqno_offset = htonl(0);
+ lso->c.len = htonl(skb->len);
cpl = (void *)(lso + 1);
cntrl = TXPKT_CSUM_TYPE(v6 ? TX_CSUM_TCPIP6 : TX_CSUM_TCPIP) |
TXPKT_IPHDR_LEN(l3hdr_len) |
--
1.5.4
^ permalink raw reply related
* [PATCH net-next 0/9] cxgb4 updates
From: Dimitris Michailidis @ 2010-08-02 23:19 UTC (permalink / raw)
To: netdev
Following are 9 patches for cxgb4. A few small fixes, new PCI ids, and a
couple features.
drivers/net/cxgb4/cxgb4.h | 3 +-
drivers/net/cxgb4/cxgb4_main.c | 172 +++++++++++++++++++++++++--------------
drivers/net/cxgb4/cxgb4_uld.h | 4 +
drivers/net/cxgb4/sge.c | 67 +++++++++-------
drivers/net/cxgb4/t4_hw.c | 2 +-
drivers/net/cxgb4/t4_hw.h | 2 +-
drivers/net/cxgb4/t4_msg.h | 2 +
drivers/net/cxgb4/t4_regs.h | 1 +
drivers/net/cxgb4/t4fw_api.h | 2 +
9 files changed, 161 insertions(+), 94 deletions(-)
^ permalink raw reply
* Re: [PATCH 1/4] net: check for reference outside of skb
From: Changli Gao @ 2010-08-02 23:11 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David Miller, netdev
In-Reply-To: <20100802220113.557212477@vyatta.com>
On Tue, Aug 3, 2010 at 6:00 AM, Stephen Hemminger <shemminger@vyatta.com> wrote:
> It is legitimate for callers of skb_header_pointer to pass a negative
> offset, but the resulting pointer should not go outside the valid
> range of data in the skb.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/include/linux/skbuff.h 2010-08-01 09:23:01.635121262 -0700
> +++ b/include/linux/skbuff.h 2010-08-01 09:25:27.453901530 -0700
> @@ -1853,6 +1853,9 @@ static inline void *skb_header_pointer(c
> {
> int hlen = skb_headlen(skb);
>
> + if (hlen + offset < 0)
> + return NULL;
> +
It seems wrong. do you mean
if (skb_headroom(hlen) + offset < 0)
Nevertheless it is also wrong. skb_header_pointer doesn't know if the
headroom is filled with valid data or not.
Thanks.
> if (hlen - offset >= len)
> return skb->data + offset;
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [patch] hp100: unmap memory on error path
From: David Miller @ 2010-08-02 23:08 UTC (permalink / raw)
To: error27; +Cc: perex, jpirko, shemminger, netdev, kernel-janitors
In-Reply-To: <20100730090604.GY26313@bicker>
From: Dan Carpenter <error27@gmail.com>
Date: Fri, 30 Jul 2010 11:06:04 +0200
> There was an error path where "mem_ptr_virt" didn't get unmapped.
>
> Signed-off-by: Dan Carpenter <error27@gmail.com>
Applied, thanks Dan.
^ permalink raw reply
* [PATCH 0/4] u32 classifier fixes
From: Stephen Hemminger @ 2010-08-02 22:00 UTC (permalink / raw)
To: David Miller; +Cc: netdev
One regression fix, and some minor stuff for u32 classifier
^ permalink raw reply
* Re: [PATCH] Tulip: don't initialize SBE xT3E3 WAN ports.
From: David Miller @ 2010-08-02 23:03 UTC (permalink / raw)
To: khc; +Cc: netdev
In-Reply-To: <m31vakc7yb.fsf@intrepid.localdomain>
From: Krzysztof Halasa <khc@pm.waw.pl>
Date: Sat, 31 Jul 2010 11:32:44 +0200
> SBE 2T3E3 cards use DECchips 21143 but they need a different driver.
> Don't even try to use a normal tulip driver with them.
>
> Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH net-next] drivers/net/wan/farsync.c: Use standard pr_<level>
From: David Miller @ 2010-08-02 23:01 UTC (permalink / raw)
To: joe; +Cc: kevin.curtis, netdev, linux-kernel
In-Reply-To: <1280719217.1752.6.camel@Joe-Laptop.home>
From: Joe Perches <joe@perches.com>
Date: Sun, 01 Aug 2010 20:20:17 -0700
> Remove locally defined equivalents
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks Joe.
^ permalink raw reply
* Re: [PATCH 4/4] u32: use get_unaligned_be32
From: Changli Gao @ 2010-08-02 23:01 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Stephen Hemminger, David Miller, netdev
In-Reply-To: <1280789717.5914.1.camel@achroite.uk.solarflarecom.com>
On Tue, Aug 3, 2010 at 6:55 AM, Ben Hutchings <bhutchings@solarflare.com> wrote:
> On Mon, 2010-08-02 at 15:45 -0700, Stephen Hemminger wrote:
>> On Tue, 3 Aug 2010 06:34:59 +0800
>> Changli Gao <xiaosuo@gmail.com> wrote:
>>
>> > On Tue, Aug 3, 2010 at 6:00 AM, Stephen Hemminger <shemminger@vyatta.com> wrote:
>> > > U32 classifier reads data from packet at a offset passed in from
>> > > user space. The offset should be aligned, but it is unsafe practice
>> > > to depend on values from userspace.
>> > >
>> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>> > >
>> > > --- a/net/sched/cls_u32.c 2010-08-01 11:21:06.945820852 -0700
>> > > +++ b/net/sched/cls_u32.c 2010-08-01 11:24:55.257793848 -0700
>> > > @@ -41,6 +41,7 @@
>> > > #include <net/netlink.h>
>> > > #include <net/act_api.h>
>> > > #include <net/pkt_cls.h>
>> > > +#include <asm/unaligned.h>
>> > >
>> > > struct tc_u_knode
>> > > {
>> > > @@ -140,7 +141,7 @@ next_knode:
>> > > data = skb_header_pointer(skb, toff, 4, &_data);
>> > > if (!data)
>> > > goto out;
>> > > - if ((*data ^ key->val) & key->mask) {
>> > > + if ((get_unaligned_be32(data) ^ key->val) & key->mask) {
>> >
>> > be32()? I think it may break configuration.
>>
>> The data pointer is be32 * already.
>
> But get_unaligned_be32() converts to native byte order.
>
__be32 does't mean the dereferenced data will be converted to be32. It
is just a notation.
typedef __u16 __bitwise __le16;
typedef __u16 __bitwise __be16;
typedef __u32 __bitwise __le32;
typedef __u32 __bitwise __be32;
typedef __u64 __bitwise __le64;
typedef __u64 __bitwise __be64;
__be* is defined the same as __le*. The compiler can't get any endian info.
Here is the discussion about http://kerneltrap.org/node/3848
Thanks.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
^ permalink raw reply
* Re: [PATCH 1/4] net: check for reference outside of skb
From: David Miller @ 2010-08-02 22:59 UTC (permalink / raw)
To: shemminger; +Cc: netdev
In-Reply-To: <20100802220113.557212477@vyatta.com>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Mon, 02 Aug 2010 15:00:31 -0700
> It is legitimate for callers of skb_header_pointer to pass a negative
> offset, but the resulting pointer should not go outside the valid
> range of data in the skb.
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Stephen, it seems to me that most existing (if not all) callers of
skb_header_pointer() already can prove that their offsets are
legitimate, negative or not. They usually do this via pskb_may_pull()
or similar.
Therefore it makes no sense to me that we punish all existing code paths
with a duplicate test just to have this check available for use in u32.
Just put the range test in u32.
Thanks.
^ permalink raw reply
* Re: [PATCH 4/4] u32: use get_unaligned_be32
From: Ben Hutchings @ 2010-08-02 22:55 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Changli Gao, David Miller, netdev
In-Reply-To: <20100802154505.46cfe94a@nehalam>
On Mon, 2010-08-02 at 15:45 -0700, Stephen Hemminger wrote:
> On Tue, 3 Aug 2010 06:34:59 +0800
> Changli Gao <xiaosuo@gmail.com> wrote:
>
> > On Tue, Aug 3, 2010 at 6:00 AM, Stephen Hemminger <shemminger@vyatta.com> wrote:
> > > U32 classifier reads data from packet at a offset passed in from
> > > user space. The offset should be aligned, but it is unsafe practice
> > > to depend on values from userspace.
> > >
> > > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> > >
> > > --- a/net/sched/cls_u32.c 2010-08-01 11:21:06.945820852 -0700
> > > +++ b/net/sched/cls_u32.c 2010-08-01 11:24:55.257793848 -0700
> > > @@ -41,6 +41,7 @@
> > > #include <net/netlink.h>
> > > #include <net/act_api.h>
> > > #include <net/pkt_cls.h>
> > > +#include <asm/unaligned.h>
> > >
> > > struct tc_u_knode
> > > {
> > > @@ -140,7 +141,7 @@ next_knode:
> > > data = skb_header_pointer(skb, toff, 4, &_data);
> > > if (!data)
> > > goto out;
> > > - if ((*data ^ key->val) & key->mask) {
> > > + if ((get_unaligned_be32(data) ^ key->val) & key->mask) {
> >
> > be32()? I think it may break configuration.
>
> The data pointer is be32 * already.
But get_unaligned_be32() converts to native byte order.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [GIT PULL net-next-2.6] vhost-net patchset for 2.6.36
From: David Miller @ 2010-08-02 22:54 UTC (permalink / raw)
To: mst; +Cc: kvm, virtualization, netdev, linux-kernel, krkumar2
In-Reply-To: <20100728133231.GA1932@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Wed, 28 Jul 2010 16:32:31 +0300
> The following changes since commit 4cfa580e7eebb8694b875d2caff3b989ada2efac:
>
> r6040: Fix args to phy_mii_ioctl(). (2010-07-21 21:10:49 -0700)
>
> are available in the git repository at:
> git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git vhost-net-next
>
Pulled, thanks Michael.
^ permalink raw reply
* Re: why do we need printk on sending syn flood cookie?
From: Mitchell Erblich @ 2010-08-02 22:49 UTC (permalink / raw)
To: Mitchell Erblich; +Cc: Franchoze Eric, Florian Westphal, netdev
In-Reply-To: <BF6AF151-741E-4242-938B-E1C8D93579C3@earthlink.net>
On Aug 2, 2010, at 3:30 PM, Mitchell Erblich wrote:
>
> On Aug 2, 2010, at 2:14 PM, Franchoze Eric wrote:
>
>>
>>
>> 02.08.10, 22:10, "Mitchell Erblich" <erblichs@earthlink.net>:
>>
>>>
>>> On Aug 2, 2010, at 9:11 AM, Franchoze Eric wrote:
>>>
>>>>
>>>>
>>>> 02.08.10, 12:17, "Florian Westphal" :
>>>>
>>>>> Franchoze Eric wrote:
>>>>>> Just sirious why do we need printk each 1 second (60*HZ) about possible syn-flood? It really floods dmesg. Is there something dengerous? I have suggestion to turn off printk about sending tcp cookie each 1 second.
>>>>>
>>>>> It is handled exactly like other printks in the networking path,
>>>>> e.g. receipt of tcp wscale == 15.
>>>>>
>>>>> Why does this need special treatment?
>>>>>
>>>>
>>>> For now I see "possible SYN flooding on port %d. Sending cookies.\n" message each second on my server. I know that there are a lot of SYNs and I know that kernel sends cookie. Why do I need so mach printk?
>>>> So I suggested add new value to /proc/sys/net/ipv4/tcp_syncookies, which will enable cookie but this printk will be turned off.
>>>
>>>
>>> Once print per sec is a very good GENERIC informative msg to an admin that
>>> this system either has some very small config'd or default values
>>> (normally set up as a percentage of memory or set sock option and/or .. )
>>> and/or that for some reason that a large number of SYNs are being rec'vd
>>> and/or that a number of connections are being un/intentionally being
>>> retried and/or dropped
>>>
>>
>> There is no much settings to tune syn requests.
>> tcp_max_syn_backlog, tcp_synack_retries, tcp_abort_on_overflow
>
> The key is that you need a reproduceable test case and determine what type of
> changes you want to make.
>
> also review the listen (backlog) code and : tcp.h: TCP_SYNQ_HSIZE
>
> Other than that, their are MANY changes that can be done to scale this section
> of code.
>
> What is the latency of serving an ACK? What is a RTT of a SYN/ACK?
> Why is each client trying to ESTABLISH a connection at the same time?
> etc.
>
> Is your server capable of serving 3000 clients? Are they sending 1 MTU per sec,
> or are they doing 1000s of pings per sec, or are they doing bulk-data-transfer or?
> Thus, even if you are able to keep 3000 connections open at one time, can
> your server properly respond to their requests in a timely manner?
>
> Mitchell Erblich
>
>>
>> As for me, than I have about 3000 clients which do a little bit less then 3000 SYNs for nginx port.
>> I'm ok with sending syn cookies to clients. Also it's not possible to turn syncs off with setting
>> bigger value to tcp_max_syn_backlog and application works well so I would simple remove
>> this messages from dmesg.
>>
>> If I limit syncs with iptables it starts to drop needed packets. So it's no solution. That's why I think that we need turn off
>> printk without turning off syn cookies.
>>
>>> Remember each printk may only be a small fraction of the number of SYNs
>>> rcv'd and this fraction COULD depend on the Mb/Gb of the intf(s) or more
>>> likely some type of avg of summation of the number of network paths
>>> involved.
>>>
>>> Mitchell Erblich
>>>
>>>
actually, MAYBE a PATCH of the freq (1x/sec, 1x/5 secs, 1x/30secs, 1x/60secs, 1x/3600 secs) with
1x per sec as the default of the printks WOULD be considered?
Mitchell Erblich
>>>
>>>> --
>>>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>>
>>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Re: why do we need printk on sending syn flood cookie?
From: Franchoze Eric @ 2010-08-02 22:48 UTC (permalink / raw)
To: Mitchell Erblich; +Cc: Florian Westphal, netdev
In-Reply-To: <BF6AF151-741E-4242-938B-E1C8D93579C3@earthlink.net>
03.08.10, 02:30, "Mitchell Erblich" <erblichs@earthlink.net>:
>
> On Aug 2, 2010, at 2:14 PM, Franchoze Eric wrote:
>
> >
> >
> > 02.08.10, 22:10, "Mitchell Erblich" :
> >
> >>
> >> On Aug 2, 2010, at 9:11 AM, Franchoze Eric wrote:
> >>
> >>>
> >>>
> >>> 02.08.10, 12:17, "Florian Westphal" :
> >>>
> >>>> Franchoze Eric wrote:
> >>>>> Just sirious why do we need printk each 1 second (60*HZ) about possible syn-flood? It really floods dmesg. Is there something dengerous? I have suggestion to turn off printk about sending tcp cookie each 1 second.
> >>>>
> >>>> It is handled exactly like other printks in the networking path,
> >>>> e.g. receipt of tcp wscale == 15.
> >>>>
> >>>> Why does this need special treatment?
> >>>>
> >>>
> >>> For now I see "possible SYN flooding on port %d. Sending cookies.\n" message each second on my server. I know that there are a lot of SYNs and I know that kernel sends cookie. Why do I need so mach printk?
> >>> So I suggested add new value to /proc/sys/net/ipv4/tcp_syncookies, which will enable cookie but this printk will be turned off.
> >>
> >>
> >> Once print per sec is a very good GENERIC informative msg to an admin that
> >> this system either has some very small config'd or default values
> >> (normally set up as a percentage of memory or set sock option and/or .. )
> >> and/or that for some reason that a large number of SYNs are being rec'vd
> >> and/or that a number of connections are being un/intentionally being
> >> retried and/or dropped
> >>
> >
> > There is no much settings to tune syn requests.
> > tcp_max_syn_backlog, tcp_synack_retries, tcp_abort_on_overflow
>
> The key is that you need a reproduceable test case and determine what type of
> changes you want to make.
>
> also review the listen (backlog) code and : tcp.h: TCP_SYNQ_HSIZE
>
> Other than that, their are MANY changes that can be done to scale this section
> of code.
>
> What is the latency of serving an ACK? What is a RTT of a SYN/ACK?
> Why is each client trying to ESTABLISH a connection at the same time?
> etc.
>
> Is your server capable of serving 3000 clients? Are they sending 1 MTU per sec,
> or are they doing 1000s of pings per sec, or are they doing bulk-data-transfer or?
> Thus, even if you are able to keep 3000 connections open at one time, can
> your server properly respond to their requests in a timely manner?
>
> Mitchell Erblich
>
Thanks about TCP_SYNQ_HSIZE, I will take a look at this code. The other questions are not easy to answer because of they require some measurements.
In general my machine is routed with forward http proxy and kernel reports syn flood at this port. Because of huge number of client behind proxy and they do
requests at the same time and there is situation that a lot of SYNCs came to the same time.
So as I understand, this problem has to be fixed somewhere and simple removing printk does not work here.
> >
> > As for me, than I have about 3000 clients which do a little bit less then 3000 SYNs for nginx port.
> > I'm ok with sending syn cookies to clients. Also it's not possible to turn syncs off with setting
> > bigger value to tcp_max_syn_backlog and application works well so I would simple remove
> > this messages from dmesg.
> >
> > If I limit syncs with iptables it starts to drop needed packets. So it's no solution. That's why I think that we need turn off
> > printk without turning off syn cookies.
> >
> >> Remember each printk may only be a small fraction of the number of SYNs
> >> rcv'd and this fraction COULD depend on the Mb/Gb of the intf(s) or more
> >> likely some type of avg of summation of the number of network paths
> >> involved.
> >>
> >> Mitchell Erblich
> >>
> >>
> >>
> >>> --
> >>> To unsubscribe from this list: send the line "unsubscribe netdev" in
> >>> the body of a message to majordomo@vger.kernel.org
> >>> More majordomo info at http://vger.kernel.org/majordomo-info.html
> >>
> >>
> >>
>
>
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox